DWREngine.setErrorHandler(displayError); function displayError(reason) { var reasonString = reason.toString(); 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 confirmationDisplayUserName(name) { if( name != null ) { document.getElementById('name').value = name; } } function confirmationDisplayResult(result) { if( result == "true" ) { document.getElementById('confirmationTable').style.display = 'none'; document.getElementById('confirmedTable').style.display = 'inline'; } } function confirmationDisplayResendResult(result) { if( result == "true" ) { alert("A confirmation email was sent.\n\nPlease wait a few minutes and retrieve the confirmation code from that email."); } } function confirmationConfirm() { if( document.getElementById('code').value == '' ) { alert('The code field must contain a value.'); return null; } if( document.getElementById('name').value == '' ) { alert('The name field must contain a value.'); return null; } RegistrationBean.performConfirmation(document.getElementById('name').value, document.getElementById('code').value, confirmationDisplayResult); } function confirmationResend() { if( document.getElementById('email').value == '' ) { alert('The email field must contain a value.'); return null; } RegistrationBean.performResend(document.getElementById('email').value, confirmationDisplayResendResult); } RegistrationBean.getUserName(confirmationDisplayUserName); if( queryString.length > 0 ) { var loginId = queryString.substring(0, queryString.indexOf("&")); loginId = loginId.substring(loginId.indexOf("=") + 1, loginId.length); var code = queryString.substring(queryString.indexOf("&") + 1, queryString.length); code = code.substring(code.indexOf("=") + 1, code.length); if( loginId.length > 0 && code.length > 0 ) { RegistrationBean.performConfirmation(loginId, code, confirmationDisplayResult); } }