jQuery(document).ready(function(){
	
		// remove link background images since we're re-doing the hover interaction below 
		// (doing it this way retains the CSS default hover states for non-javascript-enabled browsers)
		// we also want to only remove the image on non-selected nav items, so this is a bit more complicated
		jQuery(".nav").children("li").each(function() {
			var current = "nav current-" + (jQuery(this).attr("class"));
			var parentClass = jQuery(".nav").attr("class");
			if (parentClass != current) {
				jQuery(this).children("a").css({backgroundImage:"none"});
			}
		});	


		// create events for each nav item
		attachNavEvents(".nav", "pricing");
		attachNavEvents(".nav", "daycare");
		attachNavEvents(".nav", "boarding");
		attachNavEvents(".nav", "about");
		attachNavEvents(".nav", "photos");
	

		function attachNavEvents(parent, myClass) {
			jQuery(parent + " ." + myClass).mouseover(function() {
				jQuery(this).append('<div class="nav-' + myClass + '"></div>');
				jQuery("div.nav-" + myClass).css({display:"none"}).fadeIn(250);
			}).mouseout(function() {
				jQuery("div.nav-" + myClass).fadeOut(250, function() {
					jQuery(this).remove();
				});
			}).mousedown(function() {
				jQuery("div.nav-" + myClass).attr("class", "nav-" + myClass + "-click");
			}).mouseup(function() {
				jQuery("div.nav-" + myClass + "-click").attr("class", "nav-" + myClass);
			});
		}



	});

