// IE - fix blikajicich backgroundu
if(($.browser.msie && $.browser.version < 7)) {
	eval("try {document.execCommand('BackgroundImageCache', false, true);} catch(e) {}");
}

$(document).ready(function() {

	$("#p-top .user-box .account").bind("click", function(){
		$("#p-top .user-box #user-account").slideToggle();
		return false;
	});
	
	$(".product-order .order").bind("click", function(){
		$(".product-order form").slideToggle();
		return false;
	});
	
	$("ul.menu li:first").addClass("first");
	
	$("ul.submenu li a").prepend("<span>&raquo;</span>"); 

});

/**
 * nastaveni stejne vysky elementu na radku v seznamu
 */
$.fn.setLiRowHeight = function(columnCount, columnEl) {
  var actHeight = 0;
  var colEl = (columnEl) ? columnEl : "li";
  var liCount = $(columnEl, $(this)).size();
  var linesCount = Math.ceil(liCount/columnCount);

  for (i=0; i < linesCount; i++) {
    actHeight = 0;

    for (j = i*columnCount; j < i*columnCount+columnCount; j++) {
      actHeight = ($(columnEl+":eq("+j+")", $(this)).height() > actHeight) ? $(columnEl+":eq("+j+")",  $(this)).height() : actHeight;
    }
    $(">"+columnEl, $(this)).filter(function(index){
      return index >= i*columnCount && index < i*columnCount+columnCount;
    }).css("height",actHeight);
  }
}


