﻿function tally()
{
var Cost;
Cost = 0;
if (document.orderform.Item1.checked) { Cost = Cost + 1; }
if (document.orderform.Item2.checked) { Cost = Cost + 1; }
if (document.orderform.Item3.checked) { Cost = Cost + 1; }
if (document.orderform.Item4.checked) { Cost = Cost + 1; }
if (document.orderform.Item5.checked) { Cost = Cost + 1; }
if (document.orderform.Item6.checked) { Cost = Cost + 1; }
if (document.orderform.Item7.checked) { Cost = Cost + 1; }
if (document.orderform.Item8.checked) { Cost = Cost + 1; } 
if (document.orderform.Item9.checked) { Cost = Cost + 1; }
if (document.orderform.Item10.checked) { Cost = Cost + 1; }
if (document.orderform.Item11.checked) { Cost = Cost + 1; }
if (document.orderform.Item12.checked) { Cost = Cost + 1; }
Cost = ats(Cost);


document.orderform.Total.value = Cost;

}
function ats (amount)
{
amount = parseInt(amount * 100);
amount = parseFloat(amount/100);
if (((amount) == Math.floor(amount)) && ((amount - Math.floor (amount)) == 0))
{
amount = amount
return amount;
}
if ( ((amount * 10) - Math.floor(amount * 10)) == 0)
{
amount = amount + "0";
return amount;
}
if ( ((amount * 100) - Math.floor(amount * 100)) == 0)
{
amount = amount;
return amount;
}
return amount; 
}