// Licensed Materials - Property of IBM // // IBM Cognos Products: ps // // (C) Copyright IBM Corp. 2005, 2013 // // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. // Copyright (C) 2008 Cognos Incorporated. All rights reserved. // Cognos and the Cognos logo are trademarks of Cognos Incorporated. function init() { if (document.pform != null) { var nFormFields = document.pform.elements.length; for (var i=0; i < nFormFields; i++) { if( document.pform.elements[i].type != 'hidden' ) { //Handle a timing error in IE which can prevent setting the focus //the timeout is set to 750m specifically to ensure that the jaws screen reader virtual //cursor and the visible cusrsor does not get out of sync. setTimeout('document.pform.elements[' + i + '].focus()',750); break; } } } if(document.getElementById('cmdOK')) { if (document.getElementById('cmdOK').offsetWidth < 70) { document.getElementById('cmdOK').style.width = '4.9em'; } } if(document.getElementById('cmdCancel')) { if (document.getElementById('cmdCancel').offsetWidth < 70) { document.getElementById('cmdCancel').style.width = '4.9em'; } } cmdOK_enable(); return true; } function processCommand(cmd) { switch (cmd) { case 'ok' : doCommandOK(); break; case 'cancel' : doCloseAction('cancel'); break; case 'close' : doCloseAction('close'); break; case 'help' : help(); break; case 'yes' : case 'no' : if (g_PS_isPasswordResetConfirmation) { g_PS_enablePasswordResetAction = (cmd == 'yes') ? true : false; doCommandOK(); } break; } } function doCloseAction(event) { if (g_PS_externalBack != '') { setTimeout("document.location.href = g_PS_externalBack", 100); } else if (g_PS_isModal == 'true') { if (g_PS_callBackTargetJSVar) { g_PS_callBackTargetJSVar.ccModalCallBack(event, null); } } else if (g_PS_errURL != '') { errURLExit(); } else { if (parent && parent.closeErrorPage) parent.closeErrorPage(); else if (window.external && window.external.HasOnClose) { window.external.OnClose(1); return; } else if (window.opener) { try { if (window.opener.closePSLogin){ window.opener.closePSLogin(); return; } } catch (e){ window.close(); return; } } if (g_PS_isCloseMorphlet) window.close(); else if ( history.length > g_PS_emptyHistoryThreshold ) history.back(); else window.close(); } } function validate() { if (document.pform.elements[g_PS_sVerifyTextNoEcho]) { if (document.pform.elements[g_PS_sVerifyTextNoEcho][0].value != document.pform.elements[g_PS_sVerifyTextNoEcho][1].value) { alert(g_PS_msg_PasswordVerifyFailed); return false; } } if (g_PS_isPasswordResetConfirmation) { if (document.pform.elements["CAMChangePwd"]) { document.pform.elements["CAMChangePwd"].value = g_PS_enablePasswordResetAction ? "true" : "false"; } } return true; } function doCommandOK() { if (validate()) { if (typeof g_PS_mvc_enabled != "undefined" && g_PS_mvc_enabled) { mvcDoSimultaneousLogin(document.pform); // MVC } else { document.pform.submit(); } cmdOK_disable(); return true; } else { return false; } } function cmdOK_enable() { g_PS_cmdOK_enabled = true; if (document.getElementById('cmdOK')) { document.getElementById('cmdOK').disabled = false; } } function cmdOK_disable() { g_PS_cmdOK_enabled = false; if (document.getElementById('cmdOK')) { document.getElementById('cmdOK').disabled = true; } } function cmdOK_isEnabled() { return g_PS_cmdOK_enabled; } function errURLExit() { if (g_PS_errURLTooLong == 'true' && document.errURLForm) { document.errURLForm.submit(); } else { location.href = g_PS_errURL; } }