var _gaJSWindowList=new Array();var _goActiveWindow=null;function JSWindow(D,E,F,I,J,G,H,C,B){if(document.getElementById(D)!=null){alert("ID value of '"+D+"' passed to JSWindow constructor is not unique!\n\nCannot create new JSWindow, please use a unique ID.");return null}this.ID=D;this.Title=E;this.Top=F;this.Left=I;this.Width=J;this.Height=G;this.Visible=false;this.Modal=H;this.ZIndex=findMaxZIndex()+500;this.Debug=B;this.MoveOffX=0;this.MoveOffY=0;this.Template=(((C!=null)&&(C!=undefined))?C:_gtTemplateDefault);this.Elements=new Array();this.BuildWindow();this.OnWindowClosing="";var A=_gaJSWindowList.length;_gaJSWindowList[A]=this}JSWindow.prototype.GetWindowFromID=JSWindow_GetFromID;JSWindow.prototype.BuildWindow=JSWindow_BuildWindow;JSWindow.prototype.Show=JSWindow_Show;JSWindow.prototype.Hide=JSWindow_Hide;JSWindow.prototype.DebugWindow=JSWindow_DebugAction;JSWindow.prototype.AddElement=JSWindow_AddElement;JSWindow.prototype.SetTitle=JSWindow_SetTitle;JSWindow.prototype.SetTop=JSWindow_SetTop;function JSWindow_BuildWindow(){if(this.Modal){if(window.innerHeight&&window.scrollMaxY){iPgeHgt=window.innerHeight+window.scrollMaxY;iPgeWdt=document.body.offsetWidth}else{if(document.body.scrollHeight>document.body.offsetHeight){iPgeHgt=document.body.scrollHeight;iPgeWdt=document.body.scrollWidth}else{iPgeHgt=document.body.offsetHeight;iPgeWdt=document.body.offsetWidth}}if(BrowserDetect.browser=="Explorer"){this.Overlay=document.createElement('<div id="MovOvr_'+this.ID+'" style="position:absolute;top:0px;left:0px;width:'+iPgeWdt+"px;height:"+iPgeHgt+";z-index:"+(this.ZIndex-1)+';display:none;">')}else{this.Overlay=document.createElement("div");this.Overlay.setAttribute("id","ModOvr_"+this.ID);this.Overlay.setAttribute("style","position:absolute;top:0px;left:0px;width:"+iPgeWdt+"px;height:"+iPgeHgt+";z-index:"+(this.ZIndex-1)+";display:none;")}if(BrowserDetect.browser=="Explorer"){this.OverlayImg=document.createElement('<img src="/jslib/images/dotblk.gif" width="'+iPgeWdt+'" height="'+iPgeHgt+'" style="filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;">')}else{this.OverlayImg=document.createElement("img");this.OverlayImg.setAttribute("src","/jslib/images/dotblk.gif");this.OverlayImg.setAttribute("width",iPgeWdt);this.OverlayImg.setAttribute("height",iPgeHgt);this.OverlayImg.setAttribute("style","filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;")}this.Overlay.appendChild(this.OverlayImg)}if(BrowserDetect.browser=="Explorer"){this.WinBase=document.createElement('<div id="'+this.ID+'" style="position:absolute;top:'+this.Top+"px;left:"+this.Left+"px;width:"+this.Width+"px;height:"+this.Height+"px;background-color:"+this.Template.BckClr+";z-index:"+this.ZIndex+';display:none;">')}else{this.WinBase=document.createElement("div");this.WinBase.setAttribute("id",this.ID);this.WinBase.setAttribute("style","position:absolute;top:"+this.Top+"px;left:"+this.Left+"px;width:"+this.Width+"px;height:"+this.Height+"px;background-color:"+this.Template.BckClr+";z-index:"+this.ZIndex+";display:none;")}if(BrowserDetect.browser=="Explorer"){this.WinFrame=document.createElement('<div id="JSWinFrm_'+this.ID+'" style="position:relative;top:0px;left:0px;width:'+this.Width+"px;height:"+this.Height+"px;border-top:1px solid "+this.Template.BckClr+";border-left:1px solid "+this.Template.BckClr+";border-right:1px solid "+this.Template.BdrDrk+";border-bottom:1px solid "+this.Template.BdrDrk+';">')}else{this.WinFrame=document.createElement("div");this.WinFrame.setAttribute("id","JSWinFrm_"+this.ID);this.WinFrame.setAttribute("style","position:relative;top:0px;left:0px;width:"+this.Width+"px;height:"+this.Height+"px;border-top:1px solid "+this.Template.BckClr+";border-left:1px solid "+this.Template.BckClr+";border-right:1px solid "+this.Template.BdrDrk+";border-bottom:1px solid "+this.Template.BdrDrk+";")}if(BrowserDetect.browser=="Explorer"){this.InnerFrame=document.createElement('<div style="position:relative;top:0px;left:0px;width:'+(this.Width-2)+"px;height:"+(this.Height-2)+"px;border-top:1px solid "+this.Template.BdrLgt+";border-left:1px solid "+this.Template.BdrLgt+";border-right:1px solid "+this.Template.BdrShd+";border-bottom:1px solid "+this.Template.BdrShd+';">')}else{this.InnerFrame=document.createElement("div");this.InnerFrame.setAttribute("style","position:relative;top:0px;left:0px;width:"+(this.Width-2)+"px;height:"+(this.Height-2)+"px;border-top:1px solid "+this.Template.BdrLgt+";border-left:1px solid "+this.Template.BdrLgt+";border-right:1px solid "+this.Template.BdrShd+";border-bottom:1px solid "+this.Template.BdrShd+";")}if(BrowserDetect.browser=="Explorer"){this.Content=document.createElement('<div id="JSWinCnt_'+this.ID+'" style="position:relative;overflow:auto;top:2px;left:0px;width:'+(this.Width-6)+'px;">')}else{this.Content=document.createElement("div");this.Content.setAttribute("id","JSWinCnt_"+this.ID);this.Content.setAttribute("style","position:relative;overflow:auto;top:2px;left:0px;width:"+(this.Width-6)+"px;height:"+(this.Height-2)+"px;")}this.InnerFrame.appendChild(this.Content);this.WinFrame.appendChild(this.InnerFrame);this.WinBase.appendChild(this.WinFrame);if(this.Modal){document.body.appendChild(this.Overlay)}document.body.appendChild(this.WinBase)}function JSWindow_DebugAction(sDbgStr){if(this.Debug!=""){var oFld=document.getElementById(this.Debug);if((oFld==null)||(oFld==undefined)){oFld=eval("document.forms[0]."+this.Debug)}if((oFld!=null)&&(oFld!=undefined)){oFld.value=sDbgStr+"\n"+oFld.value}}}function JSWindow_GetFromID(B){var A=null;for(var C=0;C<_gaJSWindowList.length;C++){A=_gaJSWindowList[C];if(A.ID==B){break}}return A}function JSWindow_GetIDFromString(B){var A=B.split("_");return(A[1])}function JSWindow_Show(){if(this.Modal){this.Overlay.style.display="block"}this.WinBase.style.display="block";this.Content.style.height=this.Height-this.Content.offsetTop-4;this.DebugWindow("JSWindow_Show: ID=["+this.ID+"]");this.Visible=true}function JSWindow_Hide(){if(this.Modal){this.Overlay.style.display="none"}this.WinBase.style.display="none";this.DebugWindow("JSWindow_Hide: ID=["+this.ID+"]");this.Visible=false}function JSWindow_SetTop(A){this.Top=A;this.WinBase.style.top=A+"px"}function JSWindow_Close(oBtn){var sWID=JSWindow_GetIDFromString(oBtn);var oWin=JSWindow_GetFromID(sWID);if((oWin!=null)&&(oWin!=undefined)){oWin.DebugWindow("JSWindow_Close: ID=["+oWin.ID+"]");if(oWin.OnWindowClosing!=""){var sCall=oWin.OnWindowClosing+"('"+oWin.ID+"')";oWin.DebugWindow('JSWindow_Close: Calling "'+sCall+'"');eval(sCall)}oWin.Hide()}}function JSWindow_TitleBarMouseDown(D){D=(D?D:event);var A=JSWindow_GetIDFromString(this.id);var B=JSWindow_GetFromID(A);if((B!=null)&&(B!=undefined)){_goActiveWindow=B;var E=(D.pageX?D.pageX:D.clientX)+document.body.scrollLeft;var C=(D.pageY?D.pageY:D.clientY)+document.body.scrollTop;B.MoveOffX=E-B.Left;B.MoveOffY=C-B.Top;B.DebugWindow("JSWindow_TitleBarMouseDown: ID=["+B.ID+"] xLoc=["+E+"] yLoc=["+C+"] MOX=["+B.MoveOffX+"] MOY=["+B.MoveOffY+"] WinX=["+B.Left+"] WinY=["+B.Top+"]");document.onmousemove=JSWindow_DragWindow;document.onmouseup=JSWindow_TitleBarMouseUp}}function JSWindow_DragWindow(D){D=(D?D:event);var E=(D.pageX?D.pageX:D.clientX)+document.body.scrollLeft;var C=(D.pageY?D.pageY:D.clientY)+document.body.scrollTop;var B=E-_goActiveWindow.MoveOffX;var A=C-_goActiveWindow.MoveOffY;if(A>0){_goActiveWindow.WinBase.style.top=A}if(B>0){_goActiveWindow.WinBase.style.left=B}_goActiveWindow.DebugWindow("JSWindow_DragWindow: winX=["+_goActiveWindow.WinBase.style.left+"] winY=["+_goActiveWindow.WinBase.style.top+"]");StopEvent(D)}function JSWindow_TitleBarMouseUp(E){if(_goActiveWindow!=null){var B=_goActiveWindow;E=(E?E:event);var F=(E.pageX?E.pageX:E.clientX)+document.body.scrollLeft;var D=(E.pageY?E.pageY:E.clientY)+document.body.scrollTop;var C=F-B.MoveOffX;var A=D-B.MoveOffY;if(A>0){B.WinBase.style.top=A}if(C>0){B.WinBase.style.left=C}B.Top=NumericOnly(B.WinBase.style.top,false);B.Left=NumericOnly(B.WinBase.style.left,false);B.DebugWindow("JSWindow_TitleBarMouseUp  : ID=["+B.ID+"] xLoc=["+F+"] yLoc=["+D+"] MOX=["+B.MoveOffX+"] MOY=["+B.MoveOffY+"] WinX=["+B.Left+"] WinY=["+B.Top+"]");B.MoveOffX=0;B.MoveOffY=0;_goActiveWindow=null;document.onmousemove=null;document.onmouseup=null}}function JSWindow_AddElement(A,E,D){if((A!=null)&&(A!=undefined)){var C;if(BrowserDetect.browser=="Explorer"){C=document.createElement('<div id="JSWinEle_'+A.id+'" style="position:absolute;top:'+E+"px;left:"+D+'px;">')}else{C=document.createElement("div");C.setAttribute("id","JSWinEle_"+A.id);C.setAttribute("style","position:absolute;top:"+E+"px;left:"+D+"px;")}C.appendChild(A);this.Content.appendChild(C);var B=this.Elements.length;this.Elements[B]=C}}function JSWindow_SetTitle(A){this.Title=A;this.TitleBarText.nodeValue=this.Title}