// JavaScript Document

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 displayPopup(id) {
	var nom = "popup" + id;
	var h_global = document.getElementById('global').offsetHeight;
	var h_document = getWindowHeight();
	document.getElementById(nom).style.top = getOffsetY(nom) + "px";
	document.getElementById(nom).style.visibility = 'visible';
}

function hidePopup(id) {
	var nom = "popup" + id;
	document.getElementById(nom).style.visibility = 'hidden';
}
