function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features); }



function capturaTecla(e) 
{
	
     if(document.all)
     {
     	
          tecla=event.keyCode;
     }
     else
     {
     	
          tecla=e.which; 
          
     }

     if(tecla==13)
        {
        
        
        
       	 var preciominimo = document.buscador.preciominimo.value;
    	 var preciomaximo = document.buscador.preciomaximo.value;

    
     	preciominimo=preciominimo.replace(',','.');
    	 preciomaximo=preciomaximo.replace(',','.');
   
     
     	if(!IsNumeric(preciominimo) || !IsNumeric(preciomaximo))
     	{
     		
  	
  		MM_showHideLayers('sesionError9','','show');
  	
  	
    	 }
  	
  	
  	
   	 else
    	 {

     
   		if (preciominimo =="")
   			preciominimo=0;  
     		if (preciomaximo =="")
   			preciomaximo=0;

        	
        	
        	
       		document.buscador.submit();
        	
	}
        	
     			             
      }
      
}  




 function getDatos() 
 {
     var texto = document.buscador.texto.value;
     
     var categoria=document.buscador.cat.options[document.buscador.cat.selectedIndex].value;
     var nombrecategoria=document.buscador.cat.options[document.buscador.cat.selectedIndex].text;
     var preciominimo = document.buscador.preciominimo.value;
     var preciomaximo = document.buscador.preciomaximo.value;

    
     preciominimo=preciominimo.replace(',','.');
     preciomaximo=preciomaximo.replace(',','.');
   
     
     if(!IsNumeric(preciominimo) || !IsNumeric(preciomaximo))
     {
  	
  	MM_showHideLayers('sesionError9','','show');
  	
  	
     }
  	
  	
  	
     else
     {

     
   	if (preciominimo =="")
   		preciominimo=0;  
     	if (preciomaximo =="")
   		preciomaximo=0;

    thispage=window.location.href;
 
 		prefix=thispage.substring(0,thispage.lastIndexOf('?'));

 		if (prefix =="")
 		{
 	
 				estatico=thispage.substring(0,thispage.lastIndexOf('/Estatico'));
 				estatico2=thispage.substring(0,thispage.lastIndexOf('/estatico'));
 				home=thispage.substring(0,thispage.lastIndexOf('/home'));
 		
 				if (estatico !="") 
 			     		prefix1=estatico;
 			  	else 
 			  	{
 			  		if (estatico2 !="")
 			  	 		prefix1=estatico2;
			    		else	
			    		{
			    			if (home !="")
			    			{
			    				prefix1=home;
			    			}	
			    			else
			    			{
							prefix1=thispage;
						}
					}
 				}
 			
 				param="http://www.latrastiendadigital.com/web/inz/busqueda?_ResultadosBusqueda_WAR_LTD_Portlets_cat="+ categoria+"&_ResultadosBusqueda_WAR_LTD_Portlets_catNombre="+nombrecategoria+"&_ResultadosBusqueda_WAR_LTD_Portlets_texto=" + texto +"&_ResultadosBusqueda_WAR_LTD_Portlets_preciominimo=" + preciominimo +"&_ResultadosBusqueda_WAR_LTD_Portlets_preciomaximo=" + preciomaximo +"&_ResultadosBusqueda_WAR_LTD_Portlets_pag=1&_ResultadosBusqueda_WAR_LTD_Portlets_i=0&_ResultadosBusqueda_WAR_LTD_Portlets_f=0&_ResultadosBusqueda_WAR_LTD_Portlets_ordenacion=0";
 				
 		}
 		else
 		{
 	
 	
 			prefix1=prefix.substring(0,prefix.lastIndexOf('/'));
 				
 			
 			param="http://www.tienda.latrastiendadigital.com/web/inz/busqueda?_ResultadosBusqueda_WAR_LTD_Portlets_cat="+ categoria+"&_ResultadosBusqueda_WAR_LTD_Portlets_catNombre="+nombrecategoria+"&_ResultadosBusqueda_WAR_LTD_Portlets_texto=" + texto +"&_ResultadosBusqueda_WAR_LTD_Portlets_preciominimo=" + preciominimo +"&_ResultadosBusqueda_WAR_LTD_Portlets_preciomaximo=" + preciomaximo +"&_ResultadosBusqueda_WAR_LTD_Portlets_pag=1&_ResultadosBusqueda_WAR_LTD_Portlets_i=0&_ResultadosBusqueda_WAR_LTD_Portlets_f=0&_ResultadosBusqueda_WAR_LTD_Portlets_ordenacion=0";
 		}

 		URL=param;

 		 URL=URL.replace('#','');
	
 		window.location.href=URL;




 		
 		
 		}
 		
     

 }
 
 
 function getDatosPres() 
 {
     var texto = document.buscador.texto.value;
     var categoria=document.buscador.cat.options[document.buscador.cat.selectedIndex].value;
     var nombrecategoria=document.buscador.cat.options[document.buscador.cat.selectedIndex].text;
     var preciominimo = document.buscador.preciominimo.value;
     var preciomaximo = document.buscador.preciomaximo.value;

    
     preciominimo=preciominimo.replace(',','.');
     preciomaximo=preciomaximo.replace(',','.');
   
     
     if(!IsNumeric(preciominimo) || !IsNumeric(preciomaximo))
     {
  	
  	MM_showHideLayers('sesionError9','','show');
  	
  	
     }
  	
  	
  	
     else
     {

     
   	if (preciominimo =="")
   		preciominimo=0;  
     	if (preciomaximo =="")
   		preciomaximo=0;

    thispage=window.location.href;

 		prefix=thispage.substring(0,thispage.lastIndexOf('?'));

 		if (prefix =="")
 		{
 	
 				estatico=thispage.substring(0,thispage.lastIndexOf('/Estatico'));
 				estatico2=thispage.substring(0,thispage.lastIndexOf('/estatico'));
 		home=thispage.substring(0,thispage.lastIndexOf('/home'));
 		
 				if (estatico !="") 
 			     		prefix1=estatico;
 			  	else 
 			  	{
 			  		if (estatico2 !="")
 			  	 		prefix1=estatico2;
			    		else	
			    		{
			    			if (home !="")
			    			{
			    				prefix1=home;
			    			}	
			    			else
			    			{
							prefix1=thispage;
						}
					}
 				}
 			
 				param="http://www.inzentiva.com/web/inz/busqueda?_ResultadosBusquedaPres_WAR_LTD_Portlets_cat="+ categoria+"&_ResultadosBusquedaPres_WAR_LTD_Portlets_catNombre="+nombrecategoria+"&_ResultadosBusquedaPres_WAR_LTD_Portlets_texto=" + texto +"&_ResultadosBusquedaPres_WAR_LTD_Portlets_preciominimo=" + preciominimo +"&_ResultadosBusquedaPres_WAR_LTD_Portlets_preciomaximo=" + preciomaximo +"&_ResultadosBusquedaPres_WAR_LTD_Portlets_pag=1&_ResultadosBusquedaPres_WAR_LTD_Portlets_i=0&_ResultadosBusquedaPres_WAR_LTD_Portlets_f=0&_ResultadosBusquedaPres_WAR_LTD_Portlets_ordenacion=0";
 				
 		}
 		else
 		{
 	
 	
 		
 			prefix1=prefix.substring(0,prefix.lastIndexOf('/'));	
 			
 			param="http://www.inzentiva.com/web/inz/busqueda?_ResultadosBusquedaPres_WAR_LTD_Portlets_cat="+ categoria+"&_ResultadosBusquedaPres_WAR_LTD_Portlets_catNombre="+nombrecategoria+"&_ResultadosBusquedaPres_WAR_LTD_Portlets_texto=" + texto +"&_ResultadosBusquedaPres_WAR_LTD_Portlets_preciominimo=" + preciominimo +"&_ResultadosBusquedaPres_WAR_LTD_Portlets_preciomaximo=" + preciomaximo +"&_ResultadosBusquedaPres_WAR_LTD_Portlets_pag=1&_ResultadosBusquedaPres_WAR_LTD_Portlets_i=0&_ResultadosBusquedaPres_WAR_LTD_Portlets_f=0&_ResultadosBusquedaPres_WAR_LTD_Portlets_ordenacion=0";
 		}

 		URL=param;

 		 URL=URL.replace('#','');

 		window.location.href=URL;

 		}
 		
     

 }
 
 
 
 

 function hacerSubmit()
 {
 	if (validarDatos())
 	{
 		
		
		document.formulario.ubicacion.value=document.formulario.ubicacionoculta.value;		
		
		
 		document.formulario.submit();
 		
 		
 		
 	}
 }
 
 function validarDatos()
 {
 
 var nombreTienda = document.formulario.tienda.value;
 var ruta=document.formulario.ubicacionoculta.value;
 var artPag = document.formulario.artPag.value;
 var pagVista = document.formulario.pagVista.value;
  
 var IsVacio=true;   
 var IsNumero= false;


 
 IsVacio=validarVacio(nombreTienda,ruta,artPag,pagVista);
 IsNumero=validarNumero(artPag,pagVista);
 
 
  
 if (IsVacio)
 {
 	
 	MM_showHideLayers('sesionError1','','show','sesionError2','','hide','sesionError3','','hide'); 	
 	return false;
 	
 }
 else
 {
 	if(IsNumero)
 	{
 		MM_showHideLayers('sesionError1','','hide','sesionError2','','hide','sesionError3','','show'); 	
 		return true;
 	}
 	else
 	{
 		MM_showHideLayers('sesionError1','','hide','sesionError2','','show','sesionError3','','hide'); 	
 		return false;
 	}
 }
 
 }
 
 function validarVacio (nombreTienda,ruta,artPag,pagVista)
 {
 	if((nombreTienda!="") && (ruta!="") && (artPag!="") && (pagVista!=""))
 	{	

 		return false;
 		 		
 	}
 	else
 	{
 	
 		return true;
 	}
 	
 }
 
 function validarNumero (artPag,pagVista)
 {
 	var IsNumero=false;
 	
 	if(IsEntero(artPag))
 	{
 		if(IsEntero(pagVista))
 		{
 			IsNumero=true;
 		}
 	}
 	return IsNumero;
 	
 }
 
 
 function irCuenta(){
	 		thispage=window.location.href;
 		prefix=thispage.substring(0,thispage.lastIndexOf('?'));
 		if (prefix =="")
 		{
 				prefix=thispage;
 				param="cuenta?_MiCuenta_WAR_LTD_Portlets_op=1";
 		}
 	else
 		{
 			prefix=thispage.substring(0,thispage.lastIndexOf('/'));
 			param="/cuenta?_MiCuenta_WAR_LTD_Portlets_op=1";
 		}
 		
 		URL=prefix+param;
 		window.location.href= URL;

}
 

