function PopupManager() {
	this.open = function(windowTitle, windowWidth, windowHeight, contentID) {
	    var newWidth = windowWidth
	    var newHeight = windowHeight
	    if (getActiveStyleSheet() == 'large'){
	        newWidth += 10;
	        newHeight += 30;
	    }
	    if (getActiveStyleSheet() == 'huge'){
	        newWidth += 45;
	        newHeight += 60;
	    }
	    var googlewin=dhtmlwindow.open("dhtmlWindow", "inline", "<div class='dhtmlPopupContent'>"+document.getElementById(contentID).innerHTML+"</div>", windowTitle, "width="+newWidth+"px,height="+newHeight+"px,resize=0,scrolling=0,center=1", "recal");
	
		if(document.body.scrollTop>0) {
			sTop=document.body.scrollTop;
		}
		else {
			sTop=document.documentElement.scrollTop;
		}
		googlewin.style.top=(sTop+200)+"px";
	}

}

var PopupManager = new PopupManager();

function openDPopUp(url,target,w,h,scroll,resize,status,center)
{
		w=	dhtmlwindow.open(target, "iframe", url, target, "width="+w+"px,height="+h+"px,resize="+resize+",scrolling="+scroll+",center="+center, "recal");
		if(document.body.scrollTop>0) {
			sTop=document.body.scrollTop;
		}
		else {
			sTop=document.documentElement.scrollTop;
		}

	w.style.top=(sTop+200)+"px";
}

function openPopUp(url,target,w,h,scroll,resize,status,center)
{
	try{
	var settings = "";
	if (center == 1)
	{
		var l = (screen.width-w)/2;
		var t = (screen.height-h)/2;
		settings = ",left="+l+",top="+t;
	}
	
	w = window.open(url, target, "toolbar=0,scrollbars="+scroll+",location=0,statusbar="+status+",menubar=0,resizable="+resize+",width="+w+",height="+h+settings);

	if(document.body.scrollTop>0) {
			sTop=document.body.scrollTop;
		}
		else {
			sTop=document.documentElement.scrollTop;
		}
	w.style.top=(sTop+200)+"px";
	} catch(e){}
}
