function focus(){document.getElementById("htxt_UserName")!==null&&document.getElementById("htxt_UserName").focus()}
function hvalid(){try{var b=document.getElementById("htxt_UserName");b.value=trimAll(b.value);var a=b.value;if(a===""){alert("Please enter your Username Or Mobile Number.");b.focus();return false}for(var d=0;d<a.length;d++){var c=a.substring(d,d+1);if((c<"a"||"z"<c)&&(c<"A"||"Z"<c)&&(c<"0"||"9"<c)&&c!="_"&&c!="."){alert("Username Or Mobile Number field  accepts letters, numbers, underscore and dot.\n\nPlease re-enter your Username Or Mobile Number.");b.select();b.focus();return false}}if(a.length>
15){alert("Username Or Mobile Number should be 15 characters or less.\n\nPlease check your Username Or Mobile Number.");b.focus();return false}if(IsNumeric(a)){if(a.charAt(0)==0){window.alert("No need to have a starting '0'");return false}else if(a.indexOf("965")==0){alert("NO Need To Enter Country Prefix");return false}if(a.length!=8){window.alert("Invalid mobile number - "+a);return false}else if(a.charAt(0)!="6"&&a.charAt(0)!="9"&&a.charAt(0)!="5"){window.alert("Invalid  Mobile Number");return false}document.getElementById("namenumber").value=
1}var f=document.getElementById("txt_Passwd");if(f.value===""){alert("Please enter your Password.");f.focus();return false}if(f.value.length>15){alert("Password should be 15 characters or less.\n\nPlease check your Password.");f.focus();return false}return true}catch(e){return false}}function hClearTextFields(){document.getElementById("login_form").reset();document.getElementById("htxt_UserName").focus();return false}
function checkit(){var b=document.getElementById("txt_username"),a=document.getElementById("txtHint");a.style.visibility="visible";b.value=trimAll(b.value);b=b.value;if((b.substring(0,1)<"a"||b.substring(0,1)>"z")&&(b.substring(0,1)<"A"||b.substring(0,1)>"Z")){a.innerHTML="The Username should begin with an alphabetic character.";return false}for(var d=1;d<b.length;d++){var c=b.substring(d,d+1);if((c<"a"||"z"<c)&&(c<"A"||"Z"<c)&&(c<"0"||"9"<c)&&c!="_"&&c!="."){a.innerHTML="\nThe Username field  accepts letters, numbers & underscore.\n\nPlease re-enter your Username.";
a.style.padding="5px";return false}}if(b.length>15){a.innerHTML="\nThe Username should be 15 characters or less.\n\nPlease re-enter your Username.";a.style.padding="5px";return false}d="getusername.aspx";d=d+"?q="+b;d=d+"&sid="+Math.random();b="t="+(new Date).getTime();b=new Ajax.Request(d,{method:"post",postBody:b,onSuccess:function(f){a.style.visibility="visible";a.style.bottom="3px";a.style.font="bold 12px arial";a.style.padding="5px";var e=f.responseText;if(e.match("Great")){a.setAttribute("class",
"hints");a.setAttribute("className","hints")}else if(e.match("Sorry")){a.setAttribute("class","hintf");a.setAttribute("className","hintf")}a.innerHTML=f.responseText},onFailure:function(f){return false}});loader();return false}
function isusername(b){var a=document.getElementById("txt_username");if(b===""){alert("\nThe Username field is blank .\n\nPlease Enter your Username.");a.focus();return false}if((b.substring(0,1)<"a"||b.substring(0,1)>"z")&&(b.substring(0,1)<"A"||b.substring(0,1)>"Z")){alert("The Username should begin with an alphabetic character.");a.focus();return false}for(var d=1;d<b.length;d++){var c=b.substring(d,d+1);if((c<"a"||"z"<c)&&(c<"A"||"Z"<c)&&(c<"0"||"9"<c)&&c!="_"&&c!="."){alert("\nThe Username field  accepts letters, numbers & underscore.\n\nPlease re-enter your Username.");
a.select();a.focus();return false}}if(b.length>15){alert("\nThe Username should be 15 characters or less.\n\nPlease re-enter your Username.");a.focus();return false}}
function Valid(){var b=document.forms.form_reg.elements.rdgender,a=document.getElementById("txt_mobileno").value,d,c,f;b=b[0].checked?"M":b[1].checked?"F":"";d=document.getElementById("cmb_day").value;c=document.getElementById("cmb_month").value;f=document.getElementById("cmb_year").value;var e=document.getElementById("txt_username");e.value=trimAll(e.value);if(isusername(e.value)===false){e.focus();return false}if(a.charAt(0)==0){window.alert("No need to have a starting '0'");document.getElementById("txt_mobileno").focus();
return false}else if(a.indexOf("965")==0){alert("NO Need To Enter Country Prefix");document.getElementById("txt_mobileno").focus();return false}if(a.length!=8){window.alert("Invalid mobile number - "+a);document.getElementById("txt_mobileno").focus();return false}else if(a.charAt(0)!="6"&&a.charAt(0)!="9"&&a.charAt(0)!="5"){window.alert("Invalid  Mobile Number");document.getElementById("txt_mobileno").focus();return false}if(echeck(document.getElementById("txt_emailid").value)==false){document.getElementById("txt_emailid").focus();
return false}if(c==""){window.alert("Please enter valid 'Month' of your date of birth ");document.getElementById("cmb_month").focus();return false}if(d==""){window.alert("Please enter valid 'Day' of your date of birth ");document.getElementById("cmb_day").focus();return false}if(f==""){window.alert("Please enter valid 'Year' of your date of birth ");document.getElementById("cmb_year").focus();return false}if(c<1||c>12){alert("Month must be between 1 and 12.");return false}if(d<1||d>31){alert("Day must be between 1 and 31.");
return false}if((c==4||c==6||c==9||c==11)&&d==31){alert("Month "+monthName(c)+" doesn`t have 31 days!");return false}if(c==2){a=f%4==0&&(f%100!=0||f%400==0);if(d>29||d==29&&!a){alert("February "+f+" doesn`t have "+d+" days!");return false}}a=c+"/"+d+"/"+f;if(b==""){window.alert("Please select your 'Gender'");return false}if(document.getElementById("verifycode").value===""){alert("Please enter the Verification Code as shown in the form");document.getElementById("verifycode").focus();return false}if(document.getElementById("cterms").checked===
false){alert("Please accept the  terms and conditions");return false}if(!confirm("Is "+document.getElementById("txt_mobileno").value+" your mobile number ? \n\nYou will receive the password on "+document.getElementById("txt_mobileno").value+".\n\n Click Ok to register, Cancel to edit the mobile number"))return false;e="uname="+e.value+"&mno="+document.getElementById("txt_mobileno").value;e=e+"&vfc="+document.getElementById("verifycode").value;e=e+"&strdob="+a+"&gender="+b;e=e+"&email_id="+trimAll(document.getElementById("txt_emailid").value);
b=new Ajax.Request("savereginfo.aspx",{method:"post",postBody:e,onSuccess:function(h){document.getElementById("btnregister").disabled=false;if(h.responseText=="OK")window.location="post-registration.aspx";else{var g=document.getElementById("txtHint");g.setAttribute("class","hintf");g.setAttribute("className","hintf");document.getElementById("verifycode").value="";g.innerHTML=h.responseText+"<br />";g.style.visibility="visible";g.style.bottom="3px";g.style.font="bold 12px arial";g.style.padding="5px";
document.getElementById("imgvfc").src="ImageVerification.aspx?t="+Math.random();window.location+="#"}},onFailure:function(h){alert(h.responseText);return document.getElementById("btnregister").disabled=false}});document.getElementById("btnregister").disabled=true;return false}
function loader(){if(document.getElementById("terms1"))var b=new Ajax.Request("terms.htm",{method:"get",postBody:"",onSuccess:function(a){document.getElementById("terms1").value=a.responseText},onFailure:function(a){return false}})}function ClearTextFields(){document.getElementById("form1").reset();document.getElementById("txt_mobileno").focus();return false}function closeWindow(){alert("You are about to cancel the registration.");window.close();return false}
function focus1(){var b=document.getElementById("txt_mobileno");if(b.value=="Indian numbers only"){b.value="";b.focus();return false}}function redirect(){window.location="post-registration.aspx"}function statefocus(){var b=document.getElementById("cmb_city");b!=null&&b.focus()};