
/* Ajax.js */
function Loading() { if (self.rootGuid) SetCookieValue("CountsGuid", rootGuid); var el = document.getElementById('TopBarLoading'); if (el) el.style.display=""; } function DoneLoading() { var el = document.getElementById('TopBarLoading'); if (el) el.style.display="none"; if (self.AlertsPopupOnLoad && self.AlertsPopupOnLoad == true) { self.AlertsPopupOnLoad = false; setTimeout(function() { self.DoAlertsPopup(); }, 500); } } function CheckHash() { var hash = window.location.hash.substr(1); if (lastHash && hash != lastHash) { lastHash = hash; NavigateToHash(); } } var sectionToPageHash = new Array(); function UpdateCurrentPage(page) { if (self.currentSection) sectionToPageHash[currentSection] = page; currentPage = page; UpdateHash(); } var lastHash; function UpdateHash() { if (self.currentPage != null && self.currentSection != null && lastHash != "page=" + currentPage + "|section=" + currentSection) { lastHash = "page=" + currentPage + "|section=" + currentSection; window.location.hash = lastHash; } } function NavigateToHash() { if (window.location.hash != null && window.location.hash.length > 1) { var parts = window.location.hash.substr(1).split('|'); for(var pi = 0; pi < parts.length; pi++) { if (parts[pi].substr(0,4) == "page" && currentPage!=parts[pi].substr(5)) UpdateFrame(parts[pi].substr(5)); if (parts[pi].substr(0,7) == "section" && currentSection!=parts[pi].substr(8)) UpdateSection(parts[pi].substr(8)); } } } function ChangeFoldersIfNeccesary(oldFolder, newPage) { var page = self.currentPage.toLowerCase(); if (page.indexOf('frmmessages.aspx') < 0) return; if (page.indexOf('mapped=true') > 0) return; if (page.indexOf('folder=' + oldFolder.toLowerCase()) < 0) return; UpdateFrame(newPage); } function ChangeFeedsIfNeccesary(oldFolder, newPage) { var page = self.currentPage.toLowerCase(); if (page.indexOf('frmrss.aspx') < 0) return; if (page.indexOf('id=' + oldFolder.toLowerCase()) < 0) return; UpdateFrame(newPage); } function ChangeToReport(newPage) { UpdateFrame(newPage); } function ChangeFromCustomReport(newPage, rptID) { if (rptID != "") ChangeToReport(newPage); else UpdateFrame(newPage); } function InitAjaxHandlers(callback) { var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(RequestStarted); prm.add_endRequest(RequestEnded); } function AddAjaxEndRequestHandler(callback) { var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(callback); } function RequestStarted(sender, args) { if (parent.Loading) parent.Loading(); } function RequestEnded(sender, args) { if (args.get_error() != undefined) { args.set_errorHandled(true); } if (parent.DoneLoading) parent.DoneLoading(); } function ScrollUpScrollable() { var scrollable = document.getElementById('Scrollable'); scrollable.scrollTop = 0; } function UpdateFrame(page) { Loading(); var SMIFrame = GetSMPane().GetExtContentContainerElement(); if (SMIFrame.contentWindow == null) SMIFrame.src = page; else SMIFrame.contentWindow.location.href = page; } function HelpPageID(page) { HelpID = page; } 
/* Calendar.js */

