// 05/17/2009 Paul. We need to manage the Module Popups inside the same Parent Popup code so that we we can reuse the Change functions. // 05/17/2009 Paul. We will be providing the full ClientID in the function parameters, so we don't need to prepend the parent client. var sCHANGE_MODULE_ID = null; var sCHANGE_MODULE_NAME = null; var sCHANGE_QUERY = null; var bCHANGE_SUBMIT = null; function ChangeAlert() { alert('There was an error setting the Change callback.'); } function ChangeModule(sPARENT_ID, sPARENT_NAME) { // 09/03/2009 Paul. Also clear any error messages returned by AJAX. var fldAjaxErrors = document.getElementById(sCHANGE_MODULE_NAME + '_AjaxErrors'); if ( fldAjaxErrors != null ) fldAjaxErrors.innerHTML = ''; var fldCHANGE_MODULE_ID = document.getElementById(sCHANGE_MODULE_ID ); if ( sCHANGE_MODULE_NAME != null ) { var fldCHANGE_MODULE_NAME = document.getElementById(sCHANGE_MODULE_NAME); if ( fldCHANGE_MODULE_NAME != null ) { fldCHANGE_MODULE_NAME.value = sPARENT_NAME; } } if ( fldCHANGE_MODULE_ID != null ) { fldCHANGE_MODULE_ID.value = sPARENT_ID ; if ( bCHANGE_SUBMIT ) document.forms[0].submit(); } else { alert('Could not find ' + sCHANGE_MODULE_ID + ' in the form.'); } } function ModuleTypePopup(sPopupURL, sPopupTitle) { if ( sCHANGE_QUERY != null ) sPopupURL += '?' + sCHANGE_QUERY; return window.open(sPopupURL, sPopupTitle, 'width=600,height=400,resizable=1,scrollbars=1'); } function ModulePopup(sMODULE_TYPE, sMODULE_ID, sMODULE_NAME, sQUERY, bSUBMIT, sPOPUP_FILE) { // 05/18/2009 Paul. Simplify code. Only assign change function specific to the task. sCHANGE_MODULE_ID = sMODULE_ID ; sCHANGE_MODULE_NAME = sMODULE_NAME; sCHANGE_QUERY = sQUERY ; bCHANGE_SUBMIT = bSUBMIT ; sCHANGE_POPUP_FILE = sPOPUP_FILE ; if ( sCHANGE_POPUP_FILE == null ) sCHANGE_POPUP_FILE = 'Popup.aspx'; switch(sMODULE_TYPE) { default: alert('Unknown type. Add ' + sMODULE_TYPE + ' to Include/javascript/ModulePopupScripts.aspx'); break; } return false; } function ClearModuleType(sMODULE_TYPE, sMODULE_ID, sMODULE_NAME) { sCHANGE_MODULE_ID = sMODULE_ID ; sCHANGE_MODULE_NAME = sMODULE_NAME; sCHANGE_SUBMIT = null; ChangeModule('', ''); return false; }