// выставить максимальную равную высоту группе объектов
function setEqualHeight(columns) {
   var tallestcolumn = 0;
   columns.each(function() {
   currentHeight = $(this).height();
   if(currentHeight > tallestcolumn) {
      tallestcolumn  = currentHeight;
   }
   });
   columns.height(tallestcolumn);
}

/*function setEqualHeight1(columns) {
   var tallestcolumn = 0;
   columns.each(function() {
   currentHeight1 = $(this).blochim();
   if(currentHeight1 > tallestcolumn) {
      tallestcolumn  = currentHeight1;
   }
   });
   columns.blochim(tallestcolumn);

}*/

// выставить события на наведение мыши
function setHover(columns, className) {
   //alert(className);
   columns.mouseover(function() {$(this).addClass(className);});
   columns.mouseout(function() {$(this).removeClass(className);});
}

jQuery(document).ready(function() {
   setEqualHeight($("div.cat"));
   setHover($("div.cat"), "cathover");
   setHover($('.subcat_td'), "hover");

   // обработка клика - переход по первой ссылке внутри объекта
   $(".f1").click(function(){
      window.location=$(this).find("a").attr("href"); return false;
   });

   setEqualHeight($(".height"));
   setEqualHeight($(".zagol"));
   setEqualHeight($(".hei"));
   setEqualHeight($(".f2"));
});