/* Compose.js */
function CheckOpening(combobox) { var str = combobox.GetText(); if (str.length == 0 || (str.length > 0 && str[str.length-1] == ';')) return false; return true; } function CheckRequesting(combobox) { var str = combobox.GetText(); if (str.length == 0 || (str.length > 0 && str[str.length-1] == ';')) { SetVis(combobox.DropDownID,"hidden"); shown=""; combobox.HideDropDown(); return false; } } function CheckClosing(combobox) { SetVis(combobox.DropDownID,"hidden"); shown=""; } function CheckRequested(combobox) { if (combobox.Items.length == 0) { shown=""; SetVis(combobox.DropDownID,"hidden"); combobox.HideDropDown(); } else { if (shown!=combobox.DropDownID) combobox.ShowDropDown(); shown=combobox.DropDownID; SetVis(combobox.DropDownID,"visible"); } } function SetVis(cbox, style) { if (style=="hidden") { document.getElementById(cbox).style.display = "none"; document.getElementById(cbox+"Placeholder").style.display="none"; } else { document.getElementById(cbox).style.display = ""; document.getElementById(cbox+"Placeholder").style.display=""; } document.getElementById(cbox).style.visibility = style; document.getElementById(cbox+"Placeholder").style.visibility = style; } function SelectEnd(textbox) { textbox.focus(); var len = textbox.value.length; if (textbox.createTextRange) { var oRange = textbox.createTextRange(); oRange.moveStart("character", len); oRange.moveEnd("character", len); oRange.select(); } else if (textbox.setSelectionRange) textbox.setSelectionRange(len, len); } function KeyPressed(comboBox, eventArgs, x) { if (eventArgs.keyCode == 9) { var el = document.getElementById(comboBox.DropDownID).style.display; if (el != "none" && comboBox.DropDownVisible && comboBox.Items.length > 0) { var found = false; for (var i = 0;i < comboBox.Items.length; i++) if (comboBox.Items[i].Highlighted) { found = true; comboBox.Items[i].Select(); } if (found==false) comboBox.Items[0].Select(); comboBox.HideDropDown(); eventArgs.cancelBubble=true; setTimeout(function(){SelectEnd(comboBox.InputDomElement);},1); return false; } } } function ClickOverride() { return false; } function InitComposeResize() { self[multiPage].SelectPageByIndex(2); var labelColumn = document.getElementById('LabelColumn'); var textColumn = document.getElementById('TextColumn'); var ComboImage = document.getElementById(txtToClientID + '_Image'); var table = document.getElementById('ComposeTable'); comboSize = ComboImage.offsetWidth; textColumnWidth = textColumn.offsetWidth; labelColumnWidth = labelColumn.offsetWidth; ResizeComposePage(); document.AdditionalResizeEvent = ResizeComposePage; } function ResizeComposePage() { if (document.ResizeEvent) document.ResizeEvent(); var documentObj = GetDocumentObj(); var w = documentObj.clientWidth; var txtSubject = document.getElementById(txtSubjectClientID); var txtToInput = document.getElementById(txtToClientID + '_Input'); var txtCCInput = document.getElementById(txtCCClientID + '_Input'); var txtBCCInput = document.getElementById(txtBCCClientID + '_Input'); var scrollable = document.getElementById('Scrollable'); var textWidth = w - labelColumnWidth - 9; var halfWidth = Math.round(w/2) - labelColumnWidth; var otherHalfWidth = textWidth - halfWidth - labelColumnWidth; txtSubject.style.width = (textWidth + txtSubjectBoxModelWidth) + "px"; txtToInput.style.width = (textWidth + txtSubjectBoxModelWidth - comboSize) + "px"; txtCCInput.style.width = (halfWidth + txtSubjectBoxModelWidth - comboSize) + "px"; txtBCCInput.style.width = (otherHalfWidth + txtSubjectBoxModelWidth - comboSize) + "px"; var table = document.getElementById('ComposeTable'); editorSize = scrollable.clientHeight - table.offsetHeight; if (self.GetRadEditor) { var editor = GetRadEditor(RadTextClientID); if (editor) editor.SetSize("100%", editorSize); } else { var ptb = document.getElementById(PlainTextBox1ClientID); ptb.style.width = (w - 16 + ptbBoxWidth) + 'px'; ptb.style.height = (editorSize + ptbBoxHeight - 12) + 'px'; } if (evalBoxModel) { evalBoxModel = false; txtSubjectBoxModelWidth = textWidth - txtSubject.offsetWidth; txtSubjectBoxModelHeight = 22 - txtSubject.offsetHeight; if (!self.GetRadEditor) { var ptb = document.getElementById(PlainTextBox1ClientID); ptbBoxWidth = (w - 16) - ptb.offsetWidth; ptbBoxHeight = (editorSize - 12) - ptb.offsetHeight; } ResizeComposePage(); } } function AttachComboboxes() { if (self[txtToClientID] == null) return; self[txtToClientID].SelectText = ClickOverride; self[txtCCClientID].SelectText = ClickOverride; self[txtBCCClientID].SelectText = ClickOverride; if (self[RadTextClientID]) self[RadTextClientID].AttachEventHandler("onmousedown", ComboBlur); } function ComboBlur() { self[txtToClientID].HideDropDown(); self[txtCCClientID].HideDropDown(); self[txtBCCClientID].HideDropDown(); } function FixRadEditorCompose() { if (self.GetRadEditor) { var editor = GetRadEditor(RadTextClientID); RadEditor.prototype.HookedResize = editor.SetSize; RadEditor.prototype.SetSize = function() { this.HookedResize("100%", editorSize); }; } } 
/* Cookies.js */
function GetCookieValue(name) { GetNamedCookieValue(name, "STHashCookie"); } function SetCookieValue(name, value) { SetNamedCookieValue(name, value, "STHashCookie"); } function GetNamedCookieValue(name, cookieName) { var existing = readCookie(cookieName); if (existing == null) existing = ""; var newC = ""; var found = false; var ca = existing.split('|'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); var ep = c.indexOf('='); var oldName = c.substring(0, ep); if (oldName == "") continue; if (oldName == name) return c.substring(ep+1, c.length - (ep+1)); } return null; } function SetNamedCookieValue(name, value, cookieName) { var existing = readCookie(cookieName); if (existing == null) existing = ""; var newC = ""; var found = false; var ca = existing.split('|'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c == "") continue; var ep = c.indexOf('='); var oldName = c.substring(0, ep); if (oldName == "") continue; var oldValue = c.substring(ep+1); if (oldName == name) { oldValue = value; found = true; } newC = oldName + "=" + oldValue + "|" + newC; } if (!found) newC = name + "=" + value + "|" + newC; createCookie(cookieName, newC); } function ClearTreeToggle() { createCookie("STTTState", ""); } function RecordTreeToggle(node) { if (node.Attributes) { var val = node.Attributes["TTUID"]; if (val == null) return; SetNamedCookieValue(val, node.Expanded.toString(), "STTTState") } } function createCookie(name, value) { var date = new Date(); date.setDate(date.getDate() + 3650); document.cookie = name + "=" + value + "; expires=" + date.toGMTString() + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } function LPResized(sender, eventArgs) { SetCookieValue("RootLPSize", eventArgs.newWidth.toString()); } function LPCollapsed() { SetCookieValue("RootLPHid", "true"); } function LPExpanded() { SetCookieValue("RootLPHid", "false"); } 
/* DragDrop.js */
function mouseCoords(ev) { if (ev.pageX || ev.pageY) return {x:ev.pageX, y:ev.pageY}; return { x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, y:ev.clientY + document.body.scrollTop  - document.body.clientTop }; } function getPosition(e) { var left = 0; var top = 0; var width = e.offsetWidth; var height = e.offsetHeight; var id = e.id; while (e.offsetParent) { left += e.offsetLeft; top += e.offsetTop; e = e.offsetParent; } left += e.offsetLeft; top += e.offsetTop; return {x:left, y:top, x2:left+width, y2:top+height, id:id}; } var orgX = 0; var orgY = 0; var startX = 0; var startY = 0; var isDragging = false; var dropFolder = null; var gridDragging = null; function MouseMoved(evt) { if (!isDragging) return; var mousePos = mouseCoords(evt); var realY = startY - (orgY - evt.screenY); var realX = startX - (orgX - evt.screenX); if (TreeViewItems.length > 0) { dropFolder = null; for (var i = 0; i < TreeViewItems.length; i++) { var item = TreeViewItems[i]; if (realX >= item.x && realX <= item.x2 && realY >= item.y && realY <= item.y2) { var item2 = MailTreeView.FindNode(item.id); var folder = item2.Attributes.folder; if (folder != null) { dropFolder = folder; break; } } } } var ddd = document.getElementById('DragDropDiv'); if (!ddd) return; if (dropFolder!=null) ddd.className = "DragDropDivOK"; else ddd.className = "DragDropDiv"; ddd.style.top = (realY + 10) + "px"; ddd.style.left = (realX + 15) + "px"; if (Math.pow(orgY - evt.screenY,2) + Math.pow(orgX - evt.screenX,2) >100) ddd.style.display = ''; return CancelEvent(evt); }; var TreeViewItems = new Array(); function CalcTreeViewItems() { if (self.MailTreeView == null) return; TreeViewItems = new Array(); for (var i = 0; i < MailTreeView.AllNodes.length; i++) { TreeViewItems[i] = getPosition(document.getElementById(MailTreeView.AllNodes[i].ClientID)); } } function StartDragDrop(grid, text, X, Y, sX, sY) { gridDragging = grid; isDragging = true; CalcTreeViewItems(); var documentObj = GetDocumentObj(); var pageSize = parseInt(documentObj.clientHeight); var pageWidth = parseInt(documentObj.clientWidth); orgX = X; orgY = Y; startX = sX + (pageWidth - self.GetSMPane().GetExtContentContainerElement().offsetWidth) ; startY = sY + (pageSize - self.GetSMPane().GetExtContentContainerElement().offsetHeight) ; var ddd = document.getElementById('DragDropDiv'); if (!ddd) return; var dddt = document.getElementById('DragDropDivText'); dddt.innerHTML = text; ddd.style.top = startY + "px"; ddd.style.left = startX + "px"; } function EndDragDrop() { if (!isDragging) return; isDragging = false; var ddd = document.getElementById('DragDropDiv'); if (!ddd) return; ddd.style.display = 'none'; dropFolder = null; } function SetupMouseMove() { self.isDragging = true; var closureSelf = self; var closureParent = parent; var closureChild = document.getElementById(self.PreviewPane); if (closureChild != null) closureChild = closureChild.contentWindow; var func = function (evt) { closureSelf.isDragging = false; if (closureSelf.UnSetupMouseMove) closureSelf.UnSetupMouseMove(); if (closureChild && closureChild.UnSetupMouseMove) closureChild.UnSetupMouseMove(); if (closureParent.UnSetupMouseMove) closureParent.UnSetupMouseMove(); if (Math.pow(closureParent.orgY - evt.screenY,2) + Math.pow(closureParent.orgX - evt.screenX,2) > 100) closureSelf.finishedDragging = new Date(); if (closureParent.gridDragging != null && closureParent.dropFolder != null) closureSelf.__doPostBack(closureParent.gridDragging.ID.replace(/_/g,"$"), "dragdropped=" + closureParent.dropFolder); else if (closureSelf.EndDragFunc != null) { closureSelf.EndDragFunc(); closureSelf.EndDragFunc = null; } if (closureParent.EndDragDrop) closureParent.EndDragDrop(); }; closureSelf.UnSetupMouseMove(); closureParent.UnSetupMouseMove(); if (closureChild) { if (closureChild.UnSetupMouseMove)	closureChild.UnSetupMouseMove(); if (closureChild.document) { closureChild.document.MouseMoveHandler = parent.MouseMoved; closureChild.document.MouseUpHandler = func; AddHandler(closureChild.document, "mousemove", "MouseMoveHandler"); AddHandler(closureChild.document, "mouseup", "MouseUpHandler"); } } document.MouseMoveHandler = parent.MouseMoved; document.MouseUpHandler = func; AddHandler(document, "mousemove", "MouseMoveHandler"); AddHandler(document, "mouseup", "MouseUpHandler"); parent.document.MouseMoveHandler = parent.MouseMoved; parent.document.MouseUpHandler = func; AddHandler(parent.document, "mousemove", "MouseMoveHandler"); AddHandler(parent.document, "mouseup", "MouseUpHandler"); } function UnSetupMouseMove() { RemHandler(document, "mousemove", "MouseMoveHandler"); RemHandler(document, "mouseup", "MouseUpHandler"); document.MouseMoveHandler = null; document.MouseUpHandler = null; } 
/* Events.js */
function AddLoadEvent(callback) { if (window.attachEvent) window.attachEvent("onload", callback); else if (window.addEventListener) window.addEventListener("load", callback, false); } function AddUnloadEvent(callback) { if (window.attachEvent) window.attachEvent("onunload", callback); else if (window.addEventListener) window.addEventListener("unload", callback, false); } var resizeTimeout = null; function AddOnlySizeEvent(callback) { if (window.attachEvent) window.attachEvent("onresize", callback); else if (window.addEventListener) window.addEventListener("resize", callback, false); } function AddSizeEvent(callback) { if (window.attachEvent) { window.attachEvent("onload", callback); window.attachEvent("onresize", callback); } else if (window.addEventListener) { window.addEventListener("load", callback, false); window.addEventListener("resize", callback, false); } } function CancelEvent(evt) { evt.cancelBubble = true; if (evt.stopPropagation) evt.stopPropagation(); if (evt.preventDefault) evt.preventDefault(); if (evt.returnValue) evt.returnValue = false; return false; } function AddPanelSizeEvent(theDiv, theBB) { var callback = function(){ AdjustForMiniButtonBar(theDiv,theBB); }; var elem = document.getElementById(theBB); if (elem) elem.RadResize = callback; setTimeout(callback,1); setTimeout(callback,1000); } function DisableMiniButton(bar, button) { var elem = document.getElementById(bar + "_" + button + "_Enabled"); if (elem) elem.style.display = "none"; elem = document.getElementById(bar + "_" + button + "_Disabled"); if (elem) elem.style.display = ""; } function EnableMiniButton(bar, button) { var elem = document.getElementById(bar + "_" + button + "_Disabled"); if (elem) elem.style.display = "none"; elem = document.getElementById(bar + "_" + button + "_Enabled"); if (elem) elem.style.display = ""; } function GenericToggle(id) { var closed = false; var searchBar = document.getElementById(id); if (searchBar.style.display == 'none') { searchBar.style.display = ''; var inputs = searchBar.getElementsByTagName('input'); if (inputs.length > 0) inputs[0].focus(); } else { searchBar.style.display = 'none'; closed = true; Unfocus(); } if (document.ResizeEvent) document.ResizeEvent(); return closed; } function Unfocus() { if (document.HGOnBlur) document.HGOnBlur(); else if (document.body.focus) document.body.focus(); } function AddRadSizeEvent(elem, callback) { var el = document.getElementById(elem); if (el) { el.RadResize = callback; el.RadShow = callback; } } function AddHandler(target,eventName,handlerName) { if (target.addEventListener) { target[eventName + handlerName] = function(e){return target[handlerName](e)}; target.addEventListener(eventName, target[eventName + handlerName], false); } else if (target.attachEvent) { target[eventName + handlerName] = function(e){return target[handlerName](e)}; target.attachEvent("on" + eventName, target[eventName + handlerName]); } else { var originalHandler = target["on" + eventName]; if (originalHandler) { target[eventName + handlerName] = function(e){originalHandler(e); return target[handlerName](e);}; target["on" + eventName] = target[eventName + handlerName]; } else { target["on" + eventName] = target[handlerName]; } } } function RemHandler(target,eventName,handlerName) { if (target.detachEvent) { if (target[eventName + handlerName] != null) target.detachEvent("on" + eventName, target[eventName + handlerName]); target[eventName + handlerName] = null; } else if (target.removeEventListener) { target.removeEventListener(eventName, target[eventName + handlerName], false); target[eventName + handlerName] = null; } } function ReturnEmptyArray() { return new Array(); } function PanelExpand(sender, eventArgs) { if (self.currentSection) SetCookieValue("Panel_" + self.currentSection, eventArgs.Item.Value); if (self["Resize" + eventArgs.Item.Value]) self["Resize" + eventArgs.Item.Value](); } function EnterHandler(e,func) { if((document.all?window.event.keyCode:e.which) == 13) { func(); return false; } } function SetChecked(formname, val, gridname) { dml=document.forms[formname]; len = dml.elements.length; var i=0; for( i=0 ; i<len ; i++) { if (dml.elements[i].name.indexOf(gridname)==0) { dml.elements[i].checked=val; } } } function discardElement(element) { var garbageBin = document.getElementById('IELeakGarbageBin'); if (!garbageBin) { garbageBin = document.createElement('DIV'); garbageBin.id = 'IELeakGarbageBin'; garbageBin.style.display = 'none'; document.body.appendChild(garbageBin); } garbageBin.appendChild(element); garbageBin.innerHTML = ''; } function BeforeClientClickHandler(node, eventArgs) { if (node.Attributes["Unsel"]) { return false; } if (node.Attributes["ClientSideCommand"]) { eval(node.Attributes["ClientSideCommand"]); return false; } } function SetupContextMenu(contextMenuID) { var contextMenu = document.getElementById(contextMenuID); contextMenu.className = "TreeContextMenu"; } function ContextClick(node, itemText, itemID) { if (itemID == "NewFolder") AddFolder(); if (itemID == "Edit") EditFolder(); if (itemID == "Delete") DeleteFolder(); } function DetectSearch(e) { var evtobj = window.event ? event : e; var unicode = evtobj.charCode ? evtobj.charCode : evtobj.keyCode; if (unicode == 19 || (evtobj.ctrlKey && unicode == 83)) { ToggleSearch(); } } 
/* InnerSplit.js */
var topHeight = 0; function FixHorizSplitter(splitter) { var split = splitter.splitBarsByIndex[0]; if (!split.browser.IsMozilla) return; RadSplitter_SplitBar.prototype.HookedOnMouseDown = split.OnMouseDown; RadSplitter_SplitBar.prototype.HookedOnMouseUp = split.OnMouseUp; RadSplitter_SplitBar.prototype.HookedOnMouseMove = function(e) { var newE = {clientY: e.clientY + topHeight}; this.OnMouseMove(newE); }; RadSplitter_SplitBar.prototype.OnMouseUp = function(e) { var el = splitter.GetPaneByIndex(1).GetExtContentContainerElement(); if (el && el.contentDocument) { this.DetachDomEvent(el.contentDocument,"mouseup","OnMouseUp"); this.DetachDomEvent(el.contentDocument,"mousemove","HookedOnMouseMove"); this.HookedOnMouseUp(e); } }; RadSplitter_SplitBar.prototype.OnMouseDown = function(e) { topHeight = splitter.GetContainerElement().offsetTop + splitter.GetPaneByIndex(0).GetContentContainerElement().offsetHeight + document.getElementById(split.ID).offsetHeight; var el = splitter.GetPaneByIndex(1).GetExtContentContainerElement(); if (el && el.contentDocument) { this.AttachDomEvent(el.contentDocument,"mouseup","OnMouseUp"); this.AttachDomEvent(el.contentDocument,"mousemove","HookedOnMouseMove"); this.HookedOnMouseDown(e); } }; } function InnerSplitterLoaded() { FixSplitter(); document.ResizeEvent(); } function InnerGridCollapsed() { var tab = document.getElementById('ButtonBarTable'); if (tab) tab.style.display = "none"; tab = document.getElementById('HeaderPanel'); if (tab) tab.style.display = "none"; SetCookieValue("SplitGridHid", "true"); if (!isResizing) document.ResizeEvent(); } function InnerGridExpanded() { var tab = document.getElementById('ButtonBarTable'); if (tab) tab.style.display = ""; tab = document.getElementById('HeaderPanel'); if (tab) tab.style.display = ""; SetCookieValue("SplitGridHid","false"); if (!isResizing) document.ResizeEvent(); } function UpdateGrid() { if (self.GetSMPane) { var doc = DocumentFromIframe(GetSMPane().GetExtContentContainerElement()); if (doc.setNeedsRefreshed) doc.setNeedsRefreshed(); } else { if (document.setNeedsRefreshed) document.setNeedsRefreshed(); else if (parent.document.setNeedsRefreshed) parent.document.setNeedsRefreshed(); } } 
/* Notes.js */
function PostIt(id) { this.id = id; var dom = document.getElementById(id); dom.style.display="block"; dom.mouseDown = this.MouseDown; dom.mouseUp = this.MouseUp; dom.mouseMove = this.MouseMove; AddHandler(dom, "mousedown", "mouseDown"); AddHandler(dom, "mouseup", "mouseUp"); AddHandler(dom, "mousemove", "mouseMove"); }; PostIt.prototype.MouseDown = function (e) { this.dom = document.getElementById(this.id); this.startX = e.screenX; this.startY = e.screenY; this.orgX = this.dom.offsetLeft; this.orgY = this.dom.offsetTop; this.dragging = true; return CancelEvent(e); }; PostIt.prototype.MouseUp = function (e) { this.dragging = false; this.dom = null; }; PostIt.prototype.MouseMove = function (e) { if (this.dragging && this.dom) { this.dom.style.left = (this.orgX + e.screenX - this.startX) + "px";; this.dom.style.top = (this.orgY + e.screenY - this.startY) + "px"; } }; 
/* Popups.js */
function BringUpHelp(webpage) { var url = webpage; var hWnd = window.open(url, "smartertoolshelp", "width=750,height=375,toolbar=yes,resizable=yes,scrollbars=yes,location=yes,menubar=yes, status=yes"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "smartertoolshelp"; hWnd.location.href=url; } hWnd.focus(); } } function BringUpSidebarHelp(webpage) { var url = webpage; var hWnd = window.open(url, "smartertoolssidebarhelp", "width=400,height=275,resizable=yes,scrollbars=yes,status=no,toolbar=no"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "smartertoolssidebarhelp"; hWnd.location.href=url; } } } function OpenDiagnostic(webpage) { var url = webpage; var hWnd = window.open(url, "smartertoolssidebarhelp", "width=600,height=550,resizable=yes,scrollbars=yes,status=no,toolbar=no"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "smartertoolsdiagnostic"; hWnd.location.href=url; } } } function BringUpWindow(webpage) { var url = webpage; var hWnd = window.open(url, "ProgramWindow", "width=300,height=350,resizable=no,scrollbars=yes,status=yes"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "home"; hWnd.location.href=url; } } } function OpenNewMessage(webpage, width, height) /* Used for compose email popup */ { var guid = Math.floor(Math.random()*65536).toString() + Math.floor(Math.random()*65536).toString() + Math.floor(Math.random()*65536).toString(); var url = webpage; if (webpage.indexOf("?") == -1) { url += "?popup=true"; } else { url += "&popup=true"; } var hWnd = window.open(url, "popupCompose" + guid, "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,status=yes'"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; hWnd.location.href=url; } } hWnd.focus(); } function OpenUniqueNewMessage(webpage, width, height) /* Used for compose email popup */ { var url = webpage; var windowName = url.substr(url.indexOf("&messageid=") + 11); var wndIndex = windowName.substr(0, windowName.indexOf("&")); if (webpage.indexOf("?") == -1) { url += "?popup=true"; } else { url += "&popup=true"; } var hWnd = window.open(url, "popupCompose" + wndIndex, "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,status=yes'"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; hWnd.location.href=url; } } hWnd.focus(); } function ShowMenu(url) { var MenuBack; if (MenuBack == null || MenuBack.Closed) { MenuBack = window.open(url, "", "menubar=no,status=no,scrollbars=yes,resizable=no,width=225,height=285,toolbar=no,location=no,directories=no"); } MenuBack.focus() } function BringUpWindow_SSVersion(webpage) { var url = webpage; var hWnd = window.open(url, "SmarterTools",	"width=806,height=450,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,location=yes,menubar=yes"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "smartertoolshelp"; hWnd.location.href=url; } } } function BringUpImpersonationWindow(webpage) { var url = webpage; var hWnd = window.open(url, "newdomainwindow", ""); if (hWnd != null && hWnd.opener == null) { hWnd.opener = self; window.name = "home"; hWnd.location.href=url; } } function openpopupwotoolbar(popurl, name, lr, tb) { var winpops = window.open(popurl, name, "width="+lr+",height="+tb+",scrollbars,resizable"); if (winpops != null) winpops.focus(); } function BringUpAbout(webpage) { var url = webpage; var hWnd = window.open(url, "SmarterMail_Professional_Edition",	"width=370,height=220,resizable=no,scrollbars=yes,status=no,toolbar=no"); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "home"; hWnd.location.href=url; } } } function GenericPopup(url, name, options) { var hWnd = window.open(url, name, options); if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; if (name && name != "") window.name = name; hWnd.location.href=url; } hWnd.focus(); } } function PopUpNewTicket(url) { GenericPopup(url, "createTicketWindow", "width=750,height=500,resizable=yes"); } function ShowGenericRadWindow(url, height, width, callback) { var level = self; while (level != level.parent && level.GetRadWindowManager == null) level = level.parent; var ownd = level.GetRadWindowManager().GetWindowByName('GenericWindow'); ownd.GetContentFrame().style.visibility='hidden'; ownd.OnClientPageLoad = function(){ownd.GetContentFrame().style.visibility='visible'; ownd.OnClientPageLoad=null;}; ownd.SetUrl(url); ownd.SetSize(width,height); ownd.OnClientClose = callback; ownd.SetTitle(''); ownd.Show(); } function ShowGenericRadWindowByElement(url, height, width, element, callback) { var ownd = GetRadWindowManager().GetWindowByName('GenericWindow'); ownd.SetSize(width,height); ownd.element = element; if (callback!=null) ownd.OnClientClose = callback; ownd.SetUrl(url); ownd.SetTitle(''); ownd.Show(); } function ShowConfirmRadWindow(resource, size, key, callback) { confirmCallback = callback; var ownd = document.getElementById('ConfirmWindowModal'); ownd.style.display = ""; var textbox = document.getElementById('DeleteKeyCaptureBox'); textbox.focus(); ShowConfirm(resource, size); } function ShowAlertWindow(text) { confirmCallback = null; var ownd = document.getElementById('ConfirmWindowModal'); var textbox = document.getElementById('DeleteKeyCaptureBox'); if (ownd == null) { ownd = parent.document.getElementById('ConfirmWindowModal'); textbox = parent.document.getElementById('DeleteKeyCaptureBox'); parent.ShowAlert(text); } else ShowAlert(text); ownd.style.display = ""; textbox.focus(); } function WindowFix(oWnd) { oWnd.SetSize(oWnd.GetWidth(), parseInt(oWnd.Height)); } function ConfirmCallback(val) { var ownd = document.getElementById('ConfirmWindowModal'); ownd.style.display = "none"; if (val == true) if (confirmCallback != null) confirmCallback(val); confirmCallback = null; var doc = DocumentFromIframe(GetSMPane().GetExtContentContainerElement()); if (doc && doc.HGOnBlur) doc.HGOnBlur(); } function CalendarPopup(datePicker, type) { if (datePicker.GetTextBox == null) datePicker = window[datePicker.id]; var popupElement; if (type == "time") popupElement = datePicker.GetTimePopupContainer(); else popupElement = datePicker.GetPopupContainer(); var textBox = datePicker.GetTextBox(); var dimensions = datePicker.GetElementDimensions(popupElement); var position = datePicker.GetElementPosition(textBox); var textDimensions = datePicker.GetElementDimensions(textBox); var x = position.x; var y = position.y + textDimensions.height; if (position.y + textDimensions.height + dimensions.height > PageSize().y) y = position.y - dimensions.height; if (y < 0) y = 0; if (type == "time") datePicker.ShowTimePopup(x,y); else datePicker.ShowPopup(x,y); return false; } function PageSize() { var frameWidth = 100000; var frameHeight = 100000; if (self.innerWidth) { frameWidth = self.innerWidth; frameHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientWidth) { frameWidth = document.documentElement.clientWidth; frameHeight = document.documentElement.clientHeight; } else if (document.body) { frameWidth = document.body.clientWidth; frameHeight = document.body.clientHeight; } return { x:frameWidth, y:frameHeight }; } 
/* Printing.js */
function Print_IFrame(frame_name) { var iFrm = window.frames[frame_name]; if (iFrm) { iFrm.focus();  iFrm.print(); } } function PrintWindow() { if(navigator.appVersion.indexOf("MSIE 7") != -1) document.execCommand('print',false,null); else window.print(); } 
/* Resize.js */
function GetDocumentObj() { var documentObj = document.documentElement; if (window.opera || (document.all && !(document.compatMode && document.compatMode == "CSS1Compat"))) documentObj = document.body; return documentObj; } function AdjustForSize(pageSize, element) { var elem = document.getElementById(element); if (elem == null) return pageSize; if (elem.style.display=='none') return pageSize; pageSize = pageSize - elem.offsetHeight; if (pageSize < 1) pageSize = 1; return pageSize } function SetHeight(element, size) { if (size < 1) return; var elem = document.getElementById(element); if (elem) elem.style.height = size + "px"; } function SetWidth(element, size) { if (size < 1) return; var elem = document.getElementById(element); if (elem) elem.style.width = size + "px"; } function Ready() { } function AdjustForMiniButtonBar(theDiv, theBB) { var elem = document.getElementById(theDiv);  if (!elem) return; var elem2 = document.getElementById(theBB); var parent = elem.parentNode.parentNode.parentNode; var newHeight = parent.clientHeight - (elem.offsetTop - elem2.offsetTop); var newWidth = parent.clientWidth; if (newHeight<1) return; elem.style.width = newWidth + "px"; elem.style.height = newHeight + "px"; } var oldAttachEvent = window.attachEvent; var oldDetachEvent = window.detachEvent; var resizeFuncs = new Array(); var oldTimeout = null; var resizeDelay = 150; if (self != top) resizeDelay = 1; if (oldDetachEvent) { window.detachEvent = function(a,b) { if (oldDetachEvent && a != "onresize") oldDetachEvent(a,b); else { for(var i = 0; i < 999; i++) if (resizeFuncs[i] == b) { resizeFuncs[i] = null; return; } } }; } function aggregateFuncs() { for (var i = resizeFuncs.length - 1; i >= 0 ; i--) if (resizeFuncs[i]) resizeFuncs[i](window.event); } function newCallback(evt) { var temp = oldTimeout; oldTimeout = window.setTimeout(aggregateFuncs, resizeDelay); window.clearTimeout(temp); } if (oldAttachEvent) { window.attachEvent("onresize", newCallback); window.attachEvent = function(a,b) { if (oldAttachEvent && a != "onresize") oldAttachEvent(a,b); else { for(var i = 0; i < 999; i++) if (!resizeFuncs[i]) { resizeFuncs[i] = b; return; } } }; } function RegisterResizeEvent(loadEvent) { var callback = function() { if (document.ResizeEvent) document.ResizeEvent(); if (document.AdditionalResizeEvent) document.AdditionalResizeEvent(); }; if (loadEvent == undefined) { if (parent == self) AddSizeEvent(callback); else AddLoadEvent(callback); } else { if (parent == self) AddOnlySizeEvent(callback); } } 
/* Skinning.js */
function SetClasses(node, classname) { if (node.className != classname) node.className = classname; } function AddClass(node, c) { var curclass = node.className; var i = curclass.indexOf(c); if (i==-1) node.className = curclass + ' ' + c; } function RemClass(node, c) { var curclass = node.className; var i = curclass.indexOf(c); if (i==0 || i==1) node.className = ''; else if (i!=-1) node.className = curclass.substring(0,i-1); } function ChangeInnerTitle(newtitle) { if (newtitle != "") { var elem = document.getElementById('PageTitle'); if (elem)	elem.innerHTML = newtitle; top.document.title = newtitle + ' - SmarterMail'; } } function ChangeElementHTML(element, newHTML) { var elem = document.getElementById(element); if (!elem)	elem = parent.document.getElementById(element); if (elem)	elem.innerHTML = newHTML; } function ChangeFontWeight(element, bold) { var elem = document.getElementById(element); if (!elem)	elem = parent.document.getElementById(element); if (elem)	elem.style.fontWeight = bold; } function FindElement(elem) { var el = document.getElementById(elem); if (el) return el; el = parent.document.getElementById(elem); if (el) return el; el = parent.parent.document.getElementById(elem); if (el) return el; if (window.opener) { el = window.opener.document.getElementById(elem); if (el) return el; el = window.opener.parent.document.getElementById(elem); if (el) return el; el = window.opener.parent.parent.document.getElementById(elem); if (el) return el; if (window.opener.opener) { el = window.opener.opener.document.getElementById(elem); if (el) return el; el = window.opener.opener.parent.document.getElementById(elem); if (el) return el; el = window.opener.opener.parent.parent.document.getElementById(elem); if (el) return el; } } return null; } function ChangeFolderList(elem, text) { var el = FindElement(elem); if (el == null) return; el.innerHTML = text; el.style.fontWeight = "normal"; } function ChangeFolderListBold(elem, text) { var el = FindElement(elem); if (el == null) return; el.innerHTML = text; el.style.fontWeight = "bold"; } function AdjustTabText(tabStrip, tabIndex, text) { var tab = tabStrip.Tabs[tabIndex]; var span = tab.DomElement.firstChild.firstChild; span.innerHTML = text; } function DocumentFromIframe(iframe) { if (iframe.contentDocument) return iframe.contentDocument; if (iframe.contentWindow && iframe.contentWindow.document) return iframe.contentWindow.document; if (iframe.document) return iframe.document; return document; } function ResizeIframes() { var iframes = document.getElementsByTagName("IFRAME"); for (var i = 0; i < iframes.length; i++) { var doc = DocumentFromIframe(iframes[i]); if (doc.ResizeEvent) doc.ResizeEvent(); if (doc.AdditionalResizeEvent) doc.AdditionalResizeEvent(); } } function ShowSection(name, oldName) { if (name=="reload") return; var elem = document.getElementById('TopMenuIcon_' + name); var oldElem = document.getElementById('TopMenuIcon_' + currentSection); if (oldElem) oldElem.className = 'TopMenuIconCell'; if (elem) elem.className = 'TopMenuIconCellHighlight'; } function SetTopMenuImage(sectionName, image) { var id = "TopMenuIconImage_" + sectionName; var el = FindElement(id); if (el == null) return; if (el.currentImage != image) { el.innerHTML = "<img src=\"" + image + "\" />"; el.currentImage = image; } } function SplitterLoaded(splitter) { NavigateToHash(); var documentObj = GetDocumentObj(); var splitSize = documentObj.clientHeight; splitSize = AdjustForSize(splitSize,'PageHeader'); splitSize = AdjustForSize(splitSize,'PageFooter'); splitter.Resize(documentObj.clientWidth, splitSize - 1); splitter.Resize(documentObj.clientWidth, splitSize); } function PlaySound(url) { if (navigator && navigator.userAgent.indexOf("MSIE") != -1) { if (document.all.sound) document.all.sound.src = url; else if (parent.document.all.sound) parent.document.all.sound.src = url; } else { if (document.getElementById("soundSpan")) document.getElementById("soundSpan").innerHTML = "<embed src='"+url+"' hidden=true autostart=true loop=false>"; else if (parent.document.getElementById("soundSpan")) parent.document.getElementById("soundSpan").innerHTML = "<embed src='"+url+"' hidden=true autostart=true loop=false>"; } } var lastPlaySoundDate; function PlaySoundInterval(url, seconds) { if (!lastPlaySoundDate) { lastPlaySoundDate = new Date(); lastPlaySoundDate.setFullYear(2000,1,1); } var now = new Date(); var diff = now - lastPlaySoundDate; if (diff > seconds * 1000) { PlaySound(url); lastPlaySoundDate = new Date(); } } 
/* Skin.js */
/* Add any functions/overrides for this skin here */ 