		// timer variable:
		var boxtimer;

		function ViewImage(img_url,img_width,img_height,gallery_name,image_name,image_description)
		{
			document.getElementById('loadimg').src = "/aimg/bigload.gif";
			var innerstyle = document.getElementById('innerbox').style;
			innerstyle.width = img_width + 'px';
			innerstyle.height = img_height + 'px';
			document.getElementById('newimg').src = img_url;
			
			var superstring = "";
			if(image_name){superstring += "<b>" + image_name + ":</b>&nbsp;&nbsp;";}
			if(image_description){superstring += image_description;}
			superstring += "<br /><br /><a href=\"javascript:void(0);\" onclick=\"CloseBox();\">[ Close Box ]</a>\n";
			
			document.getElementById('boxtext').innerHTML = superstring;
	
			ShowBox();
		}

		function DeleteItem(item_name,item_database,dont_confirm)
		{
			var dothis = 0;
			if(!dont_confirm)
			{
				if(confirm("Are you sure you wish to delete " + item_name + "?"))
				{
					dothis = 1;
				}
			}
			else{dothis=1;}

			if(dothis)
			{
				document.getElementById('textwhileloading').innerHTML = ("Deleting " + item_name + " from " + item_database + "... Please Wait");
				var innerstyle = document.getElementById('innerbox2').style;
				innerstyle.width = "700px";
				innerstyle.height = "400px";
				ShowBox2();
				window.setTimeout("SubmitDelete()",800);
			}
		}

		function Load()
		{
			document.getElementById('textwhileloading').innerHTML = "Saving Changes... Please Wait";
			var innerstyle = document.getElementById('innerbox2').style;
			innerstyle.width = "700px";
			innerstyle.height = "400px";
			ShowBox2();
			window.setTimeout("SubmitIt()",800);
		}

		function ShowBox2()
		{
			var fp = document.getElementById('fullpage2').style;
			fp.top = document.body.scrollTop;
			fp.width = "100%";
			fp.height = "100%";
			fp.left = document.body.scrollLeft;
		}

		function SubmitIt()
		{
			document.inventoryform.submit();
		}

		function SubmitDelete()
		{
			document.deleteform.submit();
		}

		function ShowBox()
		{
			var fp = document.getElementById('fullpage').style;
			fp.top = (window.pageYOffset ? window.pageYOffset : document.body.scrollTop) + "px";
			fp.width = "100%";
			fp.height = "100%";
			fp.left = (window.pageXOffset ? window.pageXOffset : document.body.scrollLeft) + "px";
			document.getElementById('innerbox').style.width = "700px";
			document.getElementById('innerbox').style.height = "400px";
		}

		function CloseBox()
		{
			var fp = document.getElementById('fullpage').style;
			fp.width = "1px";
			fp.height = "1px";
			fp.left = "-1000px";
			var ib = document.getElementById('innerbox').style;
			ib.width = "0px";
			ib.height = "0px";
			document.getElementById('loadimg').src = "/aimg/bigload.gif";
		}

		var oldboxwidth = 150;
		var oldboxheight = 150;

		function resizeImage(obj)
		{
			document.getElementById('imageframe').style.width = oldboxwidth + "px";
			document.getElementById('imageframe').style.height = oldboxheight + "px";

			TweenJS("imageframe", 1, {width:parseInt(obj.width), height:parseInt(obj.height), ease:Sine.easeOut, onComplete:showPicture});

			oldboxwidth = parseInt(obj.width);
			oldboxheight = parseInt(obj.height);
		}

		function showPicture()
		{
			document.getElementById('loadimg').src = document.getElementById('newimg').src;
		}

		function writeFullPage()
		{
			document.write('<div id="fullpage" style="position:absolute;top:0px;left:-9999px;width:1px;height:1px;" onclick="CloseBox();">\n');
			document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" style="height:100%;">\n');
			document.write('<tr><td width="100%" height="100%" background="/aimg/shadow.png" align="center">\n');
			document.write('<table border="0" cellpadding="0" cellspacing="0">\n');
			document.write('<tr><td bgcolor="#ffffff" valign="top">\n');
			document.write('<table id="innerbox" border="0" cellpadding="0" cellspacing="0" style="width:0px;height:0px;border:3px solid black;">\n');
			document.write('<tr><td bgcolor="#ffffff" align="right" style="padding:0px;" height="20"><a href="javascript:void(0);" onclick="CloseBox();" title="Close Image Box"><img src="/aimg/closebox.png" width="20" height="20" border="0" alt="Close Image Box" /></a>&nbsp;</td></tr>\n');
			document.write('<tr><td bgcolor="#ffffff" align="center" style="padding:0px 20px 0px 20px;">\n');
			document.write('<div id="imageframe" style="position:relative;">\n');
			document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td width="100%" height="100%" align="center">\n');
			document.write('<img id="loadimg" src="/aimg/bigload.gif" alt="Loading Image Graphic" />\n');
			document.write('</td></tr></table>\n');
			document.write('</div>\n');
			document.write('<img id="newimg" src="/aimg/bigload.gif" style="position:absolute;left:-9999px;top:-9999px;" onload="resizeImage(this);" alt="Loading Image Graphic" />\n');
			document.write('</td></tr>\n');
			document.write('<tr><td bgcolor="#ffffff" align="left" style="padding:10px 20px 0px 20px;">\n');
			document.write('<span id="boxtext" style="color:#000000;">Click Anywhere to Exit</span>\n');
			document.write('</td></tr>\n');
			document.write('<tr><td bgcolor="#ffffff" align="right" style="padding:0px;" height="20">&nbsp;</td></tr>\n');
			document.write('</table>\n');
			document.write('</td></tr></table>\n');
			document.write('</td></tr></table>\n');
			document.write('</div>\n');

			document.write('<div id="fullpage2" style="position:absolute;top:0px;left:-9999px;width:1px;height:1px;">\n');
			document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" style="height:100%;">\n');
			document.write('<tr><td width="100%" height="100%" background="/aimg/shadow.png" align="center">\n');
			document.write('<table border="0" cellpadding="0" cellspacing="0">\n');
			document.write('<tr><td bgcolor="#ffffff" valign="top">\n');
			document.write('<table id="innerbox2" border="0" cellpadding="0" cellspacing="0" style="width:0px;height:0px;border:1px solid black;">\n');
			document.write('<tr><td bgcolor="#ffffff" align="center" style="padding:20px 20px 0px 20px;">\n');
			document.write('<img src="/aimg/bigload.gif" alt="Loading Graphic" /><br><b><span id="textwhileloading">Saving Changes... Please Wait.</span></b>\n');
			document.write('</td></tr></table>\n');
			document.write('</td></tr></table>\n');
			document.write('</td></tr></table>\n');
			document.write('</div>\n');
		}

		writeFullPage();
