Cufon.replace("h2,h3,h4,h5,h6");
Cufon.replace(".title");

$(document).ready(function() {
	$('#menu ul li a').each(function(idx) {
		var span = $("<div><span></span></div>");
		span.css("opacity", 0);
		span.css("margin-left", -(217-$(this).parent().width())/2);

		$(this).before(span).hover(
			function() {span.stop().animate({opacity: 0.7})},
			function() {span.stop().animate({opacity: 0})}
		);
	});

	/* PNG fix, C3C version! */
	if ($.browser.msie) {
		$("*").each(function() {
			var $$ = $(this);
			if ($$.attr('src') && $$.attr('src').match(/\.fix\.png/i) && !$$.css('filter')) {
				$$.css({
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$$.attr('src')+"',sizingMethod='crop')", 
					width: $$.width(), 
					height: $$.height()
				});
				$$.attr('src', 'images/clear.gif');
			} else if ($$.css('backgroundImage') && $$.css('backgroundImage').match(/^url\(["']?(.*\.fix\.png([?].*)?)["']?\)$/i)) {
				var path = RegExp.$1;
				var repeat = ($$.css('backgroundRepeat') == 'no-repeat') ? 'crop' : 'scale';
				$$.css({
					backgroundImage: 'none',
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path+"',sizingMethod='"+repeat+"')"
				});
				var children = $$.find("*");
				if (children.length != 0) {
					if ($$.css("position") != "absolute")
						$$.css("position", "static");
					children.each(function() {
						if (!$(this).css("position")) {
							$(this).css("position", "relative");
						}
					});
				}
			}
		});
	}
});

