	var boxHeight = 0;
function showContent(){
	var el = document.getElementById('popup_wrapper');

	el.style.display = 'block';
	
			arrayPageSize = getPageSize();
	

	arrayPageScroll = getPageScroll();
	boxHeight = el.offsetHeight;
  

	topPosition = arrayPageSize[3]/2-boxHeight/2+arrayPageScroll[1];
	leftPosition = arrayPageSize[2]/2-el.offsetWidth/2+arrayPageScroll[0];

	if(topPosition > 0) {
		el.style.top = topPosition+"px";
	}
		
	if(topPosition < 0) {
		el.style.top = "10px";
	}
	
	if(leftPosition > 0) {
		el.style.left = leftPosition+"px";
	}
	showOverlay();

 
  

}

function setWrapperHeight() {

    var el = document.getElementById('popup_wrapper');




}

function hideContent() {
	document.getElementById('popup_wrapper').style.display = 'none';
	document.getElementById('overlay').style.display = 'none';
	return false;
}

function showOverlay(){
	el = document.getElementById('overlay');
	windowHeight = arrayPageSize[1];

	if(windowHeight >= boxHeight) {
		el.style.height = windowHeight+"px";
	}
	else {
		el.style.height = boxHeight+"px";
	}
	el.style.display = "block";
	return false;
}

function getPageSize(){
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}

function activateSifr(awebroot){
	if(typeof sIFR == "function")
	{
		sIFR.replaceElement("h1", awebroot+"img/portal/impact.swf", "#176221", null, null, null, 0, 0, 0, 0, null, null, "transparent");
		sIFR.replaceElement("h2", awebroot+"img/portal/impact.swf", "#A5BF00", null, null, null, 0, 0, 0, 0, null, null, "transparent");
	};
}
