// JavaScript Document
var iid;

function showme( w, h, elem ) {
	//
	//	allow for the border
	//
	if (window.innerHeight && window.scrollMaxY) {// Firefox         
		yWithScroll = window.innerHeight + window.scrollMaxY - 1;         
		xWithScroll = window.innerWidth + window.scrollMaxX - 1;     
	} else if (parent.document.body.scrollHeight > parent.document.body.offsetHeight){ // all but Explorer Mac         
		yWithScroll = parent.document.body.scrollHeight - 1;         
		xWithScroll = parent.document.body.scrollWidth - 1;     
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari         
		yWithScroll = parent.document.body.offsetHeight - 1;         
		xWithScroll = parent.document.body.offsetWidth - 1;       
	} 
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		pw = parent.window.innerWidth - 16;
		ph = parent.window.innerHeight - 16;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		pw = parent.document.documentElement.clientWidth + 20;
		ph = parent.document.documentElement.clientHeight + 20;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		pw = parent.document.body.clientWidth + 20;
		ph = parent.document.body.clientHeight + 20;
	}

	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = parent.window.pageYOffset;
		scrOfX = parent.window.pageXOffset;
	} else {
		//DOM compliant
		scrOfY = parent.document.body.scrollTop;
		scrOfX = parent.document.body.scrollLeft;
	}

	newleft = (pw - w) / 2 + scrOfX;
	newtop = (ph - h) / 2 + scrOfY;

	var ff = parent.document.getElementById(elem.name);

	ff.style.visibility="visible";
	ff.style.width=w + "px";
	ff.style.height=h + "px";
	ff.style.left = newleft + "px";
	ff.style.top = newtop + "px";

	var oo = parent.document.getElementById('overlay');
	changeOpac(40, 'overlay')
	oo.style.visibility="visible";
	oo.style.width=xWithScroll + "px";
	oo.style.height=yWithScroll + "px";

	iid = window.setInterval("scrollme('" + elem.name + "')",500);
	
}

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
	var object = parent.document.getElementById(id).style; 
	object.opacity = (opacity / 100); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
	object.filter = "alpha(opacity=" + opacity + ")"; 
		} 
 
function closeframe( id ) 
{ 
	var oo = parent.document.getElementById('overlay');
	oo.style.width = "1px";
	oo.style.height = "1px";
	oo.style.visibility="hidden";
	
	var ff = parent.document.getElementById(id);
	ff.src="/scripts/blank.htm";
	ff.style.left = "1px";
	ff.style.top = "1px";
	ff.style.width = "1px";
	ff.style.height = "1px";
	ff.style.visibility="hidden";

	window.clearInterval(iid);
} 
function scrollme( id ) {

	if (window.innerHeight && window.scrollMaxY) {// Firefox         
		yWithScroll = window.innerHeight + window.scrollMaxY - 1;         
		xWithScroll = window.innerWidth + window.scrollMaxX - 1;     
	} else if (parent.document.body.scrollHeight > parent.document.body.offsetHeight){ // all but Explorer Mac         
		yWithScroll = parent.document.body.scrollHeight - 1;         
		xWithScroll = parent.document.body.scrollWidth - 1;     
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari         
		yWithScroll = parent.document.body.offsetHeight - 1;         
		xWithScroll = parent.document.body.offsetWidth - 1;       
	} 
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		pw = parent.window.innerWidth - 16;
		ph = parent.window.innerHeight - 16;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		pw = parent.document.documentElement.clientWidth + 20;
		ph = parent.document.documentElement.clientHeight + 20;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		pw = parent.document.body.clientWidth + 20;
		ph = parent.document.body.clientHeight + 20;
	}

	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = parent.window.pageYOffset;
		scrOfX = parent.window.pageXOffset;
	} else {
		//DOM compliant
		scrOfY = parent.document.body.scrollTop;
		scrOfX = parent.document.body.scrollLeft;
	}


	var ff = parent.document.getElementById(id);

	w = ff.style.width;
	h = ff.style.height;

	newleft = (pw - (w.replace('px','')) ) / 2 + scrOfX;
	newtop = (ph - (h.replace('px','')) ) / 2 + scrOfY;

	ff.style.left = newleft + "px";
	ff.style.top = newtop + "px";

	var oo = parent.document.getElementById('overlay');
	oo.style.width=xWithScroll + "px";
	oo.style.height=yWithScroll + "px";
}


