function patformAdd(theWidth)  {
	daNum = 16;
	daSize = parseInt(theWidth,10);
	if(navigator.platform.search("Win")>-1) 
		return daSize + daNum;
	else
		return theWidth;
}

function getJiggy(URL,pageTitle,w,h)  {
	//If pageTitle contains a space it will cause an error
	w = patformAdd(w);
	LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
	descr='scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h + ', top=' + TopPosition + ',left=' + LeftPosition + ',toolbar=0';
	eval("jiggyWd = window.open(URL,pageTitle,descr);");
}

function getMap(URL,pageTitle,w,h)  {
	//If pageTitle contains a space it will cause an error
	w = patformAdd(w);
	LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
	descr='scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h + ', top=' + TopPosition + ',left=' + LeftPosition + ',toolbar=0';
	eval("jiggyWd = window.open(URL,pageTitle,descr);");
}

var newWD="";
function getPhoto(URL,theCaption,theByLine,ppTitle)  {
	//If pageTitle contains a space it will cause an error

	//wdWidth=w
	//if(w>600) {
	//	wdWidth = 600
	//}
	//wdHeight=h
	//if(h>600) {
	//	wdHeight = 600
	//}

	captionSize = theCaption.length;
	ByLineSize = theByLine.length;
	
	pw = 600;
	ph = 400;
	
	picWidth = 600;
	picHeight = 400;
	
	if(captionSize > 0)   {
		ph = ph + 50;
	}

   if(ByLineSize > 0)   {
		ph = ph + 30;
   }

	LeftPosition = (screen.width) ? (screen.width - pw) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - ph) / 2 : 0;

	descr="scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + pw + ",height=" + ph + ", top=" + TopPosition + ",left=" + LeftPosition + ",toolbar=0";

	eval("newWD = window.open(\"\",\"Reward_Your_Senses\",descr);");
	
	newWD.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
	newWD.document.write("<html><head><title>Reward Your Senses - "+ppTitle+"</title>");
	newWD.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META HTTP-EQUIV=\"imagetoolbar\" CONTENT=\"no\">");
	newWD.document.write("<SCRIPT language=\"JavaScript\" type=\"text/JavaScript\" src=\"/css/section_menus.js\"></SCRIPT>");
	newWD.document.write("<link href=\"/css/reward.css\" rel=\"stylesheet\" type=\"text/css\"></head>");


	newWD.document.write("<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
	newWD.document.write("<div id=\"Layer1\" style=\"position:absolute; width:38px; height:13px; z-index:1; left: 20; top: 20;\"><A HREF=\"javascript:window.close()\"><img src=\"/images/close.gif\" width=\"38\" height=\"13\" border=\"0\"></A></div>");
	newWD.document.write("<table width=\"" + picWidth + "\" cellspacing=\"0\" cellpadding=\"0\">");

   newWD.document.write("<tr><td colspan=\"3\"><img src=\""+ URL + "\" width=\"" + picWidth + "\" height=\"" + picHeight + "\" border=\"0\"></td></tr>");
	newWD.document.write("<tr><td><IMG src=\"/images/spacer.gif\" width=\"20\" height=\"10\" alt=\"\"></td>");
   newWD.document.write("<td><IMG src=\"/images/spacer.gif\" width=\"560\" height=\"10\" alt=\"\"></td>");
   newWD.document.write("<td><IMG src=\"/images/spacer.gif\" width=\"20\" height=\"10\" alt=\"\"></td></tr>");
   
   if(captionSize > 0)   { 
		newWD.document.write("<tr><td><IMG src=\"/images/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td>");
		newWD.document.write("<td valign=\"top\" class=\"bodyText\">" + theCaption + "</td>");
		newWD.document.write("<td><IMG src=\"/images/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td></tr>");
	}
	
   if(ByLineSize > 0)   { 
		newWD.document.write("<tr><td><IMG src=\"/images/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td>");
		newWD.document.write("<td valign=\"middle\" align=\"right\" class=\"copyright\"><font color=\"#666666\">&#169; " + theByLine + "</font></td>");
		newWD.document.write("<td><IMG src=\"/images/spacer.gif\" width=\"20\" height=\"20\" alt=\"\"></td></tr>");
	}
	
	newWD.document.write("<tr><td colspan=3><IMG src=\"/images/spacer.gif\" width=\"600\" height=\"20\" alt=\"\"></td></tr>");
	newWD.document.write("</table></body></html>");
	newWD.document.close();
}
