function disable()
{
	document.ofrm.ta.disabled = true;
	document.ofrm.tb.disabled = true;
	document.ofrm.tc.disabled = true;
	document.ofrm.td.disabled = true;
	document.ofrm.te.disabled = true;
	document.ofrm.tf.disabled = true;
	document.ofrm.tg.disabled = true;
	document.ofrm.th.disabled = true;
	document.ofrm.subt.disabled = true;
	document.ofrm.tax.disabled = true;
	document.ofrm.ship.disabled = true;
	document.ofrm.total.disabled = true;
}

function calculate()
{  					
	if (document.getElementById('qa').value > "")
	{
		var qtya;
		var pricea;
		var totala;
		
		qtya = document.getElementById('qa').value;
		pricea = document.getElementById('pa').value;
		wgta = document.getElementById('swa').value;
		
		shipa = wgta * qtya;
		shipa = new Number(shipa);
			
		totala = qtya * pricea;
		totala = new Number(totala);
		document.ofrm.ta.value = totala.toFixed(2);
		document.ofrm.hidta.value = totala.toFixed(2);	
	}	
	else
	{
		qtya = 1;
		
		pricea = document.getElementById('pa').value;
		wgta = document.getElementById('swa').value;
		
		shipa = wgta * qtya;
		shipa = new Number(shipa);
				
		totala = qtya * pricea;		
		totala = new Number(totala);
		document.ofrm.ta.value = totala.toFixed(2);
		document.ofrm.hidta.value = totala.toFixed(2);
	}
	
	if (document.getElementById('qb').value > "")
	{
		var qtyb;
		var priceb;
		var totalb;
		
		qtyb = document.getElementById('qb').value;
		priceb = document.getElementById('pb').value;
		wgtb = document.getElementById('swb').value;
		
		shipb = wgtb * qtyb;
		shipb = new Number(shipb);
						
		totalb = qtyb * priceb;
		totalb = new Number(totalb);					
		document.ofrm.tb.value = totalb.toFixed(2);
		document.ofrm.hidtb.value = totalb.toFixed(2);		
	}
	else
	{
		qtyb = 1;
		
		priceb = document.getElementById('pb').value;
		wgtb = document.getElementById('swb').value;
		
		shipb = wgtb * qtyb;
		shipb = new Number(shipb);
						
		totalb = qtyb * priceb;
		totalb = new Number(totalb);					
		document.ofrm.tb.value = totalb.toFixed(2);
		document.ofrm.hidtb.value = totalb.toFixed(2);
	}
	
	if (document.getElementById('qc').value > "")
	{
		var qtyc;
		var pricec;
		var totalc;
		
		qtyc = document.getElementById('qc').value;
		pricec = document.getElementById('pc').value;
		wgtc = document.getElementById('swc').value;
		
		shipc = wgtc * qtyc;
		shipc = new Number(shipc);
				
		totalc = qtyc * pricec;
		totalc = new Number(totalc);					
		document.ofrm.tc.value = totalc.toFixed(2);	
		document.ofrm.hidtc.value = totalc.toFixed(2);	
	}
	else
	{
		qtyc = 1;
		
		pricec = document.getElementById('pc').value;
		wgtc = document.getElementById('swc').value;
		
		shipc = wgtc * qtyc;
		shipc = new Number(shipc);
				
		totalc = qtyc * pricec;
		totalc = new Number(totalc);					
		document.ofrm.tc.value = totalc.toFixed(2);
		document.ofrm.hidtc.value = totalc.toFixed(2);
	}									

	if (document.getElementById('qd').value > "")
	{
		var qtyd;
		var priced;
		var totald;
		
		qtyd = document.getElementById('qd').value;
		priced = document.getElementById('pd').value;
		wgtd = document.getElementById('swd').value;
		
		shipd = wgtd * qtyd;
		shipd = new Number(shipd);
				
		totald = qtyd * priced;
		totald = new Number(totald);					
		document.ofrm.td.value = totald.toFixed(2);
		document.ofrm.hidtd.value = totald.toFixed(2);		
	}
	else
	{
		qtyd = 1;
		
		priced = document.getElementById('pd').value;
		wgtd = document.getElementById('swd').value;
		
		shipd = wgtd * qtyd;
		shipd = new Number(shipd);
				
		totald = qtyd * priced;
		totald = new Number(totald);					
		document.ofrm.td.value = totald.toFixed(2);
		document.ofrm.hidtd.value = totald.toFixed(2);
	}					
	
	if (document.getElementById('qe').value > "")
	{
		var qtye;
		var pricee;
		var totale;
		
		qtye = document.getElementById('qe').value;
		pricee = document.getElementById('pe').value;
		wgte = document.getElementById('swe').value;
		
		shipe = wgte * qtye;
		shipe = new Number(shipe);
				
		totale = qtye * pricee;
		totale = new Number(totale);					
		document.ofrm.te.value = totale.toFixed(2);
		document.ofrm.hidte.value = totale.toFixed(2);		
	}
	else
	{
		qtye = 1;
		
		pricee = document.getElementById('pe').value;
		wgte = document.getElementById('swe').value;
		
		shipe = wgte * qtye;
		shipe = new Number(shipe);
				
		totale = qtye * pricee;
		totale = new Number(totale);					
		document.ofrm.te.value = totale.toFixed(2);
		document.ofrm.hidte.value = totale.toFixed(2);
	}					
	
	if (document.getElementById('qf').value > "")
	{
		var qtyf;
		var pricef;
		var totalf;
		
		qtyf = document.getElementById('qf').value;
		pricef = document.getElementById('pf').value;
		wgtf = document.getElementById('swf').value;
		
		shipf = wgtf * qtyf;
		shipf = new Number(shipf);
				
		totalf = qtyf * pricef;
		totalf = new Number(totalf);					
		document.ofrm.tf.value = totalf.toFixed(2);	
		document.ofrm.hidtf.value = totalf.toFixed(2);	
	}
	else
	{
		qtyf = 1;
		
		pricef = document.getElementById('pf').value;
		wgtf = document.getElementById('swf').value;
		
		shipf = wgtf * qtyf;
		shipf = new Number(shipf);
				
		totalf = qtyf * pricef;
		totalf = new Number(totalf);					
		document.ofrm.tf.value = totalf.toFixed(2);
		document.ofrm.hidtf.value = totalf.toFixed(2);	
	}					
	
	if (document.getElementById('qg').value > "")
	{
		var qtyg;
		var priceg;
		var totalg;
		
		qtyg = document.getElementById('qg').value;
		priceg = document.getElementById('pg').value;
		wgtg = document.getElementById('swg').value;
		
		shipg = wgtg * qtyg;
		shipg = new Number(shipg);
				
		totalg = qtyg * priceg;
		totalg = new Number(totalg);					
		document.ofrm.tg.value = totalg.toFixed(2);	
		document.ofrm.hidtg.value = totalg.toFixed(2);	
	}
	else
	{
		qtyg = 1;
		
		priceg = document.getElementById('pg').value;
		wgtg = document.getElementById('swg').value;
		
		shipg = wgtg * qtyg;
		shipg = new Number(shipg);
				
		totalg = qtyg * priceg;
		totalg = new Number(totalg);					
		document.ofrm.tg.value = totalg.toFixed(2);
		document.ofrm.hidtg.value = totalg.toFixed(2);	
	}					
	
	if (document.getElementById('qh').value > "")
	{
		var qtyh;
		var priceh;
		var totalh;
		
		qtyh = document.getElementById('qh').value;
		priceh = document.getElementById('ph').value;
		wgth = document.getElementById('swh').value;
		
		shiph = wgth * qtyh;
		shiph = new Number(shiph);
				
		totalh = qtyh * priceh;
		totalh = new Number(totalh);					
		document.ofrm.th.value = totalh.toFixed(2);	
		document.ofrm.hidth.value = totalh.toFixed(2);	
	}
	else
	{
		qtyh = 1;
		
		priceh = document.getElementById('ph').value;
		wgth = document.getElementById('swh').value;
		
		shiph = wgth * qtyh;
		shiph = new Number(shiph);
				
		totalh = qtyh * priceh;
		totalh = new Number(totalh);					
		document.ofrm.th.value = totalh.toFixed(2);
		document.ofrm.hidth.value = totalh.toFixed(2);
	}					
	
	subtotal = totala + totalb + totalc + totald + totale + totalf + totalg + totalh;
	subtotal = new Number(subtotal);
	document.ofrm.subt.value = subtotal.toFixed(2);	
	document.ofrm.hidsubt.value = subtotal.toFixed(2);
	
	if (document.getElementById('bcountry').value == "canada")
	{	
		taxs = subtotal * 0.05;
		document.ofrm.tax.value = taxs.toFixed(2); 
		document.ofrm.hidtax.value = taxs.toFixed(2);
	}
	else if (document.getElementById('bcountry').value == "Canada")
	{	
		taxs = subtotal * 0.05;
		document.ofrm.tax.value = taxs.toFixed(2);
		document.ofrm.hidtax.value = taxs.toFixed(2); 
	}	
	else
	{
		taxs = 0.00;
		document.ofrm.tax.value = taxs.toFixed(2);
		document.ofrm.hidtax.value = taxs.toFixed(2);
	}
	
	shipweight = shipa + shipb + shipc + shipd + shipe + shipf + shipg + shiph;
	shipweight = new Number(shipweight);
	
	if (shipweight < 0.5)
	{
		document.ofrm.ship.value = "4.00";
		document.ofrm.hidship.value = "4.00"; 
		shiptotal = 4.00;
	}
	else if (shipweight > 1.5)
	{
		document.ofrm.ship.value = "12.00";
		document.ofrm.hidship.value = "12.00";
		shiptotal = 12.00;
	}
	else
	{
		document.ofrm.ship.value = "9.00";
		document.ofrm.hidship.value = "9.00";
		shiptotal = 9.00;
	}	
	
	if (subtotal >= 50)
	{
		document.ofrm.ship.value = "0.00";
		document.ofrm.hidship.value = "0.00";
		shiptotal = 0.00;
	}	
			
	total = subtotal + taxs + shiptotal;
	total = new Number(total);
	document.ofrm.total.value = total.toFixed(2);
	document.ofrm.hidtotal.value = total.toFixed(2);	
}

