/* 
		National Recreation and Park Association (NRPA)
		Drop Down Menu JavaScript
		Based on jQuery Drop Line Menu
		http://www.dynamicdrive.com/style/csslibrary/item/jquery_drop_line_tabs/
		http://www.stunicholls.com/menu/jquery-dropline-7.html
*/

$(document).ready(function(){
	$("#dropmenu li.current").children("ul").css("left", "0px").show();
	$("#dropmenu li.current").children(":first-child").css({
		background: "#a0b852 url('images/menu-item-selected.png') repeat-x 0 0",
		color: "#fff"
		})
	$("#dropmenu li").hover(function(){
		if(this.className.indexOf("current") == -1)  {
			getCurrent = $(this).parent().children("li.current:eq(0)");
			if(this.className.indexOf("top") != -1)  {
				$(this).children("a:eq(0)").css({
					background: "#35b1c7 url('images/menu-item-hover.png') repeat-x 0 0",
					color: "#fff"
					});
			} else {
				$(this).children("a:eq(0)", "ul li ul li a").css({
					background: "#35b1c7 url('images/menu-item-hover.png') repeat-x 0 0",
					color: "#fff"
					});
			}
			if (getCurrent = 1 ) {
				$(this).parent().children("li.current:eq(0)").children("ul").hide();
			}
		$(this).children("ul:eq(0)").css("left", "0px").show();
		}
	},function(){
		if(this.className.indexOf("current") == -1)  {
			getCurrent = $(this).parent().children("li.current:eq(0)");
			if(this.className.indexOf("top") != -1) {
				$(this).children("a:eq(0)").css({
					background: "none",
					color: "#c8e6f2"
					});
			} else {
				$(this).children("a:eq(0)").css({
					background: "none",
					color: "#c8e6f2"
					});
			}
			if (getCurrent = 1 ) {
				$(this).parent().children("li.current:eq(0)").children("ul").show();
			}
	$(this).children("ul:eq(0)").css("left", "-99999px").hide();
		}
	});
});
