$(document)
//height
.ready(function()
{	
   var tallest = 0;
   $(".column").each(function()
   {
      var thisHeight = $(this).height();
      if(thisHeight > tallest)
      {
         tallest = thisHeight;
      }
   }).height(tallest);
})
//search
.ready(function(){		
   var defaultSearchText = 'Введите слово для поиска';
   $('#search_input').focus(function(){
      $(this).addClass('active');
      if($(this).attr("value") == defaultSearchText) $(this).attr("value", "");
   }).blur(function(){
      $(this).removeClass('active');
      if($(this).attr("value") == "") $(this).attr("value", defaultSearchText);
   });
})
//categories
.ready(function(){
   $("#categories").treeview(
   {
      animated: "fast",
      collapsed: true,
      unique: true,
      persist: "location"
   }).show();
})
//messenger
.ready(function(){	
   var windowSize = "height=500,width=650,top="+(screen ? (screen.height-600)>>1 : 100)+",left="+(screen ? (screen.width-650)>>1 : 120)+",resizable=1";
   $(".messenger").click(function (event)
   {
      var url = $(this).attr("href");
      window.open(url, "Служба_поддержки www.elektro-portal.com", windowSize);
      event.preventDefault();
   });
});

