function IsEmail(sText) { var at="@" var dot="." var lat=sText.indexOf(at) var lstr=sText.length var ldot=sText.indexOf(dot) if (sText=="" || sText==null){ return false } if (sText.indexOf(at)==-1 || sText.indexOf(at)==0 || sText.indexOf(at)==lstr){ return false } if (sText.indexOf(dot)==-1 || sText.indexOf(dot)==0 || sText.indexOf(dot)==lstr){ return false } if (sText.indexOf(at,(lat+1))!=-1){ return false } if (sText.substring(lat-1,lat)==dot || sText.substring(lat+1,lat+2)==dot){ return false } if (sText.indexOf(dot,(lat+2))==-1){ return false } if (sText.indexOf(" ")!=-1){ return false } return true } function sendContact() { if(document.contact.fullname.value) { if(IsEmail(document.contact.email.value)==true) { if(document.contact.rndchk.value) { document.contact.submit(); } else { alert ('Favor de ingresar su security code'); document.contact.rndchk.focus();return false; } } else { alert ('Favor de ingresar su dirección de e-mail'); document.contact.email.focus();return false; } } else { alert ('Favor de ingresar su nombre completo'); document.contact.fullname.focus();return false; } } function sendContact_new() { if(document.contact.fullname.value) { if(IsEmail(document.contact.email.value)==true) { document.contact.submit(); }else{ alert ('Favor de ingresar su dirección de e-mail'); document.contact.email.focus();return false; } }else{ alert ('Favor de ingresar su nombre completo'); document.contact.fullname.focus();return false; } } function set_content(index){ // this will replace the msg text of in the contact page document.contact.freetext.value = msgTxtArr[index]; }