//AUTHOR: ERIC FREIER WEATHERBANK,INC.
//DATE: JAN 2009
//THE GREEN GRID FREE-COOLING PROJECT
function airCooledSavings(wxHours, UPScapacity, electricRate, PUE, percITcooling, percChiller, percTower, ITcooling_kw, chiller_kw, tower_kw)
{
	
	chiller_kWh = (wxHours * chiller_kw);
	energyEfficiency = (chiller_kWh * PUE);
	savings = (electricRate * energyEfficiency);
	
	//round down to 2 sig digits
	if(savings>=100000)
	{
		rem = (savings%10000);
		savings = (savings-rem);
	}
	else if(savings>=10000 && savings<100000)
	{
		rem = (savings%1000);
		savings = (savings-rem);		
	}
	else if(savings>=1000 && savings<10000)
	{
		rem = (savings%100);
		savings = (savings-rem);		
	}
	else if(savings>=100 && savings<1000)
	{
		rem = (savings%10);
		savings = (savings-rem);		
	}	
	
return savings;
}
function evapCooledSavings(wxHours, UPScapacity, electricRate, PUE, percITcooling, percChiller, percTower, ITcooling_kw, chiller_kw, tower_kw)
{

	tower_kWh = (wxHours * chiller_kw);
	energyEfficiency = (tower_kWh * PUE);
	savings = (electricRate * energyEfficiency);
	
	//round down to 2 sig digits	
	if(savings>=100000)
	{
		rem = (savings%10000);
		savings = (savings-rem);
	}
	else if(savings>=10000 && savings<100000)
	{
		rem = (savings%1000);
		savings = (savings-rem);		
	}
	else if(savings>=1000 && savings<10000)
	{
		rem = (savings%100);
		savings = (savings-rem);		
	}
	else if(savings>=100 && savings<1000)
	{
		rem = (savings%10);
		savings = (savings-rem);		
	}		

return savings;
}