//============================================================================= // Author: Toomas Kaljus. Copyright (C) 2006 Digi Grupp, All Rights Reserved. // Warning! This computer program is protected by copyright law and // international treaties. Unauthorized reproduction or distribution of this // program, or any portion of it, may result in severe civil and criminal // penalties, and will be prosecuted to the maximum extent possible under law. //============================================================================= var OpenModeModeless = 2; var OpenModeModal = 1; var OpenModeWindow = 0; var OpenModeDetached = -1; var OpenModeRedirect = -2; var MarkedButton = null; var CheckFramesRedirect = false; function CheckFrames(Restore) { if (self == parent) { CheckFramesRedirect = true; if (Restore) { setTimeout('FullReload()', 0); } else { setTimeout('parent.location = \'./\'', 0); } } else { if (Restore) { if (self.name == 'main') { url = GetCookie('g'); if (url) location = url; SetCookie('g'); } } } } function SetPageTitle(Title) { document.title = Title; parent.document.title = Title; parent.parent.document.title = Title; } function FullReload(url) { if (!url) url = location; SetCookie('g', url); parent.parent.location = './'; } function ReloadOpener() { self.returnValue = 1; if (this.Opener) Opener.MustReload = true; parent.returnValue = 1; if (parent.Opener) parent.Opener.MustReload = true; parent.parent.returnValue = 1; if (parent.parent.Opener) parent.parent.Opener.MustReload = true; } function Close() { self.close(); parent.close(); parent.parent.close(); } function OnKey(sender, e, Key, ControlID, ControlID2, ControlID3) { if ((e.which ? e.which : e.keyCode) == Key) { var o; if (ControlID) { o = document.getElementById(ControlID); if (o) if (o.click) { if (sender) if (sender.blur) sender.blur(); o.click(); return false; } } if (ControlID2) { o = document.getElementById(ControlID2); if (o) if (o.click) { if (sender) if (sender.blur) sender.blur(); o.click(); return false; } } if (ControlID3) { o = document.getElementById(ControlID3); if (o) if (o.click) { if (sender) if (sender.blur) sender.blur(); o.click(); return false; } } } } function Focus(ControlID, ControlID2, ControlID3) { var o; if (ControlID) { o = document.getElementById(ControlID) if (o) if (o.focus) { o.focus(); return true; } } if (ControlID2) { o = document.getElementById(ControlID2) if (o) if (o.focus) { o.focus(); return true; } } if (ControlID3) { o = document.getElementById(ControlID3) if (o) if (o.focus) { o.focus(); return true; } } } var FocusElementOk; function FocusElement(ControlID) { if (FocusElementOk) return; form = document.forms[0]; if (form) { var o; if (ControlID) { o = form.elements[ControlID] if (o) if (o.focus) { o.focus(); FocusElementOk = true; } } } } function GetCookie(Name, Key) { var i, j, Value = '', Cookies = document.cookie.split('; ') for (i = 0; i < Cookies.length; i++) { var Cookie = Cookies[i].split('=') if (Cookie[0].toUpperCase() == Name.toUpperCase()) if (Cookie.length > 1) { if (Key) { for (j = 2; j < Cookie.length; j++) Cookie[1] = Cookie[1] + '=' + Cookie[j] var CookieKeys = Cookie[1].split('&') for (j = 0; j < CookieKeys.length; j++) { var CookieKey = CookieKeys[j].split('=') if (CookieKey[0].toUpperCase() == Key.toUpperCase()) if (CookieKey.length > 1) Value = unescape(CookieKey[1]) } } else { Value = unescape(Cookie[1]) } } } return Value } function SetCookie(Name, Value, Days) { if (Days) { var date = new Date(); date.setDate(date.getDate() + Days) if (Value) { document.cookie = Name.toUpperCase() + '=' + escape(Value.toString()) + '; path=/; expires=' + date.toGMTString() } else { document.cookie = Name.toUpperCase() + '=; path=/; expires=0' } } else { if (Value) { document.cookie = Name.toUpperCase() + '=' + escape(Value.toString()) + '; path=/' } else { document.cookie = Name.toUpperCase() + '=; path=/' } } } var ChildWinOpen = 0; var WinToReload = new Array(); var WinToReloadReady = new Array(); var ReloadParams = ''; var ExportParams = ''; function CheckForReload() { for (i=0; i= 0) params += '&d=1'; if (mode == OpenModeModeless) { if (self.showModelessDialog) { ChildWinOpen++; var z = 'dialogwidth:' + DefaultWidth + 'px;dialogheight:' + DefaultHeight + 'px'; if (w) if (h) z='dialogwidth:' + w + 'px;dialogheight:' + h + 'px'; var w = window.showModelessDialog(UrlParams(url, params), 1, z + 'resizable:yes;status:no'); WinToReload[WinToReload.length] = w; WinToReloadReady[WinToReloadReady.length] = false; if (ChildWinOpen == 1) window.setTimeout('CheckForReload()', 500); } else { mode = OpenModeModal; } } if (mode == OpenModeModal) { if (window.showModalDialog) { var z = 'dialogwidth:' + DefaultWidth + 'px;dialogheight:' + DefaultHeight + 'px'; if (w) if (h) z='dialogwidth:' + w + 'px;dialogheight:' + h + 'px'; if (window.showModalDialog(UrlParams(url, params), 1, z + 'resizable:yes;status:no')) Reload(null); } else { mode = OpenModeWindow; } } if (mode == OpenModeWindow) { ChildWinOpen++; var z = 'width=' + DefaultWidth + 'px,height=' + DefaultHeight + 'px,left=' + parseInt((screen.availWidth / 2) - (DefaultWidth / 2)) + 'px,top=' + parseInt((screen.availHeight / 2) - (DefaultHeight / 2)) + 'px,'; if (w) if (h) z='width=' + w + 'px,height=' + h + 'px,left=' + parseInt((screen.availWidth / 2) - (w / 2)) + 'px,top=' + parseInt((screen.availHeight / 2) - (h / 2)) + 'px,'; var w = window.open(UrlParams(url, params), '_blank', z + 'location=no,menubar=no,toolbar=no,status=no,directories=no,channelmode=no,resizable=yes'); WinToReload[WinToReload.length] = w; WinToReloadReady[WinToReloadReady.length] = false; if (ChildWinOpen == 1) window.setTimeout('CheckForReload()', 500); } else { if (mode == OpenModeDetached) { var z = ''; if (w) if (h) z='width=' + w + 'px,height=' + h + 'px,left=' + parseInt((screen.availWidth / 2) - (w / 2)) + 'px,top=' + parseInt((screen.availHeight / 2) - (h / 2)) + 'px,'; window.open(UrlParams(url, params), '_blank', z + 'location=no,menubar=no,toolbar=no,status=no,directories=no,channelmode=no,resizable=yes'); } else { if (mode == OpenModeRedirect) location = UrlParams(url, params); } } } function Reload(url, params) { if (params) { params = ReloadParams + '&' + params; } else { params = ReloadParams; } if (MarkedButton) SetCookie('m', MarkedButton) location = UrlParams(url, params); } function UrlParams(url, params) { if (!url) { href = location.href.split('?'); url = ''; for (i=0; i 1) return unescape(Params[i].substring(Param[0].length + 1)); } } function EdgFrameworkDialogInit(DlgMode) { if (CheckFramesRedirect) return; var Data = document.getElementById('EdgPageAppFrameDialog'); if (Data) { if (parent.dialogArguments == 1) { var dx = 25; var dy = 45; var w = Data.offsetWidth + dx; var h = Data.offsetHeight + dy; var l = parseInt(parent.dialogLeft) + parseInt((parseInt(parent.dialogWidth) - w) / 2); var t = parseInt(parent.dialogTop) + parseInt((parseInt(parent.dialogHeight) - h) / 2); if (l < dx) { w = w - (2 * (dx - l)); l = dx; } if (t < dy) { h = h - (2 * (dy - t)); t = dy; } if (parent.DialogWidth == null) parent.DialogWidth = 0; if (parent.DialogHeight == null) parent.DialogHeight = 0; if ((parent.DialogWidth < w) || (parent.DialogHeight < h)) { parent.DialogLeft = l; parent.DialogWidth = w; parent.DialogTop = t; parent.DialogHeight = h; parent.dialogLeft = l + 'px'; parent.dialogWidth = w + 'px'; parent.dialogTop = t + 'px'; parent.dialogHeight = h + 'px'; } } else if (DlgMode) { var dx = 30; var dy = 85; var w = Data.offsetWidth + dx; var h = Data.offsetHeight + dy; var l = parseInt((screen.availWidth / 2) - (w / 2)); var t = parseInt((screen.availHeight / 2) - (h / 2)); if (l < dx) { w = w - (2 * (dx - l)); l = dx; } if (t < dy) { h = h - (2 * (dy - t)); t = dy; } if (parent.DialogWidth == null) parent.DialogWidth = 0; if (parent.DialogHeight == null) parent.DialogHeight = 0; if ((parent.DialogWidth < w) || (parent.DialogHeight < h)) { parent.DialogLeft = l; parent.DialogWidth = w; parent.DialogTop = t; parent.DialogHeight = h; parent.moveTo(l, t); parent.resizeTo(w, h); } } } form = document.forms[0]; if (form) { var SetFilterButton = document.forms[0].elements['SetFilterButton']; var ClearFilterButton = document.forms[0].elements['ClearFilterButton']; var EnterButton; var EscButton; if (document.images) for (i=0; i0) { n--; if (n != 0) Scroller = setTimeout('ScrollDocument('+n+')',1); scrollBy(0,8); } var scrollup = document.getElementById('scrollup'); var scrolldown = document.getElementById('scrolldown'); if (!scrollup) { scrollup = document.createElement('img'); scrollup.id = 'scrollup'; scrollup.src = ScrollUpImage; scrollup.alt = 'Click/Dbl-Click'; scrollup.style.position = 'absolute'; scrollup.style.display = 'none'; scrollup.ondblclick = function anonymous() { ScrollDocument(-1000); } scrollup.onclick = function anonymous() { ScrollDocument(-16); } document.body.appendChild(scrollup); } if (!scrolldown) { scrolldown = document.createElement('img'); scrolldown.id = 'scrolldown'; scrolldown.src = ScrollDownImage; scrolldown.alt = 'Click/Dbl-Click'; scrolldown.style.position = 'absolute'; scrolldown.style.display = 'none'; scrolldown.ondblclick = function anonymous() { ScrollDocument(1000); } scrolldown.onclick = function anonymous() { ScrollDocument(16); } document.body.appendChild(scrolldown); } if (document.body.scrollTop <= 0) clearTimeout(Scroller); if (document.body.scrollTop >= document.body.scrollHeight - document.body.offsetHeight) clearTimeout(Scroller); scrollup.style.left = document.body.offsetWidth - parseInt(scrollup.width); scrolldown.style.left = document.body.offsetWidth - parseInt(scrolldown.width); scrollup.style.top = document.body.scrollTop; scrolldown.style.top = document.body.scrollTop + document.body.offsetHeight - parseInt(scrolldown.height); if (document.body.scrollTop != 0) { scrollup.style.display = ''; } else { scrollup.style.display = 'none'; } if (document.body.scrollTop < document.body.scrollHeight - document.body.offsetHeight) { scrolldown.style.display = ''; } else { scrolldown.style.display = 'none'; } } function ScrollEvent() { if (event.wheelDelta >= 120) { ScrollDocument(-4); } else { if (event.wheelDelta <= -120) ScrollDocument(4); } } function InitScroller() { document.body.style.height = '100%'; setInterval('ScrollDocument()',1000); document.onmousewheel=ScrollEvent; } //============================================================================= var EdgTabs_Selected = null; var TabImage = 'Resources.axd?res=tab.gif'; var TabLeftImage = 'Resources.axd?res=tableft.gif'; var TabRightImage = 'Resources.axd?res=tabright.gif'; var SelectedTabImage = 'Resources.axd?res=tabselected.gif'; var SelectedTabLeftImage = 'Resources.axd?res=tabselectedleft.gif'; var SelectedTabRightImage = 'Resources.axd?res=tabselectedright.gif'; var EmptyTabImage = 'Resources.axd?res=tabempty.gif'; function EdgTabsInit() { EdgTabs_Selected = document.getElementById('EdgTabs_Selected'); } function EdgTabsSelect(Element) { if (EdgTabs_Selected != null) { EdgTabs_Selected.innerHTML = EdgTabs_Selected.innerHTML.replace(SelectedTabLeftImage, TabLeftImage).replace(SelectedTabRightImage, TabRightImage); EdgTabs_Selected.style.backgroundImage = 'url(' + TabImage + ')'; } Element.innerHTML = Element.innerHTML.replace(TabLeftImage, SelectedTabLeftImage).replace(TabRightImage, SelectedTabRightImage); Element.style.backgroundImage = 'url(' + SelectedTabImage + ')'; if (EdgTabs_Selected != Element) EdgTabs_Selected = Element; } //============================================================================= function EdgViewInit() { var EdgViewCaptionContainer = document.getElementById('EdgViewCaptionContainer'); var EdgViewSystemContainer = document.getElementById('EdgViewSystemContainer'); var EdgViewCustomContainer = document.getElementById('EdgViewCustomContainer'); if (EdgViewCaptionContainer) EdgViewCaptionContainer.style.position = 'relative'; if (EdgViewSystemContainer) EdgViewSystemContainer.style.position = 'relative'; if (EdgViewCustomContainer) EdgViewCustomContainer.style.position = 'relative'; document.body.onscroll = function Anonymous(e) { if (!e) e = event; if (EdgViewCaptionContainer) EdgViewCaptionContainer.style.left = document.body.scrollLeft; if (EdgViewSystemContainer) EdgViewSystemContainer.style.left = document.body.scrollLeft; if (EdgViewCustomContainer) EdgViewCustomContainer.style.left = document.body.scrollLeft; } }