function nextFocus(b,a){if(Prototype.Browser.IE){b=window.event}if(b.keyCode==9){if($(a)){setTimeout(function(){$(a).focus()},5)}}}function doLoginOnRegister(){var a="";if($("userformOnRegister_username").value.length<1){a="Please enter your WAYN Username or registered email address.\n"}if($("userformOnRegister_passwd").value.length<1){a+="Please enter your password.\n"}if(a!=""&&a.length>1){if(document.userformOnRegister.userformOnRegister_username.value.length>1){document.userformOnRegister.passwd.focus()}else{document.userformOnRegister.userformOnRegister_username.focus()}msgBox("warning",a);return false}else{$("userformOnRegister_password").value=hex_md5($("userformOnRegister_passwd").value);checkLogin($("userformOnRegister_username").value,$("userformOnRegister_password").value,document.userformOnRegister);return true}}function isEnter(c){var g;var d;var b;var a=document.userform;if(window.event){g=c.keyCode}else{if(c.which){g=c.which}}if(g=="13"){if(doLogin()!=false){document.getElementById("userform").submit()}}return true}function isEnter2(c){var g;var d;var b;var a=document.userform;if(window.event){g=c.keyCode}else{if(c.which){g=c.which}}return(g=="13")}function doPasswordReminder(a){var c;try{c=newXMLobject();c.open("GET","/wayn.html?wci=lostpassword&wce=enterxml&sitename="+a,true);c.onreadystatechange=function(){switch(c.readyState){case 4:if(c.status!=200){msgBox("warning","Sorry, there was an error. Please try again later.");return false}try{var d=c.responseXML.getElementsByTagName("status").item(0).getAttribute("message");msgBox("warning",d)}catch(f){msgBox("warning","Sorry, there was an error. Please try again later.");return false}}};c.send(null)}catch(b){msgBox("warning","Sorry, there was an error. Please try again later.")}}function showLoginError(){if($("errMsg")){var b=$("errMsg").value;var a="";if(b!=""){switch(b){case"1":a="Please enter an email address.";break;case"2":a="Please enter a password.";break;case"3":a="Email/Username not found.<br><br>Remember! you need to login using the email address which you used to register.";break;case"4":a="Incorrect Password.";break;case"12":a="Please enter an email address.<br>Please enter a password.";break}alert(location.href);if(a!=""){if(location.href.indexOf("logoff")>0){a=a.replace(/\<br\>/gi,"\n");alert(a)}else{msgBox("warning",a,function(){},function(){setFocusOnUsername()})}}}}setFocusOnUsername()};
