﻿function closeSession(){
if (event.altKey==true && event.keyCode==0){document.location.href="Session_End.aspx";}
Xwidth=window.document.body.offsetWidth-window.event.clientX;
YHeight=window.event.clientY;
if(Xwidth<=30&&YHeight<0){document.location.href="Session_End.aspx";}
}

function NewCG(strPage,_target,_top,_left,_width,_height,_resizable,_menubar,_status,_scrollbars,_toolbar,_location){
var xParam='';
var xLength=0;
if (strPage==null) {return(false);}
if (strPage=='?') {return(false);}  
if (_target==null) {_target='_blank';}
if (_top!=null) {xParam=xParam +'top=' + _top + ',';}
if (_left!=null) {xParam=xParam +'left=' + _left + ',';}
if (_width!=null) {xParam=xParam +'width=' + _width + ',';}
if (_height!=null) {xParam=xParam +'height=' + _height + ',';}
if (_resizable!=null) {xParam=xParam +'resizable=' + _resizable + ',';}
if (_menubar!=null) {xParam=xParam +'menubar=' + _menubar + ',';}
if (_status!=null) {xParam=xParam +'status=' + _status + ',';}
if (_scrollbars!=null) {xParam=xParam +'scrollbars=' + _scrollbars + ',';}
if (_toolbar!=null) {xParam=xParam +'toolbar=' + _toolbar + ',';}
if (_location!=null) {xParam=xParam +'location=' + _location + ',';}
xLength=xParam.length;
xLength=xLength-1;
xParam=xParam.substring(0,xLength);
if (_target=="_blank") {document.getElementById("progress").style.display = "none";/*window.document.all("progress").style.display = "none";*/};
var array = strPage.split(".aspx?");
var windowTitle = "DOL";
if (array.length > 1) windowTitle = array[0];      	    
if (_target=='_parent'){window.open(strPage,_target,xParam);}
else{windowTitle = windowTitle.replace( new RegExp( "(\\W)+", "g" ), "_" ); window.open(strPage,windowTitle,xParam);}
}

function JavaUrlEncode(xStrString){
xStrString= escape(xStrString);
return(xStrString)
}

function ShowErrorWindow(strMsg){
window.document.all("progress").style.display = "none";
window.document.all("ErrorWindow").style.display = "block";
window.document.all("txtError").innerText=strMsg
}

function CloseErrorWindow(){
window.document.all("ErrorWindow").style.display = "none";
}

function imgCloseError_onclick(){
CloseErrorWindow();
return(true)
}

function getWSize() {
var myWidth = 0, myHeight = 0;
if(typeof(window.innerWidth)=='number') {
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && (document.body.clientWidth || document.body.clientHeight ) ) {
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
return [myHeight, myWidth];
}

function getScrollXY() {
var scrOfX = 0, scrOfY = 0;
if(typeof(window.pageYOffset)=='number') {
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)){
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;
} else if(document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
}
return [scrOfX, scrOfY];
}

function loadProgress(){
var oNode;
if (document.all) oNode  = document.all.progress;
if (document.layers) oNode  = document.progress;
if ((!document.all && document.getElementById) || (navigator.userAgent.indexOf("Opera")!=-1
    && document.getElementById)) oNode = document.getElementById('progress');
var k = new Array();
k=getWSize();
kk=getScrollXY();
try {
oNode.style.top=parseInt(kk[1]+k[0]/2)+"px";
oNode.style.left=parseInt(kk[0]+k[1]/2)+"px";
} catch (err) { }
k=null;
kk=null;
if (document.getElementById){oNode.style.display="block";}
else{
if (document.layers){oNode.visibility = "visible";}
else{oNode.style.visibility = "visible";}
}
}

function unloadProgress(){
if (document.getElementById){document.getElementById('progress').style.display="none";}
else{
if (document.layers){document.progress.visibility = "hidden";}
else{document.all.progress.style.visibility = "hidden";}
}
}

function beginRequest(sender, args){
var oNode;
if (document.all) oNode  = document.all.AjaxProgress;
if (document.layers) oNode  = document.AjaxProgress;
if ((!document.all && document.getElementById) || (navigator.userAgent.indexOf("Opera")!=-1
    && document.getElementById)) oNode = document.getElementById('AjaxProgress');
var k = new Array();
var kk = new Array();
k=getWSize();
kk=getScrollXY();
oNode.style.top=parseInt(kk[1]+k[0]/2)+"px";
oNode.style.left=parseInt(kk[0]+k[1]/2)+"px";
k=null;
kk=null;
}

function EndRequestHandler(sender, args){
unloadProgress();
}










