var bbsSearchEntered;
var bbsSearchDefault;

function QuickJump (selector, basePath) {
  var forumid = selector.options[selector.options.selectedIndex].value;
  if (forumid == -1)
    window.location = basePath + "/category-view.asp?showall=true&amp;catlock=0";  
  if (forumid != -1)
    window.location = basePath + "/forum-view.asp?forumid=" + forumid;  
}

function bbsSearchOnKeyUp(o) {
  bbsSearchEntered = true;
  if (o.value.length == 0) {bbsSearchEntered = false;}
}

function bbsSearchOnFocus(o) {
  if (o) {
    if (!bbsSearchEntered) {
      o.value = "";
    }
    o.className = "sfActive";
  }
}

function bbsSearchOnBlur() {
  if (!bbsSearchEntered) {
    bbsSearchShowDeafult();
  }
}

function bbsSearchShowDeafult() {
  var f = document.getElementById("bbsSearchQuery");
  if (f.value == "") {
    f.value = bbsSearchDefault;
    f.className = "sfInactive";
  }
}

function bbsTogglePanels(lsShow, lsHide, isRtl) {

  var lsc = document.getElementById("bbsLeftPanels");
  var t = document.getElementById("bbsLptText");
  var i = document.getElementById("bbsLptImage");
  var c = document.getElementById("bbsLpCnt");
  var rightImg = "/cafe/Images/btnRight.gif";
  var leftImg = "/cafe/Images/btnLeft.gif";
  var dt = new Date()
  if (lsc && t && i && c) {
    if (lsc.style.width != "18px") {
      // Hide
      lsc.style.width = "18px";
      t.innerHTML = "";
      if (isRtl) { i.src = leftImg; } else { i.src = rightImg; }
      i.title = lsShow;
      c.style.display = "none";
      tcLoadXml("leftPanelSetState.asp?v=0&rnd=" + dt.valueOf(), null);
    }
    else {
      // Show
      lsc.style.width = "150px";
      t.innerHTML = lsHide;
      if (isRtl) { i.src = rightImg; } else { i.src = leftImg; }
      i.title = lsHide;
      c.style.display = "block";
      tcLoadXml("leftPanelSetState.asp?v=1&rnd=" + dt.valueOf(), null);
    }
  }
}

