﻿function display() {
    document.getElementById("pngloading").style.visibility = "hidden";
    document.getElementById("pngloading").style.height = "0px";
}
function fncEnterClick(evt, BtnID)/*Where BtnID is clientid of the button*/{
    if ($.browser.msie) /*for ie*/
    {
        if (evt.keyCode == 13) {
            document.getElementById(BtnID).click();
        }
    }
    else /*for firefox only*/
    {
        if (evt.which == 13) {
            var btnid1 = BtnID.replace(/_/g, "$");
            __doPostBack(btnid1, "");
        }
    }
}

function LoadingOverlay() {

    el = document.getElementById("overlay9");
    el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
    if (el.style.visibility == "visible") {

        document.getElementById("overlay9").style.height = GetPageHeight() + 'px';
        document.getElementById("overlay9").style.width = (GetPageWidth() - 20) + 'px';
    }
    else {
        display();

    }

}


function GetPageHeight() {
    var scrollX, scrollY, windowX, windowY, pageX, pageY;
    if (window.innerHeight && window.scrollMaxY) {
        scrollX = document.body.scrollWidth;
        scrollY = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
        scrollX = document.body.scrollWidth;
        scrollY = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        scrollX = document.body.offsetWidth;
        scrollY = document.body.offsetHeight;
    }

    if (self.innerHeight) {	// all except Explorer
        windowX = self.innerWidth;
        windowY = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowX = document.documentElement.clientWidth;
        windowY = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        windowX = document.body.clientWidth;
        windowY = document.body.clientHeight;
    }

    pageY = (scrollY < windowY) ? windowY : scrollY; // for small pages with total height less then height of the viewport
    pageX = (scrollX < windowX) ? windowX : scrollX; // for small pages with total width less then width of the viewport

    return pageY;
}
/************End of Code*****************/
/***********Please dont touch this ***************/

// Returns page height;
//
function GetPageWidth() {
    var scrollX, scrollY, windowX, windowY, pageX, pageY;
    if (window.innerWidth && window.scrollMaxX) {
        scrollY = document.body.scrollHeight;
        scrollX = window.innerWidth + window.scrollMaxX;
    } else if (document.body.scrollWidth > document.body.offsetWidth) { // all but Explorer Mac
        scrollY = document.body.scrollHeight;
        scrollX = document.body.scrollWidth;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        scrollY = document.body.offsetHeight;
        scrollX = document.body.offsetWidth;
    }

    if (self.innerWidth) {	// all except Explorer
        windowY = self.innerHeight;
        windowX = self.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
        windowY = document.documentElement.clientinnerHeight;
        windowX = document.documentElement.clientWidth;
    } else if (document.body) { // other Explorers
        windowX = document.body.clientWidth;
        windowY = document.body.clientHeight;
    }

    pageY = (scrollY < windowY) ? windowY : scrollY; // for small pages with total height less then height of the viewport
    pageX = (scrollX < windowX) ? windowX : scrollX; // for small pages with total width less then width of the viewport

    return pageX;
}


