// JavaScript Document

var nbElem = 5;
var timer;

function display(elemId) {
	clearTimeout(timer);
    if (document.getElementById) {
		for (i = 1; i <= nbElem; i++) {
			tab = "menu" + i;
			document.getElementById(tab).style.visibility = (i == elemId) ? 'visible' : 'hidden';
		}
	}
}

function hide() {
    if (document.getElementById) {
		for (i = 1; i <= nbElem; i++) {
			tab = "menu" + i;
			document.getElementById(tab).style.visibility = 'hidden';
		}
	}
}

function hideCountDown() {
	timer = setTimeout("hide()", 1000);
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight=window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function getOffsetY(tab) {
	var hDiv = document.getElementById(tab).offsetHeight;
	var hDoc = getWindowHeight();
	var offsetY = 0;
	if (navigator.appName=="Microsoft Internet Explorer") {
		offsetY = document.documentElement.scrollTop + (hDoc - hDiv) / 2;
	} else {
		offsetY = window.pageYOffset + (hDoc - hDiv) / 2;
	}
	return offsetY;
}

function displayZoom(tab) {
	document.getElementById(tab).style.top = getOffsetY(tab) + "px";
	document.getElementById(tab).style.visibility = 'visible';
}

function hideZoom(tab) {
	document.getElementById(tab).style.visibility = 'hidden';
}