function openScreenshot( file, w, h, typ, closeText ) 
{
    var positionType = "absolute";

    // Get information about browser

	var appName = navigator.appName;
	
	if ( appName == "Microsoft Internet Explorer" )
	{
	    positionType = "absolute";
	}
	else if ( appName == "Netscape" )
	{
	    positionType = "fixed";
	}
	
	// Create new image with necessary parameters
	
	if ( typ == "dhtml" ) 
	{
		if ( document.all ) 
		{
			var windowWidth = self.document.body.clientWidth;
			var windowHeight = self.document.body.clientHeight;
			var scrolltop = document.body.scrollTop;
			var scrollleft = document.body.scrollLeft;
		} 
		else 
		{
			var windowWidth = self.innerWidth;
			var windowHeight = self.innerHeight;
			var scrolltop = document.documentElement.scrollTop;
			var scrollleft = document.documentElement.scrollLeft;
		}
		
		var postop = (windowHeight / 2) - (h / 2) + scrolltop + document.body.style.padding;
		var posleft = (windowWidth / 2) - (w / 2) + scrollleft + document.body.style.padding;
		
		if ( document.all ) 
		{
			if ( postop >= 20 )  
			{ 
			    postop = postop - 20; 
			}
		} 
		else 
		{
			if ( postop >= 30 ) 
			{ 
			     postop = postop - 30; 
		    }
		}
		
		var bodyObj = document.getElementsByTagName('BODY')[0];
		
		if ( !document.getElementById("dynamicImageContainer") ) 
		{
			divObjContainer = document.createElement("div");
			divObjContainer.setAttribute("id", "dynamicImageContainer");
			bodyObj.appendChild(divObjContainer);
		} 
		else 
		{
			divObjContainer = document.getElementById("dynamicImageContainer");
		}
		
		divObjContainer.style.display = "block";
		divObjContainer.innerHTML = "<div class=\"imageContainer\" style=\"top:" + 
		                            postop + "px; left:" + 
		                            posleft + "px; position: " + 
									positionType + "; display:block;\"><div class=\"imageBorder\" style=\"background-color: #fff; padding: 4px; border: none\">" + 
									"<img onclick=\"closeScreenshot();\" style=\"cursor:pointer;border: none\" src=\""+ 
									file + "\" title=\"" + 
									closeText + "\" width=\"" + 
									w + "\" height=\"" + 
									h + "\"\/><\/div><\/div>";
	} 
	else if( typ == "javascript" ) 
	{
		// center popup
		var postop = (screen.height / 2) - (h / 2);
		var posleft = (screen.width / 2) - (w / 2);
		window.open(file +'&closeText='+encodeURI(closeText)+'', '', 'dependent=yes,width='+w+',height='+h+',left='+posleft+',top='+postop+',scrollbars=no,resizable=no,menubar=no,location=no,status=no');
	}
}

function closeScreenshot() 
{
    obj = document.getElementById("dynamicImageContainer");
    
    if ( obj )
    {
        obj.style.display = "none";
    }
}

function Bum(message)
{
    alert(message);
}