/*
DropDown Menu for Nathan Smith
By Matthew Woodward (www.mwdwrd.com)
Version: mwdwrdmenu.1.0.js // Relase Date: 4/4/11
Website: http://mwdwrd.com
*/
var hoverClass = '.hoverState';

jQuery(document).ready(function() {
	
	/* Rollover function */
	jQuery(hoverClass).mouseover(function() {
		jQuery(this).stop(true, true).fadeTo(100,0.8);
	}).mouseout(function() {
		jQuery(this).stop(true, true).fadeTo(300,1);
	});

	jQuery('.topnav').children().hide();
	jQuery('.topnav').children().each(function (i) {
		jQuery(this).delay(100+(50*i)).fadeIn(500);
	});
	jQuery('ul.subnav').each(function (i) {
		jQuery(this).parent().find("a:first").addClass("sectionChild");
	});
	jQuery("ul.subnav").parent().hover(
	  function () {
	    jQuery(this).find("ul.subnav").stop(true, true).slideDown(200);
	    jQuery(this).find("a:first").addClass("sectionOver");
	  }, 
	  function () {
	    jQuery(this).find("ul.subnav").delay(300).slideUp(400);
	    jQuery(this).find("a:first").removeClass("sectionOver");
	  }
	);
});