function OpenCertDetails()
{
   thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=ESLAXT4', 'anew', config='height=470,width=520,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}
function irHome(op){
	 		thispage=window.location.href;
 		prefix=thispage.substring(0,thispage.lastIndexOf('?'));
 		if (prefix =="")
 		{
 				prefix=thispage;
 				param="home?_SolicitudRegistro_WAR_LTD_Portlets_reg=";
 		}
 	else
 		{
 			prefix=thispage.substring(0,thispage.lastIndexOf('/'));
 			param="/home?_SolicitudRegistro_WAR_LTD_Portlets_reg=";
 		}
 		
 		
 		
 		URL=prefix+param;
 		
 		if (op==1)
 			URL=prefix +"?_SolicitudRegistro_WAR_LTD_Portlets_reg=1";
 		
 		window.location.href= URL;

}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.,";
   var IsNumber=true;
   var Char;
   var puntos=0;
   var comas=0;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
          IsNumber = false;

         }
      if (Char == '.')
      {
      	puntos++;
      	if (puntos > 1)
      	{
      	
      		IsNumber=false;
      	}
      }
      }
   return IsNumber;
   
   }


function IsEntero(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
          IsNumber = false;

         }
      }
   return IsNumber;
   
   }
      
   function MM_showHideLayers() { //v6.0
					  var i,p,v,obj,args=MM_showHideLayers.arguments;
					  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
					    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
					    obj.display=v; }
					}
					
function MM_findObj(n, d) { //v4.01
					  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
					    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
					  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
					  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
					  if(!x && d.getElementById) x=d.getElementById(n); return x;
					}