var request=null;function createRequest(){try{request=new XMLHttpRequest();}
catch(trymicrosoft){try{request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(othermicrosoft){try{request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(failed){request=null;}}}
if(request==null){alert("Error creating request object!");}}
function checkUserAge(birthDateVal){if(birthDateVal==""){var span=document.getElementById("birthDateSpan");span.innerHTML="This field cannot be left blank";}
else{createRequest();var url="AgeValidator?birthDate="+birthDateVal;if(request!=null){request.open("GET",url,true);request.onreadystatechange=checkUserAgeStatus;request.send(null);}}}
function checkUserAgeStatus(){if(request.readyState==4){if(request.status==200){var response=request.responseText;if(response==""){var span=document.getElementById("birthDateSpan");span.innerHTML="";}
else{span=document.getElementById("birthDateSpan");span.innerHTML="Warning - You need to be a minimum of 18 years of age to use this site.";}}}}
function checkProfileIDAlreadyExist(profileIDval){if(profileIDval==""){var span=document.getElementById("profileIdSpan");span.innerHTML="Please enter Profile ID";}
else{createRequest();var url="UniqueProfileIdValidator?profileId="+profileIDval;if(request!=null){request.open("GET",url,true);request.onreadystatechange=checkProfileIdStatus;request.send(null);}}}
function checkProfileIdStatus(){if(request.readyState==4){if(request.status==200){var response=request.responseText;if(response==""){var span=document.getElementById("profileIdSpan");span.innerHTML="";}
else{var porifleIdValue=document.getElementById("registrationForm:profileId").value;span=document.getElementById("profileIdSpan");span.innerHTML="Sorry, the Profile ID "+porifleIdValue+" already exists, please choose another.";}}}}
function checkEmailIDAlreadyExist(emailIDval){if(emailIDval==""){var span=document.getElementById("emailAddressSpan");span.innerHTML="Please enter email address";}
else{createRequest();var url="UniqueEmailAddressValidator?emailId="+emailIDval;if(request!=null){request.open("GET",url,true);request.onreadystatechange=checkEmailIdStatus;request.send(null);}}}
function checkEmailIdStatus(){if(request.readyState==4){if(request.status==200){var response=request.responseText;if(response==""){var span=document.getElementById("emailAddressSpan");span.innerHTML="";}
else{if(document.getElementById("registrationForm:emailAddress")==null){var emailIdValue=document.getElementById("saathiRegisterForm:emailAddress").value;}
else{var emailIdValue=document.getElementById("registrationForm:emailAddress").value;}
span=document.getElementById("emailAddressSpan");span.innerHTML="The e-mail address "+emailIdValue+" has already been registered, please check and try again.";}}}}
function confimEmailIds(emailIDval){if(emailIDval==""){var span=document.getElementById("confirmEmailAddressSpan");span.innerHTML="Please re-enter email address";}
else{var emailIdValue=document.getElementById("registrationForm:emailAddress").value;var confirmEmailIdValue=document.getElementById("registrationForm:confirmEmailAddress").value;if(emailIdValue!=confirmEmailIdValue){span=document.getElementById("confirmEmailAddressSpan");span.innerHTML="The two e-mail addresses don't match";}
else{span=document.getElementById("confirmEmailAddressSpan");span.innerHTML="";}}}
function checkPassword(passwordVal){if(passwordVal==""){var span=document.getElementById("passwordSpan");span.innerHTML="This field cannot be left blank";}
else{span=document.getElementById("passwordSpan");span.innerHTML="";}}
function confimPasswords(passwordVal){if(passwordVal==""){var span=document.getElementById("reEnterPasswordSpan");span.innerHTML="This field cannot be left blank";}
else{var passwordValue=document.getElementById("registrationForm:password").value;var confirmPasswordValue=document.getElementById("registrationForm:reEnterPassword").value;if(passwordValue!=confirmPasswordValue){span=document.getElementById("reEnterPasswordSpan");span.innerHTML="The values in the Password and confirm Password fields don't match ";}
else{span=document.getElementById("reEnterPasswordSpan");span.innerHTML="";}}}
function checkFirstName(firstNameVal){if(firstNameVal==""){var span=document.getElementById("firstNameSpan");span.innerHTML="This field cannot be left blank";}
else{span=document.getElementById("firstNameSpan");span.innerHTML="";}}
function checkLastName(lastNameVal){if(lastNameVal==""){var span=document.getElementById("lastNameSpan");span.innerHTML="This field cannot be left blank";}
else{span=document.getElementById("lastNameSpan");span.innerHTML="";}}
function checkOtherState(otherStateVal){if(otherStateVal==""){var span=document.getElementById("otherStateSpan");span.innerHTML="This field cannot be left blank";}
else{span=document.getElementById("otherStateSpan");span.innerHTML="";}}
function checkCity(cityVal){if(cityVal==""){var span=document.getElementById("citySpan");span.innerHTML="This field cannot be left blank";}
else{span=document.getElementById("citySpan");span.innerHTML="";}}
function checkReligion(value){if(value==""){var span=document.getElementById("religionSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("religionSpan");span.innerHTML="";}}
function checkState(value){if(value==""){var span=document.getElementById("stateSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("stateSpan");span.innerHTML="";}}
function checkCaste(value){if(value==""){var span=document.getElementById("casteSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("casteSpan");span.innerHTML="";}}
function checkMotherTongue(value){if(value==""){var span=document.getElementById("motherTongueSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("motherTongueSpan");span.innerHTML="";}}
function checkHeight(value){if(value==""){var span=document.getElementById("heightSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("heightSpan");span.innerHTML="";}}
function checkEducation(value){if(value==""){var span=document.getElementById("educationSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("educationSpan");span.innerHTML="";}}
function checkSalary(value){if(value==""){var span=document.getElementById("salarySpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("salarySpan");span.innerHTML="";}}
function checkProfession(value){if(value==""){var span=document.getElementById("professionSpan");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("professionSpan");span.innerHTML="";}}
function checkVerificationCode(value){if(value==""){var span=document.getElementById("verificationCodeSpan");span.innerHTML="This field cannot be left blank";}
else{span=document.getElementById("verificationCodeSpan");span.innerHTML="";}}
function checkAboutUserWord1(value){if(value==""){var span=document.getElementById("aboutUserWord1Span");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("aboutUserWord1Span");span.innerHTML="";}}
function checkAboutUserWord2(value){if(value==""){var span=document.getElementById("aboutUserWord2Span");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("aboutUserWord2Span");span.innerHTML="";}}
function checkAboutUserWord3(value){if(value==""){var span=document.getElementById("aboutUserWord3Span");span.innerHTML="Please select atleast one";}
else{span=document.getElementById("aboutUserWord3Span");span.innerHTML="";}}