<!-- function sf(){wattspowercost.hours.focus();} // This sets the initial cursor focus to the input tag named 'hours'
function computepc()
{
var pc = document.wattspowercost; // This is the name of the form we'll we working with turned into the variable pc.
// line 5, hours to use in the power cost calculation
var hours = (pc.hours.value);
if (isNaN(hours)) hours = 0; pc.hours.value = "0";
pc.hours.value = Math.abs(hours);
// line 6, kwatthour to use in the power cost calculation
var kwatthour = (pc.kwatthour.value);
if (isNaN(kwatthour)) kwatthour = 0; pc.kwatthour.value = "0";
pc.kwatthour.value = Math.abs(kwatthour);
// line 7, watts2 to use in the power cost calculation
var watts2 = (pc.watts2.value);
if (isNaN(watts2)) watts2 = 0; pc.watts2.value = "0";
pc.watts2.value = Math.abs(watts2);	
// then compute the power cost per day based upon the formula
var perday = ((watts2 / 1000) * hours * kwatthour);
pc.perday.value = (perday).toFixed(2);	
// then compute the power cost per year based upon the formula
var peryear = ((watts2 / 1000) * hours * 365 * kwatthour);
pc.peryear.value = (peryear).toFixed(2);	
// then compute the power cost per month based upon the formula
var permonth = ((watts2 / 1000) * hours * (365 /12) * kwatthour);
pc.permonth.value = (permonth).toFixed(2);	
}
// -->



