  function show(theName) {
    obj = document.getElementById(theName);
    obj.className = 'show';
  }

  function hide(theName) {
    obj = document.getElementById(theName);
    obj.className = 'hide';
  }

  function showMenu(theId,subPos) {
    obj = document.getElementById(theId);
    obj.className = 'mshow';
    if (subPos) showSub(theId,subPos);
    else hideSub('informatie');
  }

  function hideMenu(theId) {
    obj = document.getElementById(theId);
    obj.className = 'mhide';
  }

  function swap_div(theId) {
    obj = document.getElementById(theId);
    if (obj.className == 'show') hide(theId);
    else show(theId);
  }
  
  function showSub(theId,thePos) {
    theObj = document.getElementById('menu');
    theLeft = theObj.offsetLeft;

    theObj = document.getElementById('sub_' + theId);
    theObj.style.left = theLeft + thePos + 'px';
    theObj.className = 'show';
  }
  
  function hideSub(theId) {
    theObj = document.getElementById('sub_' + theId);
    if (theObj.className != 'hide') theObj.className = 'hide';
  }

  function jah(url,target) {
    // native XMLHttpRequest object
    document.getElementById(target).innerHTML = 'sending...';
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(target);};
        req.open("GET", url, true);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {jahDone(target);};
            req.open("GET", url, true);
            req.send();
        }
    }
  }

  function jahDone(target) {
    // only if req is "loaded"
    if (req.readyState == 4) {
      if (req.status == 200) {
        results = req.responseText;
        document.getElementById(target).innerHTML = results;
        initDocument(true);
      } else {
        document.getElementById(target).innerHTML="jah error:\n" +
        req.statusText;
      }
    }
  }

  function swap_button(theId) {
    obj = document.getElementById(theId);
    if (obj.className == 'show') {
        hide(theId);
        show(theId + '_act');
    } else {
        hide(theId + '_act');
        show(theId);
    }
  }

  function getLeft(thePos) {
    theObj = document.getElementById('menu');
    theLeft = theObj.offsetLeft;
    return theLeft + thePos;
  }

  function win(theUrl) {
    var newwin = window.open(theUrl,'newwin','scrollbar=yes,status=yes,scrollbars=yes,width=600,height=500,top=0,left=0');
  }

  function positionBottom(ev) {
    windowHeight = window.innerHeight;
    if (!windowHeight) windowHeight = document.body.clientHeight;
    contentObj = document.getElementById('content');
    if (contentObj) {
      contentOffsetHeight = contentObj.offsetHeight;
      obj = document.getElementById('contentfooter');
      if (contentOffsetHeight > 420) {
	obj.style.top = (contentOffsetHeight + 120) + 'px';
      }
      else obj.style.top = 550 + 'px';
      //alert(contentOffsetHeight);
    }
    obj.className = 'show';
    return true;
  }

  function resetStyles() {
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++)
      inputList[i].style.backgroundColor = "transparent";
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++)
      selectList[i].style.backgroundColor = "transparent";
  }



  function pos(theId) {
    obj = document.getElementById('m_'+ theId);
    objs = document.getElementById('sub_'+ theId);
    objs.style.left = obj.offsetLeft + 'px';
    objs.className = 'show';
  }

  function init() {
    positionBottom();
    show_errors();
    //obj = document.getElementById('contentfooter');
    //h = obj.style.top;
    //alert(h);
  }
  


