// JavaScript Document
//function to convert values to currency format
function formatCurrency(num) 
{
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
//return (((sign)?'':'-') + '$' + num + '.' + cents);
return (((sign)?'':'-') + num + '.' + cents);
}

function priceCalc()
{
	var manQty = document.forms.f1.manual.value;
	var man2Qty = document.forms.f1.manual2.value;
	var coachCorner = document.forms.f1.coachCorner.value;
	var total = 0;
	
	if(manQty != "select")
	{
		total = manQty * 60;
	}
	else
	{
		total = 0;
	}
	
	if(man2Qty != "select")
	{
		total += (man2Qty * 50);
	}
		
	if(coachCorner == 6)
	{
		total += 35;
	}
	else if(coachCorner == 12)
	{
		total += 55;
	}
	else
	{
		total = total;
	}
	
	//format for currency
	total = formatCurrency(total);
	
	//display data
	with(document)
	{
		forms.f1.total.value = "$" + total;
	}
}
