currentShownDiv = '';
function show(id)
{
 currentShownObj = document.getElementById(currentShownDiv);
 if (currentShownObj != null)
 currentShownObj.style.display = 'none';
 if (id == currentShownDiv)
 {
  currentShownDiv = '';
  return;
 }
 currentShownDiv = id;
 objToShow = document.getElementById(id);
 if (objToShow.style.display == 'none')
 {
  objToShow.style.display = 'block';
 }
 else
 {
  objToShow.style.display = 'none';
 }
}

function show_layer(x)
{
    if(document.layers)
        document.layers[x].visibility="show";
    else
        document.getElementById(x).style.visibility="visible";
}
function hide_layer(x)
{
    if(document.layers)
        document.layers[x].visibility="hide";
    else
        document.getElementById(x).style.visibility="hidden";
}

function klapp(x)
{
 if(!old)
 {
  old = memold;
 }
 if(old != x)
 {
  show_layer(x);
  old = x;
 }
 else
 {
  old = '';
 }
}
function check(x)
{
 if(old && old != x)
 {
  hide_layer(old);
  show_layer(x);
  old = x;
 }
}
function out()
{
 if(old)
 {
  hide_layer(old);
  memold = old;
  old = '';
 }
}

function setCheckboxes(theForm, elementName, isChecked)
{
 var chkboxes = document.forms[theForm].elements[elementName];
 var count = chkboxes.length;
 if (count) 
 {
  for (var i = 0; i < count; i++) 
  {
   chkboxes[i].checked = isChecked;
  }
 } 
 else 
 {
  chkboxes.checked = isChecked;
 } 
 return true;
}
