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; 
        scrOfX = window.pageXOffset; 
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant 
        scrOfY = document.body.scrollTop; 
        scrOfX = document.body.scrollLeft; 
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode 
        scrOfY = document.documentElement.scrollTop; 
        scrOfX = document.documentElement.scrollLeft; 
    } 
    return { x: scrOfX, y: scrOfY }; 
} 

function browserSize() {

    
    if (typeof (window.innerWidth) == 'number') {
       
        winW = window.innerWidth;
        winH = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
     
        winW = document.documentElement.clientWidth;
        winH = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        
        winW = document.body.clientWidth;
        winH = document.body.clientHeight;
    }

   
    return { w: winW, h: winH };

}



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 posMenu(div){
	div = document.getElementById(div);
	/* dSize = DivSize(div);
	topPos = ((winSize.h-dSize.h)/2);
	if(topPos<0){
		topPos = 0;
	}*/
	scrollPos = getScrollXY();
	
	div.style.top =  110 + "px"; 
	div.style.left = scrollPos.x + "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";
    }


}







var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var fullVersion  = ''+parseFloat(navigator.appVersion); 
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;

// In MSIE, the true version is after "MSIE" in userAgent
if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 browserName = "Microsoft Internet Explorer";
 fullVersion = nAgt.substring(verOffset+5);
}
// In Opera, the true version is after "Opera" 
else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 browserName = "Opera";
 fullVersion = nAgt.substring(verOffset+6);
}
// In Chrome, the true version is after "Chrome" 
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
 browserName = "Chrome";
 fullVersion = nAgt.substring(verOffset+7);
}
// In Safari, the true version is after "Safari" 
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
 browserName = "Safari";
 fullVersion = nAgt.substring(verOffset+7);
}
// In Firefox, the true version is after "Firefox" 
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
 browserName = "Firefox";
 fullVersion = nAgt.substring(verOffset+8);
}
// In most other browsers, "name/version" is at the end of userAgent 
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) ) 
{
 browserName = nAgt.substring(nameOffset,verOffset);
 fullVersion = nAgt.substring(verOffset+1);
 if (browserName.toLowerCase()==browserName.toUpperCase()) {
  browserName = navigator.appName;
 }
}
// trim the fullVersion string at semicolon/space if present
if ((ix=fullVersion.indexOf(";"))!=-1) fullVersion=fullVersion.substring(0,ix);
if ((ix=fullVersion.indexOf(" "))!=-1) fullVersion=fullVersion.substring(0,ix);

majorVersion = parseInt(''+fullVersion,10);
if (isNaN(majorVersion)) {
 fullVersion  = ''+parseFloat(navigator.appVersion); 
 majorVersion = parseInt(navigator.appVersion,10);
}



window.onscroll = function()
{
	
	if(browserName == "Microsoft Internet Explorer" && (fullVersion == "6.0" || fullVersion == "5.5")){
		document.getElementById('Menu').style.position = "absolute";
		document.getElementById('Menu').style.top = "110px";
				posMenu('Menu');
	} 
}
window.onload = function() {
	winSize = browserSize();
	
	if(browserName == "Microsoft Internet Explorer" && (fullVersion == "6.0" || fullVersion == "5.5")){
		document.getElementById('Menu').style.position = "absolute";
		document.getElementById('Menu').style.top = "110px";
		
		posMenu('Menu');
		alert('dome');
	}else{
		
	}
}
