﻿//<!--
// Custom fading navigation: Jon Sinclair, December 27, 2008
// Feel free to use this as needed, please leave the credit 
// if don't change the code, or just change the variables.
$(document).ready(function(){
	// the hover is on the top level of the navigation
	
	$("#nav").find("ul li").hover(
		function(){
			if (this._timerID)
				clearTimeout(this._timerID)
			$("ul",this).fadeIn("fast");
			$("ul li ul",this).hide();
		}, 
		function(){
			var self = this;
			var fadespeed = 200;
			this._timerID = window.setTimeout(function(){
				// jQuery fade out the UL of the calling li
				$("ul", self).fadeOut("fast");
			},fadespeed);
		}
	);
} 
);

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);
//-->