// JavaScript Document
function mytest() {
document.write("mytest: ");
}

function whichButton() {
var group1Checked 

	for (var i=0; i<document.frmOrder.group1.length; i++) {
	
		if (document.frmOrder.group1[i].checked) {
		group1Checked = document.frmOrder.group1[i].value
		}
		
	}
	
	if (document.frmOrder.group1[0].checked) {
		document.frmOrder.p1.value = '45';
		document.frmOrder.p2.value = '9';
		document.frmOrder.p3.value = '5';
		document.frmOrder.p4.value = '10';
		document.frmOrder.p5.value = '10';
		document.frmOrder.p6.value = '15';
		document.frmOrder.p7.value = '15';
		document.frmOrder.p8.value = '10';
		document.frmOrder.p9.value = '5';
		document.frmOrder.p10.value = '5';
		document.frmOrder.p11.value = '5';
		}
		
	if (document.frmOrder.group1[1].checked) {
		document.frmOrder.p1.value = '55';
		document.frmOrder.p2.value = '10';
		document.frmOrder.p3.value = '9';
		document.frmOrder.p4.value = '15';
		document.frmOrder.p5.value = '15';
		document.frmOrder.p6.value = '20';
		document.frmOrder.p7.value = '20';
		document.frmOrder.p8.value = '15';
		document.frmOrder.p9.value = '7';
		document.frmOrder.p10.value = '7';
		document.frmOrder.p11.value = '7';
		}
}

function calculateOrder()
{
    //var quantity, totalOrder;
	
	//var group1Checked;

    quantity = parseInt(document.frmOrder.q1.value);
	price = parseInt(document.frmOrder.p1.value);
    totalOrder = quantity * price;

    document.frmOrder.t1.value = "$"+totalOrder;
	 
	
	////---------2--------------
	//var quantity2, totalOrder2;

    quantity2 = parseInt(document.frmOrder.q2.value);
	price2 = parseInt(document.frmOrder.p2.value);
    totalOrder2 = quantity2 * price2;

    document.frmOrder.t2.value = "$"+totalOrder2;
	
	
	////---------3--------------
    quantity3 = parseInt(document.frmOrder.q3.value);
	price3 = parseInt(document.frmOrder.p3.value);
    totalOrder3 = quantity3 * price3;

    document.frmOrder.t3.value = "$"+totalOrder3;
	
	////---------4--------------
    quantity4 = parseInt(document.frmOrder.q4.value);
	price4 = parseInt(document.frmOrder.p4.value);
    totalOrder4 = quantity4 * price4;
	document.frmOrder.t4.value = "$"+totalOrder4;
	
	
	////---------5--------------
    quantity5 = parseInt(document.frmOrder.q5.value);
	price5 = parseInt(document.frmOrder.p5.value);
    totalOrder5 = quantity5 * price5;
	document.frmOrder.t5.value = "$"+totalOrder5;
	
	////---------6-------------
    quantity6 = parseInt(document.frmOrder.q6.value);
	price6 = parseInt(document.frmOrder.p6.value);
    totalOrder6 = quantity6 * price6;
	document.frmOrder.t6.value = "$"+totalOrder6;
	
	////---------7------------
    quantity7 = parseInt(document.frmOrder.q7.value);
	price7 = parseInt(document.frmOrder.p7.value);
    totalOrder7 = quantity7 * price7;
	document.frmOrder.t7.value = "$"+totalOrder7;
	
	////---------8--------------
    quantity8 = parseInt(document.frmOrder.q8.value);
	price8 = parseInt(document.frmOrder.p8.value);
    totalOrder8 = quantity8 * price8;
	document.frmOrder.t8.value = "$"+totalOrder8;
	
	////---------9------------
    quantity9 = parseInt(document.frmOrder.q9.value);
	price9 = parseInt(document.frmOrder.p9.value);
    totalOrder9 = quantity9 * price9;
	document.frmOrder.t9.value = "$"+totalOrder9;
	
	////---------10-------------
    quantity10 = parseInt(document.frmOrder.q10.value);
	price10 = parseInt(document.frmOrder.p10.value);
    totalOrder10 = quantity10 * price10;
	document.frmOrder.t10.value = "$"+totalOrder10;
	
	////---------11-------------
    quantity11 = parseInt(document.frmOrder.q11.value);
	price11= parseInt(document.frmOrder.p11.value);
    totalOrder11 = quantity11 * price11;
	document.frmOrder.t11.value = "$"+totalOrder11;
	
	
	//var quantity2, totalOrder2;

    //quantity2 = parseInt(document.frmOrder.q2.value);
	//price2 = parseInt(document.frmOrder.p2.value);
    total = totalOrder + totalOrder2 + totalOrder3 + totalOrder4 + totalOrder5 + totalOrder6 + totalOrder7 + totalOrder8 + totalOrder9 + totalOrder10 + totalOrder11;

    document.frmOrder.total.value = "$"+total;
}
