// JavaScript Document

//jQuery Stuff

$(document).ready(function() {

$(".notlink").click(function() {
	$(this).parent().children("ul").toggle();
	});




// ECMAScript Menu system
// Credit: Gez Lemon | http://juicystudio.com/article/ecmascriptmenu.php



if (!navLocation) var navLocation = 0;

	var bRollup, objLinks, objNode, objAnchor;

    // Check we're working with a DOM compliant browser
    if (document.getElementById && document.createElement)
    {
        if (document.getElementById('nav2'))
		{
			var strLocation = window.location.protocol + '//' + window.location.host + window.location.pathname;			
			if (navLocation != 0) strLocation = navLocation;
			if (strLocation.charAt(strLocation.length - 1) == '/') strLocation += 'index.html';
			var objMenu = document.getElementById('nav2');
            var objLinks = objMenu.getElementsByTagName('a');
			


            	for (var j=0; j<objLinks.length; j++)
            	{
                	if (objLinks[j].href == strLocation)
                	{
                    	bRollup = false;

                    	// Added by John Hunter, modified by Mark Powell
                    	// set class for linkto current page
                      	objNode = objLinks[j];
                      	objNode.parentNode.className = 'selected';
                      	objNode.parentNode.parentNode.parentNode.className = 'show';
                      	objNode.parentNode.parentNode.parentNode.parentNode.parentNode.className = 'show';
						
						objLinks[j].style.display = 'block';
						
						var objNestedLI = objLinks[j].parentNode;
						var thirdNav = objNestedLI.getElementsByTagName('ul');
						
						if (thirdNav.length > 0)
						{
							thirdNav[0].style.display = 'block';
							
						}
                	}
            	}
        	
		}
    }

});

sfHover = function() {
	var sfEls = document.getElementById("navMain").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" iehover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);