  function show(theName) {
    obj = document.getElementById(theName);
    cl = obj.className.replace('hide','show');
    obj.className = cl;
  }

  function hide(theName) {
    obj = document.getElementById(theName);
    cl = obj.className.replace('show','hide');
    obj.className = cl;
  }

  function swapCheckbox(theName,theObj,hCheck) {
    checkObj = document.getElementById(theName);
    prevVal = checkObj.value;
    if (prevVal == 0) {
      theObj.style.backgroundPosition='0px ' + hCheck + 'px';
      newVal = 1;
    } else {
      theObj.style.backgroundPosition='0px 0px';
      newVal = 0;
    }
    checkObj.value = newVal;
  }
  
  function swap_category(theId) {
    oldCat = document.forms.catForm.category.value;
    obj = document.getElementById(oldCat);
    obj.className = 'hide';
    obj = document.getElementById('a_' + oldCat);
    obj.src = 'images/arrow_right.png';
    obj = document.getElementById(theId);
    obj.className = 'show';
    obj = document.getElementById('a_' + theId);
    obj.src = 'images/arrow_down.png';
    document.forms.catForm.category.value = theId;
  }
  
  function getScreenWidth() {
    isNetscape = (navigator.appName == "Netscape");
    available = (isNetscape) ? window.innerWidth : document.body.clientWidth;
    return available;
  }
    
  function getScreenHeight() {
    isNetscape = (navigator.appName == "Netscape");
    available = (isNetscape) ? window.innerHeight : document.body.clientHeight;
    return available;
  }
  
  function centerDiv(theId) {
    obj = document.getElementById(theId);
    w = obj.offsetWidth + 300;
    h = obj.offsetHeight + 300;
    sw = getScreenWidth();
    sh = getScreenHeight();
    scrolly = (document.all)?document.body.scrollTop:window.pageYOffset;
    obj.style.left = Math.ceil((sw - w) / 2)  + 'px';
    obj.style.top = Math.ceil((sh - h) / 2) + scrolly + 'px';
  }

