	//yonis jquery stuff for GEMS (c) 2009-10
	//yoni@social-ink.net
	
	var $j = jQuery.noConflict(); //declare this cause of problems with WP
	
	$j(function(){
	
		// this is to reveal that hidden mouseover image above the nav buttons
			$j("#tabs img").hover(function() {
				var myid = $j(this).attr("id");
				var mytab = "#"+myid+"_popup";

				$j(mytab).css("visibility","visible");

				}, function() {
					var myid = $j(this).attr("id");
					var mytab = "#"+myid+"_popup";
					$j(mytab).css("visibility","hidden");
					//lets re-add the image to the current img
					$j(".curtab").css("visibility","visible");
				});

		// this is to make the front page buttons fade coolly
		
			$j("img.fp_buttons").hover(function() {
				$j(this).fadeTo("fast", 0.8);	
			}, function() {
				$j(this).fadeTo("fast", 1);
			});
				
		/* lets start yons dynamic menu stuff here */
		
			//first lets open menus according to where we are, in a "breadcrumbs" way
				$j('#submenu li.current_page_ancestor ul').show();
				$j('#submenu li.current_page_item ul').show();
				
			//add plus signs to open menus
				$j('#submenu ul li.current_page_ancestor a:first').addClass("openul");
				$j('#submenu li.current_page_ancestor.current_page_parent a:first').addClass("openul");
				$j('#submenu .openul').prepend("+ ");
				
			//embolden and embiggen the noblest soul
				$j('#submenu li.current_page_item a:first').css("font-weight","bold");			
				

			// now add the hover effect itself, accordion-style
				$j("#submenu ul li").hover(function() {
					$j(this).children("ul").show("medium");
				}, function() {
					//$j(this).children("ul").hide("fast"); we are hiding this because toggling it again makes browsers go CRAZY
				});			
		
});
