<!--
function round(number,x) {
  return Math.round(number * Math.pow(10,x)) / Math.pow(10,x);
}

function cents(amount) {
  amount -= 0;

  amount = round(amount, 2);

  if (amount == 0)
    amount += '.00';
  else if (amount == Math.floor(amount))
    amount += '.00';
  else if (amount*10 == Math.floor(amount*10))
    amount += '0';

  return '' + amount;
}

function padwith(num, size, chr) {
  num = '' + num;
  while (num.length < size) num = chr + num;
  return num;
}

function calc(what) {
  var subTotal = 0;
  for (var i=0;i<products.length/2;i++) {
    var quantity = what.elements['quantity' + i].value - 0;
    var price = what.elements['price' + i].value - 0;
    var total = quantity * price;
    total = cents(total);
    what['total' + i].value = padwith(total,9,' ');
    subTotal += total - 0;
  }
  subTotal = cents(subTotal);
  what.subTotal.value = padwith(subTotal,9,' ');
  var taxrate = what.tax.value - 0
  var taxTotal = cents((subTotal - 0) / 100 * taxrate);
  what.taxTotal.value = padwith(taxTotal,9,' ');
  var grandTotal = cents((subTotal - 0) + (taxTotal - 0));
  what.grandTotal.value = padwith(grandTotal,9,' ');
}

var products = new Array(
  '<strong>Banner Ads</strong> (pay-per-click) 1000 visitors<br>1000 clicks of focused ads on search engines targeted by keyword searches', 500.00,
  '<strong>Banner Ads</strong> (pay-per-click) 250 visitors', 125.00,
  '<strong>Banner Ads</strong> (pay-per-click) 100 visitors', 50.00,
  '<strong>Email Marketing</strong> 10,000 emails/month<br>(100 emails/month <span style="color: red;">Free 60 day trial</span>)', 299.00,
  '<strong>Email Marketing</strong> 1,000 emails/month', 199.00,
  '<strong>Search Engine Submission</strong> (1 annual url)<br>Site is optimized prior to submission and tracked. <br>Url is submitted to 19 top engines', 79.00,
  '<strong>Traffic Builder Suite</strong> (annual fee)<br>Submission to search engines, email marketing, and banner ads', 249.00,
  '<strong>Sales Leads</strong> ($.10 to $.50 per record)<br>$0.40 average, estimate by selecting the number of leads per month to show yearly fees', 4.80,
  '<strong>Search Engine Pay-Per-Click Ads</strong><br>$5 set-up fee per ad, estimate $50/month cap on click charges', 605.00,
  '<strong>Directory Paid Inclusion</strong> (yahoo.com annual fee)', 299.00
  
);
//-->