
var novinkyAnimation = function(index, action) {
	var novinky = $('#flow_aktuality .novinka');
	if (index >= novinky.length) {
		index = 0;
	}
	
	if (action == "show") {
		$(novinky[index]).show("slow");
		setTimeout('novinkyAnimation('+index+', "hide")', 5000);
	}
	else {
		$(novinky[index]).hide("slow");
		index++;
		setTimeout('novinkyAnimation('+index+', "show")', 500);
	}
};



function jQ_SrovnejVyskuKaret() { 

  var counter = 0;

  $(' .tr_vyrovnani ').each(function(counter) { 
  
     var max_height = 0;
     var srovnat = true;
     $(' .vyrovnavany_produkt_'+counter+' ').each(function(index) {
      
       var height = $(this).height();

       if (max_height < height)
         max_height = height;                         
     });
    
     if (srovnat) {
       $('.vyrovnavany_produkt_'+counter).each(function(index) {
         $(this).height(max_height);
       });      
     }
  });
}  



$(function() {
		    $("a[rel^=lightbox]").lightBox(); 


    // odkazy s class="external" otevreme v novem okne
    $('a.external').click(function() {
      if (window.open(this.href)) {
        return false;
      }
    });

		    
		// aktuality
    var novinky = $('#flow_aktuality .novinka');
    if (novinky.length > 1) {
	    novinky.each(function() {
	    	$(this).hide();
	    });        
	    if (novinky.length > 0) {
	    	novinkyAnimation(0, "show");
	    }
    }
		$('#flow_aktuality .aktuality').css("visibility", "visible");

});


