function update_discounted_price(price, display_field) {
	if (/^\d+(\.\d+)?$/.test(price)) {
		price_as_cents = Math.round(price * 100);
		discounted_price_as_cents = Math.round(price_as_cents * 0.7);
		discounted_price = discounted_price_as_cents / 100;
		discounted_price = "$" + discounted_price;
		if (/\d+\.\d{2}/.test(discounted_price)) {
			display_field.innerHTML = discounted_price;
		} else if (/\d+\.\d/.test(discounted_price)) {
			display_field.innerHTML = discounted_price + "0";
		} else {
			display_field.innerHTML = discounted_price + ".00";
		}
	}
	else { 
		display_field.innerHTML = "$0.00";
		alert('Please enter a valid dollar amount, leaving off the dollar sign. For example: 199.99'); }
}

function view_proof(product_form) {
	product_id = $(product_form['line_item[product_id]']).getValue().strip();
	class_year = $(product_form['detail[class_year]']).getValue().strip();
	section = $(product_form['detail[section]']).getValue().strip();
	if (/\d{4}/.test(class_year) && /\w+/.test(section)) {
		window.open("/store/categories/photos/products/proof?product_id=" + product_id + "&class_year=" + class_year + "&section=" + section);	
	}	else {
		alert("Please select a Section and Class Year");
	}
}