//function MM_jumpMenu(targ,selObj,restore){ //v3.0
//eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
//if (restore) selObj.selectedIndex=0;
//}

$(document).ready(function(){

  //Hide (Collapse) the toggle containers on load
  $(".toggle_container").hide(); 

  //Switch the "Open" and "Close" state per click
  $(".trigger").toggle(function(){
    $(this).addClass("active");
    }, function () {
    $(this).removeClass("active");
  });

  //Slide up and down on click
  $(".trigger").click(function(){  
    $(this).next("div.toggle_container").slideToggle("slow");
  });

  // highlight selected publication (indicated by #anchor)
  if (location.href.indexOf('#') > 0)
  {
    var query = location.href.split('#');
    $("#" + query[1]).addClass("selected-publication");
  }
  
  // make sure the search box auto-selects text on click (or on focus?)
  $("#query").click(function(){
    $(this).select();
  });
});
