﻿var bCancelAutoOut = false; function ResetTimeout() { window.setTimeout("TimeoutWarn()", 1620000); document.getElementById("lblautoout").innerHTML = "120"; bCancelAutoOut = false } function TimeoutWarn() { showPopup('loutwarn', 350); setTimeout("adjustAutoOut()", 1000) } function adjustAutoOut() { if (bCancelAutoOut == true) { ResetTimeout() } else { var a = document.getElementById("lblautoout"); var i = parseInt(a.innerHTML); if (i == 0) { TimeoutRedirect() } else { i--; a.innerHTML = i; setTimeout("adjustAutoOut()", 1000) } } } function cancelAutoOut() { bCancelAutoOut = true; hidePopup('loutwarn') } function TimeoutRedirect() { var a = "You have been inactive for 30 minutes, therefore, your session has terminated and you have been logged out."; var s = window.location.href; window.location = s.replace(window.location.pathname, "/staff/loginconflict.aspx?id=o&msg=") + a } function whatBrowser() { var i = 0; i = navigator.userAgent.indexOf("Chrome"); if (i > -1) { return "chrome" } else { i = navigator.userAgent.indexOf("Firefox"); if (i > -1) { return "firefox" } else { i = navigator.userAgent.indexOf("MSIE"); if (i > -1) { return "ie" } else { i = navigator.userAgent.indexOf("Safari"); if (i > -1) { return "safari" } else { return "unknown" } } } } } function isIE6() { if (whatBrowser() == "ie") { if (navigator.appVersion.indexOf("MSIE 6.0") > -1) { return true } } return false } function isIE7() { if (whatBrowser() == "ie") { if (navigator.appVersion.indexOf("MSIE 7.0") > -1) { return true } } return false } function GetScrollX() { switch (whatBrowser()) { case "ie": return document.documentElement.scrollLeft; break; default: return window.pageXOffset; break } } function GetScrollY(a) { switch (whatBrowser()) { case "ie": return document.documentElement.scrollTop; break; case "firefox": if (a == true) { return 0 } else { return window.pageYOffset } break; default: return window.pageYOffset; break } } function resizebody() { var a = document.getElementById('navleft'); var b = document.getElementById('navleftcontent'); var c = document.getElementById('body'); var d = document.getElementById('navbot'); var e = document.getElementById('borderleft'); var f = document.getElementById('borderright'); if (a != null) { if (a.offsetHeight > c.offsetHeight) { c.style.height = a.offsetHeight + 'px' } } var h = c.offsetHeight; if (d != null) { h += d.offsetHeight } e.style.height = h + 'px'; f.style.height = h + 'px'; if (a != null) { a.style.height = c.offsetHeight + 'px'; b.style.height = (c.offsetHeight - 8) + 'px' } if (isIE6()) { if (a != null) { a.style.marginLeft = "14px" } if (d != null) { d.style.marginLeft = a.style.marginLeft } IE6Static() } positionProgImg() } function IE6Static() { var a = 22; var b = GetScrollY(false); var c = document.getElementById('bg'); c.style.top = (b + a) + "px"; window.setTimeout("IE6Static()", 10) } function positionProgImg() { var a = document.getElementById("prg"); if (a != null) { var b = document.getElementById("body"); var c = (b.offsetWidth / 2) - (a.offsetWidth / 2); var d = (b.offsetHeight / 2) - (a.offsetHeight / 2); a.style.top = d + "px"; a.style.left = c + "px" } } function hoverGraphic(a, b, c, d) { var e = document.getElementById('divHover'); if (!c) { c = 0 } if (!d) { d = 0 } if (b == true) { e.style.top = (a.offsetTop - 18 + d) + 'px'; e.style.left = (5 + c) + 'px'; e.style.visibility = 'visible' } else { e.style.visibility = 'hidden' } } function waitButton(a) { if (document.createElement) { var b = document.createElement('button'); b.className = a.className; b.disabled = true; b.innerHTML = 'Please wait...'; a.parentNode.insertBefore(b, a); a.style.display = 'none' } return true } function swapImage(a, b) { var c = a.src; var i = c.indexOf("_"); if (i > -1) { var e = c.indexOf(".", i); if (e > -1) { var d = c.substring(e + 1, e + 4); c = c.substring(0, i) + "_" + b + "." + d; a.src = c } } } function showPopup(a, b) { placePopup(a, b); if (isIE6()) { AbleElements('hidden') } document.documentElement.style.overflow = 'hidden'; document.body.scroll = "no"; document.getElementById("lBGDim").style.visibility = 'visible'; document.getElementById(a).style.visibility = 'visible' } function AbleElements(b) { var a = document.getElementById('aspnetForm').elements; for (var i = 0; i < a.length; i++) { if (a[i].type == 'select-one') { if ((a[i].name.indexOf('lbOilWell') == -1) && (a[i].name.indexOf('lbFields') == -1)) { a[i].style.visibility = b } } } } function placePopup(a, b) { var c = document.getElementById("lBGDim"); var d = document.getElementById(a); var e = GetScrollX(); var f = GetScrollY(true); c.style.top = f + "px"; c.style.height = document.documentElement.clientHeight + "px"; c.style.left = e + "px"; c.style.width = document.documentElement.clientWidth + "px"; var g = (document.documentElement.clientWidth / 2) - (b / 2) + e; var h = (document.documentElement.clientHeight / 2) - (d.offsetHeight / 2) + f; d.style.top = h + "px"; d.style.left = g + "px"; d.style.width = b + "px" } function hidePopup(a) { if (isIE6()) { AbleElements('visible') } document.getElementById("lBGDim").style.visibility = 'hidden'; document.getElementById(a).style.visibility = 'hidden'; document.documentElement.style.overflow = ''; document.body.scroll = '' }