// OrderCD.js -- Compile Print Info to order CD

var printWindow = null
function printOrder() {	
	// check if printWindow already open
	if (!printWindow || printWindow.closed) {
		printWindow = window.open("","","width=600,height=500,scrollbars")
		// assemble content
		var printContent = "<html><head><title>Print CD Order</title><link href='pbb.css' rel='stylesheet' type='text/css'></head>"
		printContent += "<body><table width=\"500\"><tr><td width=\"195\" valign=\"top\"><img src=\"images/CDCover_1.jpg\" width=\"190\" height=\"195\" border=\"2\" alt=\"\"></td><td width=\"305\" valign=\"middle\"><div class=\"BODYHEAD\">CD Order Form</div><br><div class=\"BODYSUBHEAD\">Prairie Brass Band - CD<br>P.O. Box 182<br>Arlington Heights, IL 60006-0182</div></td></tr></table>"
		printContent += "<table width='500'><tr><td><hr><div class='PERFDATE'>Please review the information on this page and make sure that it is correct. If it is not,  close this window and return to the order input page.<br><br>If the info is correct, print this page using the Print button at the bottom and mail it, along with a check or money order, to the Prairie Brass Band at the address above. Make checks payable to \"Prairie Brass Band\".</div><br></td></tr><tr><td><div class='PERFDATE'>Mailing Address:</div><div class='PERFINFO'>"
		printContent += document.forms['orderCD'].elements.firstname.value + " " + document.forms['orderCD'].elements.lastname.value + "<br>";
		printContent += document.forms['orderCD'].elements.address.value + "<br>"
		if (document.forms['orderCD'].elements.address2.value != "") {
			printContent += document.forms['orderCD'].elements.address2.value + "<br>"
		}
		printContent += document.forms['orderCD'].elements.city.value + ", " + document.forms['orderCD'].elements.state.value + " " + document.forms['orderCD'].elements.zip.value + "<br>"
		if (document.forms['orderCD'].elements.country.value != "") {
			printContent += document.forms['orderCD'].elements.country.value + "<br>"
		}
		printContent += "<br></div><div class='PERFDATE'>Contact Info:</div><div class='PERFINFO'>" + document.forms['orderCD'].elements.phone.value + "<br>" + document.forms['orderCD'].elements.email.value + "<br><br></div>"
		printContent += "<div class='PERFDATE'>Order Detail:</div><div class='PERFINFO'>" + document.forms['orderCD'].elements.quantity.value + " CD's<br>$"
		printContent += document.forms['orderCD'].elements.quantity.value * 17
		printContent += " Total<br></div></td></tr></table>"

		printContent += "<form><input type='button' name='printPage' value='Print Order' onclick='parent.print()'></form></body></html>"
		printWindow.document.write(printContent)
		printWindow.document.close()
	} else {
	printWindow.focus()
	}
}

