var sizeIncrease=2;
var theContName="container";
var theCont=document.getElementById(theContName);

function CloseDivPop()
{
	var theImgPop=document.getElementById("imagePop");

	if(theImgPop)
	{
		theImgPop.border="0";
		theImgPop.style.display="none";
		theCont.removeChild(theImgPop);
	}

	var theX=document.getElementById("theX");

	if(theX)
	{
		theX.border="0";
		theX.style.display="none";
		theCont.removeChild(theX);
	}
}

function ShowDivPop()
{
	var theImgPop=document.getElementById("imagePop");

	if(theImgPop)
		theImgPop.style.display="block";
}

function DivPop(a,theW,theH)
{
	if(document.getElementById("imagePop"))
		CloseDivPop();

	var theImgPop=document.createElement("img");

	theImgPop.style.display="none";
	theImgPop.id="imagePop";
	theImgPop.src=a;
	theImgPop.border=1;
	theImgPop.alt=theImgPop.title="click the image to close it";
	theImgPop.style.position="absolute";
	theImgPop.style.zIndex=100;

	theImgPop.width=theW*sizeIncrease;
	theImgPop.height=theH*sizeIncrease;

	theCont.insertBefore(theImgPop,theCont.firstChild);


	var theX=document.createElement("img");
	theX.id="theX";
	theX.src="/media/close.jpg";
	theX.border=1;
	theX.style.background="black";
	theX.alt=theX.title="click the X to close the image";
	theX.style.position="absolute";
	//theX.style.top="-10px";
	//theX.style.left="-10px";
	theX.style.zIndex=200;
	theX.onclick=CloseDivPop;

	theCont.insertBefore(theX,theCont.firstChild);


	if(theImgPop.complete)
		ShowDivPop();

	theImgPop.onclick=CloseDivPop;
	theImgPop.onload=ShowDivPop;
}

