function tdmouseover(el) { el.style.color = "yellow" el.style.backgroundColor = "#76a8eb" } function tdmouseout(el) { el.style.color = "black" el.style.backgroundColor = "#8fbbf6" } function checkCheckBox(f) { if ((f.agree.checked == false) || (f.contacttitle.value == " ") ) { alert('Please check the "I agree" checkbox to continue.'); return false; } else return true; } function checkCheckBox(f) { if ((f.agree.checked == false) || (f.contacttitle.value == " ") ) { alert('Please check the "I agree" checkbox to continue.'); return false; } else return true; } function isValidEmail(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert("Invalid E-mail ID"); return false; } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Invalid E-mail ID"); return false; } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Invalid E-mail ID"); return false; } if (str.indexOf(at,(lat+1))!=-1){ alert("Invalid E-mail ID"); return false; } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Invalid E-mail ID"); return false; } if (str.indexOf(dot,(lat+2))==-1){ alert("Invalid E-mail ID"); return false; } if (str.indexOf(" ")!=-1){ alert("Invalid E-mail ID"); return false; } return true; } function IsNumeric(sText) { var ValidChars = "0123456789"; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } function IsEmptyOption(aTextField) { if ( aTextField.selectedIndex == 0 ) { alert('Fill all required fields.'); return true; } } function IsEmpty(aTextField) { if ((aTextField.value.length==0) || (aTextField.value==null)) { alert('Fill all required fields.'); return true; } else { return false; } } function thesame(aTextField, bTextField) { if (aTextField.value==bTextField.value) { return true; } else { return false; } } function ValidateSponsorForm(form) { if(IsEmpty(form.fname)) { alert('You have not entered a first name'); form.fname.focus(); return false; } if(IsEmpty(form.lname)) { alert('You have not entered a last name'); form.lname.focus(); return false; } if(IsEmpty(form.referred_email)) { alert('You have not entered an Email Address'); form.referred_email.focus(); return false; } if(IsEmpty(form.referred_email2)) { alert('You have not entered an Email Address'); form.referred_email2.focus(); return false; } if(!thesame(form.referred_email, form.referred_email2)) { alert('Please make sure both email addresses are the same'); form.email1.focus(); return false; } if(IsEmpty(form.phone)) { alert('You have not entered a phone'); form.phone.focus(); return false; } if(IsEmpty(form.city)) { alert('You have not entered a City'); form.city.focus(); return false; } if(IsEmpty(form.state)) { alert('You have not entered a State'); form.state.focus(); return false; } if(IsEmptyOption(form.relation_type_id)) { alert('You have not choosen a relationship type, from drop down list'); form.relation_type_id.focus(); return false; } return true; }