<!-- Code that adds a "Print with Shutterfly" link to slide images.
     Shutterfly is a service that prints images and delivers them to your door.
-->

<script type="text/javascript">
function submitOrderForm()
{
	if (location.protocol != 'http:') alert("Ordering prints on-line requires this album to be hosted on a public web server.");
	else if (confirm("You will now be transferred to Shutterfly.com where you may order prints of this image.\nWithin a couple of days, Shutterfly will grab your selected images (originals if published)\nfrom this web site for printing. Make sure they are available on-line!\n\nDisclaimer:\nJAlbum assumes no responsibility for the fulfillment of this printing service.")) {
		form = document.forms['orderform'];
		location = window.location;
		form.returl.value = location.href;
		form["imraw-1"].value = location.href.replace(new RegExp(form.fromSlides.value,""),form.toImage.value);
		form["imthumb-1"].value = location.href.replace(new RegExp(form.fromSlides.value,""),form.toThumb.value);
		form.submit();
	}
}
</script>

<form id="orderform" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="post">
<p>
<input type="hidden" name="addim" value="1" />
<input type="hidden" name="protocol" value="SFP,100" />
<input type="hidden" name="pid" value="C4PP" />
<input type="hidden" name="psid" value="JALB" />
<input type="hidden" name="imnum" value="1" />
<input type="hidden" name="imraw-1" value="REPLACE_ME" />
<ja:if exists="originalPath">
<input type="hidden" name="imrawwidth-1" value="$originalWidth" />
<input type="hidden" name="imrawheight-1" value="$originalHeight" />
<input type="hidden" name="toImage" value="$imagePath" />
</ja:if>
<ja:else>
<input type="hidden" name="imrawwidth-1" value="$imageWidth" />
<input type="hidden" name="imrawheight-1" value="$imageHeight" />
<input type="hidden" name="toImage" value="$imagePath" />
</ja:else>
<input type="hidden" name="imthumb-1" value="REPLACE_ME" />
<input type="hidden" name="imthumbwidth-1" value="$thumbWidth" />
<input type="hidden" name="imthumbheight-1" value="$thumbHeight" />
<input type="hidden" name="returl" value="REPLACE_ME" />

<input type="hidden" name="fromSlides" value="slides/$currentPage" />
<input type="hidden" name="toThumb" value="thumbs/$fileName" />
</p>
</form>
