var sub1 = 99;
var sub2 = 0;
var value1 = 99;
var value2 = 49;

function plusone_licenses()
{
var x = document.forms.calculate;
x[0].value = parseInt(x[0].value) +1;
var tmp = x[1].value;
subtotal1();
}

function plusone_upgrades()
{
var x = document.forms.calculate;
x[3].value = parseInt(x[3].value) + 1;
var tmp = x[3].value;
subtotal2();
}

function subtotal1()
{
var x = document.forms.calculate;
var value = x[0].value;
var tmp = x[2].options[x[2].selectedIndex].innerHTML;
var price = 99;

if(tmp == "$49 - Leased FileTrack License")
price = 49;

if(tmp == "$99 - Owned FileTrack License")
price = 99;

if(tmp == "---")
price = 0;

if(tmp == "$39 - Upgrade Installation (Pro)")
price = 39;

sub1 = price*value;
total();
}

function subtotal2()
{
var x = document.forms.calculate;
var value = x[3].value;
var tmp = x[5].options[x[5].selectedIndex].innerHTML;
var price = 29;

if(tmp == "$29 - 1 Year Additional Access")
price = 29;

sub2 = price*value;
total();
}

function total()
{
var total = sub1 + sub2;
var x = document.forms.calculate;

x[6].value = "$" + total;
}