function focus(){document.getElementById("htxt_UserName")!==null&&document.getElementById("htxt_UserName").focus()}
function hvalid(){var a=document.getElementById("htxt_UserName");a.value=trimAll(a.value);var b=a.value;if(b===""){alert("Please enter your Username Or Mobile Number.");a.focus();return false}for(var d=0;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("Username Or Mobile Number field  accepts letters, numbers, underscore and dot.\n\nPlease re-enter your Username Or Mobile Number.");a.select();a.focus();return false}}if(b.length>15){alert("Username Or Mobile Number should be 15 characters or less.\n\nPlease check your Username Or Mobile Number.");
a.focus();return false}if(IsNumeric(b)){if(!validatelocalnumber(b)){a.focus();return false}document.getElementById("namenumber").value=1}a=document.getElementById("txt_Passwd");if(a.value===""){alert("Please enter your Password.");a.focus();return false}if(a.value.length>15){alert("Password should be 15 characters or less.\n\nPlease check your Password.");a.focus();return false}return true}
function hClearTextFields(){document.getElementById("login_form").reset();document.getElementById("htxt_UserName").focus();return false}
function checkit(){var a=document.getElementById("txt_username"),b=document.getElementById("txtHint");b.style.visibility="visible";a.value=trimAll(a.value);a=a.value;if((a.substring(0,1)<"a"||a.substring(0,1)>"z")&&(a.substring(0,1)<"A"||a.substring(0,1)>"Z")){b.innerHTML="The Username should begin with an alphabetic character.";return false}for(var d=1;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!="."){b.innerHTML="\nThe Username field  accepts letters, numbers & underscore.\n\nPlease re-enter your Username.";
b.style.padding="5px";return false}}if(a.length>15){b.innerHTML="\nThe Username should be 15 characters or less.\n\nPlease re-enter your Username.";b.style.padding="5px";return false}d="getusername.aspx";d=d+"?q="+a;d=d+"&sid="+Math.random();a="t="+(new Date).getTime();a=new Ajax.Request(d,{method:"post",postBody:a,onSuccess:function(e){b.style.visibility="visible";b.style.bottom="3px";b.style.font="bold 12px arial";b.style.padding="5px";var f=e.responseText;if(f.match("Great")){b.setAttribute("class",
"hints");b.setAttribute("className","hints");b.style.bottom="3px"}else if(f.match("Sorry")){b.setAttribute("class","hintf");b.setAttribute("className","hintf");b.style.bottom="3px"}b.innerHTML=e.responseText},onFailure:function(e){return false}});loader();return false}
function isusername(a){var b=document.getElementById("txt_username");if(a===""){alert("\nThe Username field is blank .\n\nPlease Enter your Username.");b.focus();return false}if((a.substring(0,1)<"a"||a.substring(0,1)>"z")&&(a.substring(0,1)<"A"||a.substring(0,1)>"Z")){alert("The Username should begin with an alphabetic character.");b.focus();return false}for(var d=1;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("\nThe Username field  accepts letters, numbers & underscore.\n\nPlease re-enter your Username.");
b.select();b.focus();return false}}if(a.length>15){alert("\nThe Username should be 15 characters or less.\n\nPlease re-enter your Username.");b.focus();return false}}
function Valid(){var a=document.getElementById("cmb_prefix"),b=document.forms.form_reg.elements.rdgender,d,c,e;b=b[0].checked?"M":b[1].checked?"F":"";d=document.getElementById("cmb_day").value;c=document.getElementById("cmb_month").value;e=document.getElementById("cmb_year").value;var f=document.getElementById("txt_username");f.value=trimAll(f.value);if(isusername(f.value)===false){f.focus();return false}if(a.value==""){window.alert("Please select your country prefix");a.focus();return false}if(!validatemobilenumber_international_new(a.value,
a.value+document.getElementById("txt_mobileno").value)){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(e==
""){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){var i=e%4==0&&(e%100!=0||e%400==0);if(d>29||d==29&&!i){alert("February "+e+" doesn`t have "+d+" days!");return false}}d=c+"/"+d+
"/"+e;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;a="uname="+f.value+"&prefix="+a.value+"&mno="+document.getElementById("txt_mobileno").value;a=a+"&vfc="+document.getElementById("verifycode").value;a=a+"&strdob="+d+"&gender="+b+"&state_id=undefined";a=a+"&city_id=undefined&email_id="+trimAll(document.getElementById("txt_emailid").value);a=new Ajax.Request("savereginfo.aspx",{method:"post",postBody:a,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;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 a=new Ajax.Request("terms.htm",{method:"get",postBody:"",onSuccess:function(b){document.getElementById("terms1").value=b.responseText},onFailure:function(b){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 a=document.getElementById("txt_mobileno");if(a.value=="Indian numbers only"){a.value="";a.focus();return false}}function redirect(){window.location="post-registration.aspx"}function statefocus(){var a=document.getElementById("cmb_city");a!=null&&a.focus()};