function EstaVacio(Dato) {
		for (var i=0; i< Dato.length; i++) {
			if (Dato.substring(i,i+1) != " ")
				return(false);
		}
		return(true);
		}
		
function esEmail(cajaEmail)
 {
    //Devuelve falso si el e-mail no contiene '@' and '.' .   
    if (cajaEmail.indexOf ('@',0) == -1 || cajaEmail.indexOf ('.',0) == -1)
    {      
      //cajaEmail.select();      
      //cajaEmail.focus();      
      return false;      
    }   
    else       
      return true;      
}

function ComprobarCamposContacto()
	{
		if (form1.Nombre.value=="" || EstaVacio(form1.Nombre.value))
		{
			window.alert("Escriba su nombre");
			return;
		}
		if (form1.Apellidos.value=="" || EstaVacio(form1.Apellidos.value))
		{
			window.alert("Escriba sus apellidos");
			return;
		}
		if (form1.Empresa.value=="" || EstaVacio(form1.Empresa.value))
		{
			window.alert("Escriba el nombre de su empresa");
			return;
		}
		if (form1.Departamento.value=="" || EstaVacio(form1.Departamento.value))
		{
			window.alert("Escriba su departamento y cargo");
			return;
		}
		if (form1.Poblacion.value=="" || EstaVacio(form1.Poblacion.value))
		{
			window.alert("Escriba su Población");
			return;
		}
		if (form1.Pais.value=="" || EstaVacio(form1.Pais.value))
		{
			window.alert("Escriba su país de pertenencia");
			return;
		}
		if (form1.Telefono.value=="" || EstaVacio(form1.Telefono.value))
		{
			window.alert("Escriba su teléfono");
			return;
		}
		/*if (form1.Fax.value=="" || EstaVacio(form1.Fax.value))
		{
			window.alert("Escriba su número de Fax");
			return;
		}*/
		if (!esEmail(form1.Email.value))
		{
			window.alert("Escriba su dirección de mail");
			return;
		}
		/*if (form1.Pagina.value=="" || EstaVacio(form1.Pagina.value))
		{
			window.alert("Escriba su dirección de página web");
			return;
		}*/
		document.form1.action='enviarMail.asp';
		document.form1.submit();

	}
function ControlVersion()
	{  
  	var Netscape, MSIE;
  	var Win, Mac;
  	var NetscapeVer, MSIEVer;
  
	//Detección de navegador

	  Netscape = navigator.appName == "Netscape";
	  MSIE = navigator.appName == "Microsoft Internet Explorer";
    
	//Detección de plataforma

		Win = navigator.userAgent.indexOf("Win") > -1;
		Mac = navigator.userAgent.indexOf("Mac") > -1;
		
	//Extraer versión del navegador

	if(Win) 
	{
	  if(MSIE)
  		{	
			MSIEVer=0
			temp=navigator.appVersion.split("MSIE")
			MSIEVer=parseFloat(temp[1])
		
			if (MSIEVer<5.5) //NON IE browser will return 0
			alert("Esta Web emplea IFrames, para su correcta visualización requiere Ms Explorer 5.5 ó superior")
		}
		else if(Netscape)
		{
			NetscapeVer=0
			if(navigator.userAgent.indexOf("Netscape6")!=-1)
				{
					temp1=navigator.userAgent.split("Netscape6/")
				}
				else
				{
					temp1=navigator.userAgent.split("Netscape/")
				}
				NetscapeVer=parseFloat(temp1[1])
		
			if (parseFloat(navigator.appVersion)<5.0&&parseFloat(navigator.appVersion)!=5.0)
				alert("Esta Web emplea IFrames, para su correcta visualización se requiere Netscape 7.0 ó superior")
			else if(NetscapeVer < 7.0)
					alert("Esta Web emplea IFrames, para su correcta visualización se requiere Netscape 7.0 ó superior")
		}
		else
		{
			alert("Sistema optimizado para Microsoft Explorer 5.5 ó superior")
		}
	}
	else if(Mac)
	{
		alert("Esta Web emplea IFrames, para su correcta visualización se requieren versiones superiores a Explorer 5.5 ó Netscape 7.0")
	}
	return;
	}
function CheckVersion()
	{  
  	var Netscape, MSIE;
  	var Win, Mac;
  	var NetscapeVer, MSIEVer;
  
	//Detección de navegador

	  Netscape = navigator.appName == "Netscape";
	  MSIE = navigator.appName == "Microsoft Internet Explorer";
    
	//Detección de plataforma

		Win = navigator.userAgent.indexOf("Win") > -1;
		Mac = navigator.userAgent.indexOf("Mac") > -1;
		
	//Extraer versión del navegador

	if(Win) 
	{
	  if(MSIE)
  		{	
			MSIEVer=0
			temp=navigator.appVersion.split("MSIE")
			MSIEVer=parseFloat(temp[1])
		
			if (MSIEVer<5.5) //NON IE browser will return 0
			alert("This web use IFrames, is required Ms Explorer 5.5 or better")
		}
		else if(Netscape)
		{
			NetscapeVer=0
			if(navigator.userAgent.indexOf("Netscape6")!=-1)
				{
					temp1=navigator.userAgent.split("Netscape6/")
				}
				else
				{
					temp1=navigator.userAgent.split("Netscape/")
				}
				NetscapeVer=parseFloat(temp1[1])
		
			if (parseFloat(navigator.appVersion)<5.0&&parseFloat(navigator.appVersion)!=5.0)
				alert("This web use IFrames, is required Netscape 7.0 or better")
			else if(NetscapeVer < 7.0)
					alert("This web use IFrames, is required Netscape 7.0 or better")
		}
		else
		{
			alert("System optimize for Microsoft Explorer 5.5 or better")
		}
	}
	else if(Mac)
	{
		alert("This web use IFrames, is required better versions of Internet Explorer 5.5 or Netscape 7.0")
	}
	return;
	}
