function aBarraMenuHoritzontal(linkDesti)
{ 
   location.href=linkDesti;
}
function abotonsBarraMenuSuperior(linkDesti)
{ 
   location.href=linkDesti;
}
function abotonsPeu(linkDesti)
{ 
   location.href=linkDesti;
}
function aBarraMenuEsquerra(linkDesti)
{ 
   location.href=linkDesti;
}
function aBotoProducte(linkDesti)
{ 
   location.href=linkDesti;
}
function aReferencias(linkDesti)
{ 
   location.href=linkDesti;
}
function aReferenciasNewWindow(linkDesti)
{ 
   window.open(linkDesti);
}

function presionaBuscador(event,idioma,textoOriginalBuscador){
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    //13 corresponde al intro
    if (keyCode == 13) 
    	acceptarBuscador(idioma,textoOriginalBuscador);
 } 
function acceptarBuscador(idioma,textoOriginalBuscador) {
 
	  if (document.formEnt3.buscar.value == textoOriginalBuscador){
			 return;
	  }   	
	  document.formEnt3.submit();
	  // window.alert("OK");
}

function presionaBuscador2(event,idioma,textoOriginalBuscador){
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    //13 corresponde al intro
    if (keyCode == 13) 
    	acceptarBuscador2(idioma,textoOriginalBuscador);
 } 
function acceptarBuscador2(idioma,textoOriginalBuscador) {
 
	  if (document.formEnt2.buscar.value == textoOriginalBuscador){
			 return;
	  }   	
	  document.formEnt2.submit();
	  // window.alert("OK");
}

function presiona(event,idioma){
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    //13 corresponde al intro
    if (keyCode == 13) 
  	  acceptarContacte(idioma);
 }  
function acceptarContacte(idioma) {
  var txtnom = "El campo nombre es obligatorio"; 
  var txtemail = "El campo email es obligatorio"; 
  var txtmensaje = "El campo mensaje es obligatorio"; 
  var txtemailNoCorrecto = "El campo email no es correcto"; 
  
  if (idioma==4){ //Ingles
	  txtnom = "The field Name is mandatory";
      txtemail = "The field E-mail is mandatory"; 
      txtmensaje = "The field Message is mandatory";  
      txtemailNoCorrecto = "The field E-mail is not correct";
  }
  
  if (idioma==5){ //Frances
      txtnom = "Le champ Personne a contacter est obligatoire.";
      txtemail = "Le champ E-mail est obligatoire"; 
      txtemailNoCorrecto = "Le champ E-mail nest pas correct";    
      txtmensaje = "The field Message is mandatory";  
  }  
  
  //if (document.formEnt.condicionsLegals.checked == false){
  //		 window.alert(txtcondicionsLegals);
  //		 return;
  // }    
  
  if (document.formEnt.nom.value == ""){
		 window.alert(txtnom);
		 return;
  }  
  if (document.formEnt.email.value == ""){
		 window.alert(txtemail);
		 return;
	  } 	 	  
  if (document.formEnt.email.value != ""){
		if (document.formEnt.email.value.indexOf("@",0) == -1){
			 alert(txtemailNoCorrecto);
			 return;
		}else{
			if (document.formEnt.email.value.indexOf(".",0) == -1){
				 alert(txtemailNoCorrecto);
				 return;
			}
		}
   } 
  if (document.formEnt.mensaje.value == ""){
		 window.alert(txtmensaje);
		 return;
   }    
	
  document.formEnt.submit();
   //window.alert("OK");
}

