var NWR_Window=null;

function openWindow(imageName, imgWidth, imgHeight) {
	// Initialize variables
	leftPos = 0;
	topPos = 0;
	imgNum = 0;
	sbars = 0;
	
	// Set desired resolution for the image
	width = imgWidth;
	height = imgHeight;
	imageName = './images/' + imageFolder + '/' + imageName;

	winWidth = width + 22;
	winHeight = height +26 +110;
		
	myMessage = "award info popup";

	// center the window in the screen
	leftPos = ((screen.width/2)-(winWidth/2));
	topPos = ((screen.height/2)-(winHeight/2)-20);
	//	alert("width: " + width + " * height: " + height + "\ntop: " + topPos + " left: " + leftPos )
	if (topPos < 0){topPos = 0;}
	if (leftPos < 0){leftPos = 0;}

	// Create the window
	if (NWR_Window && (!NWR_Window.closed)){
	   NWR_Window.close();
	}
	if (winHeight> screen.height){sbars=1; winHeight=(screen.height-80); }
		
	winParams = "resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + sbars + ",width=" + winWidth + ",height=" + winHeight + ",left=" + leftPos + ",top=" + topPos;
	NWR_Window = window.open('', 'NWR_Window', winParams )
	NWR_Window.document.open();
	NWR_Window.document.write("<HTML><HEAD>");
	NWR_Window.document.write("<TITLE>NorthWoods-Retreat.com :: " + seriesTitle + "</TITLE>");
	NWR_Window.document.write("<style rel='STYLESHEET'  type='text/css'>");
	NWR_Window.document.write("img {border: 2px solid #660000; }");
	NWR_Window.document.write(".seriesTitle {font: bold italic 24px 'Times New Roman', Times, serif; color:#660000; }");
	NWR_Window.document.write(".seriesDate {font: bold 12px Arial, Helvetica, sans-serif; color: #660000; }");
	NWR_Window.document.write("</style>");
	NWR_Window.document.write("</HEAD><basefont face='arial, helvetica, sans-serif' size='3'>");
	NWR_Window.document.write("<body bgcolor='#FFFFFF' text='#FF6666' link='#990000' vlink='#0099CC' onBlur='this.close' class='nav'>");
	NWR_Window.document.write("<h2 class='seriesTitle' align='left'>" + seriesTitle  + "<br>");
	NWR_Window.document.write("<span class='seriesDate' align='right'>" + seriesDate + "</span></h2><center><hr>");
	/* USE THE FOLOWING LINE TO MANUALY SIZE THE IMAGE */
//		NWR_Window.document.write("<IMG HSPACE=0 VSPACE=0 HEIGHT=" + imgname.high + " WIDTH=" + imgname.wide +" SRC='" + contentArg + "'>");
	NWR_Window.document.write("<IMG HSPACE=0 VSPACE=0 HEIGHT=" + (height-26) + " WIDTH=" + (width-22) + " SRC=\'" + imageName + "\' alt=\'" + imageName + "\'>");
	/* USE THE FOLOWING LINE TO AUTOMATICALLY USE THE IMAGE AT 100 PERCENT OF ITS SIZE */
	// NWR_Window.document.write("<IMG HSPACE=0 VSPACE=0 SRC='" + imgname.name + "'>");
	NWR_Window.document.write("<hr>");
	NWR_Window.document.write("<FORM ><INPUT TYPE='button' VALUE='Close' onClick='window.close()'></FORM>");
	NWR_Window.document.write("</center>");
	NWR_Window.document.write("</BODY></HTML>");
	NWR_Window.document.close();
	NWR_Window.focus();
}
