//	ieErrorHandler
//	--------------
//	Allows IE to properly handle failed JS calls
//	"onerror" must be the name of the error handling function so IE can use it properly
//	This must be the top function
//	Send user to the appropriate screenshot page if pop-ups don't work
//
function ieErrorHandler(errorMessage,url,line)
{
	location.href=imgPath + (newURLname(picName));
	return true;
} 

onerror = ieErrorHandler;

//	Global Variables
//	----------------
//	picName holds the name of the image that should appear in the pop-up window in 
//	openPicWindow, in case of an IE error (see error handling function at top of JS)
picName = "";

//	newURLname
//	----------
//	This function takes the name of the image and returns a URL of the same basic name.
//	It cuts off the last four characters of the image name (.gif or .jpg) and adds ".html"
//
function newURLname(pic)
{
	var newURL = pic.substring(0,(pic.length) - 4);
	newURL += ".html" ;
	return (newURL);
}

//	openPicWindow
//	-------------
//	This function creates a pop-up window sized just right for an image, using the image's name, 
//	width, height and description as parameters. 
function openPicWindow(pic, picWidth, picHeight, picDesc)
{
	picName = pic;
	winWidth = picWidth + 50;
	winHeight = picHeight + 60;
	NewWin = window.open("", "pic_window", "resizable,width="+ winWidth + ",height="+ winHeight);
	
	NewWin.document.open();
	NewWin.document.write('<html><head><title>' + picDesc +'</title></head><body background="../images/back.gif" bgcolor="#045E08"><center><img src="images/'+ pic +'" vspace=7 width=' + picWidth +' height=' + picHeight + ' alt="' + picDesc +'"><br><form><input type=button value="close" onClick="window.close()"></form></center></body></html>');
	NewWin.document.close();
}

function openWin(url,winname,winwidth,winheight)
		{
			eval("window.open('" + url + "','" + winname + "','width=" + winwidth + ",height=" + winheight + ",resizable')");
		}