<!-- Begin
var text="Thank You for using the S. King Company Inverter Calculator.<br> We suggest the following inverters for your application: <br><b>";
var hotText="Statpower NotePower50 or NotePower75";
var URL="http://www.skingcompany.com/search_results.asp?txtsearchParamTxt=note50+note75&txtsearchParamType=ANY&txtsearchParamCat=8&txtsearchParamMan=24&txtsearchParamVen=ALL&txtDateAddedStart=&txtDateAddedEnd=&txtPriceStart=&txtPriceEnd=&txtFromSearch=fromSearch&iLevel=1";
var hotText2="Statpower NotePower50 or NotePower75";
var URL2="http://www.skingcompany.com/search_results.asp?txtsearchParamTxt=note50+note75&txtsearchParamType=ANY&txtsearchParamCat=8&txtsearchParamMan=24&txtsearchParamVen=ALL&txtDateAddedStart=&txtDateAddedEnd=&txtPriceStart=&txtPriceEnd=&txtFromSearch=fromSearch&iLevel=1";
var contValue=50;
var surgeValue=50;

function testIt()
{
	if ((document.calcform.subtotal.value > 0) && (document.calcform.subtotal.value <= 70))
	{
     		hotText="Statpower NotePower50 or NotePower75";
	   	URL="http://www.skingcompany.com/search_results.asp?txtsearchParamTxt=note50+note75&txtsearchParamType=ANY&txtsearchParamCat=8&txtsearchParamMan=24&txtsearchParamVen=ALL&txtDateAddedStart=&txtDateAddedEnd=&txtPriceStart=&txtPriceEnd=&txtFromSearch=fromSearch&iLevel=1";
	   	contValue=70;
	}
     	if ((document.calcform.subtotal.value > 70) && (document.calcform.subtotal.value <= 150))
	{
     		hotText="150 watt Inverters Comparison Chart";
	   	URL="http://www.skingcompany.com/portable_power/comparison_charts/150watt_comparison.htm";
	   	contValue=150;
	}
	if ((document.calcform.subtotal.value > 150) && (document.calcform.subtotal.value <= 400))
	{
     		hotText="300 watt Inverters Comparison Chart";
     		URL="http://www.skingcompany.com/portable_power/comparison_charts/300watt_comparison.htm";
     		contValue=300;
     	}
     	if ((document.calcform.subtotal.value > 300) && (document.calcform.subtotal.value <= 700))
	{
     		hotText="600 watt Inverters Comparison Chart";
     		URL="http://www.skingcompany.com/portable_power/comparison_charts/600watt_comparison.htm";
     		contValue=600;
     	}
     	if ((document.calcform.subtotal.value > 700) && (document.calcform.subtotal.value <= 1000))
	{
     		hotText="1000 watt Inverters Comparison Chart";
     		URL="http://www.skingcompany.com/portable_power/comparison_charts/1000watt_comparison.htm";
     		contValue=1000;
     	}
     	if ((document.calcform.subtotal.value > 1000) && (document.calcform.subtotal.value <= 1500))
	{
     		hotText="1500 watt Inverters Comparison Chart";
     		URL="http://www.skingcompany.com/portable_power/comparison_charts/1500watt_comparison.htm";
     		contValue=1500;
     	}
     	if ((document.calcform.subtotal.value > 1500) && (document.calcform.subtotal.value <= 2500))
	{
     		hotText="2500 watt Inverters Comparison Chart";
     		URL="http://www.skingcompany.com/portable_power/comparison_charts/2500watt_comparison.htm";
     		contValue=2500;
     	}
     	if (document.calcform.subtotal.value > 2500) 
	{
     		hotText="Please click here to contact us by email or call us at the number at the top of the page for a recommendation";
     		URL="mailto:customerservice@skingcompany.com?subject=Need larger than 2500 watt inverter";
     		contValue=2500;
	}
     	
	if ((document.calcform.subtotal2.value > 0) && (document.calcform.subtotal2.value <= 150))
	{
     		hotText2="Statpower NotePower50 or NotePower75";
     		URL2="http://www.skingcompany.com/search_results.asp?txtsearchParamTxt=note50+note75&txtsearchParamType=ANY&txtsearchParamCat=8&txtsearchParamMan=24&txtsearchParamVen=ALL&txtDateAddedStart=&txtDateAddedEnd=&txtPriceStart=&txtPriceEnd=&txtFromSearch=fromSearch&iLevel=1";
     		surgeValue=75;
     	}
	if ((document.calcform.subtotal2.value > 150) && (document.calcform.subtotal2.value <= 400))
	{
     		hotText2="150 watt Inverters Comparison Chart";
     		URL2="http://www.skingcompany.com/portable_power/comparison_charts/150watt_comparison.htm";
     		surgeValue=150;
     	}
     	if ((document.calcform.subtotal2.value > 400) && (document.calcform.subtotal2.value <= 800))
	{
     		hotText2="300 watt Inverters Comparison Chart";
     		URL2="http://www.skingcompany.com/portable_power/comparison_charts/300watt_comparison.htm";
     		surgeValue=300;
     	}
     	if ((document.calcform.subtotal2.value > 800) && (document.calcform.subtotal2.value <= 1200))
	{
     		hotText2="600 watt Inverters Comparison Chart";
     		URL2="http://www.skingcompany.com/portable_power/comparison_charts/600watt_comparison.htm";
     		surgeValue=600;
     	}
     	if ((document.calcform.subtotal2.value > 1200) && (document.calcform.subtotal2.value <= 2400))
	{
     		hotText2="1000 watt Inverters Comparison Chart";
     		URL2="http://www.skingcompany.com/portable_power/comparison_charts/1000watt_comparison.htm";
     		surgeValue=1000;
     	}
     	if ((document.calcform.subtotal2.value > 2400) && (document.calcform.subtotal2.value <= 3000))
	{
     		hotText2="1500 watt Inverters Comparison Chart";
     		URL2="http://www.skingcompany.com/portable_power/comparison_charts/1500watt_comparison.htm";
     		surgeValue=1500;
     	}
     	if ((document.calcform.subtotal2.value > 3000) && (document.calcform.subtotal2.value <= 5000))
	{
     		hotText2="2500 watt Inverters Comparison Chart";
     		URL2="http://www.skingcompany.com/portable_power/comparison_charts/2500watt_comparison.htm";
     		surgeValue=2500;
     	}
	if (document.calcform.subtotal2.value > 5000)
	{
     		hotText2="Please click here to contact us by email or call us at the number at the top of the page for a recommendation";
     		URL2="mailto:customerservice@skingcompany.com?subject=Need larger than 2500 watt inverter";
     		surgeValue=5000;
     	}

	if (document.layers)
	{
		/*if (surgeValue > contValue)
		{
     			document.layers['which'].document.open();
     			document.layers['which'].document.write(text + "<br>Based on your input we recommend you look at " + hotText2.link(URL2)) + "</b>";
          		document.layers['which'].document.close();
		}
	    	else 
		{
    			document.layers['which'].document.open();
    			document.layers['which'].document.write(text + "<br>Based on your input we recommend you look at " + hotText.link(URL)) + "</b>";
			document.layers['which'].document.close();
		}*/
    }
  	else 
  	{
  		/*if (surgeValue > contValue)
     			document.all.which.innerHTML = text + "<br>Based on your input we recommend you look at " + hotText2.link(URL2) + "</b>";
	   	
	   	else 
	   		document.all.which.innerHTML = text + "<br>Based on your input we recommend you look at " + hotText.link(URL) + "</b>";
		*/
	}	
		




showIt('which');

}




