	function calculator()
	{
	//Weekly Variables

	var w_lunch = document.SavingsCalculator.w_lunch.value;
		if(w_lunch.length < 1)
		{
		w_lunch = 0;
		} 			 
	var w_dinner = document.SavingsCalculator.w_dinner.value;
		if(w_dinner.length < 1)
		{
		w_dinner = 0;
		}

		 
	//Monthly Variables
	var m_pizza = document.SavingsCalculator.m_pizza.value;
		if(m_pizza.length < 1)
		{
		m_pizza = 0;
		} 

	var m_minigolf = document.SavingsCalculator.m_minigolf.value;
		if(m_minigolf.length < 1)
		{
		m_minigolf = 0;
		} 

	var m_movietickets = document.SavingsCalculator.m_movietickets.value;
		if(m_movietickets.length < 1)
		{
		m_movietickets = 0;
		} 
	var m_movierental = document.SavingsCalculator.m_movierental.value;
		if(m_movierental.length < 1)
		{
		m_movierental = 0;
		} 
	
	
	//Yearly Variables
	var y_hotel = document.SavingsCalculator.y_hotel.value;
		if(y_hotel.length < 1)
		{
		y_hotel = 0;
		} 
	
	var y_cruise = document.SavingsCalculator.y_cruise.value;
		if(y_cruise.length < 1)
		{
		y_cruise = 0;
		} 

	var y_themepark = document.SavingsCalculator.y_themepark.value;
		if(y_themepark.length < 1)
		{
		y_themepark = 0;
		} 
	var y_theatre = document.SavingsCalculator.y_theatre.value;
		if(y_theatre.length < 1)
		{
		y_theatre = 0;
		} 

	var y_golf = document.SavingsCalculator.y_golf.value;
		if(y_golf.length < 1)
		{
		y_golf = 0;
		} 
	
	var y_oil = document.SavingsCalculator.y_oil.value;
		if(y_oil.length < 1)
		{
		y_oil = 0;
		}
	
	var y_carpets = document.SavingsCalculator.y_carpets.value;
		if(y_carpets.length < 1)
		{
		y_carpets = 0;
		} 

	var y_flowers = document.SavingsCalculator.y_flowers.value;
		if(y_flowers.length < 1)
		{
		y_flowers = 0;
		} 

	var y_cds = document.SavingsCalculator.y_cds.value;
		if(y_cds.length < 1)
		{
		y_cds = 0;
		} 

	var fTotal =((w_lunch*52*3.27) + (w_dinner*52*7.82) + (m_pizza*52*7.37) +(m_minigolf*12*5.33)+(m_movietickets*12*6.25) + (m_movierental*12* 5.75)+(y_hotel*21.42)+(y_cruise*20.00)+(y_themepark*14.77) + (y_theatre*21.48)+(y_golf*13.41)+(y_oil*5.08)+(y_carpets*20.00)+(y_flowers*6.16)+(y_cds*2.69));

if (fTotal < 150.00)
{
	fTotal = formatCurrency(fTotal);

	document.SavingsCalculator.Total.value = fTotal;
	document.getElementById("DisplayTotal").innerHTML = "<div id=calcSumTop></div><div id=calcSum><span>Estimated Yearly Savings:</span><br>" + fTotal + "<div id=calcDisclaimer><b>Hmmm... </b>so maybe saving on restaurants and travel doesn’t quite add up. Fortunately, with thousands of other great shopping and entertainment deals, Great Fun has plenty of ways for you to save BIG. And, now that you can dine out and see the world for less, you may just find more ways to have fun. Try it today, and see how easy it is to get more out of life... for less!</div></div><div id=calcSumBottom></div><div id=disclaimer>*The above figure represents your estimated annual savings by using the Great Fun benefits represented above. Your actual savings may vary depending on your region and usage.</div>";
	return true;
}
else	if (fTotal > 1000.00)
	{
	fTotal = formatCurrency(1000.00);

	document.SavingsCalculator.Total.value = fTotal;
	document.getElementById("DisplayTotal").innerHTML = "<div id=calcSumTop></div><div id=calcSum><span>Estimated Yearly Savings:</span><br>" + fTotal + "+ <div id=calcDisclaimer><b>Wow... sound too good to be true?</b> It’s not! With so many ways to save, you could save hundreds – even thousands – of dollars each year by using Great Fun’s member discounts on the things you love. Sign up today, and start getting more out of life... for less!</div></div><div id=calcSumBottom></div><div id=disclaimer>*The above figure represents your estimated annual savings by using the Great Fun benefits represented above. Your actual savings may vary depending on your region and usage.</div>";
	return true;
	}
	else
	{
	fTotal = formatCurrency(fTotal);

	document.SavingsCalculator.Total.value = fTotal;
	document.getElementById("DisplayTotal").innerHTML = "<div id=calcSumTop></div><div id=calcSum><span>Estimated Yearly Savings:</span><br>" + fTotal + "<div id=calcDisclaimer><b>Wow... that's quite a deal!</b> Plus, with thousands of other great deals on shopping and entertainment, Great Fun is your ticket to saving BIG on all the things you love! Sign up and start saving today!</div></div><div id=calcSumBottom></div><div id=disclaimer>*The above figure represents your estimated annual savings by using the Great Fun benefits represented above. Your actual savings may vary depending on your region and usage.</div>";
	return true;
	}

	}


//Function that formats total to currency
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);
	}