function enhanceContactPage(){ btn=document.getElementById('btncontact_send'); if(btn){ addEvent(btn,'click',checkContactFrm); } } function checkContactFrm(e){ var err; var email=document.getElementById('contact_email'); if(email){ lbl=getRelatedLabel(email.id); if(email.value.length<6){ cancelDefaultBehavior(e); if(typeof contact_err_email!='undefined' && contact_err_email.length>0){ if(lbl){ if(!lbl.oldtxt){ lbl.oldtxt=lbl.firstChild.data; } lbl.firstChild.data=contact_err_email; lbl.className+=' err txtbig'; email.className+=' err'; if(!err){ err=email; } }else{ popDHTML('popmsgerr',contact_err_email,400,'auto'); return; } } }else{ if(lbl.oldtxt){ lbl.firstChild.data=lbl.oldtxt; lbl.oldtxt=''; } lbl.className=lbl.className.replace(/[ ]*err/g,''); lbl.className=lbl.className.replace(/[ ]*txtbig/g,''); email.className=email.className.replace(/[ ]*err/g,''); } } var pseudo=document.getElementById('contact_pseudo'); if(pseudo){ lbl=getRelatedLabel(pseudo.id); if(pseudo.value.length<5){ var noaccount=document.getElementById('contact_noaccount'); if(noaccount && !noaccount.checked){ cancelDefaultBehavior(e); if(typeof contact_err_pseudo!='undefined' && contact_err_pseudo.length>0){ if(lbl){ if(!lbl.oldtxt){ lbl.oldtxt=lbl.firstChild.data; } lbl.firstChild.data=contact_err_pseudo; lbl.className+=' err txtbig'; pseudo.className+=' err'; if(!err){ err=pseudo; } }else{ popDHTML('popmsgerr',contact_err_pseudo,400,'auto'); return; } } }else{ if(lbl.oldtxt){ lbl.firstChild.data=lbl.oldtxt; lbl.oldtxt=''; } lbl.className=lbl.className.replace(/[ ]*err/g,''); lbl.className=lbl.className.replace(/[ ]*txtbig/g,''); pseudo.className=pseudo.className.replace(/[ ]*err/g,''); } }else{ if(lbl.oldtxt){ lbl.firstChild.data=lbl.oldtxt; lbl.oldtxt=''; } lbl.className=lbl.className.replace(/[ ]*err/g,''); lbl.className=lbl.className.replace(/[ ]*txtbig/g,''); pseudo.className=pseudo.className.replace(/[ ]*err/g,''); } } var msg=document.getElementById('contact_msg'); if(msg){ lbl=getRelatedLabel(msg.id); if(msg.value.length<3){ cancelDefaultBehavior(e); if(typeof contact_err_msg!='undefined' && contact_err_msg.length>0){ if(lbl){ if(!lbl.oldtxt){ lbl.oldtxt=lbl.firstChild.data; } lbl.firstChild.data=contact_err_msg; lbl.className+=' err txtbig'; msg.className+=' err'; if(!err){ err=msg; } }else{ popDHTML('popmsgerr',contact_err_msg,400,'auto'); return; } } }else{ if(lbl.oldtxt){ lbl.firstChild.data=lbl.oldtxt; lbl.oldtxt=''; } lbl.className=lbl.className.replace(/[ ]*err/g,''); lbl.className=lbl.className.replace(/[ ]*txtbig/g,''); msg.className=msg.className.replace(/[ ]*err/g,''); } } if(err){ err.focus(); } if(document.frmcontact.javascript){ document.frmcontact.javascript.value='1'; } if(document.frmcontact.screenres){ document.frmcontact.screenres.value=screen.width+' x '+screen.height; } } addEvent(window,'load',enhanceContactPage);