$(document).ready(function(){
	$("#kategorie + #stranka").css("margin-left", "200px"); // pridame margin kvuli menu
	
	if($("#kategorie").length > 0){
		//$(".stranka_obal").height($("#stranka").height());
	}
	
	if($("#dalsi_ceny").length > 0){
		$("#dalsi_ceny img").hover(function(){
			$(this).animate({
				"marginRight": "-=10px"
			},150);
		},function(){
			$(this).animate({
				"marginRight": "+=10px"
			},150);
		});
	}
	
	
	if($(".ikonky").length > 0){
		$(".ikonky img").hover(function(){
			$(this).animate({
				"marginLeft": "+=6px"
			},150);
		},function(){
			$(this).animate({
				"marginLeft": "-=6px"
			},150);
		});
	}
	
	function equalHeight(group) {
		tallest = 0;
		group.each(function() {
			thisHeight = $(this).height();
			if(thisHeight > tallest) {
				tallest = thisHeight;
			}
		});
		group.height(tallest);
	}
	
	equalHeight($(".obj"));
	
	
	// novinky
	function showObj(i){
		$("div.news_obj").hide();
		$("#obj_"+i).show("slow");
	}
	
	equalHeight($("div.news_obj"));
	var novinek = $("div.news_obj").size();
	$("#news").height($("div.news_obj").height());
	
	if(novinek>1){
		$("div.news_obj").hide();
		$("#news :first-child").show();
		var i = 2;
		var refreshId = setInterval(function(){
			showObj(i);
			if(i==novinek){
				i=1;
			}else{
				i++;
			}
		}, 7000);
	}
	
	
	// hodnoceni
	

});
