/********************************************************/
/***** Funciones para la validaci¢n del formulario ******/
/********************************************************/
function validarCampos() {
        var strErrorMsg=''
        var stremail=document.lugobcnform.email.value;
        if (!verifEmail(stremail)) {
                strErrorMsg+='      * Correo electrónico \n';
        }
        
        var strfullname=document.lugobcnform.ciudad.value;
        if (strfullname=="")  {
                strErrorMsg+='      * Ciudad y País \n';
        }

        var strfullname=document.lugobcnform.mensaje.value;
        if (strfullname=="")  {
                strErrorMsg+='      * Mensaje\n';
        }
/*

        var strfullname=document.lugobcnform.conocernos.value;
        if ((strfullname=="") || (strfullname=="0"))  {
                strErrorMsg+='      * Cómo ha conocido la web \n';
        }

        var strfullname=document.lugobcnform.navegador.value;
        if ((strfullname=="") || (strfullname=="0"))  {
                strErrorMsg+='      * Seleccione su navegador \n';
        }

        var strfullname=document.lugobcnform.conexion.value;
        if ((strfullname=="") || (strfullname=="0"))  {
                strErrorMsg+='      * Seleccione su tipo de conexión \n';
        }

        var strtelefono=document.lugobcnform.telefono.value;
		if ((strtelefono == "") || (strtelefono == "Teléfono")){
			strErrorMsg+='      * Teléfono.\n';
		}
		
         var strtelefono=document.lugobcnform.telefono.value;
		if (!verifNumerico(strtelefono)){
		strErrorMsg+='      * Teléfono: Solamente se pueden introducir números en este campo.\n';
		}			
*/
      
        if (strErrorMsg!='') {
                strErrorMsg ='Los siguientes datos son incorrectos:\n' + strErrorMsg
                alert (strErrorMsg);
                return false;
        }       else {
                return true;
        }

}

function enviarForm() {
        return validarCampos();
}       

function verifEmail(s) {
     if (s != '')
        {   
          var chrs = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-@';
          var sLen = s.length; var i=0, c=0, cCnt=0, step=0;
          if (sLen < 6) return false;
          while (i < sLen)
                 {
                  c=s.charAt(i);
                  if (!(chrs.indexOf(c)>=0 || (c=='_' && step<1))) return false;
                  if (c=='.') { if (cCnt<1) return false; cCnt=0; }
                  if (c=='@') { if (step>0) return false; if (cCnt<1) return false; step++; cCnt=0; }
                  cCnt=cCnt+1; i++;
                 }       
          if (cCnt < 3 || cCnt > 5 || step==0 || (s.indexOf(".")<0) ) return false;
          return true;
        }
     else { return true; }
}

function verifNumerico(strInput) {
        if (strInput != '') {
                if (!strInput.match(/[^0-9]/)) {
                        return true;
                }
        }

}

function borrarCampos()
  {
    if(confirm("¿ Está seguro-a de querer borrar los datos ?"))
       {
        return true;
       }
     else {
       return false;
        }
   } 
 