function ImageWindow(imageNameGWS, imageWidthGWS, imageHeightGWS, altTextGWS, bgcolorGWS, borderGWS, borderMarginGWS) 
{
	//alert("Got here!" + imageNameGWS + " : " + imageWidthGWS + " : " + imageHeightGWS + " : " + altTextGWS + " : " + bgcolorGWS + " : " + borderGWS + " : " + borderMarginGWS);

	// get current window size
	var currWidthGWS = screen.width;
	var currHeightGWS = screen.height;

	// get/set border size
	borderMarginGWS = borderMarginGWS - 0 // make a number
	if (borderMarginGWS == "")
	{
		var imageAdjGWS = 10
	}
	else
	{
		var imageAdjGWS = borderMarginGWS
	}
	
	// set defalt name
	if (imageNameGWS == "")
	{
		imageNameGWS = "No Image Name";
	}

	// set defalt image size
//	if (imageWidthGWS == "")
//	{
//		imageWidthGWS = 50;
//	}
//	if (imageHeightGWS == "")
//	{
//		imageHeightGWS = 50;
//	}

	// set defalt text
	if (altTextGWS == "")
	{
		altTextGWS = "No Image Text";
	}

	// set default image background color
	if (bgcolorGWS == "")
	{
		bgcolorGWS = "#FFFFFF";
	}

	// image size adjustment
	// if image size is creater then current window, adjust image size
	if (imageWidthGWS > currWidthGWS)
	{	
	  byFactor = currWidthGWS/ imageWidthGWS;
	  imageWidthGWS = currWidthGWS;
	  imageHeightGWS = imageHeightGWS * byFactor;
	}
	//if (imageHeightGWS > currHeightGWS - adj)
	if (imageHeightGWS > currHeightGWS)
	{
	  byFactor = currHeightGWS / imageHeightGWS;
	  imageWidthGWS = (imageWidthGWS * byFactor);
	  imageHeightGWS = currHeightGWS; 
	}

	var scrWidthGWS;
	var scrHeightGWS;
//	if (imageWidthGWS == 0 || imageHeightGWS == 0)
//	{
//		scrWidthGWS = 600;
//		scrHeightGWS = 500;
//	}
//	{
//	else
//	{
//		scrWidthGWS = imageWidthGWS;
//		scrHeightGWS = imageHeightGWS;
//		scrWidthGWS = "600";
//		scrHeightGWS = "500";
		scrWidthGWS = "1024";
		scrHeightGWS = "768";
//	}

	var posTop =  0;
	var posLeft = 0;

	if (borderGWS == "borderyes")
	{
	  if (borderMarginGWS == "")
		{
			borderMarginGWS = 0;
	  }
		else
		{
			borderMarginGWS = borderMarginGWS - 0; 
		}
	  var scrHeightTemp = imageHeightGWS - 0 + (2 * borderMarginGWS);
	  if (scrHeightTemp < scrHeightGWS) 
		{
			scrHeightGWS = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidthGWS - 0 + (2 * borderMarginGWS);
	  if (scrWidthTemp < scrWidthGWS) 
		{
			scrWidthGWS = scrWidthTemp;
	  }
	  
	  if (scrHeightGWS < 100) {scrHeightGWS = 100;}
	  if (scrWidthGWS < 100) {scrWidthGWS = 100;}

	  posTop =  10;
	  posLeft = 10;
 	}

		posTop = parseInt(posTop);
		posLeft = parseInt(posLeft);		
		scrWidthGWS = parseInt(scrWidthGWS); 
		scrHeightGWS = parseInt(scrHeightGWS);

		// make room on screen for close button
		scrHeightGWS = scrHeightGWS + 20;

		// make image a tad smaller to give border
		//imageHeightGWS = imageHeightGWS - imageAdjGWS;
		//imageWidthGWS = imageWidthGWS - imageAdjGWS;
		// make scr size a tad large to give border
		scrHeightGWS = scrHeightGWS + imageAdjGWS;
		scrWidthGWS = scrWidthGWS + imageAdjGWS;

	//alert("Got here, too!" + imageNameGWS + " : Image - " + imageWidthGWS + " : " + imageHeightGWS + " : Screen - " + scrWidthGWS + " : " + scrHeightGWS + " : " + borderGWS + " : " + borderMarginGWS);

		newWindow = window.open("GWSWindow.htm","newWindow","width="+scrWidthGWS+",height="+scrHeightGWS+",left="+posLeft+",top="+posTop);
		newWindow.document.open();
		newWindow.document.write('<html><title>'+altTextGWS+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF" onBlur="self.close()" onClick="self.close()">');  
		newWindow.document.write('<table width='+imageWidthGWS+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeightGWS+'><tr><td class="maintextBold">');

		//newWindow.document.write('<img src="'+imageNameGWS+'" width='+imageWidthGWS+' height='+imageHeightGWS+' alt="Click screen to close">'); 
		if (imageWidthGWS == 0 || imageHeightGWS == 0)
		{
		newWindow.document.write('<img src="'+imageNameGWS+'" alt="Click screen to close">'); 
		}
		else
		{
		newWindow.document.write('<img src="'+imageNameGWS+'" width='+imageWidthGWS+' height='+imageHeightGWS+' alt="Click screen to close">'); 
		}

		newWindow.document.write('<br><a href="javascript:;" onClick="close_window()"><img src="images/closewindow.gif" width="101" height="23" border="0" alt="Close"></a>')
		newWindow.document.write('</td></tr></table></body></html>');
		newWindow.document.close();
		newWindow.focus();

}

