var popup;

function initPopup()
{
	popup = document.getElementById("popup-block");
	var shadow = document.getElementById("popup-shadow");
	var page = document.getElementById("page");
	var _height = document.body.offsetHeight;
	var _page_height = page.offsetHeight;
	if (_height > _page_height)
		shadow.style.height = _height + "px";
	else {
		shadow.style.height = _page_height + "px";
	}
	var _close = document.getElementById("close");
	var _buttons = document.getElementsByTagName("a");
	for (var i=0; i<_buttons.length; i++) {
		if (_buttons[i].className == "enab-popup") {
			_buttons[i].onclick = function()
				{
					popup.style.left = "0";
		                }
		}
	}

	/*_close.onclick = function()
		{
			popup.style.left = "-9999px";
                }*/
}

if (window.addEventListener){
	window.addEventListener("resize", initPopup, false);
	window.addEventListener("load", initPopup, false);
}
else if (window.attachEvent){
	window.attachEvent("onresize", initPopup);
	window.attachEvent("onload", initPopup);
}
