$(document).ready(function()
{
  // Init pdBox
  $('.thickbox').pdBox({minWidth: 400});

	$('.img-box').each(function(){ 
     var imgBoxH = $(this).height();
     $('img', this).each(function (){
       $(this).bind('load', function(){
        var imgH = $(this).height(); 
        $(this).css('margin-top', (imgBoxH - imgH) / 2 + 'px');
       }).attr('src', this.src);
     });
     
  });
  
  $('.brand-list').sortCheckbox();
  
  $("#job-table").tablesorter( {sortList: [[0,0]]} ); 
  
  $('#main-menu li:has(.submenu) > a').addClass('link-submenu');

	$('input#q').each(function(){
      var btntext = $(this).attr('value');
      $(this).focus(function(){ 
            text = $(this).attr('value');
            if( text == 'Hledaný výraz' || text == 'Searched phrase' || text == 'Необходимый текс для поиска' ){
                $(this).attr('value', '');
            }
            $(this).css({'color':'#333', 'font-style':'normal'});
      }).blur(function(){
            var text2 = $(this).attr('value'); 
            if( text2 == '' || text2 == undefined ){
                $(this).attr('value', btntext);
            }
            $(this).css({'color':'#666', 'font-style':'italic'});
      });
  });  
});