function acceptarSolicitudInformacion(idioma) {
	  var txtproducto = "El campo producto es obligatorio";
	  var txtempresa = "El campo empresa es obligatorio"; 
	  var txtpersonaContacto = "El campo persona de contacto es obligatorio"; 
	  var txtciudad = "El campo ciudad es obligatorio"; 
	  var txtpais = "El campo pais es obligatorio"; 
	  var txttelefono = "El campo telefono es obligatorio"; 
	  var txtemail = "El campo email es obligatorio"; 
	  var txtemailNoCorrecto = "El campo email no es correcto"; 
	  
	  if (idioma==4){ //Ingles
		  txtproducto = "The field Product Name is mandatory";
	      txtempresa = "The field Company Name is mandatory";
	      txtpersonaContacto = "The field Name is mandatory"; 
	      txtciudad = "The field City/Town is mandatory";
	      txtpais = "The field State/Country is mandatory";
	      txttelefono = "The field Telephone is mandatory";
	      txtemail = "The field E-mail is mandatory"; 
	      txtemailNoCorrecto = "The field E-mail is not correct";
	      txtdepartamento = "The field Department/Area is mandatory";
	      txtcomentario = "The field C.V. is mandatory";       
	  }

	  if (document.formEnt.producto.value == ""){
			 window.alert(txtproducto);
			 return;
	  }  	  
	  if (document.formEnt.empresa.value == ""){
			 window.alert(txtempresa);
			 return;
	  }  
	  if (document.formEnt.personaContacto.value == ""){
	    	 window.alert(txtpersonaContacto);
			 return;
	  }  
	  if (document.formEnt.ciudad.value == ""){
			 window.alert(txtciudad);
			 return;
	  }  
	  if (document.formEnt.pais.value == ""){
			 window.alert(txtpais);
			 return;
	  }  
	  if (document.formEnt.telefono.value == ""){
			 window.alert(txttelefono);
			 return;
	  }  
	  if (document.formEnt.email.value == ""){
			 window.alert(txtemail);
			 return;
	  } 	 	  
	  if (document.formEnt.email.value != ""){
		if (document.formEnt.email.value.indexOf("@",0) == -1){
			 alert(txtemailNoCorrecto);
			 return;
		}else{
			if (document.formEnt.email.value.indexOf(".",0) == -1){
				 alert(txtemailNoCorrecto);
				 return;
			}
		}
	  } 
	 	
	  document.formEnt.submit();
	  // window.alert("OK");
}

function acceptarSubcripcionNoticias(idioma) {
	  var txtcondicionsLegals = "Debe de aceptar las condiciones legales";
	  var txtnom = "El campo nombre es obligatorio";
	  var txtempresa = "El campo empresa es obligatorio"; 
	  var txtciudad = "El campo ciudad es obligatorio"; 
	  var txtpais = "El campo pais es obligatorio";
	  var txtemail = "El campo email es obligatorio"; 
	  var txtemailNoCorrecto = "El campo email no es correcto"; 
	  
	  if (idioma==4){ //Ingles
		  txtcondicionsLegals = "Must accept the legal conditions";
		  txtnom = "The field Name is mandatory";
	      txtempresa = "The field Company Name is mandatory";
	      txtciudad = "The field City/Town is mandatory";
	      txtpais = "The field State/Country is mandatory";
	      txtemail = "The field E-mail is mandatory"; 
	      txtemailNoCorrecto = "The field E-mail is not correct";       
	  }
	  if (document.formEnt.condicionsLegals.checked == false){
			 window.alert(txtcondicionsLegals);
			 return;
	  }  
	  if (document.formEnt.nom.value == ""){
			 window.alert(txtnom);
			 return;
	  }  
	  if (document.formEnt.email.value == ""){
			 window.alert(txtemail);
			 return;
	  } 	 	  
	  if (document.formEnt.email.value != ""){
		if (document.formEnt.email.value.indexOf("@",0) == -1){
			 alert(txtemailNoCorrecto);
			 return;
		}else{
			if (document.formEnt.email.value.indexOf(".",0) == -1){
				 alert(txtemailNoCorrecto);
				 return;
			}
		}
	  } 	  
	  if (document.formEnt.empresa.value == ""){
			 window.alert(txtempresa);
			 return;
	  }  
	  if (document.formEnt.ciudad.value == ""){
			 window.alert(txtciudad);
			 return;
	  }  
	  if (document.formEnt.pais.value == ""){
			 window.alert(txtpais);
			 return;
	  }  

	 	
	  document.formEnt.submit();
	  // window.alert("OK");
}


