function setCreatePhotoPage()
{
	nch = "<h3>To purchase: " + currentPhoto.toString() + "</h3>"+
	"<h2>Choose a paper type, size and quantity...</h2>";

	setEditPageContent();
	createPhotoPage.createHtml(container);
}

function setEditPage()
{
	nch = "<h3>To edit: " + currentPhoto.toString() + "</h3>"+
	"<h2>Change paper type, size and/or quantity...</h2>";

	setEditPageContent();
	editPage.createHtml(container);
}

function setEditPageContent()
{
	cch = "<div align='center'>"+
	"<applet id='paperPreviewer' codebase='" + GLOBAL_PATH + "' code='web.PaperViewer.class' "+
	"width='630' height='150' style='margin: 10px;'>"+
	"<param name='imageToShow' value='" + currentPhoto.num + "'>"+
	"You are visiting a page that contains an applet written with Java technology. "+
	"Please install the Java Runtime Environment before refreshing this page.<br>"+
	"<a href='http://java.com/java/download/index.jsp?cid=jdp88178' target='_blank'>"+
	"<img width='170' height='100' border='0' style='margin: 8px;' "+
	"alt='GetJava Download Button' title='GetJava' "+ 
	"src='http://java.com/en/img/everywhere/getjava_lg.gif?cid=jdp88178'></a><br />"+
	"</applet>"+
	"</div>"+

	"<table align='center'><tr><td><fieldset><legend>Paper Type</legend>"+
	getPaperTypesSelectorHtml()+
	"</td></fieldset>"+
	"<td><fieldset><legend>Photo Size</legend>"+

	getPaperSizesSelectorHtml() +

	"</fieldset></td>"+
	"<td><fieldset><legend>Price</legend>"+
	"<input id='pPrice' type='text' size='10' readonly='readonly' class='noBorder' "+
	"style='font-weight: bold;'></input>"+
	"</fieldset></td>"+
	"<td><fieldset><legend>Qty</legend>"+
	getQuantitySelectorHtml()+
	"</fieldset></td></tr>"+

	"<tr><td colspan='4' align='left' class='small'>Actual print size may vary slightly.</td></tr>"+

	"<tr><td colspan='4' height='60' align='right'>"+
	"<a href='#' onclick='top.changePage(\"pricingPage\"); "+
	"return false;' title='View Pricing Information' class='reg'>pricing details</a> &nbsp; "+
	"&nbsp; &nbsp; "+
	"<input type='button' value='cancel' class='btn' onclick=";
	if(currentPage.name == "Photographs")
	{
		cch += "'top.createPhotoPage.prev()'";
	}
	else
	{
		cch += "'top.editPage.cancel()'";
	}
	cch += "</input>&nbsp;"+
	"<input type='button' value='" + 
	(currentPage.name == "Photographs" ? "Add to Cart" : "Save") + 
	"' class='btn' onclick=";
	if(currentPage.name == "Photographs")
	{
		cch += "'top.createPhotoPage.next()'";
	}
	else
	{
		cch += "'top.editPage.next()'";
	}
	cch += "></input>"+
	"</td></tr></table>";


	sch = "<p>To really experience the full quality of my photographs, I suggest you get them "+
	"printed on canvas in the 16\" x 20\" or larger size. You will be amazed at the "+
	"experience you will have from viewing them at that size on canvas.</p>";

	container = new Container();
	container.paintLayout(PAINT_LAYOUT);
	container.setSpacing(SPACING);
	container.setNorthComponent(nch, "center");
	container.setCenterComponent(cch, "center");
	container.setSouthComponent(sch);
}



function createPurchasePage()
{	
	nch = "<h2>Shopping Cart contains " + cart.getNumberOfItems() +
	" item" + (cart.getNumberOfItems() == 1 ? "" : "s") + "...</h2>";

	if(cart.items.length == 0)
	{
		cch = "<table><tr><td><p>To purchase a photograph from Joe:</p>"+
		"<ul class='reg'><li>Go to the Photographs page.</li>"+
		"<li>Search through Joe's photo album and select.</li>"+
		"<li>Click the \"Purchase Photo\" button.</li>"+
		"<li>Select your favorite paper, photo size and quantity.</li>"+
		"<li>Buy as many photographs as you like!</li></ul>"+ 
		"</td></tr></table>"+
		"<h3>All transactions are handled by PayPal's secure server</h3>";

		sch = "";
	}
	else
	{
		nch += getPayPalForm();

		cch = cart.getHtml();

		sch = "<br /><input type='button' value='<< more photos' "+
		"class='btn' onclick='top.purchasePage.prev()'></input>&nbsp;"+
		"<input type='button' value='Checkout >>' class='btn' "+
		"onclick='top.purchasePage.actionPerformed()'></input>";
	}


	container = new Container();
	container.paintLayout(PAINT_LAYOUT);
	container.setSpacing(SPACING);
	container.setNorthComponent(nch, "center");
	container.setCenterComponent(cch, "center");
	container.setSouthComponent(sch, "center");

	purchasePage.createHtml(container);
}