$(document).ready(function() { 

  /* Old talks system code. Kept for legacy support if required */
  
  // Hiding and showing of search form
  // $('.search-form form').css('display', 'none');
  // $('.search-title').empty()
  // 
  // $('<a href="./">Click to search again</a>').appendTo('.search-title');
  // $('.search-title a').click(function() {
  //   var box = $(this).parent().parent();
  //   box.children('form').toggle();
  //   return false;
  // });
  // 
  // $("#talk-list").tablesorter({
  //   textExtraction: function(node) { 
  //     // extract data from markup and return it
  //     $node = $(node)
  //     desc = $node.children('.talk-description');
  //     if (desc.length > 0) {
  //       return desc.text();
  //     } else {
  //       return $node.text();
  //     }
  //   }
  // });
  // 
  // Re-stripe table after sorting
  // $("#talk-list").bind("sortEnd",function() { 
  //   $('#talk-list tbody tr:odd').removeClass('row-even').addClass('row-odd');
  //   $('#talk-list tbody tr:even').removeClass('row-odd').addClass('row-even');
  // });
  
  //
  
  $('#subject').change(function (event) {
    window.location = '/shop/talks/subjects/' + event.target.value;
    return false;
  });
  $('#speaker').change(function (event) {
    window.location = '/shop/talks/speakers/' + event.target.value;
    return false;
  });
  
  $('p.talk-search-button').hide();
});
