function checkExpand(num) {
  if(document.getElementById('question'+num).className == 'answerhide') {
    document.getElementById('question'+num).className = 'answershow';
    addHit(num);
  } else {
    document.getElementById('question'+num).className = 'answerhide';
  }
}

function showHide(id) {
  if(document.getElementById(id).className=='hide') 
    document.getElementById(id).className = 'show';
  else
    document.getElementById(id).className = 'hide';
}

function addNode(node) {
  document.location = 'categories.php?parentNode=' + node;
}

function deleteNode(node, children) {
  if(confirm('Are you sure you want to delete this category?')) {
    if(children) {
      alert('Category has subcategories in it.  All subcategories must first be deleted.');
    } else {
      document.location = 'categories.php?func=delete&nName=' + node;
    }
  }
}

function updateNode(node) {
  document.location = 'categories.php?func=u&parentNode=' + node;
}

function upNode(node) {
  document.location = 'categories.php?func=up&nName=' + node;
}

function downNode(node) {
  document.location = 'categories.php?func=down&nName=' + node;
}

function addHit(faqid) {
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      try {
	req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(E) {
	req = false;
      }
    }
  }

  if (req) {
    req.open("GET", "http://babypartner.com/faqtest/faq_hit.php?id=" + faqid, true);
    req.onreadystatechange = noNothing;
    req.send(null);
  }
}

function noNothing() {
  if (req.readyState == 4) {
    if (req.status == 200) {
      htmlpage = req.responseXML;
    } else {
      //nothing;
    }
  }
}
