
function  changeselect (radio) {
	
	if (radio == "4.25X6") {
		document.getElementById("selection").innerHTML = "&nbsp;Standard";
		document.getElementById("unitcostper").innerHTML = "$0.137&nbsp;";
	}
	else if (radio == "5X7") {
		document.getElementById("selection").innerHTML = "&nbsp;Large";
		document.getElementById("unitcostper").innerHTML = "$0.15&nbsp;";	
	}
	else if (radio == "6X8.5") {
		document.getElementById("selection").innerHTML = "&nbsp;Deluxe";
		document.getElementById("unitcostper").innerHTML = "$0.17&nbsp;";	
	}
	else if (radio == "6X11") {
		document.getElementById("selection").innerHTML = "&nbsp;Sumo";
		document.getElementById("unitcostper").innerHTML = "$0.19&nbsp;";
	}
	else if (radio == "halffold") {
		document.getElementById("selection").innerHTML = "&nbsp;1/2-Fold";
		document.getElementById("unitcostper").innerHTML = "$0.40&nbsp;";
	}
	else if (radio == "trifold") {
		document.getElementById("selection").innerHTML = "&nbsp;Tri-Fold";
		document.getElementById("unitcostper").innerHTML = "$0.40&nbsp;";
	}
	
	calculatetotal();
	
}

function  changequantity (selection) {
	

		inserttext = "Qty: " + selection + "\&nbsp\;";
		
		document.getElementById("qty").innerHTML = inserttext;	

		calculatetotal();
}


function calculatetotal() {

	var result = new Array(2)
	
	thequantity = document.getElementById("qty").innerHTML;
	thecostperp = document.getElementById("unitcostper").innerHTML


	thequantity = (thequantity.substring(5));
	thecostperp = (thecostperp.substring(1));
	
	var pattern = /\&/;
	result = thequantity.split(pattern);
	
	thequantity = result[0];
	

	pattern = /\&/;
	result = thecostperp.split(pattern);

	
	thecostperp = result[0];
	

	var total = (thecostperp * thequantity);
	
	total = (Math.round(total*100)/100);
	total = total.toFixed(2);
	document.getElementById("subtotalprice").innerHTML = "$" + total + "&nbsp;";
	document.getElementById("totalprice").innerHTML = "$" + total + "&nbsp;";
	
		
}