jQ = jQuery;
var cost = new Array();
var classes = new Array();
function newTot(obj, amt, what)
{
if (isNaN(obj.value))
{
obj.value = 0
}
if (obj.value < 0)
{
obj.value = 0;
}
var total = 0;
var descrip = "";
if (amt > 0) {
cost[obj.id] = new Array(obj.value, amt, what);
} else {
classes[what] = obj.checked;
}
for (x in cost)
{
total = total + cost[x][0] * cost[x][1];
descrip += cost[x][0] + " x " + cost[x][2] + " @ " + cost[x][1]
descrip += "\n"
}
for (x in classes)
{
if (classes[x]) {
descrip += x + " ";
}
}
var fee = (total+0.30) / (1. - 0.029) - total;
fee = parseInt(fee * 100.) / 100.;
jQ('#total').text(total+fee);
jQ("#idamount").val(total+fee);
jQ("#idcustom").val(descrip);
jQ('#subtotal').text(total);
jQ('#fee').text(fee);
}