function calTotal() {
	var totalCost;
	var qty;
	var yourSFT = parseFloat(document.getElementById('yourSFT').value);  
    qty = Math.ceil(yourSFT / (parseInt(document.getElementById('units').value) * parseFloat(document.getElementById('unitSize').value)));
		if ((parseInt(document.getElementById('stock').value) +1) > qty) {
			var totalSFT = Math.round(qty * parseInt(document.getElementById('units').value) * parseFloat(document.getElementById('unitSize').value) * 100) / 100;
            totalCost = qty * parseFloat(document.getElementById('boxPrice').value);
			document.getElementById('box_qty').innerHTML = qty;
			document.forms.tForm0.quan.value = qty;
			document.forms.tForm0.quant.value = qty;
			document.getElementById('total_sft').innerHTML = totalSFT.toFixed(2);
	    } else {
		    document.getElementById('box_qty').innerHTML = 0;
			document.getElementById('total_sft').innerHTML = 0.00;
			totalCost = 0.00;		
		}
	document.getElementById('total_cost').innerHTML = totalCost.toFixed(2);	
}
