//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function loadwindow(url,width,height,title){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
if (!title) title = "";

if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) {	
	yScroll = window.innerHeight + window.scrollMaxY;
	xScroll = window.innerWidth + window.scrollMaxX;
} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
	yScroll = document.body.scrollHeight;
	xScroll = document.body.scrollWidth;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
	yScroll = document.body.offsetHeight;
	xScroll = document.body.offsetWidth;
}

if (self.pageYOffset || self.pageXOffset) {
	yScrolltop = self.pageYOffset;
} else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){	 // Explorer 6 Strict
	yScrolltop = document.documentElement.scrollTop;
} else if (document.body) {// all other Explorers
	yScrolltop = document.body.scrollTop;
}

de = document.documentElement;
wPage = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
hPage = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight

srcDoc = document;
overlayDiv = srcDoc.createElement('div');
overlayDiv.setAttribute('id','mcOverlayDiv');
overlayDiv.style.position = 'absolute';
overlayDiv.style.zIndex = '100';
overlayDiv.style.width = xScroll+'px';
overlayDiv.style.height = yScroll+'px';
overlayDiv.style.top = '0px';
overlayDiv.style.left = '0px';
overlayDiv.style.minHeight = '100%';
overlayDiv.style.background = '#000';
overlayDiv.style.filter = 'alpha(opacity=60)';
overlayDiv.style.mozOpacity = '0.6';
overlayDiv.style.opacity = '0.6';
srcDoc.body.appendChild(overlayDiv);
		
document.getElementById("DWcontent").style.height=initialheight=height-25+"px"
document.getElementById("DWdiv").style.display=''
document.getElementById("DWdiv").style.width=initialwidth=width+"px"
document.getElementById("DWdiv").style.height=initialheight=height+"px"
document.getElementById("DWdiv").style.left=(xScroll-width)/2+"px";
document.getElementById("DWdiv").style.top=(yScrolltop+(hPage-height)/2)+"px";
//(arrayPageScroll[1] + (pagesize[1]-TB_HEIGHT)/2)
if (ns6) document.getElementById("DWtitle").textContent=title;
else document.getElementById("DWtitle").innerText=title;
document.getElementById("DWframe").src=url
}
}

function closeit(){
document.getElementById("DWdiv").style.display="none";
document.body.removeChild(document.getElementById("mcOverlayDiv"));
}