function showIt(layer)
{   
	if(document.layers)
		(document.layers[layer].visibility="show");
	
	else 
	{	
		if (document.all) 
			(document.all[layer].style.visibility="visible");
	}
}





function calculateSurgeKnown()
{

	if (document.calcform.surge1a.checked)
		(document.calcform.surgeneed1.value = document.calcform.total1.value);
	
	if (document.calcform.surge1.checked)
		(document.calcform.surgeneed1.value = (document.calcform.total1.value * 4));
	
	if (document.calcform.surge2a.checked)
		(document.calcform.surgeneed2.value = document.calcform.total2.value);
		
	if (document.calcform.surge2.checked)
		(document.calcform.surgeneed2.value = (document.calcform.total2.value * 4));
	
	if (document.calcform.surge3a.checked)
		(document.calcform.surgeneed3.value = document.calcform.total3.value);
		
	if (document.calcform.surge3.checked)
		(document.calcform.surgeneed3.value = (document.calcform.total3.value * 4));
	
	if (document.calcform.surge4a.checked)
		(document.calcform.surgeneed4.value = document.calcform.total4.value);
	
	if (document.calcform.surge4.checked)
		(document.calcform.surgeneed4.value = (document.calcform.total4.value * 4));
	
	if (document.calcform.surge5a.checked)
		(document.calcform.surgeneed5.value = document.calcform.total5.value);
		
	if (document.calcform.surge5.checked)
		(document.calcform.surgeneed5.value = (document.calcform.total5.value * 4));
	

document.calcform.subtotal.value = (eval(document.calcform.total1.value) + eval(document.calcform.total2.value) + eval(document.calcform.total3.value) + eval(document.calcform.total4.value) + eval(document.calcform.total5.value));
document.calcform.subtotal2.value = (eval(document.calcform.surgeneed1.value) + eval(document.calcform.surgeneed2.value) + eval(document.calcform.surgeneed3.value) + eval(document.calcform.surgeneed4.value) + eval(document.calcform.surgeneed5.value));
document.calcform.dci.value = (document.calcform.subtotal.value / 10);
document.calcform.dcis.value = (document.calcform.subtotal2.value / 10);
//document.calcform.OhmsPerFoot.value = eval(0.360000 / (eval(document.calcform.dci.value) * eval(document.calcform.DesiredLength.value * 2)));

document.calcform.CMArea.value = eval((10.75 * eval(document.calcform.dci.value) * eval(document.calcform.DesiredLength.value * 2))/.36);

	if ((eval(document.calcform.CMArea.value) <= 2336) && (eval(document.calcform.dci.value) <= 25)) 
		(document.calcform.WireSizeNeeded.value = 16);
	else 
		if ((eval(document.calcform.CMArea.value) <= 3702) && (eval(document.calcform.dci.value) <= 35))
			(document.calcform.WireSizeNeeded.value = 14);
		else 
			if ((eval(document.calcform.CMArea.value) <= 5833) && (eval(document.calcform.dci.value) <= 45))
				(document.calcform.WireSizeNeeded.value = 12);
			else
				if ((eval(document.calcform.CMArea.value) <= 9343) && (eval(document.calcform.dci.value) <= 60))
					(document.calcform.WireSizeNeeded.value = 10);
				else 
					if ((eval(document.calcform.CMArea.value) <= 14810) && (eval(document.calcform.dci.value) <= 80))
						(document.calcform.WireSizeNeeded.value = 8);
					else 
						if ((eval(document.calcform.CMArea.value) <= 24538) && (eval(document.calcform.dci.value) <= 120))
							(document.calcform.WireSizeNeeded.value = 6);
						else 
							if ((eval(document.calcform.CMArea.value) <= 37360) && (eval(document.calcform.dci.value) <= 160))
								(document.calcform.WireSizeNeeded.value = 4);
							else 
								if ((eval(document.calcform.CMArea.value) <= 62450) && (eval(document.calcform.dci.value) <= 210))
									(document.calcform.WireSizeNeeded.value = 2);
								else 
									if ((eval(document.calcform.CMArea.value) <= 77790) && (eval(document.calcform.dci.value) <= 245))
										(document.calcform.WireSizeNeeded.value = 1);
									else 
										if ((eval(document.calcform.CMArea.value) <= 98980) && (eval(document.calcform.dci.value) <= 285))
											(document.calcform.WireSizeNeeded.value = 0);
										else 
											if ((eval(document.calcform.CMArea.value) <= 125100) && (eval(document.calcform.dci.value) <= 330))
												(document.calcform.WireSizeNeeded.value = "00");
											else 
												if ((eval(document.calcform.CMArea.value) <= 158600) && (eval(document.calcform.dci.value) <= 385))
													(document.calcform.WireSizeNeeded.value = "000");
												else 
													if ((eval(document.calcform.CMArea.value) <= 205500) && (eval(document.calcform.dci.value) <= 445))
														(document.calcform.WireSizeNeeded.value = "0000");
													else
														(document.calcform.WireSizeNeeded.value = "Too Big");
													


testIt()

}






