DWREngine.setErrorHandler(displayError); function displayError(reason) { var reasonString = reason.toString(); registrationClick = false; if( reasonString.indexOf("TypeError: player has no properties") != -1 && !globalError ) { globalError = true; alert("Your session has expired. Please re-login to the application."); } else if( reasonString.indexOf("null") != -1 && !globalError ) { globalError = true; alert("Your session has expired. Please re-login to the application."); } if( !globalError ) { alert(reasonString); } } function registrationDisplayRegistration(result) { if( result == "true" ) { var email = document.getElementById('email').value; DWRUtil.setValue("registrationEmailAddress", email); document.getElementById('registerTable').style.display = 'none'; document.getElementById('registerConfirmTable').style.display = 'inline'; } } var registrationClick = false; function registrationRegister() { if( !registrationClick ) { if( document.getElementById('name').value == '' ) { alert('The Login ID field must contain a value.'); return null; } if( document.getElementById('name').value.length < 4 ) { alert('The Login ID field must contain 4 characters.'); return null; } if( document.getElementById('name').value.length > 14 ) { alert('The Login ID field may only contain 14 characters.'); return null; } if( document.getElementById('password').value == '' ) { alert('The password field must contain a value.'); return null; } if( document.getElementById('password').value.length < 4 ) { alert('The password field must contain 4 characters.'); return null; } if( document.getElementById('email').value == '' ) { alert('The email field must contain a value.'); return null; } if( document.getElementById('email').value.length < 4 ) { alert('The email field must contain 4 characters.'); return null; } if( document.getElementById('email').value != document.getElementById('emailconfirm').value ) { alert('The email and the email confirm fields must contain the same value.'); return null; } if( document.getElementById('password').value != document.getElementById('passwordconfirm').value ) { alert('The password and the password confirm confirmation fields must contain the same value.'); return null; } if( document.getElementById('rulesconfirm').checked == false) { alert('The game rules must be read and agreed to.'); return null; } registrationClick = true; RegistrationBean.performRegistration(document.getElementById('name').value, document.getElementById('password').value, document.getElementById('email').value, document.getElementById('rulesconfirm').checked, document.getElementById('receiveemail').checked, registrationDisplayRegistration); } }