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 sWindowOnLoad = ''; var sWindowOnUnload = ''; //@@ var sWindowOnResize = ''; //@@ function eventWindowOnResize() //@@ { eval(sWindowOnResize); } function windowOnResize(sJavascript) //@@ { sWindowOnResize += sJavascript; } function windowOnUnload(sJavascript) // @@ { sWindowOnUnload += sJavascript; } function eventWindowOnUnload() { } function getValueFromParamList(plist, pname, sep) { if (sep == null) sep = ','; iPos_Start = plist.indexOf(pname + '='); if (iPos_Start != -1) { iPos_End = plist.indexOf(sep, iPos_Start); if (iPos_End == -1) iPos_End = plist.length; return plist.substring(iPos_Start + pname.length + 1, iPos_End); } else { return -1; } } function setValueInParamList(plist, pname, sParamValue, sep) { if (sep == null) sep = ','; iPos_Start = plist.indexOf(pname + '='); if (iPos_Start != -1) { iPos_End = plist.indexOf(sep, iPos_Start); if (iPos_End == -1) iPos_End = plist.length; return plist.substring(0, iPos_Start) + pname + '=' + sParamValue + plist.substr(iPos_End); } else { return plist + ',' + pname + '=' + sParamValue; } } function eventWindowOnLoad() { setTimeout("eventWindowOnLoad_();" ,0); } function eventWindowOnLoad_() { if(typeof(dRenderStart) != "undefined") var sRenderDiff = DateDiffString(dRenderStart, new Date()); if(typeof(bDebugMode) != "undefined" && bDebugMode) DebugPrint(); var oSpan = document.getElementById('debugOnloadTime'); if(oSpan != null) { oSpan.innerHTML = TimeEval(sWindowOnLoad, 'Onload event'); setTimeout("DisplayTimingReport();", 5); } else eval(sWindowOnLoad); oSpan = document.getElementById('debugRenderTime'); if(oSpan != null) oSpan.innerHTML = sRenderDiff; } function windowOnLoad(sJavascript) { if (navigator.appName == "Netscape" && false) { if (document.body.attributes.onload) document.body.attributes.onload.value += ";" + sJavascript; else document.body.setAttribute("onload", sJavascript); } else { window.onload = function() { eventWindowOnLoad(); }; if(typeof(bDebugMode) != "undefined" && bDebugMode) sWindowOnLoad += 'TimeEval("' + sJavascript + '", "' + sJavascript + '");'; else sWindowOnLoad += 'eval("' + sJavascript + '");'; } } 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')); 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); 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 eventWindowOnFocus() { if(bCloseOnFocus) window.close(); } function windowPrint() { window.print(); } function AddSlashes(sText) { re = /(['\\])/g; return sText.replace(re, "\\$1"); }