// JavaScript Document version where nocleaner & suction = same calculation (no .667)

			function calculate()
			{

				//text field variable assignment
				var  pumpAmp=document.getElementById("pumpamperage").value;
				pumpAmp=parseFloat(pumpAmp);
				var  pumpUsage=document.getElementById("pumpusage").value;
				pumpUsage=parseFloat(pumpUsage);
				var  costKWH=document.getElementById("costkwh").value;
				costKWH=parseFloat(costKWH);
				var  seasonDays=document.getElementById("daysperseason").value;
				seasonDays=parseFloat(seasonDays);
				var  prAmp=document.getElementById("jetamperage").value;
				prAmp=parseFloat(prAmp);
				var  pumpPRUsage=document.getElementById("pumphoursperday").value;
				pumpPRUsage=parseFloat(pumpPRUsage);
				var  prUsage=document.getElementById("jetunithoursperday").value;
				prUsage=parseFloat(prUsage);
				var  unitCost=document.getElementById("priceofunit").value;
				unitCost=parseFloat(unitCost);
				var boostAmp=document.getElementById("boostAmp").value;
				boostAmp=parseFloat(boostAmp);
				var boostUsage=document.getElementById("boostUsage").value;
				boostUsage=parseFloat(boostUsage);
				
				if (document.getElementById("pumphoursperday").value >= 2)
				{
					if (document.getElementById("suction").checked==true)
					{
						//Pump calculation.
						var KWH=(pumpAmp*115)/1000 //kwh calculation for pump
						var pumpKWHperDay=KWH*pumpUsage //pumps kw used a day    
						var totKWperSeason=pumpKWHperDay*seasonDays //pumps kw per season
						var pumpCostSeason=totKWperSeason*costKWH //pumps cost a season

						//Pump and jet cleaner calculation
						var prKWHperHour=(prAmp*115)/1000 //jet cleaner kw per hour
						var prKWPerDay=prKWHperHour*prUsage //jet cleaner kw per day
						var pumpKWHperdayWpr=KWH*pumpPRUsage; //pumps kw a day
						var totKWPerDayWpr=prKWPerDay + pumpKWHperdayWpr
						var totKWPerSeasonWpr=totKWPerDayWpr*seasonDays
						var prCostSeason=totKWPerSeasonWpr*costKWH

						//Anual Savings calculations
						var annualSaving=pumpCostSeason-prCostSeason // Anual savings
						var prPaidT=annualSaving/seasonDays //days jet pays itself
						var prPaid=unitCost/prPaidT //
						var kwSave=totKWperSeason-totKWPerSeasonWpr //
	 
						//Print results.
						document.getElementById("anuualsavings").value="You will save $"+Math.round(annualSaving*100)/100+" per season";
						document.getElementById("anuualsavings").style.color="#000000";
						document.getElementById("anuualsavings").style.backgroundColor="#FFFFFF";

						document.getElementById("numberofdays").value="The cleaner will be paid for in "+Math.round(prPaid)+" Days of use";
						document.getElementById("numberofdays").style.color="#000000";
						document.getElementById("numberofdays").style.backgroundColor="#FFFFFF";

						document.getElementById("KWyearSaving").value="You will save "+Math.round(kwSave)+" KwH per season / year";
						document.getElementById("KWyearSaving").style.color="#000000";
						document.getElementById("KWyearSaving").style.backgroundColor="#FFFFFF";
					}
					else if (document.getElementById("pressure").checked==true)
					{ 
						if (document.getElementById("boostAmp").value <= 0 || document.getElementById("boostUsage").value <= 0)
						{
							alert("boost fields must be greater than 0")
						}
						else
						{
							//Pump calculation.
							var KWH=(pumpAmp*115)/1000 //kwh calculation for pump
							var pumpKWHperDay=KWH*pumpUsage //pumps kw used a day    
							var boostKWH=(boostAmp*115)/1000//kwh calculation for booster
							var boostKWHperDay=boostKWH*boostUsage; //
							var totKWPerDay=pumpKWHperDay+boostKWHperDay //
							var totKWperSeason=totKWPerDay*seasonDays //pumps kw per season
							var pumpCostSeason=totKWperSeason*costKWH //pumps cost a season

							//Pump and jet cleaner calculation
							var prKWHperHour=(prAmp*115)/1000 //jet cleaner kw per hour
							var prKWPerDay=prKWHperHour*prUsage //jet cleaner kw per day
							var pumpKWHperdayWpr=KWH*pumpPRUsage; //pumps kw a day
							var totKWPerDayWpr=prKWPerDay + pumpKWHperdayWpr
							var totKWPerSeasonWpr=totKWPerDayWpr*seasonDays
							var prCostSeason=totKWPerSeasonWpr*costKWH

							//Anual Savings calculations
							var annualSaving=pumpCostSeason-prCostSeason // Anual savings
							var prPaidT=annualSaving/seasonDays //days jet pays itself
							var prPaid=unitCost/prPaidT //
							var kwSave=totKWperSeason-totKWPerSeasonWpr //
							
							//Print results.
							document.getElementById("anuualsavings").value="You will save $"+Math.round(annualSaving*100)/100+" per season";
							document.getElementById("anuualsavings").style.color="#000000";
							document.getElementById("anuualsavings").style.backgroundColor="#FFFFFF";

							document.getElementById("numberofdays").value="The cleaner will be paid for in "+Math.round(prPaid)+" Days of use";
							document.getElementById("numberofdays").style.color="#000000";
							document.getElementById("numberofdays").style.backgroundColor="#FFFFFF";

							document.getElementById("KWyearSaving").value="You will save "+Math.round(kwSave)+" KwH per season / year";
							document.getElementById("KWyearSaving").style.color="#000000";
							document.getElementById("KWyearSaving").style.backgroundColor="#FFFFFF";
						}
					}
					else if(document.getElementById("nocleaner").checked==true)
					{
						//Pump calculation.
							var KWH=(pumpAmp*115)/1000 //kwh calculation for pump
							var pumpKWHperDay=KWH*pumpUsage //pumps kw used a day    
							var totKWperSeason=pumpKWHperDay*seasonDays //pumps kw per season
							var pumpCostSeason=totKWperSeason*costKWH //pumps cost a season

							//Pump and jet cleaner calculation
							var prKWHperHour=(prAmp*115)/1000 //jet cleaner kw per hour
							var prKWPerDay=prKWHperHour*prUsage //jet cleaner kw per day
							var pumpKWHperdayWpr=KWH*pumpPRUsage; //pumps kw a day
							var totKWPerDayWpr=prKWPerDay + pumpKWHperdayWpr
							var totKWPerSeasonWpr=totKWPerDayWpr*seasonDays
							var prCostSeason=totKWPerSeasonWpr*costKWH

							//Anual Savings calculations
							var annualSaving=pumpCostSeason-prCostSeason // Anual savings
							var prPaidT=annualSaving/seasonDays //days jet pays itself
							var prPaid=unitCost/prPaidT //
							var kwSave=totKWperSeason-totKWPerSeasonWpr //
							
							//Print results.
							document.getElementById("anuualsavings").value="You will save $"+Math.round(annualSaving*100)/100+" per season";
							document.getElementById("anuualsavings").style.color="#000000";
							document.getElementById("anuualsavings").style.backgroundColor="#FFFFFF";

							document.getElementById("numberofdays").value="The cleaner will be paid for in "+Math.round(prPaid)+" Days of use";
							document.getElementById("numberofdays").style.color="#000000";
							document.getElementById("numberofdays").style.backgroundColor="#FFFFFF";

							document.getElementById("KWyearSaving").value="You will save "+Math.round(kwSave)+" KwH per season / year";
							document.getElementById("KWyearSaving").style.color="#000000";
							document.getElementById("KWyearSaving").style.backgroundColor="#FFFFFF";
					}

					else if(document.getElementById("suction").checked==false && document.getElementById("pressure").checked==false && document.getElementById("nocleaner").checked==false)
					{
						alert("Please choose your cleaner type")
					} 

				}
				else
				{
					alert("Aqua Products Unit: Pump hours per day recommended time must be 2 hours or greater.");
				}
			}

			function resetText()
			{
				document.getElementById("pumpamperage").value="";
				document.getElementById("pumpusage").value="";
				document.getElementById("costkwh").value="";
				document.getElementById("daysperseason").value="";
				document.getElementById("jetamperage").value="";
				document.getElementById("pumphoursperday").value="";
				document.getElementById("jetunithoursperday").value="";
				document.getElementById("priceofunit").value="";
				document.getElementById("boostAmp").value="";
				document.getElementById("boostUsage").value="";

				document.getElementById("anuualsavings").value="";
				document.getElementById("numberofdays").value="";
				document.getElementById("KWyearSaving").value="";
				document.getElementById("pumphoursperday").value="";
			
				document.getElementById("anuualsavings").style.backgroundColor="#AFD1DE";
				document.getElementById("numberofdays").style.backgroundColor="#AFD1DE";
				document.getElementById("KWyearSaving").style.backgroundColor="#AFD1DE";

			}
			function setColor()
			{
				
				document.getElementById("anuualsavings").style.backgroundColor="#8BBECF";
				document.getElementById("numberofdays").style.backgroundColor="#8BBECF";
				document.getElementById("KWyearSaving").style.backgroundColor="#8BBECF";
				document.getElementById("anuualsavings").readOnly=true;
				document.getElementById("numberofdays").readOnly=true;
				document.getElementById("KWyearSaving").readOnly=true;
				document.getElementById("anuualsavings").style.border = "none";
				document.getElementById("numberofdays").style.border = "none";
				document.getElementById("KWyearSaving").style.border = "none"; 
				document.getElementById("pumphoursperday").style.border = "none";
				document.getElementById("pumphoursperday").readOnly=true;
				document.getElementById("pumphoursperday").style.backgroundColor="#8BBECF";
				pumphoursperday
			}
			function makeInvis()
			{
				document.getElementById("boostAmp").value ="";
				document.getElementById("boostAmp").readOnly=true;
				document.getElementById("boostAmp").style.backgroundColor="#8BBECF";

				document.getElementById("boostUsage").value="";
				document.getElementById("boostUsage").readOnly=true;
				document.getElementById("boostUsage").style.backgroundColor="#8BBECF";
			}
			function makeVis()
			{
				document.getElementById("boostAmp").value = "10";
				document.getElementById("boostAmp").readOnly=true;
				document.getElementById("boostAmp").style.backgroundColor="#FFFFFF";

				document.getElementById("boostUsage").value = "";
				document.getElementById("boostUsage").readOnly=false;
				document.getElementById("boostUsage").style.backgroundColor="#FFFFFF";
			}
