var strre=/[a-zA-Z0-9_]{6,10}/i;function validate_username(a){return strre.test(a)}function checkaddr(b){var a=document.forms.reg;if(b==2){alert("That email address is already in use.");a.email.focus();return false}else{if(b==3||!emailre.test(a.email.value)){alert("You must enter a valid email address. [2]");a.email.focus();return false}}check_reg_cont(a)}function email_pre_check(a){if(a.value==""){alert("Please enter your email address.");a.focus();return false}else{if(!emailre.test(a.value)){alert("You must enter a valid email address. [1]");a.focus();return false}}return true}function check_reg(){var a=document.forms.reg;if(a.username.value==""){alert("Please enter a username.");a.username.focus();return false}if(!email_pre_check(a.email)){return false}else{c=AjaxEval("/account/mod/check_email.php?cb=true&addr="+a.email.value)}}function check_reg_cont(a){if(a.password.value==""){alert("Please enter a password.");a.password.focus();return false}if(!strre.test(a.password.value)){alert("Passwords must be between 6 and 10 characters long,\nand must be letters and numbers only.");a.password.focus();return false}if(a.confirm.value==""){alert("Please confirm your password.");a.confirm.focus();return false}if(a.password.value!=a.confirm.value){alert("Your confirmation entry does not match your password.");a.confirm.focus();return false}if(a.vrfy.value==""){alert("Please enter the letters or numbers you see in the image.");a.vrfy.focus();return false}if(a.accept.value=="1"){a.submit()}else{present_terms()}}function present_terms(){g=new AjaxGet("/signup/terms.php","modal_content");modal_show(594,435)}function complete_reg(b){if(b==1){var a=document.forms.reg;a.accept.value=1;a.submit()}else{modal_hide()}}function cancel_reg(){if(confirm("Are you sure you want to cancel your registration?")){window.location.href="/signup/cancel.php"}else{return false}}function lu_email(){var a=document.forms.reg.email;if(!email_pre_check(a)){return false}busy='<img src="/images/spinner.gif" alt="" width="16" height="16" align="top" style="position: relative; top: 3px;"> Searching...<br/>';g=new AjaxGet("/account/mod/check_email.php?addr="+a.value,"unchk",busy);return true}function check_plan(a){alert(a);return false}function check_fb(){var a=document.forms.feedback;if(!a.topic.selectedIndex>0){alert("Please tell us the issue you are writing about.");a.topic.focus();return false}if(a.detail.value==""){alert("Please give us some detail the issue you are writing about.");a.detail.focus();return false}if(a.vrfy.value==""){alert("Please enter the letters or numbers you see in the image.");a.vrfy.focus();return false}return true}function update_profile(){theform=document.forms.profileform;params=parse_params(theform);var a=FCKeditorAPI.GetInstance("profile").GetXHTML();params+="&profileXHTML="+encodeURIComponent(a);p=new AjaxPost("/account/mod/profile_update.php",params,"process1")}function preview_profile(){theform=document.forms.profileform;var a=FCKeditorAPI.GetInstance("profile").GetXHTML();params="profileXHTML="+encodeURIComponent(a);p=new AjaxPost("/account/mod/profile_view.php",params,"modal_content");modal_show(600,500)}function optin_change(b){var a=b==true?1:0;var d=new AjaxCallback();d.callback=function(h){var e=(b==true?"You will now receive":"You will no longer receive")+" email updates from&nbsp;GoChords.";var f=d.json(h);result=f.response==1?"<b>Your email preferences have been updated.</b><br/>"+e:"An error occurred.";$m("process2").innerHTML=result};d.process("/account/mod/optin_update.php?optin_pref="+a)};