
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 getBodyScrollTop()
{
	return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
	return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function getClientCenterX()
{
		var arrayPageSize = getPageSize();
		var hei=arrayPageSize[1];
		var wid=document.body.scrollWidth;

	return parseInt(wid/2);
}

function getClientCenterY()
{
		var arrayPageSize = getPageSize();
		var hei=arrayPageSize[1];
		var wid=document.body.scrollWidth;

	return parseInt(hei/2)+getBodyScrollTop();
}


	function maximize() {
		var width=800;
		var height=470;
		var arrayPageSize = getPageSize();
		var hei=arrayPageSize[1]-4;
		var wid=document.body.scrollWidth;

		var half_width=width/2;
		var half_height=height/2;

		document.getElementById('shaded').style.height=hei+"px";
		document.getElementById('shaded').style.width=wid+"px";

		if((getClientCenterY()-half_height)>0) var tp=getClientCenterY()-half_height-60-110; else var tp=10;

		document.getElementById('infoiframe_div').style.top=tp+"px";
		document.getElementById('infoiframe_div').style.left=(getClientCenterX()-half_width)+"px";

		document.getElementById('infoiframe_div').style.width=width+"px";
		document.getElementById('infoiframe_div').style.height=height+"px";
	
		document.getElementById('shaded').className="shaded_vis";
		document.getElementById('infoiframe_div').className="infoiframe_visible";			
	}


	function minimize() {
		document.getElementById('shaded').className="shaded_hid";
		document.getElementById('infoiframe_div').className="infoiframe_hidden";
		window.document.vid.stop() ;
	}