function calculateA()
{

	if (document.calcform.amps1.value > 0)
	{
		(document.calcform.total1.value = document.calcform.amps1.value * 120) 
		&& (document.calcform.watts1.value = document.calcform.amps1.value * 120)
	}
	else 
	{	(document.calcform.total1.value = 0) &&
		(document.calcform.amps1.value = 0) &&
		(document.calcform.watts1.value = 0)
	}
	if (document.calcform.amps2.value > 0)
	{
		(document.calcform.total2.value = document.calcform.amps2.value * 120) 
		&& (document.calcform.watts2.value = document.calcform.amps2.value * 120)
	}
	else 
	{	(document.calcform.total2.value = 0) &&
		(document.calcform.amps2.value = 0) &&
		(document.calcform.watts2.value = 0)
	}
	if (document.calcform.amps3.value > 0)
	{
		(document.calcform.total3.value = document.calcform.amps3.value * 120) 
		&& (document.calcform.watts3.value = document.calcform.amps3.value * 120)
	}
	else 
	{	(document.calcform.total3.value = 0) &&
		(document.calcform.amps3.value = 0) &&
		(document.calcform.watts3.value = 0)
	}
	if (document.calcform.amps4.value > 0)
	{
		(document.calcform.total4.value = document.calcform.amps4.value * 120) 
		&& (document.calcform.watts4.value = document.calcform.amps4.value * 120)
	}
	else 
	{	(document.calcform.total4.value = 0) &&
		(document.calcform.amps4.value = 0) &&
		(document.calcform.watts4.value = 0)
	}
	if (document.calcform.amps5.value > 0)
	{
		(document.calcform.total5.value = document.calcform.amps5.value * 120) 
		&& (document.calcform.watts5.value = document.calcform.amps5.value * 120)
	}
	else 
	{	(document.calcform.total5.value = 0) &&
		(document.calcform.amps5.value = 0) &&
		(document.calcform.watts5.value = 0)
	}
		
calculateSurgeKnown()
}




