/* Functions to hide and show quick login and quick search in the tools menu */

var timeClose = 4000; //Timeout for the Login and Search in toolsmenu
 var divClose=null;
 
function showForm(idShow, idHide)
{
  var topEl = document.getElementById(idShow+'Top');
  var bottomEl = document.getElementById(idShow+'Bottom');
  clearTimeout(divClose);
  hideEl(idHide);
  topEl.className += ' topShow'; 
  bottomEl.className += ' bottomShow'; 
}

function hideEl(id)
{ 
  var topEl = document.getElementById(id+'Top');
  var bottomEl = document.getElementById(id+'Bottom');
  topEl.className = 'mouseovertop';
  bottomEl.className = 'mouseoverbottom';
}

function hideForm(id)
{
  clearTimeout(divClose);
  divClose=setTimeout('hideEl("'+id+'");',timeClose);
}

function SwitchChecks(obj, id)
{
  var status = document.getElementById('status');
  var printers = document.getElementById(id).childNodes;
  var inputObj;
  if(status.value == '1') //remove all checks
  { 
    for(i = 0; i < printers.length; i++)
    {
      inputObj = printers[i].childNodes[0];
      inputObj.checked = '';
    }
    status.value = '0';
    obj.value = 'Select all';
  }
  else //set all checks
  {
    for(i = 0; i < printers.length; i++)
    {
      inputObj = printers[i].childNodes[0];
      inputObj.checked = 'checked';
    }
    status.value = '1';
    obj.value = 'Remove all';
  }
}