function getDocumentSize() {
	var w = 0;
	if (document.body && document.body.offsetWidth) w = document.body.offsetWidth;
	if (document.documentElement && document.documentElement.offsetWidth ) w = document.documentElement.offsetWidth;
	if (window.innerWidth) w = window.innerWidth;
	
	var h = 0;
	h = Math.max(
			Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
			Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
			Math.max(document.body.clientHeight, document.documentElement.clientHeight)
	);
		
	return {width:w, height:h}; 				
}	

function showZPMABanner() {
	if (document.getElementById("ba-overlay") != null) return;
	
	var flashEl = document.getElementById("top_banner_container");
	var _body = document.getElementsByTagName('body')[0];
		
	//set flash holder height
	var flashlHolder = flashEl.parentNode;
	//flashlHolder.style.height = '515px';
	flashlHolder.style.zIndex = 2001;
	
	//set flash height
	var flashObj = flashEl.getElementsByTagName('object')[0];
	flashObj.setAttribute('height', '515');
	
	// create overlay
	docSize = getDocumentSize();
	var overlay = document.createElement('div');
	overlay.setAttribute('id', 'ba-overlay');
	overlay.style.width = docSize.width+"px";
	overlay.style.height = docSize.height+"px";		
	_body.appendChild(overlay);
	
}


function hideZPMABanner() {
	var overlay = document.getElementById("ba-overlay");
	var _body = document.getElementsByTagName('body')[0];
	
	_body.removeChild(overlay); 
	
	var flashEl = document.getElementById("top_banner_container");
	var flashlHolder = flashEl.parentNode;
	//flashlHolder.style.height = '100px';
	flashlHolder.style.zIndex = 1;
	var flashObj = flashEl.getElementsByTagName('object')[0];
	flashObj.setAttribute('height', '100');		
		
}	
