<!-- Code that adds a "Print with MyPix or Shutterfly" link to slide images.
     These services prints images and delivers them to your door.
-->
<%!
	String productUrl;
	String postUrl;
	if (printing.equals("mypix")) {
		productUrl = "mypix.se";
		postUrl = "http://www.mypix.se/jalbum/UpdateCart.asp";
	}
	else {
		productUrl = "shutterfly.com";
		postUrl = "http://www.shutterfly.com/c4p/UpdateCart.jsp";
	}
%>

<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.\n" +
	 "Use the JAlbum publish section to publish this album.");
	else if (confirm("You will now be transferred to <%=productUrl%> where you may order prints of this image.\n<%=productUrl%> will shortly 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;
		href = location.href;
		form["imraw-1"].value = href.substring(0,href.lastIndexOf("slides/")) + form.toImage.value;
		form["imthumb-1"].value = href.substring(0,href.lastIndexOf("slides/")) + form.toThumb.value;
		form.submit();
	}
}


</script>

<form name="orderform" action="<%=postUrl%>" 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="$fileName">
</ja:if>
<ja:else>
<input type="hidden" name="imrawwidth-1" value="$imageWidth">
<input type="hidden" name="imrawheight-1" value="$imageHeight">
<ja:if test="<%= engine.getImageLinking().equals("LinkOriginals") %>">
	<input type="hidden" name="toImage" value="$fileName">
</ja:if>
<ja:else>
	<input type="hidden" name="toImage" value="slides/$fileName">

</ja:else>
</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>
