// JavaScript Document

    function funFoco1(){
    foco = document.getElementById('FComents');
    campo = document.getElementById('FArea');
    if(campo.value == ""){
        campo.focus();
    }else{
        foco.focus();
    }
    }

    function funFoco2(){
    foco = document.getElementById('Fcoments');
    foco.focus();
    }

function funValidaRegistro(datos){
if(document.getElementById("Fname").value==""){
alert("Por favor escribe tu nombre.");
document.getElementById("Fname").focus();
return;
}

if(document.getElementById("Fphone").value==""){
alert("Por favor escribe tu n\u00famero telef\u00f3nico.");
document.getElementById("Fphone").focus();
return;
}

if(document.getElementById("Fmail").value==""){
alert("Por favor escribe tu correo.");
document.getElementById("Fmail").focus();
return;
}

if(document.getElementById("Fmail").value.indexOf('@',0)== -1 || document.getElementById("Fmail").value.indexOf('.',0)==-1){
alert("Direcci\u00F3n de E-mail inv\u00E1lida."); document.getElementById("Fmail").focus(); return;
}

if(document.getElementById("Fstate").value==""){
alert("Por favor selecciona la entidad donde vives.");
document.getElementById("Fstate").focus();
return;
}

if(document.getElementById("Farea").value==""){
alert("Por favor selecciona el \u00e1rea de inter\u00e9s .");
document.getElementById("Farea").focus();
return;
}

if(document.getElementById("Fcoments").value==""){
alert("Por favor escribe tus comentarios.");
document.getElementById("Fcoments").focus();
return;
}
document.frmContacto.submit();
}

function funIsNumber(e) { 

tecla = (document.all) ? e.keyCode : e.which; 


if (tecla < 32 ) return true;
if (tecla==32 ) return true;
if (tecla==40 ) return true;
if (tecla==41 ) return true;
if (tecla==45 ) return true;

patron = /[1234567890]/;

te = String.fromCharCode(tecla);

return patron.test(te);

} 

function funIsMail(e) { 

tecla = (document.all) ? e.keyCode : e.which; 


if (tecla < 32 ) return true;
if (tecla==95 ) return true;
if (tecla==45 ) return true;
if (tecla==209 ) return true;
if (tecla==241 ) return true;

patron = /[1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.]/;

te = String.fromCharCode(tecla);

return patron.test(te);

} 