var browser = navigator.appName;
var b_version = navigator.appVersion;
var version = parseFloat(b_version);
var winSize = "";


function getScrollXY() {

   
    var scrOfX = 0, scrOfY = 0;

    if (typeof (window.pageYOffset) == 'number') {
        scrOfY = window.pageYOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        scrOfY = document.body.scrollTop;

    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        scrOfY = document.documentElement.scrollTop;

    }
   
    return scrOfY;
}

function browserSize() {

    
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        winW = window.innerWidth;
        winH = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        winW = document.documentElement.clientWidth;
        winH = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        winW = document.body.clientWidth;
        winH = document.body.clientHeight;
    }

   
    return { w: winW, h: winH };

}

winSize = browserSize();

function DivSize(div) {
    
    
    if (browser != "Netscape") {
        mW = document.getElementById(div).offsetWidth;
        mH = document.getElementById(div).offsetHeight;
    } else {
        mW = document.getElementById(div).innerWidth;
        mH = document.getElementById(div).offsetHeight;
    }

    return { w: mW, h: mH };
}

function centerDiv(div) {
    scrollR = getScrollXY();
    

    cDiv = DivSize(div);
    if (((winSize.h - cDiv.h + scrollR) / 2) <= 10) {
        document.getElementById(div).style.top = 11 + scrollR + "px";
    } else {
        document.getElementById(div).style.top = (winSize.h - cDiv.h) / 2 + scrollR + "px";
    }
    document.getElementById(div).style.left = (winSize.w - cDiv.w) / 2 + "px";

}

function fillScreen(div) {
    scrollR = getScrollXY();
   
    
    
    document.getElementById(div).style.height = (winSize.h + scrollR + 100) + "px";
}

function show(div) {
    document.getElementById(div);
    document.getElementById(div).style.display = "block";

}
function hide(div) {
    document.getElementById(div).style.display = "none";
}

function hideshow(div){
	if(document.getElementById(div) != undefined){
		if(document.getElementById(div).style.display == "none" || document.getElementById(div).style.display == ""){
			document.getElementById(div).style.display = "block";
		}else{
			document.getElementById(div).style.display = "none";
		}
	}
}


function ChangeSizeBet(divOne, divTwo, dif) {

   
    if (document.getElementById(divOne) != undefined && document.getElementById(divTwo) != undefined && document.getElementById(divOne) != "null" && document.getElementById(divTwo) != "null") {
       
        SizeOne = DivSize(divOne);
        SizeTwo = DivSize(divTwo);

        if (SizeOne.h < SizeTwo.h) {
            document.getElementById(divOne).style.height = (Number(SizeTwo.h) - dif) + "px";

        } else {
            document.getElementById(divTwo).style.height = (Number(SizeOne.h) - dif) + "px";
        }
        

    }

}

function MaxHeight(div, dif) {

    browserSize = browserSize();
    if (document.getElementById(div) != undefined) {
        document.getElementById(div).style.height = (Number(browserSize.h) - dif) + "px";
    }


}

function logonScreen() {
   
  
    fillScreen('blackLogonDiv');
    
    show('blackLogonDiv');
    show('formLogonDiv');
    centerDiv('formLogonDiv');

}

function closeLogon() {
   
    hide('blackLogonDiv');
    hide('formLogonDiv');
}

