  function reloadSearch() {
    var page = location.href;
    // Strip our the page number
    var first = new RegExp(/[?]first=[0-9]+/);
    if (page.match(first)) {
      page = page.replace(first,"");
      // Check to see if there are other args.
      var hasAmp = RegExp(/[&]/);
      if (page.match(hasAmp)) {
        // Replace amp w/question mark
        page = page.replace(hasAmp,"?");
      }
    }
    location.href=page;
  }

  function topTabs(tab,resubmit,click){
    if (document.forms.home) {
      var f = document.forms.home;
      resubmit = false;
    } else {
      var f = document.forms.advsearch;
    }
    if (tab == 'plus-tab') {
      $("#plus-tab")[0].className = 'tab-on';
      $("#std-tab")[0].className = 'tab-off';
      if (f.f_plus && f.t_plus) {
        f.f_plus.value = 1;
        f.t_plus.value = 1;
      }
      $.writeValueToCookie('adv_search', 'f_plus', '1');
      if (resubmit == false) {
        //Put this back if the STD tab hid it.
        $("#paging_top").show();
        $("#paging_bot").show();
      }
    } else {
      $("#plus-tab")[0].className = 'tab-off';
      $("#std-tab")[0].className = 'tab-on';
      if (f.f_plus && f.t_plus) {
        f.f_plus.value = "";
        f.t_plus.value = "";
      }
      $.writeValueToCookie('adv_search', 'f_plus', '0');
//      $.writeValueToCookie('adv_search_temp', 'a', 'a');
      if (resubmit == false) {
        //Hide pagethrough when switching to tab with no results.
        $("#paging_top").hide();
        $("#paging_bot").hide();
      }
    }
    if (resubmit == true) {
      //this setTimeout is necessary to make the form submit work in IE6
      setTimeout("reloadSearch();", 50);
    } else {
      ShowPlusFilters();
      if (tab == 'plus-tab') {
        $("[@name='a']").find("[@value='" + $.getValueFromCookie('adv_search_temp','a') + "']").attr("selected",true);
      }
    }
    if (click == true) {
      //Lets us know that the user clicked a tab so that we can properly set defaults -- see default_top. 
      $.writeValueToCookie('phnvc', 'tabClick', 'Y');
    }
  }
