﻿var bCancelAutoOut=false;var timeout;function ResetTimeout(){clearInterval(timeout);window.setTimeout("TimeoutWarn()",1620000);document.getElementById("lblautoout").innerHTML="120";if(bCancelAutoOut==true){jQuery.post(navfromroot("/staff/sesrefresh.aspx"),null,function(a){if(a=="ok"){bCancelAutoOut=false;}else{TimeoutRedirect();}});}}function TimeoutWarn(){showPopup("loutwarn",350);timeout=window.setInterval("adjustAutoOut()",1000);}function adjustAutoOut(){if(bCancelAutoOut==true){ResetTimeout();}else{var b=document.getElementById("lblautoout");var a=parseInt(b.innerHTML);if(a==0){TimeoutRedirect();}else{a--;b.innerHTML=a;}}}function cancelAutoOut(){bCancelAutoOut=true;hidePopup("loutwarn");}function TimeoutRedirect(){clearInterval(timeout);var a="You have been inactive for 30 minutes, therefore, your session has terminated and you have been logged out.";window.location=navfromroot("/staff/loginconflict.aspx?id=o&msg="+a);}function navfromroot(b){var a=window.location.href.replace(window.location.search,"");a=a.replace(window.location.pathname,b);return a;}function whatBrowser(){var a=0;a=navigator.userAgent.indexOf("Chrome");if(a>-1){return"chrome";}else{a=navigator.userAgent.indexOf("Firefox");if(a>-1){return"firefox";}else{a=navigator.userAgent.indexOf("MSIE");if(a>-1){return"ie";}else{a=navigator.userAgent.indexOf("Safari");if(a>-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(){}function IE6Static(){var c=22;var b=GetScrollY(false);var a=document.getElementById("bg");a.style.top=(b+c)+"px";window.setTimeout("IE6Static()",10);}function positionProgImg(){var d=document.getElementById("prg");if(d!=null){var a=document.getElementById("body");var b=(a.offsetWidth/2)-(d.offsetWidth/2);var c=(a.offsetHeight/2)-(d.offsetHeight/2);d.style.top=c+"px";d.style.left=b+"px";}}function hoverGraphic(e,b,d,c){var a=document.getElementById("divHover");if(!d){d=0;}if(!c){c=0;}if(b==true){a.style.top=(e.offsetTop-18+c)+"px";a.style.left=(5+d)+"px";a.style.visibility="visible";}else{a.style.visibility="hidden";}}function waitButton(b){if(document.createElement){var a=document.createElement("button");a.className=b.className;a.disabled=true;a.innerHTML="Please wait...";b.parentNode.insertBefore(a,b);b.style.display="none";}return true;}function swapImage(f,g){var a=f.src;var b=a.indexOf("_");if(b>-1){var d=a.indexOf(".",b);if(d>-1){var c=a.substring(d+1,d+4);a=a.substring(0,b)+"_"+g+"."+c;f.src=a;}}}function showPopup(b,a){placePopup(b,a);if(isIE6()){AbleElements("hidden");}document.documentElement.style.overflow="hidden";document.body.scroll="no";document.getElementById("lBGDim").style.visibility="visible";document.getElementById(b).style.visibility="visible";}function AbleElements(a){var d=document.getElementById("aspnetForm").elements;for(var c=0;c<d.length;c++){if(d[c].type=="select-one"){if((d[c].name.indexOf("lbOilWell")==-1)&&(d[c].name.indexOf("lbFields")==-1)){d[c].style.visibility=a;}}}}function placePopup(h,e){var c=document.getElementById("lBGDim");var b=document.getElementById(h);var g=GetScrollX();var f=GetScrollY(true);c.style.top=f+"px";c.style.height=document.documentElement.clientHeight+"px";c.style.left=g+"px";c.style.width=document.documentElement.clientWidth+"px";b.style.width=e+"px";var a=(document.documentElement.clientWidth/2)-(e/2)+g;var d=(document.documentElement.clientHeight/2)-(b.offsetHeight/2)+f;b.style.top=d+"px";b.style.left=a+"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="";}function setReady(){jQuery(document).ready(function(){jQuery("#headflash").supersleight({shim:"/images/v2/x.gif"});jQuery("#li1").hover(function(){swapImage(document.getElementById("imgLogo1"),"s");doLogo(1,"show",true);},function(){swapImage(document.getElementById("imgLogo1"),"u");doLogo(1,"hide",true);});jQuery("#li2").hover(function(){swapImage(document.getElementById("imgLogo2"),"s");doLogo(2,"show",true);},function(){swapImage(document.getElementById("imgLogo2"),"u");doLogo(2,"hide",true);});jQuery("#li3").hover(function(){swapImage(document.getElementById("imgLogo3"),"s");doLogo(3,"show",true);},function(){swapImage(document.getElementById("imgLogo3"),"u");doLogo(3,"hide",true);});jQuery("#ul1").hover(function(){doLogo(1,"show",true);},function(){doLogo(1,"hide",true);});jQuery("#ul2").hover(function(){doLogo(2,"show",true);},function(){doLogo(2,"hide",true);});jQuery("#ul3").hover(function(){doLogo(3,"show",true);},function(){doLogo(3,"hide",true);});if(window.body_ready!=null){window.body_ready();}var a=jQuery(document).height()-jQuery("#headwrapper").height();if(jQuery.browser.msie==true){a-=4;}if(jQuery("#bodywrapper").height()<a){jQuery("#bodywrapper").height(a);}if(jQuery.browser.msie==true){if(jQuery.browser.version<8){jQuery("#nav").parents().each(function(){var b=jQuery(this);var c=b.css("position");if(c=="relative"||c=="absolute"||c=="fixed"){b.hover(function(){jQuery(this).addClass("on-top");},function(){jQuery(this).removeClass("on-top");});}});if(jQuery.browser.version<7){}}}});}var showLogo=new Array(false,false,false);function doLogo(e,d,a){var b=jQuery("#divLogo"+e);var c=b.position();if(d.toLowerCase()=="show"){if(a==true){showLogo[e-1]=true;}if(showLogo[e-1]==true){b.slideDown("fast");}}else{if(a==true){showLogo[e-1]=false;}if(showLogo[e-1]==false){b.slideUp("fast");}}}
