function checkEnglish(evt){evt=(evt)?evt:((window.event)?event:null);if(evt)
var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));else
return false;if((charCode>96&&charCode<123)||(charCode>64&&charCode<91)||charCode==32||charCode==8||charCode==46||charCode==9||charCode==8||charCode==37||charCode==39||charCode==36||charCode==35)
return true;else
alert('Enter English Letters only!')
return false
return true}
function checkFields(form){if(form.Fname.value==""){alert("You must indicate a valid first name.")
form.Fname.focus()
return false;}
for(i=0;i<form.Fname.value.length;i++)
{charCode=form.Fname.value.charCodeAt(i);if((charCode>96&&charCode<123)||(charCode>64&&charCode<91)||charCode==32)
{}
else
{alert('Enter First Name In English Letters only!')
form.Fname.focus()
return false;}}
if(form.Lname.value==""){alert("You must indicate a valid last (family) name.")
form.Lname.focus()
return false;}
for(i=0;i<form.Lname.value.length;i++)
{charCode=form.Lname.value.charCodeAt(i);if((charCode>96&&charCode<123)||(charCode>64&&charCode<91)||charCode==32)
{}
else
{alert('Enter Last Name In English Letters only!')
form.Lname.focus()
return false;}}
if(form.country_of_birth){if(form.country_of_birth.selectedIndex==0){alert("You must select your country of birth.")
form.country_of_birth.focus()
return false;}}
if(form.birth_country){if(form.birth_country.selectedIndex==0){alert("You must select your country of birth.")
form.birth_country.focus()
return false;}}
if(form.email.value==""){alert("Missing email address.")
form.email.focus()
return false;}
if(isEmail(form.email.value)==false){alert("Please insert a valid email.")
form.email.focus()
return false;}
if(form.ConfirmEmailField.value==""){alert("Missing email address.")
form.ConfirmEmailField.focus()
return false;}
if(form.ConfirmEmailField.value!=form.email.value){alert("Email addresses do not match. In order to ensure that you will receive the information to log into your account you must insert your exact email address in both fields.")
form.ConfirmEmailField.focus()
return false;}
if(form.jobedu!=null){if(!form.jobedu.checked){alert("You may not continue with this process unless you have a job or finished high school according to requirements.");return false;}}
if(form.phone.value!=""){if(check_string("phone")==false){alert("Only Numbers Please!");form.phone.focus();return false;}}
if(form.area.value!=""){if(check_string("area")==false){alert("Only Numbers Please!");form.area.focus();return false;}}
exitXPBFlag=false
return true;}
function checkFieldsWithPhone(form){if(form.Fname.value==""){alert("You must indicate a valid first name.")
form.Fname.focus()
return false;}
if(form.Lname.value==""){alert("You must indicate a valid last (family) name.")
form.Lname.focus()
return false;}
if(form.country_of_birth){if(form.country_of_birth.selectedIndex==0){alert("You must select your country of birth.")
form.country_of_birth.focus()
return false;}}
if(form.birth_country){if(form.birth_country.selectedIndex==0){alert("You must select your country of birth.")
form.birth_country.focus()
return false;}}
if(form.email.value==""){alert("Missing email address.")
form.email.focus()
return false;}
if(isEmail(form.email.value)==false){alert("Please insert a valid email.")
form.email.focus()
return false;}
if(form.ConfirmEmailField.value==""){alert("Missing email address.")
form.ConfirmEmailField.focus()
return false;}
if(form.ConfirmEmailField.value!=form.email.value){alert("Email addresses do not match. In order to ensure that you will receive the information to log into your account you must insert your exact email address in both fields.")
form.ConfirmEmailField.focus()
return false;}
if(form.phone.value==""){alert("You must indicate a valid phone number.")
form.phone.focus()
return false;}
if(form.jobedu!=null){if(!form.jobedu.checked){alert("You may not continue with this process unless you have a job or finished high school according to requirements.");return false;}}
exitXPBFlag=false}
function alertjobedu(form_input){if(!form_input.checked){alert("You may not continue with this process unless you have a job or finished high school according to requirements.");return false;}}
function isEmail(mail){var char1=mail.split("@");var y=mail.indexOf("@",0);var e=mail.indexOf(".",0);var w=mail.lastIndexOf(".",mail.length-1);var sp=mail.indexOf(" ",0);var pl=mail.indexOf("@.",0);for(i=0;i<mail.length;i++)
{if(mail.charAt(i)=="/"||mail.charAt(i)==":"||mail.charAt(i)==";"||sp>0||pl>0||mail.charAt(i)=='"'||char1.length>2||y==-1||y==0||e==0||w==mail.length-1||e==-1){return false;}}}
function check_string(tagName){var strLen,strTemp,tempChar,allowedChars,isExist;allowedChars='0123456789';strTemp=document.getElementById(tagName).value;strLen=strTemp.length;for(i=0;i<strLen;i++){tempChar=strTemp.charAt(i);isExist=allowedChars.indexOf(tempChar);if(isExist==-1){alert("Only Numbers Please!");document.getElementById(tagName).value=document.getElementById(tagName).value.substring(0,strLen-1);return false;}}
return true;}
