(function (jQuery) {
  jQuery(function() {

    jQuery(".printButton > a").attr('href', 'javascript:window.print()');

    jQuery("select#cat, select#force").val('');    
    //  browse by publication type
    jQuery("select#cat").change(function () {
      jQueryvalue = jQuery(this).val();
      if (jQueryvalue && jQueryvalue !== '') {
        jQueryloc = "/search-publications?cat="+jQueryvalue;
        window.location.href = jQueryloc;
      }
    });
    
    //  browse by police force
    jQuery("select#force").change(function () {
      jQueryvalue = jQuery(this).val();
      if (jQueryvalue && jQueryvalue !== '') {
        jQueryloc = "/search-publications?force="+jQueryvalue;
        window.location.href = jQueryloc;
      }
    });
    
    //  police force menu
    jQuery(".force-menu").change(function () {
      jQueryvalue = jQuery(this).val();
      if (jQueryvalue && jQueryvalue !== '') {
        jQueryloc = "/"+jQueryvalue;
        window.location.href = jQueryloc;
      }
    });
    
    //  faceted search
    jQuery("a.showmore").click(function () {
      jQuery(this).hide();
      jQuery(this).parent().find(".fs.more").slideDown();
    });

  });
})(jQuery);
 

