// Create the image box
//
//	<style type="text/css">
//	<!--
//	#imagebox {position:absolute; visibility:hidden;}
//	-->
//	</style>
//
// is embedded in the <head> of html file and
//<script type="text/javascript" src="js-lib/popimage.js"></script>
//
// is placed in the body

document.write("<DIV ID='imagebox'></DIV>");

var ibox = document.getElementById("imagebox").style;
var icontent = document.getElementById("imagebox");



function
popimage(image, x, y, width, height)
{
	var bcolor = 'darkgray';

	ibox.left = x + "px";
	ibox.top = y + "px";


	if( width && height )
	{
		var content =
		"<TABLE BORDER='1' BORDERCOLOR=" + bcolor + " CELLPADDING=2 CELLSPACING=0 " +
		"><TD ALIGN='center'><IMG SRC=" + image + " WIDTH='" + width +
		"' HEIGHT='" + height + "'></TD></TABLE>";
	}
	else if (width && !height)
	{
		var content =
		"<TABLE BORDER='1' BORDERCOLOR=" + bcolor + " CELLPADDING=2 CELLSPACING=0 " +
		"><TD ALIGN='center'><IMG SRC=" + image + " WIDTH='" + width +
		"'></TD></TABLE>";
	}
	else if (!width && height)
	{
		var content =
		"<TABLE BORDER='1' BORDERCOLOR=" + bcolor + " CELLPADDING=2 CELLSPACING=0 " +
		"><TD ALIGN='center'><IMG SRC=" + image + " HEIGHT='" + height +
		"'></TD></TABLE>";
	}
	else
	{
		var content =
		"<TABLE BORDER='1' BORDERCOLOR=" + bcolor + " CELLPADDING=2 CELLSPACING=0 " + 
		"><TD ALIGN='center'><IMG SRC=" + image + "></TD></TABLE>";
	}

	icontent.innerHTML = content;
	ibox.visibility = "visible";

}


function
killimage()
{
      ibox.visibility = "hidden";
}
