function addLoadEvent(func) {
    var ondl = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;	
	}else {
	 window.onload = function(){
		ondl();
		func();
	}
  }
}

addLoadEvent(sideOf);
//addLoadEvent(ztbl);
//-- sitemap -- addLoadEvent(keepCurrent);

//open  a product image in a new window without making a new html page
//html example: <a href="#" onclick="cls('../../images/enclosuresIndexBP12a.jpg');">
//js
function cls(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function showPic(z){
 if (document.getElementById) {
    var hold = document.getElementById('pic');
	hold.setAttribute('src',z);
	//alert(hold);
 } else {
	 //alert();
  return true;
 }
}

//specs definition
//mouseover spec not understand and a popup win with definition and useage appers - or link to product faq page



function sideOf(id) {
	if(!document.getElementById) return false;
	var d = window.document.getElementById('howto');
	d.style.display = "none";

	var z = window.document.getElementById('dyi');
	z.style.width = 200;
	z.onmouseover = function(){
	d.style.display = "block";
	}
	z.onmouseout = function(){
	d.style.display = "none";
	}
}

function ztbl(){
if(!document.getElementsByTagName) return false;
var tables = document.getElementsByTagName('table');
	for(i=0; i<tables.length; i++){
		var odd = false;
		var rows = tables[i].getElementsByTagName('tr');
		for(j=0; j<rows.length; j++){
			if(odd == true){
			rows[j].style.backgroundColor ='#E5E3D3';
			odd = false;
			}else{
			odd = true;
			}
		}	
	}
}

//cycle through sub nav of products 
// highlight bg of selected btn
//


function dsply(n){
if(document.getElementById('iwsub') || document.getElementById('icsub') || document.getElementById('spsub') || document.getElementById('cabsub') || document.getElementById('adzub')){
	if(n == 'iwsub') {
	document.getElementById('iwsub').style.display="block";
	}else{
	document.getElementById('iwsub').style.display="none";	
	}		
	//
	if(n == 'icsub') {
	document.getElementById('icsub').style.display="block";
	}else{
	document.getElementById('icsub').style.display="none";	
	}		
	//
	if(n == 'spsub') {
	document.getElementById('spsub').style.display="block";
	}else{
	document.getElementById('spsub').style.display="none";	
	}		
	//
	if(n == 'cabsub') {
	document.getElementById('cabsub').style.display="block";
	}else{
	document.getElementById('cabsub').style.display="none";	
	}		
	//
	if(n == 'adzsub') {
	document.getElementById('adzsub').style.display="block";
	}else{
	document.getElementById('adzsub').style.display="none";	
	}		
	//
	if(n == 'accsub') {
	document.getElementById('adzsub').style.display="block";
	}else{
	document.getElementById('adzsub').style.display="none";	
	}		
	//

}
}

/*from html dog */
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

