function Ajax() { }; Ajax.isSupported =function() { return Ajax.createXMLHttpRequest() != undefined; }; Ajax.createRequest =function(strURL, strMethod, bAsync, strUserName, strPassword) { return new AjaxRequest(strURL, strMethod, bAsync, strUserName, strPassword); }; Ajax.createXMLHttpRequest =function() { if(window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if(window.XMLHttpRequest) return new XMLHttpRequest(); }; function AjaxRequest(strURL, strMethod, bAsync, strUserName, strPassword) { this.setURL(strURL); if(typeof(strMethod) != "undefined") this.setMethod(strMethod); if(typeof(bAsync) != "undefined") this.setAync(bAsync); if(typeof(strUserName) != "undefined") this.setUserName(strUserName); if(typeof(strPassword) != "undefined") this.setPassword(strPassword); }; AjaxRequest.prototype.strMethod     ="GET"; AjaxRequest.prototype.bAsync        =true; AjaxRequest.prototype.bAborted      =false; AjaxRequest.prototype.bForceNoCache =true; AjaxRequest.prototype.setMethod =function(strMethod) { this.strMethod =strMethod; }; AjaxRequest.prototype.getMethod =function() { return this.strMethod; }; AjaxRequest.prototype.setURL =function(strURL) { this.strURL =strURL; }; AjaxRequest.prototype.getURL =function() { return this.strURL; }; AjaxRequest.prototype.setForceNoCache =function(bForceNoCache) { this.bForceNoCache =bForceNoCache; }; AjaxRequest.prototype.getForceNoCache =function() { return this.bForceNoCache; }; AjaxRequest.prototype.setAync =function(bAsync) { this.bAsync =bAsync; }; AjaxRequest.prototype.isAsync =function() { return this.bAsync; }; AjaxRequest.prototype.setUserName =function(strUser) { this.strUser =strUser; }; AjaxRequest.prototype.getUserName =function() { return this.strUser; }; AjaxRequest.prototype.setPassword =function(strPassword) { this.strPassword =strPassword; }; AjaxRequest.prototype.getPassword =function() { return this.strPassword; }; AjaxRequest.prototype.setCallback =function(funcCallback) { this.funcCallback =funcCallback; }; AjaxRequest.prototype.getCallback =function() { return this.funcCallback; }; AjaxRequest.prototype.setTargetElement =function(targetElem) { this.targetElem =targetElem; this.setCallback(this.innerHTMLCallback); }; AjaxRequest.prototype.getTargetElement =function() { return this.targetElem; }; AjaxRequest.prototype.setRequest =function(xmlhttpreq) { this.xmlhttpreq =xmlhttpreq; }; AjaxRequest.prototype.getRequest =function() { return this.xmlhttpreq; }; AjaxRequest.prototype.setPayload =function(strPayload) { this.strPayload =strPayload; }; AjaxRequest.prototype.getPayload =function() { return this.strPayload; }; AjaxRequest.prototype.send =function() { if(this.isAborted()) return; this.setRequest(Ajax.createXMLHttpRequest()); this.getRequest().open(this.getMethod(), this.createURL(), this.isAsync(), this.getUserName(), this.getPassword()); this.getRequest().onreadystatechange =createCallbackDispatch(this); if(this.getMethod() == 'POST') { this.getRequest().setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); this.getRequest().setRequestHeader("Content-Length", this.getPayload().length); this.getRequest().send(this.getPayload()); } else this.getRequest().send(null); }; AjaxRequest.prototype.createURL =function() { var             strURL =this.getURL(); if(this.getForceNoCache()) { if(strURL.indexOf("?") == -1) strURL +="?"; else strURL +="&"; strURL +="ts=" +new Date().getTime(); } if(this.getUseJSessionID()) strURL =this.insertJSessionID(strURL); return strURL; }; AjaxRequest.prototype.insertJSessionID =function(strURL) { var         ichInsert =strURL.indexOf("?"); if(ichInsert == -1) return strURL +";jsessionid=" +document.jsessionid; var         astr =strURL.split("?", 2); return astr[0] +";jsessionid=" +document.jsessionid +"?" +astr[1]; }; AjaxRequest.prototype.getUseJSessionID =function() { var             strJSIDCookie =Cookies.getCookieValue("jsessionid"); if(document.jsessionid == null) return false; if((strJSIDCookie != "") && (strJSIDCookie != document.jsessionid)) return true; if(strJSIDCookie != "") return false; return true; }; AjaxRequest.prototype.abort =function() { this.bAborted =true; if(this.getRequest() != null) { this.getRequest().abort(); this.setRequest(null); } }; AjaxRequest.prototype.isAborted =function() { return this.bAborted; }; AjaxRequest.prototype.toString =function() { return this.getMethod() + " " +this.getURL() +" " +this.isAsync(); }; function createCallbackDispatch(ajaxreq) { return (function() { if(ajaxreq.isAborted()) return; if(ajaxreq.getRequest().readyState == 4) { if(window.closed) return; if(ajaxreq.getRequest().status == 200) { if(ajaxreq.getCallback()) ajaxreq.getCallback()(ajaxreq); } } }); }; AjaxRequest.prototype.innerHTMLCallback =function(ajaxreq) { if((ajaxreq.getRequest().responseText == null) || (ajaxreq.getRequest().responseText == "")) return; if(typeof ajaxreq.getTargetElement() == "string") elemInto =document.getElementById(ajaxreq.getTargetElement()); else elemInto =ajaxreq.getTargetElement(); if(elemInto != null) elemInto.innerHTML =ajaxreq.getRequest().responseText; }; function ChatSession(strURL, nID, scrollpane) { this.setURL(strURL); this.setID(nID); this.setScrollPane(scrollpane); this.setSendOnEnter(true); this.setTrackTail(true); this.beginPolling(); this.setAudioAlerts(true); }; ChatSession.prototype.setScrollPane =function(strScrollPane) { this.strScrollPane =strScrollPane; }; ChatSession.prototype.getScrollPane =function() { return this.strScrollPane; }; ChatSession.prototype.setURL =function(strURL) { this.strURL =strURL; }; ChatSession.prototype.getURL =function() { return this.strURL; }; ChatSession.prototype.setID =function(nID) { this.nID =nID; }; ChatSession.prototype.getID =function() { return this.nID; }; ChatSession.prototype.publish =function() { this.sendComposition(); this.clearComposition(); elemChatCompose =document.getElementById("chatcompose"); elemChatCompose.focus(); }; ChatSession.prototype.sendComposition =function () { var         ajaxreq =Ajax.createRequest(this.getURL(), "POST", true); ajaxreq.setPayload("chatsession=" +this.getID() +"&msg=" +this.getCompositionText()); ajaxreq.send(); }; ChatSession.prototype.clearComposition =function() { this.setCompositionText(""); }; ChatSession.prototype.setCompositionText =function(strText) { elemChatCompose =document.getElementById("chatcompose"); elemChatCompose.value =strText; }; ChatSession.prototype.getCompositionText =function() { elemChatCompose =document.getElementById("chatcompose"); return elemChatCompose.value; }; ChatSession.prototype.beginPolling =function() { this.ajaxreqPoll =Ajax.createRequest(this.getURL() +"?chatsession=" +this.getID(), "GET", true); this.ajaxreqPoll.setCallback(this.createPollResponseHandler(this)); this.intervalPoll =window.setInterval(createServerPoller(this.ajaxreqPoll), 1000); }; ChatSession.prototype.endPolling =function() { window.clearInterval(this.intervalPoll); }; function createServerPoller(ajaxreq) { return (function() { ajaxreq.send(); }); }; ChatSession.prototype.createPollResponseHandler =function (chatsession) { return (function(ajaxreqPoll) { if(ajaxreqPoll.getRequest().status != 200) return; var             strText =ajaxreqPoll.getRequest().responseText; if((strText == null) || (strText == "")) return; strText =strText.replace(/^\s+/, ""); strText =strText.replace(/\s+$/, ""); if(strText.indexOf("---chat-messages---:") != 0) { chatsession.setConnected(false); return; } chatsession.setConnected(true); strText =strText.replace(/^---chat-messages---:\s+/, ""); var             bChime =chatsession.getAudioAlerts(); if(chatsession.getScrollPane().isEmpty()) bChime =false; chatsession.appendTranscript(strText); chatsession.appendTranscript("\r"); if(bChime) Sound.play('/chime.wav'); }); }; ChatSession.prototype.appendTranscript =function(strText) { this.getScrollPane().appendContent(strText); }; function handleComposeEnter(chatsession, event) { if(chatsession.isSendOnEnter() && (event.keyCode == 13)) chatsession.publish(); }; ChatSession.prototype.setSendOnEnter =function(bSendOnEnter) { this.bSendOnEnter =bSendOnEnter; }; ChatSession.prototype.isSendOnEnter =function() { return this.bSendOnEnter; }; ChatSession.prototype.setTrackTail =function(bTrackTail) { this.getScrollPane().setTrackTail(bTrackTail); }; ChatSession.prototype.isTrackTail =function() { return this.getScrollPane().isTrackTail(bTrackTail); }; ChatSession.prototype.setAudioAlerts =function(bAudioAlerts) { if(bAudioAlerts == undefined) return; this.bAudioAlerts =bAudioAlerts; }; ChatSession.prototype.getAudioAlerts =function() { return this.bAudioAlerts; }; ChatSession.prototype.setConnected =function(bConnected) { var         bOld =this.isConnected(); this.bConnected =bConnected; if(bOld != bConnected) { if(bOld == undefined) { if(bConnected == false) this.appendTranscript("<i>[unable to connect to server]</i><br />"); } else if(bConnected == false) this.appendTranscript("<i>[disconnected from server]</i><br />"); else this.appendTranscript("<i>[connected to server]</i><br />"); } }; ChatSession.prototype.isConnected =function() { return this.bConnected; }; ChatSession.prototype.close =function() { this.endPolling(); if(!this.bCloseWithoutLeaving) { var       ajaxreq =Ajax.createRequest("/leavechat", "POST", true); ajaxreq.setPayload("chatsession=" +this.getID()); ajaxreq.send(); } this.bCloseWithoutLeaving =undefined; this.getScrollPane().setVisible(false); }; ChatSession.prototype.createExternalizer =function(chatsession) { return (function(dlgbx) { chatsession.externalize(dlgbx); }); }; ChatSession.prototype.externalize =function(dlgbx) { this.endPolling(); var     strWinProp ="width=" +dlgbx.getViewElement().style.width +"," +"height=" +dlgbx.getViewElement().style.height; var     winExternal =window.open("/chatroom?chatsession=" +this.getID(), "chat_" +this.getID(), strWinProp); this.bCloseWithoutLeaving =true; if(winExternal == null) this.enterLimbo(); }; ChatSession.prototype.enterLimbo =function() { var         ajaxreq =Ajax.createRequest("/chatLimbo", "POST", true); ajaxreq.setPayload("chatsession=" +this.getID()); ajaxreq.send(); }; function Client() { }; Client.DARKEN_ELEMENT_ID        ="darkenClient"; Client.darken =function() { var         elemDarken =document.getElementById(Client.DARKEN_ELEMENT_ID); if(!elemDarken) { elemDarken =Client.createDarkenElement(); document.getElementsByTagName("body")[0].appendChild(elemDarken); } var         zindex =50; var         opacity =70; var         bgcolor ='#000000'; elemDarken.style.zIndex =zindex; elemDarken.style.opacity =(opacity /100); elemDarken.style.MozOpacity =(opacity /100); elemDarken.style.filter ='alpha(opacity=' +opacity +')'; elemDarken.style.backgroundColor =bgcolor; elemDarken.style.width =getWindowInnerWidth() +'px'; elemDarken.style.height =getWindowInnerHeight() +'px'; elemDarken.style.display ='block'; }; Client.undarken =function() { var         elemDarken =document.getElementById(Client.DARKEN_ELEMENT_ID); if(elemDarken) elemDarken.style.display='none'; }; Client.createDarkenElement =function() { var         elemDarken =document.createElement("div"); elemDarken.style.position='absolute'; elemDarken.style.top ='0px'; elemDarken.style.left ='0px'; elemDarken.style.overflow ='hidden'; elemDarken.style.display ='none'; elemDarken.id =Client.DARKEN_ELEMENT_ID; return elemDarken; }; function Cookies() { }; Cookies.getCookieValue =function(strName) { var         strFind =strName +"="; var         cchFind =strFind.length; var         cchMax =document.cookie.length; var         ich =0; while(ich <cchMax) { var     jch =ich +cchFind; if(document.cookie.substring(ich, jch) == strFind) return Cookies.getCookieValueAt(jch); ich =document.cookie.indexOf(" ", ich) +1; if(ich == 0) return ""; } return ""; }; Cookies.getCookieValueAt =function(ich) { var         ichEnd =document.cookie.indexOf(";", ich); if(ichEnd == -1) ichEnd =document.cookie.length; return unescape(document.cookie.substring(ich, ichEnd)); }; function DialogBox(strTitle) { this.setTitle(strTitle); this.setX(10); this.setY(10); this.setWidth(100); this.setHeight(100); this.setExternalizer(null); this.nUnique =(++DialogBox.cCounter); }; DialogBox.cCounter =0; DialogBox.prototype.setTitle =function(strTitle) { this.strTitle =strTitle; }; DialogBox.prototype.getTitle =function() { return this.strTitle; }; DialogBox.prototype.setX =function(x) { this.x =x; }; DialogBox.prototype.getX =function() { return this.x; }; DialogBox.prototype.setY =function(y) { this.y =y; }; DialogBox.prototype.getY =function() { return this.y; }; DialogBox.prototype.setWidth =function(width) { this.width =width; }; DialogBox.prototype.getWidth =function() { return this.width; }; DialogBox.prototype.setHeight =function(height) { this.height =height; }; DialogBox.prototype.getHeight =function() { return this.height; }; DialogBox.prototype.setViewElement =function(elemView) { this.elemView =elemView; }; DialogBox.prototype.getViewElement =function() { return this.elemView; }; DialogBox.prototype.setTitleBarElement =function(elemTitleBar) { this.elemTitleBar =elemTitleBar; }; DialogBox.prototype.getTitleBarElement =function() { return this.elemTitleBar; }; DialogBox.prototype.setContentElement =function(elemContent) { this.elemContent =elemContent; }; DialogBox.prototype.getContentElement =function() { return this.elemContent; }; DialogBox.prototype.isVisible =function() { return this.getViewElement().style.visibility == "hidden"; }; DialogBox.prototype.setVisible =function(bVisible) { if(bVisible) { this.getViewElement().style.visibility ="visible"; this.setHandlers(); this.requestFocus(); } else { this.getViewElement().style.visibility ="hidden"; this.clearHandlers(); } }; DialogBox.prototype.requestFocus =function() { FocusManager.giveFocus(this.getViewElement(), this); }; DialogBox.prototype.setFocus =function(bFocus) { if(bFocus) this.getTitleBarElement().className ="titlebar titlebar-focused"; else this.getTitleBarElement().className ="titlebar titlebar-unfocused"; }; DialogBox.prototype.addTo =function(elemParent) { var         divDlg =document.createElement("div"); divDlg.className ="dialogbox"; divDlg.style.position ="absolute"; divDlg.style.visibility ="hidden"; divDlg.style.top =this.getY() +"px"; divDlg.style.left=this.getX() +"px"; divDlg.style.width =this.getWidth() +"px"; divDlg.style.height =this.getHeight() +"px"; divDlg.style.overflow ="hidden"; var         divContent =document.createElement("div"); divContent.className ="dialog-content"; this.setTitleBarElement(divDlg.appendChild(this.createTitleBar())); this.setContentElement(divDlg.appendChild(divContent)); this.setViewElement(elemParent.appendChild(divDlg)); this.setVisible(true); }; DialogBox.prototype.close =function() { this.setVisible(false); if(this.getViewElement() != undefined) { this.getViewElement().parentNode.removeChild(this.getViewElement()); this.setViewElement(undefined); } }; DialogBox.prototype.loadContentsFrom =function(strURL) { var         ajaxreq =Ajax.createRequest(strURL, "GET"); ajaxreq.setCallback(this.contentsLoadCallback); ajaxreq.dlgbx =this; ajaxreq.send(); }; DialogBox.prototype.contentsLoadCallback =function(ajaxreq) { if((ajaxreq.getRequest().responseText == null) || (ajaxreq.getRequest().responseText == "")) return; ajaxreq.dlgbx.getContentElement().innerHTML =ajaxreq.getRequest().responseText; }; DialogBox.prototype.setHandlers =function() { this.getTitleBarElement().onmousedown =this.createClickHandler(this); this.getTitleBarElement().onmouseup =this.createMouseUpHandler(this); if(document.layers) { } else if(document.body & document.body.addEventListener) { this.getTitleBarElement().addEventListener("mousemove", this.createDragHandler(this), true); this.getTitleBarElement().addEventListener("mouseup", this.createMouseUpHandler(this), true); } else { Events.addMouseMoveHandler(this.getUniqueID(), this.createDragHandler(this)); } }; DialogBox.prototype.clearHandlers =function() { this.getTitleBarElement().onmousedown =null; this.getTitleBarElement().onmouseup =null; if(document.layers) { } else if(document.body & document.body.addEventListener) { this.getTitleBarElement().addEventListener("mousemove", this.createDragHandler(this), true); this.getTitleBarElement().addEventListener("mouseup", this.createMouseUpHandler(this), true); } else { Events.removeMouseMoveHandler(this.getUniqueID()); } }; DialogBox.prototype.createTitleBar =function() { var         div =document.createElement("div"); div.className ="titlebar titlebar-unfocused"; var         divTitle =document.createElement("div"); divTitle.className ="title"; divTitle.appendChild(document.createTextNode(this.getTitle())); div.appendChild(divTitle); var         divBtn =document.createElement("div"); divBtn.className ="buttons"; var         imgExternalize =document.createElement("img"); imgExternalize.setAttribute("src", "/art/window_new_16x16.png"); imgExternalize.setAttribute("width", "16"); imgExternalize.setAttribute("height", "16"); imgExternalize.title ="Send to separate window"; imgExternalize.className="externalize"; if(!this.isExternalizable()) imgExternalize.style.visibility ="hidden"; imgExternalize.onmousedown =this.createExternalizeHandler(this); this.setExternalizeImage(imgExternalize); divBtn.appendChild(imgExternalize); var         imgGoAway =document.createElement("img"); imgGoAway.setAttribute("src", "/art/delete2_16x16.png"); imgGoAway.setAttribute("width", "16"); imgGoAway.setAttribute("height", "16"); imgGoAway.className="goaway"; imgGoAway.title ="Close"; imgGoAway.onmousedown =this.createGoAwayHandler(this); divBtn.appendChild(imgGoAway); div.appendChild(divBtn); div.appendChild(document.createElement("br")); return div; }; DialogBox.prototype.createExternalizeHandler =function(dlgbx) { return (function() { if(dlgbx.isExternalizable() != null) dlgbx.getExternalizer()(dlgbx); dlgbx.goAway(); return false; }); }; DialogBox.prototype.createGoAwayHandler =function(dlgbx) { return (function() { dlgbx.goAway(); return false; }); }; DialogBox.prototype.goAway =function() { if((this.getGoAwayFunction() != null) && (this.getGoAwayFunction() != undefined)) this.getGoAwayFunction()(); this.setVisible(false); this.getViewElement().parentNode.removeChild(this.getViewElement()); }; DialogBox.prototype.setGoAwayFunction =function(funcGoAway) { this.funcGoAway =funcGoAway; }; DialogBox.prototype.getGoAwayFunction =function() { return this.funcGoAway; }; DialogBox.prototype.setDrag =function(drag) { this.drag =drag; }; DialogBox.prototype.getDrag =function() { return this.drag; }; DialogBox.prototype.createClickHandler =function(dlgbx) { return (function(evt) { return dlgbx.engageDrag(evt); }); }; DialogBox.prototype.engageDrag =function(evt) { this.requestFocus(); var         jsevt =new JSEvent((evt) ? evt : event); this.setDrag(new Drag(jsevt.getMouseX(), jsevt.getMouseY(), parseInt(getElementStyle(this.getViewElement(), "left", "left")), parseInt(getElementStyle(this.getViewElement(), "top", "top"))) ); jsevt.cancelBubble(true); }; DialogBox.prototype.createDragHandler =function(dlgbx) { return (function(evt) { return dlgbx.handleDrag(evt); }); }; DialogBox.prototype.handleDrag =function(evt) { if(!this.getDrag()) return true; var         jsevt =new JSEvent((evt) ? evt : event); var         xNew =this.getDrag().getNewElementX(jsevt.getMouseX()); var         yNew =this.getDrag().getNewElementY(jsevt.getMouseY()); this.getViewElement().style.left =xNew +"px"; this.getViewElement().style.top =yNew +"px"; jsevt.cancelBubble(true); return false; }; DialogBox.prototype.createMouseUpHandler =function(dlgbx) { return (function(evt) { return dlgbx.handleMouseUp(evt); }); }; DialogBox.prototype.handleMouseUp =function(evt) { this.setDrag(null); return false; }; DialogBox.prototype.getUniqueID =function() { return "DialogBox" +this.nUnique; }; DialogBox.prototype.setExternalizeImage =function(imgExternalize) { this.imgExternalize =imgExternalize; }; DialogBox.prototype.getExternalizeImage =function() { return this.imgExternalize; }; DialogBox.prototype.setExternalizer =function(funcExternalize) { this.funcExternalize =funcExternalize; if(this.getExternalizeImage() != undefined) { if(funcExternalize == null) this.getExternalizeImage().style.visibility ="hidden"; else this.getExternalizeImage().style.visibility ="visible"; } }; DialogBox.prototype.getExternalizer =function() { return this.funcExternalize; }; DialogBox.prototype.isExternalizable =function() { return (this.funcExternalize != null) && (this.funcExternalize != undefined); }; function JSEvent(evt) { this.setEvent(evt); }; JSEvent.prototype.setEvent =function(evt) { if(evt.pageX) this.bN4 =true; else if(evt.clientX) this.bIE =true; this.evt =evt; }; JSEvent.prototype.getEvent =function() { return this.evt; }; JSEvent.prototype.isN4 =function() { return this.bN4; }; JSEvent.prototype.isIE =function() { return this.bIE; }; JSEvent.prototype.getMouseX =function() { if(this.isN4()) return this.getEvent().pageX; else if(this.isIE()) return this.getEvent().clientX; }; JSEvent.prototype.getMouseY =function() { if(this.isN4()) return this.getEvent().pageY; else if(this.isIE()) return this.getEvent().clientY; }; JSEvent.prototype.cancelBubble =function(bCancel) { if(this.isN4()) return this.getEvent().cancelBubble =bCancel; else if(this.isIE()) return this.getEvent().cancelBubble =bCancel; }; JSEvent.prototype.toString =function() { var             str ="JSEvent: "; if(this.isN4()) str +="N4"; else if(this.isIE()) str +="IE"; else str +="Unknown"; str +=" mouse@(" +this.getMouseX() +", " +this.getMouseY() +")"; return str; }; function Events() { Events.init(); }; Events.init =function() { Events.mapMouseMoveHandler =new Map(); Events.mapMouseDownHandler =new Map(); Events.mapMouseUpHandler =new Map(); document.onmousemove =Events.handleMouseMove; document.onmousedown =Events.handleMouseDown; document.onmouseup =Events.handleMouseUp; }; Events.handleMouseMove =function(evt) { var             afunc =Events.mapMouseMoveHandler.getValues(); for(var i =0;i <afunc.length;i++) { var         func =afunc[i]; if(func != null) func(evt); } }; Events.handleMouseDown =function(evt) { var             afunc =Events.mapMouseDownHandler.getValues(); for(var i =0;i <afunc.length;i++) { var         func =afunc[i]; if(func != null) func(evt); } }; Events.handleMouseUp =function(evt) { var             afunc =Events.mapMouseUpHandler.getValues(); for(var i =0;i <afunc.length;i++) { var         func =afunc[i]; if(func != null) func(evt); } }; Events.addMouseMoveHandler =function(strKey, funcAdd) { if(funcAdd == null) return; Events.mapMouseMoveHandler.put(strKey, funcAdd); }; Events.addMouseDownHandler =function(strKey, funcAdd) { if(funcAdd == null) return; Events.mapMouseDownHandler.put(strKey, funcAdd); }; Events.addMouseUpHandler =function(strKey, funcAdd) { if(funcAdd == null) return; Events.mapMouseUpHandler.put(strKey, funcAdd); }; Events.removeMouseMoveHandler =function(strKey) { Events.mapMouseMoveHandler.remove(strKey); }; Events.removeMouseDownHandler =function(strKey) { Events.mapMouseDownHandler.remove(strKey); }; Events.removeMouseUpHandler =function(strKey) { Events.mapMouseUpHandler.remove(strKey); }; Events.getMouseMoveHandler =function(strKey) { return Events.mapMouseMoveHandler.get(strKey); }; Events.getMouseDownHandler =function(strKey) { return Events.mapMouseDownHandler.get(strKey); }; Events.getMouseUpHandler =function(strKey) { return Events.mapMouseUpHandler.get(strKey); }; Events.getMouseMoveSize =function() { return Events.mapMouseMoveHandler.getSize(); }; Events.getMouseDownSize =function() { return Events.mapMouseDownHandler.getSize(); }; Events.getMouseUpSize =function() { return Events.mapMouseUpHandler.getSize(); }; Events.toString =function() { var     str =""; str +="mousemove: " +Events.mapMouseMoveHandler; str +=" mousedown: " +Events.mapMouseDownHandler; str +=" mouseup: " +Events.mapMouseUpHandler; return str; }; function Fader(elem, colorBegin, colorEnd, nMilliDuration, nMilliUpdate) { this.setElement(elem); this.setColorBegin(colorBegin); this.setColorEnd(colorEnd); this.setDuration(nMilliDuration); this.setUpdateInterval(nMilliUpdate); }; Fader.prototype.setElement =function(elem) { this.elem =elem; }; Fader.prototype.getElement =function() { return this.elem; }; Fader.prototype.setColorBegin =function(colorBegin) { this.colorBegin =colorBegin; }; Fader.prototype.getColorBegin =function() { return this.colorBegin; }; Fader.prototype.setColorEnd =function(colorEnd) { this.colorEnd =colorEnd; }; Fader.prototype.getColorEnd =function() { return this.colorEnd; }; Fader.prototype.setDuration =function(nMilliDuration) { this.nMilliDuration =nMilliDuration; }; Fader.prototype.getDuration =function() { return this.nMilliDuration; }; Fader.prototype.setUpdateInterval =function(nMilliUpdate) { this.nMilliUpdate =nMilliUpdate; }; Fader.prototype.getUpdateInterval =function() { return this.nMilliUpdate; }; Fader.prototype.begin =function() { var         dateNow =new Date(); this.setBeginTime(dateNow); this.getElement().style.backgroundColor =this.getColorAt(dateNow); var         nIntervalID =window.setInterval(this.createUpdateFunction(this), this.getUpdateInterval()); this.setIntervalID(nIntervalID); }; Fader.prototype.createUpdateFunction =function(fader) { return (function() { var         dateNow =new Date(); var         strColor =fader.getColorAt(dateNow); fader.getElement().style.backgroundColor =strColor; var         nMilliElapsed =dateNow.getTime() -fader.getBeginTime().getTime(); if(nMilliElapsed >=fader.getDuration()) window.clearInterval(fader.getIntervalID()); }); }; Fader.prototype.setIntervalID =function(nIntervalID) { this.nIntervalID =nIntervalID; }; Fader.prototype.getIntervalID =function() { return this.nIntervalID; }; Fader.prototype.setBeginTime =function(date) { this.dateBegin =date; }; Fader.prototype.getBeginTime =function() { return this.dateBegin; }; Fader.prototype.getColorAt =function(date) { var     nFactor =this.getFactorAt(date); var     strColor ="rgb("; strColor +=this.interpolateColorComponent("red", nFactor) +"%, "; strColor +=this.interpolateColorComponent("green", nFactor) +"%, "; strColor +=this.interpolateColorComponent("blue", nFactor) +"%"; strColor +=")"; return strColor; }; Fader.prototype.getFactorAt =function(dateNow) { var     nMilliElapsed =dateNow.getTime() -this.getBeginTime().getTime(); var     nPercentage =nMilliElapsed /this.getDuration(); nPercentage =Math.max(nPercentage, 0); nPercentage =Math.min(nPercentage, 1); return nPercentage; }; Fader.prototype.interpolateColorComponent =function(strComponent, nFactor) { var     nCCBegin =this.getColorBegin()[strComponent]; var     nCCEnd =this.getColorEnd()[strComponent]; return this.interpolate(nCCBegin, nCCEnd, nFactor); }; Fader.prototype.interpolate =function(nBegin, nEnd, nFactor) { var     nDelta =nEnd -nBegin; var     nAdd =nDelta *nFactor; return nBegin +nAdd; }; Fader.prototype.toString =function() { var         str ="Fader: "; str +=getBeginColor(); str +="-->"; str +=getEndColor(); str +=" "; str +=getUpdateMillis(); str +=" / "; str +=getDurationMillis(); return str; }; function FocusManager() { }; FocusManager.elemFocus =null; FocusManager.objCallbackFocus =null; FocusManager.giveFocus =function(elem, objCallback) { if((FocusManager.elemFocus) && (elem != FocusManager.elemFocus)) FocusManager.unfocus(FocusManager.elemFocus, FocusManager.objCallbackFocus); elem.style.zIndex ="100"; if(objCallback.setFocus) objCallback.setFocus(true); FocusManager.elemFocus =elem; FocusManager.objCallbackFocus =objCallback; }; FocusManager.unfocus =function(elem, objCallback) { elem.style.zIndex ="99"; if(objCallback.setFocus) objCallback.setFocus(false); }; function Map() { this.map =new Array(); }; Map.prototype.put =function(strKey, objValue) { if(strKey == null) return; if(strKey == undefined) return; this.map[strKey] =objValue; }; Map.prototype.remove =function(strKey) { delete this.map[strKey]; }; Map.prototype.get =function(strKey) { return this.map[strKey]; }; Map.prototype.getSize =function() { var         cPair =0; for(var strKey in this.map) { cPair++; } return cPair; }; Map.prototype.getValues =function() { var         aValRet =new Array(); var         iPair =0; for(var strKey in this.map) { aValRet[iPair++] =this.get(strKey); } return aValRet; }; Map.prototype.toString =function() { var     str =""; for(var i in this.map) { str +=i +"->" +this.get(i) +"\n"; } return str; }; var             ajaxreqPopup; var             timeoutID; var             elementOffset; var             divPopup; var             strDivPopup ="popup"; var             strDivOverlay ="overlay"; function literalOverlay(elemBase, strText, strHAlign) { divPopup =document.getElementById(strDivOverlay); abortAnyOutstanding(); clearPopups(); elementOffset =elemBase; if((strText != null) && (strText != "")) { divPopup.innerHTML =strText; divPopup.style.width ="auto"; if(strHAlign == "right") divPopup.style.right =getWindowInnerWidth() -calculateOffsetRight(elementOffset) -20 +"px"; else divPopup.style.left =calculateOffsetLeft(elementOffset) +"px"; divPopup.style.top =calculateOffsetTop(elementOffset) +"px"; divPopup.style.height =elementOffset.offsetHeight +"px"; divPopup.style.background =getBackgroundColor(elementOffset); divPopup.style.fontFamily =getElementStyle(elementOffset, "fontFamily", "font-family"); divPopup.style.fontSize =getElementStyle(elementOffset, "fontSize", "font-size"); divPopup.style.color =getElementStyle(elementOffset, "color", "color"); divPopup.style.textAlign ="right"; divPopup.style.marginRight ="0"; divPopup.style.paddingRight ="0"; divPopup.onmouseout=createClearPopups(); divPopup.style.visibility = "visible"; } } function literalPopup(elementTrigger, strText, relPosition) { divPopup =document.getElementById(strDivPopup); abortAnyOutstanding(); clearPopups(); elementOffset =elementTrigger; if((strText != null) && (strText != "")) showPopup(strText, relPosition); } function imagePopup(elementTrigger, strURL, relPosition, nHeightBegin, nHeightEnd, cMilliDelay) { divPopup =document.getElementById(strDivPopup); abortAnyOutstanding(); clearPopups(); elementOffset =elementTrigger; timeoutID =window.setTimeout(createAppearAndGrow(strURL, relPosition, nHeightBegin, nHeightEnd), cMilliDelay); } function triggerPopup(elementTrigger, strURL, cMilliDelay) { divPopup =document.getElementById(strDivPopup); abortAnyOutstanding(); clearPopups(); elementOffset =elementTrigger; ajaxreqPopup =Ajax.createRequest(strURL, "GET"); ajaxreqPopup.setCallback(popupCallback); if(cMilliDelay) timeoutID =window.setTimeout(createSendLater(ajaxreqPopup), cMilliDelay); else ajaxreqPopup.send(); } function createSendLater(ajaxreq) { return (function() { ajaxreq.send(); }); } function createAppearAndGrow(strURL, relPosition, nHeightBegin, nHeightEnd) { return (function() { var             elemImg =document.createElement("img"); elemImg.src =strURL; elemImg.height =nHeightBegin; divPopup.appendChild(elemImg); setOffsets(divPopup.offsetWidth, divPopup.offsetHeight, relPosition); divPopup.style.visibility = "visible"; timeoutID =window.setTimeout(createGrow(elemImg, 2, nHeightEnd), 2); }); } function createGrow(elemImg, nDelta, nMax) { return (function() { elemImg.height =Math.min(elemImg.height +nDelta, nMax); if(elemImg.height <nMax) timeoutID =window.setTimeout(createGrow(elemImg, nDelta, nMax), 2); }); } function abortAnyOutstanding() { if(ajaxreqPopup != null) { ajaxreqPopup.abort(); ajaxreqPopup =null; } if(timeoutID != null) { window.clearTimeout(timeoutID); timeoutID =null; } } function popupCallback(ajaxreqPopup) { if((ajaxreqPopup.getRequest().responseText == null) || (ajaxreqPopup.getRequest().responseText == "")) return; showPopup(ajaxreqPopup.getRequest().responseText); } function showPopup(strResponseText, relPosition) { divPopup.innerHTML =strResponseText; setOffsets(divPopup.offsetWidth, divPopup.offsetHeight, relPosition); divPopup.style.visibility = "visible"; } function clearPopups() { abortAnyOutstanding(); if(divPopup != null) { var         cChildren =divPopup.childNodes.length; for(var i =cChildren -1; i >=0; i--) { divPopup.removeChild(divPopup.childNodes[i]); } divPopup.style.visibility = "hidden"; } } function setOffsets(width, height, relPosition) { var         left =-1; var         right =-1; var         top =0; if(relPosition == null) { left =calculateOffsetLeft(elementOffset) -width; if(left <0) left =calculateOffsetRight(elementOffset); top =getYFullyAboveBottom(calculateOffsetTop(elementOffset), height); } else if(relPosition == "right") { left =calculateOffsetRight(elementOffset); top =getYFullyAboveBottom(calculateOffsetTop(elementOffset), height); } else if(relPosition == "leftAligned") { left =calculateOffsetLeft(elementOffset); top =calculateOffsetTop(elementOffset); } else if(relPosition == "rightAligned") { right =getWindowInnerWidth() -calculateOffsetRight(elementOffset); top =calculateOffsetTop(elementOffset); } if(left >= 0) divPopup.style.left =left +"px"; else if(right >= 0) divPopup.style.right =right +"px"; divPopup.style.top =top +"px"; } function calculateOffsetTop(field) { return calculateOffset(field, "offsetTop"); } function calculateOffsetLeft(field) { return calculateOffset(field, "offsetLeft"); } function calculateOffsetRight(field) { return calculateOffsetLeft(field) +field.offsetWidth; } function calculateOffset(field, attr) { var         offset =0; while(field) { offset +=field[attr]; field =field.offsetParent; } return offset; } function getYFullyAboveBottom(yPrefer, nImgHeight) { return Math.min(getWindowInnerHeight() +getScrollY() -nImgHeight, yPrefer); } function getWindowInnerWidth() { if(document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth; else if(document.body && document.body.clientWidth) return document.body.clientWidth; else return 0; } function getWindowInnerHeight() { if(typeof(window.innerHeight) == 'number') return window.innerHeight; else if(document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight; else if(document.body && document.body.clientHeight) return document.body.clientHeight; return 0; } function getScrollX() { if(typeof(window.pageXOffset) == 'number') return window.pageXOffset; else if(document.body && document.body.scrollLeft) return document.body.scrollLeft; else if(document.documentElement && document.documentElement.scrollLeft) return document.documentElement.scrollLeft; else return 0; } function getScrollY() { if(typeof(window.pageYOffset) == 'number') return window.pageYOffset; else if(document.body && document.body.scrollTop) return document.body.scrollTop; else if(document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop; else return 0; } function getBackgroundColor(elem) { var         bgcolor =getElementStyle(elem, "backgroundColor", "background-color"); if(bgcolor != 'transparent') return bgcolor; if(elem.parentNode != null) return getBackgroundColor(elem.parentNode); return 'transparent'; }; function createClearPopups() { return (function(evt) { clearPopups(); }); } function ScrollBar(strElemRoot, scrollpane) { this.nUnique =(++ScrollBar.cCounter); this.setRootElement(document.getElementById(strElemRoot)); this.setScrollPane(scrollpane); this.setUnitIncrement(15); this.urlImgArrowDown ="/art/arrow_down_blue_16x16.png"; this.urlImgArrowUp ="/art/arrow_up_blue_16x16.png"; this.urlImgThumb ="/art/media_stop_16x16.png"; this.nHeightThumb =27; this.nHeightBtn =16; this.nWidthBtn =16; this.nPanelBorderExtra =4; this.createView(); }; ScrollBar.cCounter =0; ScrollBar.prototype.setRootElement =function(elemRoot) { this.elemRoot =elemRoot; }; ScrollBar.prototype.getRootElement =function() { return this.elemRoot; }; ScrollBar.prototype.setScrollPane =function(scrollpane) { this.scrollpane =scrollpane; }; ScrollBar.prototype.getScrollPane =function() { return this.scrollpane; }; ScrollBar.prototype.setViewElement =function(elemScrollbar) { this.elemScrollbar =elemScrollbar; }; ScrollBar.prototype.getViewElement =function() { return this.elemScrollbar; }; ScrollBar.prototype.setThumb =function(elemThumb) { this.elemThumb =elemThumb; }; ScrollBar.prototype.getThumb =function() { return this.elemThumb; }; ScrollBar.prototype.setUnitIncrement =function(nUnitIncrement) { this.nUnitIncrement =nUnitIncrement; }; ScrollBar.prototype.getUnitIncrement =function() { return this.nUnitIncrement; }; ScrollBar.prototype.getBlockIncrement =function() { return this.getScrollPane().getViewHeight(); }; ScrollBar.prototype.createClickHandler =function(scrollbar) { return (function(evt) { scrollbar.handleClick(evt); }); }; ScrollBar.prototype.handleClick =function(evt) { this.endScrolling(); evt =(evt) ? evt : event; var         target =(evt.target) ? evt.target :evt.srcElement; target =(target.nodeType == 3) ? target.parentNode: target; switch(target.className) { case "scrollUp": this.adjustValue(0 -this.getUnitIncrement()); this.beginScrolling(this.createContinuousScroll(this, 0 -this.getUnitIncrement())); evt.cancelBubble =true; break; case "scrollDown": this.adjustValue(this.getUnitIncrement()); this.beginScrolling(this.createContinuousScroll(this, this.getUnitIncrement())); evt.cancelBubble =true; break; case "scrollbar": var         yEvt =(evt.offsetY) ? evt.offsetY : ((evt.layerY) ?evt.layerY : -1); if(yEvt >= 0) { var             yDelta =0; if(this.isInTopWell(yEvt)) yDelta =0 -this.getBlockIncrement(); if(this.isInBottomWell(yEvt)) yDelta =this.getBlockIncrement(); if(yDelta != 0) { this.adjustValue(yDelta); this.beginScrolling(this.createContinuousScroll(this, yDelta)); } evt.cancelBubble =true; } break; case "scrollThumb": this.engageThumb(evt); evt.cancelBubble =true; break; } return false; }; ScrollBar.prototype.createDragHandler =function(scrollbar) { return (function(evt) { return scrollbar.handleDrag(evt); }); }; ScrollBar.prototype.handleDrag =function(evt) { if(!this.getThumbDrag()) return true; var         jsevt =new JSEvent((evt) ? evt : event); var         yThumbNew =this.getThumbDrag().getNewElementY(jsevt.getMouseY()); yThumbNew =Math.max(yThumbNew, this.nHeightBtn); var         yWellMax =parseInt(getElementStyle(this.getViewElement(), "height", "height")); yWellMax -=this.nHeightBtn; yWellMax -=this.nHeightThumb; yThumbNew =Math.min(yThumbNew, yWellMax); this.getThumb().style.top =yThumbNew +"px"; this.setValue(this.calculateValueFromThumbPosition()); jsevt.cancelBubble(true); return false; }; ScrollBar.prototype.isInTopWell =function(y) { var         yThumbTop =parseInt(this.getThumb().style.top); return y <yThumbTop; }; ScrollBar.prototype.isInBottomWell =function(y) { var         yThumbTop =parseInt(this.getThumb().style.top); var         yThumbHeight =this.nHeightThumb; return y >yThumbTop +yThumbHeight; }; ScrollBar.prototype.createMouseUpHandler =function(scrollbar) { return (function(evt) { return scrollbar.handleMouseUp(evt); }); }; ScrollBar.prototype.handleMouseUp =function(evt) { this.endScrolling(); this.setThumbDrag(null); return false; }; ScrollBar.prototype.createContinuousScroll =function(scrollbar, nDelta) { return (function(evt) { scrollbar.adjustValue(nDelta); if(scrollbar.getValue() <= scrollbar.getMin()) scrollbar.endScrolling(); if(scrollbar.getValue() >= scrollbar.getMax()) scrollbar.endScrolling(); }); }; ScrollBar.prototype.beginScrolling =function(func) { this.idScrolling =setInterval(func, 100); }; ScrollBar.prototype.endScrolling =function() { clearInterval(this.idScrolling); }; ScrollBar.prototype.updateThumb =function() { this.getThumb().style.top =this.calculateThumbPosition() +"px"; }; ScrollBar.prototype.calculateThumbPosition =function() { var         nHeightAvail =parseInt(getElementStyle(this.getViewElement(), "height", "height")); nHeightAvail -=this.nHeightBtn; nHeightAvail -=this.nHeightBtn; nHeightAvail -=this.nHeightThumb; var         yThumb =(this.getValue() /this.getMax()) *nHeightAvail; yThumb +=this.nHeightBtn; yThumb =Math.round(yThumb); return yThumb; }; ScrollBar.prototype.calculateValueFromThumbPosition =function() { var         nHeightAvail =parseInt(getElementStyle(this.getViewElement(), "height", "height")); nHeightAvail -=this.nHeightBtn; nHeightAvail -=this.nHeightBtn; nHeightAvail -=this.nHeightThumb; var         yThumb =parseInt(getElementStyle(this.getThumb(), "top", "top")); yThumb -=this.nHeightBtn; var         nVal =(yThumb /nHeightAvail) *this.getMax(); return nVal; }; ScrollBar.prototype.engageThumb =function(evt) { var         jsevt =new JSEvent(evt); this.setThumbDrag(new Drag(jsevt.getMouseX(), jsevt.getMouseY(), parseInt(getElementStyle(this.getThumb(), "left", "left")), parseInt(getElementStyle(this.getThumb(), "top", "top"))) ); jsevt.cancelBubble(true); }; ScrollBar.prototype.setThumbDrag =function(dragThumb) { this.dragThumb =dragThumb; }; ScrollBar.prototype.getThumbDrag =function() { return this.dragThumb; }; ScrollBar.prototype.getMin =function() { return this.getScrollPane().getVerticalMin(); }; ScrollBar.prototype.getMax =function() { return this.getScrollPane().getVerticalMax(); }; ScrollBar.prototype.getValue =function() { return this.getScrollPane().getViewY(); }; ScrollBar.prototype.setValue =function(nVal) { var         bRet =this.getScrollPane().setViewY(nVal); this.updateThumb(); return bRet; }; ScrollBar.prototype.adjustValue =function(nDelta) { return this.setValue(this.getValue() +nDelta); }; ScrollBar.prototype.getVisible =function() { return this.getViewElement().style.visibility == "hidden"; }; ScrollBar.prototype.setVisible =function(bVisible) { if(bVisible) { this.getViewElement().style.visibility ="visible"; this.setHandlers(); } else { this.getViewElement().style.visibility ="hidden"; this.clearHandlers(); } }; ScrollBar.prototype.setHandlers =function() { this.getViewElement().onmousedown =this.createClickHandler(this); this.getViewElement().onmouseup =this.createMouseUpHandler(this); if(document.layers) { } else if(document.body & document.body.addEventListener) { this.getThumb().addEventListener("mousemove", this.createDragHandler(this), true); this.getThumb().addEventListener("mouseup", this.createMouseUpHandler(this), true); } else { Events.addMouseMoveHandler(this.getUniqueID(), this.createDragHandler(this)); Events.addMouseUpHandler(this.getUniqueID(), this.createMouseUpHandler(this)); } }; ScrollBar.prototype.clearHandlers =function() { this.getViewElement().onmousedown =null; this.getViewElement().onmouseup =null; if(document.layers) { } else if(document.body & document.body.addEventListener) { this.getThumb().addEventListener("mousemove", this.createDragHandler(this), true); this.getThumb().addEventListener("mouseup", this.createMouseUpHandler(this), true); } else { Events.removeMouseMoveHandler(this.getUniqueID()); Events.removeMouseUpHandler(this.getUniqueID()); } }; ScrollBar.prototype.createView =function() { var     btnUp =this.createUpButton(); var     divWrap =document.createElement("div"); divWrap.className ="scrollbar"; divWrap.style.position ="absolute"; divWrap.style.visibility ="hidden"; while(parseInt(getElementStyle(this.getScrollPane().getElement(), "width", "width")) == 0) {    } divWrap.style.top =getElementStyle(this.getScrollPane().getElement(), "top", "top"); divWrap.style.left=parseInt(getElementStyle(this.getScrollPane().getElement(), "width", "width")) +this.nPanelBorderExtra +"px"; divWrap.style.width =this.nWidthBtn +"px"; divWrap.style.height =getElementStyle(this.getScrollPane().getElement(), "height", "height"); divWrap.appendChild(btnUp); divWrap.appendChild(this.createDownButton()); this.setThumb(divWrap.appendChild(this.createThumb())); this.setViewElement(this.elemRoot.appendChild(divWrap)); this.setVisible(true); }; ScrollBar.prototype.createUpButton =function() { var             btnUp =document.createElement("img"); btnUp.className ="scrollUp"; btnUp.src =this.urlImgArrowUp; btnUp.height =this.nHeightBtn; btnUp.width =this.nWidthBtn; btnUp.alt ="Scroll Up"; btnUp.style.position ="absolute"; btnUp.style.top ="0px"; btnUp.style.left ="0px"; return btnUp; }; ScrollBar.prototype.createDownButton =function() { var             btnDown =document.createElement("img"); btnDown.className ="scrollDown"; btnDown.src =this.urlImgArrowDown; btnDown.height =this.nHeightBtn; btnDown.width =this.nWidthBtn; btnDown.alt ="Scroll Down"; btnDown.style.position ="absolute"; btnDown.style.bottom ="0px"; btnDown.style.left ="0px"; return btnDown; }; ScrollBar.prototype.createThumb =function() { var             btnThumb =document.createElement("img"); btnThumb.className ="scrollThumb"; btnThumb.src =this.urlImgThumb; btnThumb.height =this.nHeightThumb; btnThumb.width =this.nWidthBtn -1; btnThumb.alt ="Scroll Thumb"; btnThumb.style.position ="absolute"; btnThumb.style.bottom ="0px"; btnThumb.style.left ="1px"; btnThumb.style.top =this.nWidthBtn +"px"; return btnThumb; }; ScrollBar.prototype.getUniqueID =function() { return "ScrollBar" +this.nUnique; }; function getElementStyle(elem, strAttrIE, strAttrCSS) { if(elem.currentStyle) return elem.currentStyle[strAttrIE]; else if(window.getComputedStyle) { var     styleComp =window.getComputedStyle(elem, ""); return styleComp.getPropertyValue(strAttrCSS); } return ""; }; function getElementStyleByID(strElemID, strAttrIE, strAttrCSS) { var         elem =document.getElementById(strElemID); if(elem.runtimeStyle) return elem.runtimeStyle[strAttrIE]; else if(elem.currentStyle) return elem.currentStyle[strAttrIE]; else if(window.getComputedStyle) { var     styleComp =window.getComputedStyle(elem, ""); return styleComp.getPropertyValue(strAttrCSS); } return ""; }; function Drag(xMouse, yMouse, xElem, yElem) { this.setMouseX(xMouse); this.setMouseY(yMouse); this.setElementX(xElem); this.setElementY(yElem); }; Drag.prototype.setMouseX =function(xMouse) { this.xMouse =xMouse; }; Drag.prototype.getMouseX =function() { return this.xMouse; }; Drag.prototype.setMouseY =function(yMouse) { this.yMouse =yMouse; }; Drag.prototype.getMouseY =function() { return this.yMouse; }; Drag.prototype.setElementX =function(xElement) { this.xElement =xElement; }; Drag.prototype.getElementX =function() { return this.xElement; }; Drag.prototype.setElementY =function(yElement) { this.yElement =yElement; }; Drag.prototype.getElementY =function() { return this.yElement; }; Drag.prototype.getNewElementX =function(xMouseNew) { var         xMouseDelta =xMouseNew -this.getMouseX(); return this.getElementX() +xMouseDelta; }; Drag.prototype.getNewElementY =function(yMouseNew) { var         yMouseDelta =yMouseNew -this.getMouseY(); return this.getElementY() +yMouseDelta; }; Drag.prototype.toString =function() { return "Element: (" +this.getElementX() +", " +this.getElementY() +") Mouse: (" +this.getMouseX() +", " +this.getMouseY() +")"; }; function ScrollPane(strElemRootID, strElemPaneID, strElemContentID) { this.setElement(document.getElementById(strElemPaneID)); this.setContentElement(document.getElementById(strElemContentID)); this.setScrollBar(new ScrollBar(strElemRootID, this)); this.setTrackTail(true); }; ScrollPane.prototype.getVisible =function() { return this.getViewElement().style.visibility == "hidden"; }; ScrollPane.prototype.setVisible =function(bVisible) { if(bVisible) { this.getElement().style.visibility ="visible"; } else { this.getElement().style.visibility ="hidden"; } if(this.getScrollBar()) this.getScrollBar().setVisible(bVisible); }; ScrollPane.prototype.setElement =function(elemPane) { this.elemPane =elemPane; }; ScrollPane.prototype.getElement =function() { return this.elemPane; }; ScrollPane.prototype.setContentElement =function(elemContent) { elemContent.style.height ="auto"; this.elemContent =elemContent; }; ScrollPane.prototype.getContentElement =function() { return this.elemContent; }; ScrollPane.prototype.setScrollBar =function(scrollbar) { this.scrollbar =scrollbar; }; ScrollPane.prototype.getScrollBar =function() { return this.scrollbar; }; ScrollPane.prototype.getViewY =function() { return 0 -parseInt(this.getContentElement().style.top); }; ScrollPane.prototype.setViewY =function(y) { y =Math.max(this.getVerticalMin(), y); y =Math.min(this.getVerticalMax(), y); this.getContentElement().style.top =0 -y +"px"; }; ScrollPane.prototype.getVerticalMin =function() { return 0; }; ScrollPane.prototype.getVerticalMax =function() { var             nHeight =parseInt(getElementStyle(this.getContentElement(), "height", "height")); if(isNaN(nHeight)) { if(this.getContentElement().clientHeight) nHeight =this.getContentElement().clientHeight; } return nHeight -this.getViewHeight() +5; }; ScrollPane.prototype.getViewHeight =function() { var             nHeight =parseInt(getElementStyle(this.getElement(), "height", "height")); return nHeight; }; ScrollPane.prototype.appendContent =function(strAppend) { this.getContentElement().innerHTML +=strAppend; if(this.isTrackTail()) this.scrollToTail(); else this.getScrollBar().updateThumb(); }; ScrollPane.prototype.isEmpty =function() { return this.getContentElement().innerHTML == ""; }; ScrollPane.prototype.scrollToTail =function() { this.getScrollBar().setValue(this.getVerticalMax()); }; ScrollPane.prototype.setTrackTail =function(bTrackTail) { this.bTrackTail =bTrackTail; if(this.bTrackTail) this.scrollToTail(); }; ScrollPane.prototype.isTrackTail =function() { return this.bTrackTail; }; function Sound() { }; Sound.ELEMENT_ID        ="XsoundClipX"; Sound.play =function(strClipURL) { var         elem =Sound.getSoundElement(); var         strHTML ="<embed src='" +strClipURL +"' hidden=true autostart=true loop=false width='0' height='0'>"; elem.innerHTML =strHTML; }; Sound.getSoundElement =function() { var         elem =document.getElementById(Sound.ELEMENT_ID); if(elem == null) { elem =document.createElement("div"); elem.id =Sound.ELEMENT_ID; elem.style.position ="absolute"; document.body.appendChild(elem); elem =document.body.appendChild(elem); } return elem; };