function ShowHideLayer(oItems) 
{
	if ((oItems.style.display =="") || (oItems.style.display == 'none'))
	{
	
	oItems.style.display = "";//block
	}
	else
	{
	oItems.style.display = "none"; 
	}
}// JavaScript Document.

function ShowHideLayer_xx( whichLayer ) { 
	var elem, vis;
	 if( document.getElementById ) // Así es como debía de funcionar 
	 	elem = document.getElementById( whichLayer ); 
	 else if( document.all ) // Asi es como los MSIE funcionan
	 	 elem = document.all[whichLayer]; 
	 else if( document.layers ) // Asi funciona con NN4
	 	 elem = document.layers[whichLayer]; vis = elem.style;
	 if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) 
	 	 	  vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; 
	 	 	  vis.display = (vis.display==''||vis.display=='block')?'none':'block'; 
}

function ShowHideLayerGrab(oItems)
{
	if ((oItems.style.display =="") || (oItems.style.display == 'none'))
	{
	
	oItems.style.display = "block";
	}
	else
	{
	document.frm_comprar_joya.grab_diamante.value = '';
	oItems.style.display = "none"; 
	}
}// JavaScript Document

function ShowHideLayerGrabD(oItems)
{
	if ((oItems.style.display =="") || (oItems.style.display == 'none'))
	{
	
	oItems.style.display = "block";
	}
	else
	{
	document.frm_diamante.grab_diamante.value = '';
	oItems.style.display = "none"; 
	}
}// JavaScript Document
	
function imprimir_detalle(id){
	sendDataPreloader('a=1','/sitio/include/formatoimprimircompra.php','detalle','Cargando informacion');
	this.tbl_fondo=document.getElementById('tbl_fondo'); //reference veil
	this.interVeil=document.getElementById('interVeil'); //reference veil
	this.interVeil.style.visibility="visible";
	this.interVeil.style.height=document.body.scrollHeight;
	this.detalle=document.getElementById('detalle'); //reference veil
	this.detalle.style.top = document.body.scrollTop + 10;
	this.detalle.style.left = '30%';
	this.detalle.style.visibility="visible";
	}
	
function ver_tarjeta(msg,pagina){
	sendform('frm_confirmacion','detalle','/sitio/include/carro_ver_tarjeta.php')
	this.interVeil=document.getElementById('interVeil'); //reference veil
	this.interVeil.style.visibility="visible";
	this.interVeil.style.height=document.body.scrollHeight;
	this.detalle=document.getElementById('detalle'); //reference veil
	this.detalle.style.top = document.body.scrollTop + 75;
	this.detalle.style.left = '28%';
	this.detalle.style.visibility="visible";
	}

function ver_info(param,pagina,div,msg){
	sendDataPreloader(param, pagina ,div,msg);
	this.interVeil=document.getElementById('interVeil'); //reference veil
	this.interVeil.style.visibility="visible";
	this.interVeil.style.height=document.body.scrollHeight;
	this.detalle=document.getElementById('detalle'); //reference veil
	this.detalle.style.top = document.body.scrollTop + 100;
	this.detalle.style.left = '30%';
	this.detalle.style.visibility="visible";
	}

function seleccionar_medida(){
	ok=1;
	for(i=1;i<=document.form1.indice.value;i++){
		if(eval("document.form1.medida"+i+".value") == '--'){
		
		ok=0;
		}
	}
	if(ok == 1){
	 sendform('form1','portada','/sitio/include/carro_login.php'); 
	}else{
	alert("Seleccione las medidas de los anillos.");
	}
}

function mismo_envio(){
	if(document.frm_cuenta.mismo_domicilio.checked == true){
	document.frm_cuenta.nombre_env.value = document.frm_cuenta.nombre_fac.value;
	document.frm_cuenta.apellido_env.value = document.frm_cuenta.apellido_fac.value;
	document.frm_cuenta.direccion_env.value = document.frm_cuenta.direccion_fac.value;
	document.frm_cuenta.ciudad_env.value = document.frm_cuenta.ciudad_fac.value;
	document.frm_cuenta.provincia_env.value = document.frm_cuenta.provincia_fac.value;
	document.frm_cuenta.id_pais_env.value = document.frm_cuenta.id_pais_fac.value;
	document.frm_cuenta.codigo_postal_env.value = document.frm_cuenta.codigo_postal_fac.value;
	}else{
	document.frm_cuenta.nombre_env.value = "";
	document.frm_cuenta.apellido_env.value = "";
	document.frm_cuenta.direccion_env.value = "";
	document.frm_cuenta.ciudad_env.value = "";
	document.frm_cuenta.provincia_env.value = "";
	document.frm_cuenta.id_pais_env.value = 0;
	document.frm_cuenta.codigo_postal_env.value = "";
}

}
function ver_paises(id){
 		sendDataPreloader('a=1','include/paises.php','detalle','Cargando presentación');
		this.tbl_fondo=document.getElementById('tbl_fondo'); //reference veil
		this.interVeil=document.getElementById('interVeil'); //reference veil
		this.interVeil.style.visibility="visible";
		this.interVeil.style.height=document.body.scrollHeight;
		this.detalle=document.getElementById('detalle'); //reference veil
		this.detalle.style.top = document.body.scrollTop + 100;
		this.detalle.style.left = '16%';
		this.detalle.style.visibility="visible";
	}
	
var ventana;
function AbrirVentana(windowURL, windowName, windowFeatures) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
	} 
	
function enviar_login(){

if(document.form_login.user_usuario.value.replace(/ /g, '') == '' || document.form_login.user_clave.value.replace(/ /g, '') == ''){
alert('Debe ingresar un usuario y contraseña válido');
}else{
document.form_login.submit();
}

}
