var hoverColour = "#FFF";
// BEGIN IE 7 z-index Navigation Fix by: Chepri DJV
// Check for browser version
jQuery.each(jQuery.browser, function(i, val) {
if($j.browser.msie && val == '7.0'){
$j(function() {
var zIndexNumber = 1000;
$j('div').each(function() {
// Apply this fix to only head-top-wrapper's children (doing this prevents the fix from affecting the rest of the page)
if(this.id == 'header-top-wrapper'){
$j(this).children().css('zIndex', zIndexNumber);
zIndexNumber -= 10;
}
});
});
}
});
// END IE 7 z-index Navigation Fix by: Chepri DJV

$j(function(){
	$j("a.hoverBtn").show("fast", function() {
		$j(this).wrap("<div class=\"hoverBtn\">");
		$j(this).attr("class", "");
	});
	
	//display the hover div
	$j("div.hoverBtn").show("fast", function() {
		//append the background div
		$j(this).append("<div></div>");
		
		//get link's size
		var wid = $j(this).children("a").width();
		var hei = $j(this).children("a").height();
		
		//set div's size
		$j(this).width(wid);
		$j(this).height(hei);
		$j(this).children("div").width(wid);
		$j(this).children("div").height(hei);
		
		//on link hover
		$j(this).children("a").hover(function(){
			//store initial link colour
			if ($j(this).attr("rel") == "") {
				$j(this).attr("rel", $j(this).css("color"));
			}
			//fade in the background
			$j(this).parent().children("div")
				.stop()
				.css({"display": "none", "opacity": "1"})
				.fadeIn("fast");
			//fade the colour
			$j(this)	.stop()
				.css({"color": $j(this).attr("rel")})
				.animate({"color": hoverColour}, 350);
		},function(){
			//fade out the background
			$j(this).parent().children("div")
				.stop()
				.fadeOut("slow");
			//fade the colour
			$j(this)	.stop()
				.animate({"color": $j(this).attr("rel")}, 250);
		});
	});
});

