<!-- Begin
window.onload=show;
function show(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function doPopup(popupPath) {
var newWin = window.open(popupPath, 'name', 'location=YES,status=YES,resizable=YES,scrollbars=YES,width=569,height=376,top=0,left=0');
newWin.focus();
}

///////////////////////////////////////////////////////////////////////////////////
/// This Script is Copyrighted 2007-2008 and belongs to Solar-Attic-Fan-Info.com///
/// Contact Solar-Attic-Fan-Info.com If you wish to use this code. ////////////////
///////////////////////////////////////////////////////////////////////////////////

function  doMath() {

var one = eval(document.theForm.input.value);
var two = eval(document.theForm.input2.value);
var three = eval(document.theForm.input3.value);
var four = eval(document.theForm.input4.value);
if ( (document.theForm.input.value != '' ) && (document.theForm.input2.value != '' )&& (document.theForm.input3.value != '' )) 
{
var prod = one  *   two  *  three  / '2';
var prod2 = prod  *   four   / '60';
var prod3 = prod2 / '150';
document.theForm.display.value=one;
document.theForm.display2.value=two;
document.theForm.display3.value=three;
document.theForm.display4.value=four;
document.theForm.display5.value=prod.toFixed(0);
document.theForm.display6.value=prod2.toFixed(0);
document.theForm.display7.value=prod3.toFixed(1);
cfmpropeller();
}
else { alert ( "Form is not complete. Please Input Attic's LENGTH*, WIDTH* and HEIGHT* values." ); 
}
}
function clearAll() {
document.theForm.input.value='';
document.theForm.input2.value='';
document.theForm.input3.value='';
document.theForm.input4.value='10';
document.theForm.display.value='';
document.theForm.display2.value='';
document.theForm.display3.value='';
document.theForm.display4.value='';
document.theForm.display5.value='';
document.theForm.display6.value='';
document.theForm.display7.value='';
switchid('a0');
}


///////////////////

function cfmpropeller(){

var cfm = eval(document.theForm.display6.value);

if (cfm <= 500)
   {
   switchid('a1');
   }
else if (cfm >= 501 && cfm <= 800)
   {
   switchid('a2');
   }
else if (cfm >=801 && cfm <= 1250)
   {
   switchid('a3');
   }
   else if (cfm >= 1251 && cfm <= 1350)
   {
   switchid('a4');
   }
else if (cfm >=1351 && cfm <= 1550)
   {
   switchid('a5');
   }
else if (cfm >=1551 && cfm <= 2700)
   {
   switchid('a6');
   }
else if (cfm >=2701 && cfm <= 3100)
   {
   switchid('a7');
   }
else
   {
   switchid('a8');
   }

}




////////////////////

//here you place the ids of every element you want.
var ids=new Array('a0','a1','a2','a3','a4','a5','a6','a7','a8');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
// End -->