// JavaScript Document
jQuery(document).ready(function($) {
	$('#Seasonal ul ul').hide(); //This hides all subMenus when the page loads
	$('#Seasonal ul li.current_page_parent ul').show(); //If the current page has subMenus, they are shown on load
	
	$('#Seasonal ul li a').click(function(){ //if a main Menu is clicked do the following:
		var $nextUL = $(this).next(); //find the next tag after the clicked item and store it in a variable
		var $visibleSubMenus = $('#Seasonal ul li ul:visible').not($nextUL);	//check for visible subMenus, ignoring the next ul and store it in a variable
		if ($visibleSubMenus.length ) { //if there are visible subMenus (length returns how many there are so if there is 1 or more)
		  $visibleSubMenus.slideUp('fast', function() { //hide all visible subMenus then do the following
			$nextUL.slideToggle('fast'); //show the next ul tag
		  });
		} else { //if there are no other visible subMenus do the following:
			$nextUL.slideToggle('fast'); //show the next ul tag
		}
		if( $nextUL.is('ul') ){  //if there is subMenu
			return false; //ignore the url of the parent Menu
		}
	});
	
		$('nav>ul>li:eq(3)').addClass('split');

	
});
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);
