// JavaScript Document

function KD_jumpMenu(form){ //Resizeable pop-up window from drop-down jump menu. -Kevin
  var jumpfeatures = "height=600,width=800,location=yes,"
+ "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes";
		var jumpURL = form.stores.options[form.stores.selectedIndex].value;
			if(jumpURL != 'none'){ popup = window.open(jumpURL,"AllStores",jumpfeatures); //For Title
			}
  }
  
// HIDE/SHOW Script

function show(id){ 
   if(document.getElementById(id)){   
       var ele = document.getElementById(id);    
       if(ele.style.display=="none"){  
           ele.style.display="block";        
	}
   } 
} 
function hide(id){ 
   if(document.getElementById(id)){   
       var ele = document.getElementById(id);    
       if(ele.style.display=="block"){  
           ele.style.display="none";        
       }
   } 
} 

// START HOVER MENU
sfHover = function navmenu() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function navmenu() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function navmenu() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); 
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
// END HOVER MENU (swaps id to show favorities)


// SWAPS CLASS TO SHOW SUB-CATEGORIES OF STORES
if (window.attachEvent) window.attachEvent("onload", sfHoverCat); 
else window.addEventListener('load',sfHoverCat,false); 

function sfHoverCat() 
{ 
  var regSfUL = /\bmenu-cat\b/; 
  var ULs, UL, LIs, LI, i=j= -1; 
  ULs = document.getElementsByTagName("ul"); 

while( UL=ULs[++i] )
{

if( regSfUL.test(UL.className) )
{
j = -1;
LIs=UL.getElementsByTagName("li");
while( LI=LIs[++j] )
{
LI.onmouseover = over;
LI.onmouseout = out;
}
}
}

function out()
{
this.className=this.className.replace(/\bsfhovercat\b/, "");
}

function over()
{
this.className+=" sfhovercat";
}

}

