
function $(id){if(id&&document.getElementById(id)){var ele=document.getElementById(id);return ele;}
else
return null;}
function echeck(str){var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str.indexOf(at)==-1){return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){return false}
if(str.indexOf(at,(lat+1))!=-1){return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){return false}
if(str.indexOf(dot,(lat+2))==-1){return false}
if(str.indexOf(" ")!=-1){return false}
return true}
function ValidateForm(f){if(f.first_name.value==""){alert("Please Enter First name");f.first_name.focus();return false;}
if(f.email.value==""){alert("Please Enter Email");f.email.focus();return false;}
else{var eid=f.email.value;if(echeck(eid)==false){alert("Invalid Email")
f.email.focus();return false;}
else{return true;}
}
}
function ValidateForm1(f){if((f.check.checked==false)||(f.init.value=='')){alert('We ask that you read the FAQ on this page and verify by checking the\nbox and entering your initials before moving forward.  We prefer to work\nonly with investors who first take the time to learn about our program.');return false;}
return true;}
function ValidateForm2(f){res=true;res&=isNotEmpty(f,'first_name');res&=isNotEmpty(f,'last_name');res&=isNotEmpty(f,'email');res&=isNotEmpty(f,'city');res&=isNotEmpty(f,'phone');res&=isNotEmpty(f,'zip');res&=isNotEmpty(f,'address');if(!res){$('error_message_1').innerHTML='YOUR APPLICATION IS NOT COMPLETE';$('error_message_2').innerHTML='Please complete the items marked in red';return false;}
else{return true;}
}
function isNotEmpty(f,field_name){if(f[field_name].value==''){$('label_'+field_name).className='red'
f[field_name].onkeypress=new Function('resetLabelFor("'+field_name+'")');return false;}
return true;}
function resetLabelFor(field_name){var f=$('form2');f.onkeypress='';$('label_'+field_name).className='';}
