﻿function dom(id)
{
    return document.getElementById(id);
}
function getPrint(id)
{
    var width = 446;
    var imageTop = "specials_popup_top_430.jpg";
    var imageBottom = "specials_popup_bottom_430.jpg";
    
    if(arguments.length > 1)
    {
        width = arguments[1];
        imageTop = "specials_popup_top.jpg";
        imageBottom = "specials_popup_bottom.jpg"
    }

    var popupStr = "";

	myWindow = window.open("","spaPackages", "width="+ width +",height=500,scrollbars=yes");
	myWindow.focus();
	popupStr += "<html><head><title>Norwich Spa, Connecticut Day Spa | The Spa at Norwich Inn</title>";
	popupStr += "<script src=\"js/functions.js\"><\/script>";
	popupStr += "<link href=\"stlyes.css\" rel=\"stylesheet\" type=\"text\/css\" \/>";
	popupStr += "<style>body{margin:0;}</style>";
	
	popupStr += "</head><body>";
	
	popupStr += "<table width=\"425\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#f4eace\">";
    popupStr += "  <tr>";
    popupStr += "    <td><img src=\"images/"+imageTop+"\" width=\""+(width - 16)+"\" height=\"81\"></td>";
    popupStr += "  </tr>";
    popupStr += "  <tr>";
    popupStr += "    <td align=\"center\" bgcolor=\"#f4eace\"><table width=\"375\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    popupStr += "      <tr><td height=\"268\" align=\"center\" valign=\"top\">";
	
	popupStr += "		<table width=\"100%\" align=\"center\"><tr><td>";
	var temp = dom(id);
	if(temp)
		popupStr += temp.innerHTML;	
	popupStr += "	<br/></td></tr></table>";
	
	popupStr += "      </td></tr>";
    popupStr += "    </table></td>";
    popupStr += "  </tr>";
    popupStr += "  <tr>";
    popupStr += "    <td><img src=\"images/"+imageBottom+"\" width=\""+(width - 16)+"\" height=\"65\"></td>";
    popupStr += "  </tr>";
    popupStr += "</table>";
    popupStr += "<script>var img = document.getElementById('printerFriendly');img.src='images/specials_printnow.gif';img.onclick=function(){window.print();};";
    popupStr += "var table = document.getElementById('treatmentTable');if(table){table.width="+(width - 22)+";}window.print();";
    popupStr += "<\/script>"
	popupStr += "</body></html>";
	
	myWindow.document.write(popupStr);
	myWindow.document.close();
}