$(document).ready(function(){
	// FaceBox Init
/*	if ($('a[rel*=facebox]').length == 1) {
		$('a[rel*=facebox]').facebox();
	} else if ($('a[rel*=facebox]').length > 1) {
		$('a[rel*=facebox]').facebox({
			close_text    : 'ZATVOR'
		});
	}*/
	
	$("A[rel='fancybox'],A[rel='fancybox-dialog']").fancybox({
		'centerOnScroll' : true,
		'autoScale' : true,
		'padding' : 20,
		'scrolling' : 'no'
	});
	
	// IE6 PNG Fix
	$('.png, .ui-icon').ifixpng();
	
	// IE6 Menu Fix
	if($.browser.msie && $.browser.version=="6.0") {
		$("UL.dropdown > LI").mouseover( function() {
			var pos = $(this).position();
			$(this).children("UL").css("top", (pos.top+31)+"px");
			$(this).children("UL").css("left", pos.left+"px");
			$(this).children("UL").css("visibility", "visible");
		});
		$("UL.dropdown > LI").mouseout( function() {
			$(this).children("UL").css("visibility", "hidden");
		});
	}
	
	resize();
	setTimeout("resize()", 500);
});

function resize() {
	hl = $("#widgets-left").height();
	hr = $("#widgets-right").height();
	hc = $("#content").height();
	h = Math.max(hl, hr, hc);
	if($.browser.msie && $.browser.version=="6.0") {
		$("#content,#widgets-homepage").css("height", (h+30)+"px");
	} else {
		$("#content,#widgets-homepage").css("min-height", h+"px");
	}
}

