	$(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
		$(".gnavi").children("li").each(function() {
			var current = "gnavi current-" + ($(this).attr("class"));
			var parentClass = $(".gnavi").attr("class");
			if (parentClass != current) {
				$(this).children("a").css({backgroundImage:"none"});
			}
		});	


		// create events for each nav item
		attachNavEvents(".gnavi", "top");
		attachNavEvents(".gnavi", "bi");
		attachNavEvents(".gnavi", "consulting");
		attachNavEvents(".gnavi", "solution");
		attachNavEvents(".gnavi", "grobal");
		attachNavEvents(".gnavi", "db");
		attachNavEvents(".gnavi", "case");
		attachNavEvents(".gnavi", "recruit");
	

		function attachNavEvents(parent, myClass) {
			$(parent + " ." + myClass).mouseover(function() {
				$(this).append('<div class="gnavi-' + myClass + '"></div>');
				$("div.gnavi-" + myClass).css({display:"none"}).fadeIn(300);
			}).mouseout(function() {
				$("div.gnavi-" + myClass).fadeOut(300, function() {
					$(this).remove();
				});
//			}).mousedown(function() {
//				$("div.gnavi-" + myClass).attr("class", "gnavi-" + myClass + "-click");
//			}).mouseup(function() {
//				$("div.gnavi-" + myClass + "-click").attr("class", "gnavi-" + myClass);
			});
		}



	});

