function total_charge(unitCost_quantity)
{
		unit_cost = unitCost_quantity.split('_');
	total = parseInt(unit_cost[1]);	
	
	perUnit = (parseInt(unit_cost[1]) / parseInt(unit_cost[0]));

	$('selectQuantityCharge').innerHTML = '$' + total.toFixed(2) + " + tax";
	
	$('costPerUnit').innerHTML = '$' + perUnit.toFixed(2) + ' each';
	
}

function total_cost(current_total,unit_cost,uid)
{
	var unit_cost = unit_cost.split('_');
	var grandTotal = $('grandTotal').innerHTML;

	// grandtotal minus current item
	var a = parseFloat(grandTotal.replace('$','')) - parseFloat(current_total.replace('$',''));
	
	total = parseInt(unit_cost[1]);
	divTag = "totalCost" + uid;
	$(divTag).innerHTML = '$' + total.toFixed(2);
	
	//update the per unit cost
	var per_unit_cost =  (parseInt(unit_cost[1])/parseInt(unit_cost[0]));
	$('perUnitCost'+uid).innerHTML = '$' + per_unit_cost.toFixed(2);
	
	newGrandTotal = total + a;
	$('grandTotal').innerHTML = '$' + newGrandTotal.toFixed(2);
}

