﻿<!--
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 getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}
function SetContent(popupContainer) {
	if (document.getElementById) {
		var windowHeight = 200;
		var windowWidth = getWindowWidth();
		if (windowHeight > 0) {
			var contentElement = document.getElementById(popupContainer);
			var contentHeight = contentElement.offsetHeight;
			var contentWidth = 400;
			contentElement.style.display = "block";
			document.getElementById("shade").style.display = "block";
			
			if (windowHeight - contentHeight > 0) {
				contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
			}
			else {
				contentElement.style.top = '200px';
			}
			
			
			if (windowWidth - contentWidth > 0) {
				contentElement.style.left = '200px';
			}

		}
	}
}

function CloseContent(popupContainer)
{
    document.getElementById(popupContainer).style.display = "none";
    document.getElementById("shade").style.display = "none";
}

//-->



