function totalLine(line){
	lineQuantity = document.getElementById('qnty' + line).value;
	linePrice = document.getElementById('price' + line).value;
	lineTotal = lineQuantity * linePrice;
	
	document.getElementById('total' + line).value = lineTotal.toFixed(2);
	document.getElementById('dispTotal' + line).value = '$' + lineTotal.toFixed(2);
	
	allInputs = document.getElementById('orderform').getElementsByTagName('input');
	
	totalQuantity = 0;
	totalPrice = 0;
	for(i=0; i<allInputs.length; i++){
		if(allInputs[i].className == 'quantity'){
			totalQuantity = totalQuantity + parseInt(allInputs[i].value);
		}
		
		if(allInputs[i].className == 'total'){
			lineTotalPrice = allInputs[i].value * 1;
			totalPrice = totalPrice + lineTotalPrice;
		}
	}
	
	document.getElementById('totalQuantity').value = totalQuantity;
	document.getElementById('totalPrice').value = totalPrice;
	document.getElementById('disptotalPrice').value = "$" + totalPrice.toFixed(2);
	deposit = totalQuantity * 0.1;
	document.getElementById('deposit').value = deposit;
	document.getElementById('dispdeposit').value = "$" + deposit.toFixed(2);
	grandTotal = totalPrice + deposit;
	document.getElementById('grandTotal').value = grandTotal;
	document.getElementById('dispgrandTotal').value = "$" + grandTotal.toFixed(2);
	
	if(totalQuantity >= 12){
		document.getElementById('submit_form').disabled = false;
	} else {
		document.getElementById('submit_form').disabled = true;
	}
}