//set up prices for ordering information table
var FirstTimeApplicationCost = 30;
var SubsequentApplicationCost = 20;
var third_qtyCost = 20;
var dup_trans_qtyCost = 15;
var frame_qtyCost = 15;

//initialize subtotals and total to zero
var FirstTimeApplicationFees = 0
var SubsequentApplicationFees = 0;
var third_qtyFees = 0;
var dup_trans_qtyFees = 0;
var frame_qtyFees = 0;
var totalAppFees = 0;

//function for <select> inputs
function calc_select(obj) {
	var feeName = obj.name + "Fees";
	var costName = obj.name + "Cost";
	var cellName = obj.name + "CELL";

	window[feeName] = obj.value * window[costName]
	
	document.getElementById(cellName).innerHTML = "$" + window[feeName];
	document.getElementById("totalCELL").innerHTML = "$" + calc_total();
}

//function for radio inputs
function calc_option(whichOpt) {

	if (whichOpt == "FirstTimeApplication") {
		document.getElementById("FirstTimeApplicationCELL").innerHTML = "$" + FirstTimeApplicationCost;
		FirstTimeApplicationFees = FirstTimeApplicationCost;

		document.getElementById("SubsequentApplicationCELL").innerHTML = "$0";
		SubsequentApplicationFees = 0;
	}
	else {
		document.getElementById("SubsequentApplicationCELL").innerHTML = "$" + SubsequentApplicationCost;
		SubsequentApplicationFees = SubsequentApplicationCost;

		document.getElementById("FirstTimeApplicationCELL").innerHTML = "$0";
		FirstTimeApplicationFees = 0;
	};
	
	document.getElementById("totalCELL").innerHTML = "$" + calc_total();
}

//function that totals all costs
function calc_total() {
	return FirstTimeApplicationFees + SubsequentApplicationFees + third_qtyFees + dup_trans_qtyFees + frame_qtyFees + totalAppFees;
}