$(document).ready(function() {

  $('.selectableHeader').click(
    function() {
      $(this).toggleClass('clicked');
      var childs = $(this).parent().find('input.selectableChild')
      if($(this).hasClass('clicked')) {
        childs.attr('checked', 'checked');
        //if(childs.hasClass('markChecked')) childs.parent().addClass('checked');
      } else {
        childs.removeAttr('checked');
        //if(childs.hasClass('markChecked')) childs.parent().removeClass('checked');
        
      }
    }
  );

  $('#num_result_form').change(function() {
    var curr = window.location.toString();
    window.location = curr.replace(/&num=[0-9]+/gi, '') + "&num=" + this.value;
  });
  
  $('#adv-open').click(
    function() { 
      if($('#adv-container').hasClass('expanded')) {
        $('#adv-container').removeClass('expanded').slideUp();
      } else {
        $('#adv-container').addClass('expanded').slideDown();
      }
    }
  );
  
  $('#adv-hide').click(
    function() { 
      $('#adv-open').trigger('click');
    }
  );
  
  $('.resizable-v').resizable({
    handles: 's',
    resize: function (event, ui) {
      var wys = parseInt($(this).height())-30;
      $(this).find('.wrapper').css('height', wys);  
    },
    minHeight: 25,
  });
});