function calculate()
{

	if (document.calcform.watts1.value > 0){
		(document.calcform.total1.value = document.calcform.watts1.value) 
			&& (document.calcform.amps1.value = document.calcform.watts1.value / 120)}
	else {(document.calcform.total1.value = 0) &&
			(document.calcform.amps1.value = 0) &&
			(document.calcform.watts1.value = 0)}
		
	if (document.calcform.watts2.value > 0){
		(document.calcform.total2.value = document.calcform.watts2.value) 
		&& (document.calcform.amps2.value = document.calcform.watts2.value / 120)}
	else {(document.calcform.total2.value = 0) &&
			(document.calcform.amps2.value = 0) &&
			(document.calcform.watts2.value = 0)}
	
	if (document.calcform.watts3.value > 0){
		(document.calcform.total3.value = document.calcform.watts3.value) 
		&& (document.calcform.amps3.value = document.calcform.watts3.value / 120)}
	else {(document.calcform.total3.value = 0) &&
			(document.calcform.amps3.value = 0) &&
			(document.calcform.watts3.value = 0)}

	if (document.calcform.watts4.value > 0){
		(document.calcform.total4.value = document.calcform.watts4.value) 
		&& (document.calcform.amps4.value = document.calcform.watts4.value / 120)}
	else {(document.calcform.total4.value = 0) &&
			(document.calcform.amps4.value = 0) &&
			(document.calcform.watts4.value = 0)}
			
	if (document.calcform.watts5.value > 0){
		(document.calcform.total5.value = document.calcform.watts5.value) 
		&& (document.calcform.amps5.value = document.calcform.watts5.value / 120)}
	else {(document.calcform.total5.value = 0) &&
			(document.calcform.amps5.value = 0) &&
			(document.calcform.watts5.value = 0)}

calculateSurgeKnown()



}

function init() {

  var img;

  // Find the position of the embedded image and move bar accordingly, note
  // that we have to adjust for the table's cell padding.

  img = getImage("placeholder");
  if (document.layers){
  document.which.moveTo(getImagePageLeft(img) - 2, getImagePageTop(img) - 2);
  }
  
}
// End -->
