var DOM = (document.getElementById) ? true : false; var IE = (document.all) ? true : false; var NS4 = (document.layers) ? true : false; var helpwindow; var childwindow; var calendarwindow; var tmpPopup; var bDontCloseChildren = 0; var bCloseOnFocus = 0; var sWindowOnUnload = ''; var sWindowOnResize = ''; function getValueFromParamList(sParamList, sParamName, sSeparator) { if (sSeparator == null) sSeparator = ','; iPos_Start = sParamList.indexOf(sParamName + '='); if (iPos_Start != -1) { iPos_End = sParamList.indexOf(sSeparator, iPos_Start); if (iPos_End == -1) iPos_End = sParamList.length; return sParamList.substring(iPos_Start + sParamName.length + 1, iPos_End); } else { return -1; } } function windowOpen(sUrl, sName, sOptions, bDontAutoClose, bDontFocus) { iRequestedWidth = parseInt(getValueFromParamList(sOptions, 'width')); iRequestedHeight = parseInt(getValueFromParamList(sOptions, 'height')); iRequestedLeft = parseInt(getValueFromParamList(sOptions, 'left')); iRequestedTop = parseInt(getValueFromParamList(sOptions, 'top')); // adjust values if nessecairy if (!isNaN(iRequestedWidth)) iPopupWidth = Math.min(iRequestedWidth, screen.availWidth); if (!isNaN(iRequestedHeight)) iPopupHeight = Math.min(iRequestedHeight, screen.availHeight); if (!isNaN(iRequestedLeft)) iPopupLeft = Math.min(iRequestedLeft, screen.availWidth - iPopupWidth); if (!isNaN(iRequestedTop)) iPopupTop = Math.min(iRequestedTop, screen.availHeight - iPopupHeight); // set the new values for width, height, etc. if changed if (!isNaN(iRequestedWidth) && iRequestedWidth != iPopupWidth) sOptions = setValueInParamList(sOptions, 'width', iPopupWidth); if (!isNaN(iRequestedHeight) && iRequestedHeight != iPopupHeight) sOptions = setValueInParamList(sOptions, 'height', iPopupHeight); if (!isNaN(iRequestedLeft) && iRequestedLeft != iPopupLeft) sOptions = setValueInParamList(sOptions, 'left', iPopupLeft); if (!isNaN(iRequestedTop) && iRequestedTop != iPopupTop) sOptions = setValueInParamList(sOptions, 'top', iPopupTop); tmpPopup = window.open(sUrl, sName, sOptions); if (!bDontFocus) setTimeout("try{tmpPopup.focus();} catch(e) {}", 10); else setTimeout("try{this.focus();} catch(e) {}", 10); if(!bDontAutoClose) { try { if(typeof(sName) != 'undefined' && sName != '' && window.name != tmpPopup.name) childwindow = tmpPopup; } catch (e) { childwindow = tmpPopup; } } return tmpPopup; } function parentFocus() { try { window.opener.focus(); } catch(e) {} } function windowClose() { parentFocus(); window.close(); } function eventWindowOnUnload() { if(!bDontCloseChildren) { try { childwindow.close(); } catch(e) {} try { calendarwindow.close(); } catch(e) {} } eval(sWindowOnUnload); } function eventWindowOnFocus() { if(bCloseOnFocus) window.close(); } function eventWindowOnResize() { eval(sWindowOnResize); } function windowPrint() { window.print(); } function eventWindowOnBeforePrint() { try { document.getElementById('divPreviewHeader').style.display = 'none'; } catch(e) {} try { document.getElementById('tableDebugPV').style.display = 'none'; } catch(e) {} } function eventWindowOnAfterPrint() { try { document.getElementById('divPreviewHeader').style.display = 'inline'; } catch(e) {} try { document.getElementById('tableDebugPV').style.display = 'inline'; } catch(e) {} } function EscapeQuote(sText) { re = /'/g; return sText.replace(re, "\\'"); } function AddSlashes(sText) { re = /(['\\])/g; return sText.replace(re, "\\$1"); } function Html2Asc(sText) { re = /&/g; return sText.replace(re, "\&"); }