var UN=true;var EM=true;function checkUN(o,t){aj('/wla/wlpms.nsf/(cyn)?OpenAgent&T='+t+'&U='+o.value.replace(/ /g,'+'),t=='username'?'unResult':'emResult');}function userTest(o){var v=o.value;var tc=v.substring(v.length-1,v.length);var charCode=v.charCodeAt(v.length-1);var alpha=(charCode>=65&&charCode<=90)||(charCode>=97&&charCode<=122)||(charCode>=48&&charCode<=57)||(charCode>=32&&charCode<=32);if(o.value==''){$('usernametick').src='/icons/vwicn080.gif';$('underuser').innerHTML='';}else if(!alpha){o.value=o.value.substring(0,o.value.length-1);$('underuser').innerHTML='<br/>Please only use letters & numbers ...';}else checkUN(o,'username');}function mailTest(o){if(o.value.indexOf('@')>-1&&o.value.indexOf('.')>-1&&o.value.replace(/ /g,'')!='')checkUN(o,'email');else{EM=true;$('underemail').innerHTML='';$('emailtick').src='/icons/vwicn080.gif';cwg();}}function emResult(xmldoc){var r=xmldoc.getElementsByTagName('response');if(r[0].firstChild.nodeValue=='true'){EM=true;$('emailtick').src='/icons/vwicn080.gif';$('underemail').innerHTML='<br/>This e-mail address is already in use ...';}else if($('email').value==''){EM=true;$('emailtick').src='/icons/vwicn080.gif';$('underemail').innerHTML='';cwg();}else{EM=false;$('emailtick').src='/icons/vwicn082.gif';$('underemail').innerHTML='';cwg();}}function cwg(){if($('password').value==$('passwordretype').value&&$('password').value!=''&&$('email').value!=''&&EM==false&&$('fullname').value!=''&&$('tandc').checked==true)$('regbut').disabled=false;else $('regbut').disabled=true;}function comparep(a,b,ai,bi){if(a.value==b.value&&a.value!=''){ai.src="/icons/vwicn082.gif";bi.src="/icons/vwicn082.gif";}else{ai.src="/icons/vwicn080.gif";bi.src="/icons/vwicn080.gif";}}function s(d){thisdb=d;$('fullname').value='';$('email').value='';}function sendreg(){p=$('password');if(p.value==$('passwordretype').value){g=$('gender');d=$('day');$('regbut').disabled=true;$('regbut').value='Processing registration ...';aj('/'+thisDb+'/(nyp)?CreateDocument','completereg','user_fullname='+$('fullname').value+'&'+'user_email='+$('email').value+'&'+'user_password='+p.value+'&'+'user_mobile='+$('mobile').value+'&'+'user_address1='+$('address1').value+'&'+'user_address2='+$('address2').value+'&'+'user_city='+$('city').value+'&'+'user_focus='+$('lafocus').options[$('lafocus').selectedIndex].text+'&'+'user_disability='+$('disability').options[$('disability').selectedIndex].text+'&'+'user_WLMailing='+$('WLMailing').checked+'&'+'user_postcode='+$('postcode').value+'&'+'user_weight='+$('weight').value+'&'+($('gm')?('user_groupinvite='+$('gm').value+'&'):'')+(g.options[g.selectedIndex].text!=''?'user_gender='+g.options[g.selectedIndex].text+'&':'')+(d.options[d.selectedIndex].text!=''?'user_dob='+d.options[d.selectedIndex].text+'/'+$('month').options[$('month').selectedIndex].text+'/'+$('year').options[$('year').selectedIndex].text:''));}}function completereg(xmldoc){window.location='/RegistrationComplete';}