function showOrder() {
	document.getElementById('orderlink').style.display = "none";
	document.getElementById('orderform').style.display = "block";
}

function hideOrder() {
	document.getElementById('orderlink').style.display = "block";
	document.getElementById('orderform').style.display = "none";	
}

function showShipping(shipcheck) {
	if(shipcheck.checked==true) {
		document.getElementById('shipping_box').style.display = "none";	
	} else {
		document.getElementById('shipping_box').style.display = "block";
	}
}

function updateFile(filename) {
	document.cartform.photo_filename.value = filename;
}

function updateTax(billingstate) {
	var shipping_cost = Number(document.getElementById('shipping_cost').value);
	var total_cost = Number(document.getElementById('total_cost').innerHTML);
	var subtotal = total_cost - shipping_cost;

	if(billingstate=="MI") {
		var salestax = subtotal * 0.06;
		var totaltaxcost = shipping_cost + salestax + subtotal;
		
		document.getElementById('sales_tax').innerHTML = salestax.toFixed(2);
		document.getElementById('order_sales_tax').value = salestax.toFixed(2);
		document.getElementById('total_cost').innerHTML = totaltaxcost.toFixed(2);
		document.getElementById('order_total_cost').innerHTML = totaltaxcost.toFixed(2);
	} else {
		var salestax = 0;
		var totalcost = shipping_cost + (subtotal - salestax);
		
		document.getElementById('sales_tax').innerHTML = salestax.toFixed(2);
		document.getElementById('order_sales_tax').value = salestax.toFixed(2);
		document.getElementById('total_cost').innerHTML = totalcost.toFixed(2);
		document.getElementById('order_total_cost').innerHTML = totalcost.toFixed(2);
	}
}
