$(function() {
	$("a#kooponline").attr("target", "_blank");
	$("table#bottomMenu h2").bind("mouseover", mouseOverTitle);
	$("table#bottomMenu td").bind("mouseleave", mouseOutTd);
	$("#mainMenu a").fadingMenu({nightriderInterval:15000});
	$("a[rel*=fancybox]").fancybox({
		overlayOpacity:0,
		zoomSpeedIn:500,
		zoomSpeedOut:500,
		zoomOpacity:true
	});
	$(document).pngFix();
	$("div.left").each(function() {
	
		$left = $(this);
		$right = $(this).next("div.right");
	
		if ($left.height()<$right.height()) {
			$left.css("min-height", $right.height()+ "px");
		}
	
	});
	
	function mouseOutTd(e) {
		mouseOut($(this).find("ul"));
	}
	
	function mouseOverTitle(e) {
		mouseOver(this);
	}
	
	function mouseOut(elem) {
		$(elem).parent("td").find("ul").animate(
		{
			height:0
		},
		{
			easing:"easeOutCirc",
			queue:false,
			duration:1000
		});
	
	}
	
	function mouseOver (elem) {
		var heightA = 37 * $(elem).parent("td").find(">ul li a").size();
		
		$(elem).parent("td").find("ul").animate(
			{
				height:heightA
			},
			{
				easing:"easeOutSine",
				queue:false,
				duration:650
			});
	}
});