function resetForm() { 
	   document.formEnt.reset();
	   document.formEnt.motivoConsulta[0].checked = true;
}

function resetFormSolicitudInformacion() { 
	   document.formEnt.reset();
}

function resetFormSubcripcionNoticias() { 
	   document.formEnt.reset();
}

function comprovarFormulario(){
	if (document.formEnt != null){
		if (document.formEnt.motivoConsulta != null){
		    var formularioSeleccionado = false;
			$("informacion").style.display="none";
			$("trabajo").style.display="none";
			
		    if (document.formEnt.motivoConsulta[0].checked){
		       $('informacion').style.display="";
			   formularioSeleccionado = true;
		    }
			if (document.formEnt.motivoConsulta[1].checked){
		       $('trabajo').style.display="";
			   formularioSeleccionado = true;
			}  
		    if (document.formEnt.motivoConsulta[2].checked){
		       $('informacion').style.display="";
			   formularioSeleccionado = true;
		    }
			if (document.formEnt.motivoConsulta[3].checked){
		       $('informacion').style.display="";
			   formularioSeleccionado = true;
			}  
		    if (document.formEnt.motivoConsulta[4].checked){
		       $('informacion').style.display="";
			   formularioSeleccionado = true;
		    }
			
			if ( formularioSeleccionado == false){
			   $('informacion').style.display="";
			   document.formEnt.motivoConsulta[0].checked = true;
			}	
		}
	}

}







	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	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;
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
		

	function cargarMapa1(idioma) {
		var txtCENTRAL_FABRICA = "Luqsa"; 
		  
		if (idioma==4){ //Ingles
			var txtCENTRAL_FABRICA = "Luqsa"; 
		}			
		cargarImatges();
	   if (GBrowserIsCompatible()) {	
	      var map1 = new GMap2($("map1"));
	      var point = new google.maps.LatLng(41.560058,0.577575);
	      map1.setCenter(point, 12);
	      map1.addControl(new GSmallMapControl());
	      map1.addControl(new GMapTypeControl()); 
	      var marker = new google.maps.Marker(point); 
	      map1.addOverlay(marker);
	      var logo= "/UserFiles/Image/luqsa-logo.jpg";
	      var titol= txtCENTRAL_FABRICA;
	      var direccion= "Afueras, s/n<br>" +
                         "25173 - SUDANELL<br>" +
                         "Tel. (+ 34) <strong>973 25 82 56</strong><br>" +
                         "Fax (+ 34) <strong>973 25 80 19 </strong><br>";
	      var email= "info@luqsa.es";
	      var html="<table width='400' bgcolor='#FFFFFF' height='164' border='0' cellspacing='0' cellpadding='0'>" +
	                   "<tr>" + 
	                      "<td colspan='2' class='txtTitolParagraf' style='padding-top:10px; padding-left:10px' valign='middle'><strong>" +
	                      titol + "</strong></td>" +
	                   "</tr>" +
	                   "<tr>" +
	                      "<td valign='top' style='padding-left:10px' class='fontMap'>" +
	                          direccion +
	                      "</td>" +
	                      "<td valign='top' style='padding-left:10px'>" +
	                      "<img src='" + logo + "'>" +
                      "</td>" +	                      
	                   "</tr>" +
                   "</table>";
	      google.maps.Event.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
	      marker.openInfoWindowHtml(html);
	   }  	   
	} 		

	function cargarImatges() {
		   MM_preloadImages('/UserFiles/Image/Cabecera-baner-rojo.jpg','/UserFiles/Image/Cabecera-baner-gris.jpg');
	} 

	
	function doPrint(){
	
		$("cabecera").style.display="none";
		$("pie").style.display="none";
		$("pie2").style.display="none";
		$("migas").style.display="none";
		//$("menuBotonsEsquerra").style.display="none";
	
		window.print();
		
		$("cabecera").style.display="";
		$("pie").style.display="";
		$("pie2").style.display="";
		$("migas").style.display="";
		//$("menuBotonsEsquerra").style.display="";
	}

