$("a").ready(function() {
	$("a").each(function(i) {
		$(this).click(function() {
			$(this).blur();
		});
	});
});

$(".menu_fade_back_image").ready(function() {
	$(".menu_fade_back_image a").each(function(i) {			
		//duplicate the control(without event handlers) and fade it 
		var hoverClone = $(this).clone();
		hoverClone.css({ "position": "absolute", "width":$(this).width(), "height":$(this).height(), "top":$(this).position().top });
		hoverClone.addClass("hover");
		hoverClone.insertAfter($(this));
		hoverClone.hide();
		
		var activeClone = $(this).clone();
		activeClone.css({ "position": "absolute", "width":$(this).width(), "height":$(this).height(), "top":$(this).position().top });
		activeClone.addClass("active");
		activeClone.insertAfter(hoverClone);
		activeClone.hide();
		
		$(this).mouseover(function() {
			$(this).hide();  //this prevents flickering (:hover in css)
			hoverClone.fadeIn("slow");
			$(this).show();
		});
		
		hoverClone.mousedown(function() {
			$(this).hide();  //this prevents flickering (:hover in css)
			activeClone.fadeIn("slow");
			$(this).show();
		}).mouseout(function() {
			$(this).fadeOut("slow");
		});
		
		activeClone.mouseup(function() {
			$(this).fadeOut("slow");
			hoverClone.fadeIn("slow");
		});
	});
});