	//alert(document.getElementById("topbar").style.width);
	//alert(iecompattest().clientHeight);
	var topbarWidth = 300;
	var topbarHeight = 150;
	var persistclose= 0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
	var startX = (iecompattest().clientWidth - topbarWidth)/2	//(iecompattest().clientWidth/2); //set x offset of bar in pixels
	var startY = (iecompattest().clientHeight - topbarHeight)/2 //set y offset of bar in pixels
	if(startY<=0) startY = 100;
	var verticalpos="fromtop" //enter "fromtop" or "frombottom"

	//alert(window.screen.availHeight); 
	function iecompattest()
	{
		var ret = (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
		if(ret == null){ret = document.documentElement;}
		return ret;
	}

	function closebar()
	{		
		window.resizeTo(screen.availWidth, screen.availHeight)		
		document.getElementById("topbar").style.visibility="hidden";
		document.getElementById("modalContainer").style.visibility="hidden";
	}
	
	function staticbar(strText,h,w)
	{
		topbarHeight = h + 2; 
		topbarWidth = w - 1;
		startX = (iecompattest().clientWidth - topbarWidth)/2	//(iecompattest().clientWidth/2); //set x offset of bar in pixels
		startY = (iecompattest().clientHeight - topbarHeight)/2 //set y offset of bar in pixels
		
		if(startY<=0) 
		{
			window.resizeTo(screen.width,screen.height);
			window.moveTo(0,0);
			startY = 50;
		}
		
		barheight=document.getElementById("topbar").offsetHeight;
		document.getElementById("modalContainer").style.height = document.documentElement.scrollHeight + "px";
		document.getElementById("modalContainer").style.width = document.documentElement.scrollWidth + "px";
		var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
		var d = document;
		function ml(id)
		{
			var el=d.getElementById(id);
			el.style.height = topbarHeight + "px";
			el.style.width = topbarWidth + "px";
			//el.innerHTML = strText;
			document.getElementById("topbar").innerHTML = "<iframe scrolling='no' src='"+ strText +"' frameborder='0' height='"+ h +"' width='"+ w +"'></iframe>";
			el.style.visibility="visible";
			document.getElementById("modalContainer").style.visibility="visible";
			if(d.layers)el.style=el;
			el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
			el.x = startX;
			//alert("X: " + startX);
			if (verticalpos=="fromtop")
			{
				el.y = startY;
				//alert("Y: " + startY);
			}
			else
			{
				el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
				el.y -= startY;
				//alert("Y: " + startY);
			}
			return el;
		}
		window.stayTopLeft=function()
		{
			if (verticalpos=="fromtop")
			{
				var pY = ns ? pageYOffset : iecompattest().scrollTop;
				if(pY<topbarHeight)				ftlObj.y += (pY + startY - ftlObj.y)/8;
				
			}
			else
			{
				var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
				ftlObj.y += (pY - startY - ftlObj.y)/8;
			}
			ftlObj.sP(ftlObj.x, ftlObj.y);
			//setTimeout("stayTopLeft()", 10);
		}
		ftlObj = ml("topbar");
		stayTopLeft();
	}

	/*
	if (window.addEventListener)
		window.addEventListener("load", staticbar, false)
	else if (window.attachEvent)
		window.attachEvent("onload", staticbar)
	else if (document.getElementById)
		window.onload=staticbar
	*/
