$(window).ready(function(){

  /**
   * 15:46 6/5/2010
   * myjquery.js
   * created by Branislav Zvolensky, epix technology
   */
   
  // Finds highest height of div.produkt element inside div.prod-row
  // and sets the same height for all elements in the row
  $('div.prod-row').each(function(){
	  var maxheight = 340;
	  $('div.produkt', this).each(function(index){
		var actheight = $(this).height();
		if(actheight > maxheight){
		  maxheight = actheight;
		};
	  });
	  //alert('maxheight is '+maxheight);
	  $('div.produkt', this).each(function(){
	    $(this).height(maxheight);
	  });
  });
  
  $('div.prod-row').each(function(){  
	  // do the same for produktwide2 box
	  var maxheight = 340;
	  $('div.produktwide2', this).each(function(index){
		var actheight = $(this).height();
		if(actheight > maxheight){
		  maxheight = actheight;
		};
	  });
	  //alert('maxheight is '+maxheight);
	  $('div.produktwide2', this).each(function(){
	    $(this).height(maxheight);
	  });
  });
  
  /**
   * Dynamic menu
   */
  
  //Hide submenus
  $('ul.submenu').css({'display':'none'});
  
  //Test if expanded and show it
  if($('ul.submenu').hasClass('expanded')){
	$('ul.expanded').show();  
  }
  
  /*** Uncoment to activate dynamic menu **/
  
  /**
  // On click hide or show submenu
  $('li#psy a.main-cat').click(function(){
	$('ul.submenu:visible').slideUp();
	$('ul.psy:hidden').slideDown();
	return false;
  });
  
  $('li#macky a.main-cat').click(function(){
	$('ul.submenu:visible').slideUp();
	$('ul.macky:hidden').slideDown();
	return false;
  });
  
  $('li#vtaky a.main-cat').click(function(){
	$('ul.submenu:visible').slideUp();
	$('ul.birds:hidden').slideDown();
	return false;
  });
  
  $('li#hlodavce a.main-cat').click(function(){
	$('ul.submenu:visible').slideUp();
	$('ul.hlodavce:hidden').slideDown();
	return false;
  });
  
  $('li#ryby a.main-cat').click(function(){
	$('ul.submenu:visible').slideUp();
	$('ul.ryby:hidden').slideDown();
	return false;
  });
  
  $('li#potreby a.main-cat').click(function(){
	$('ul.submenu:visible').slideUp();
	$('ul.potreby:hidden').slideDown();
	return false;
  });
  
  **/
  
});
