 var use_gebi=false, use_css=false, use_layers=false;
 function  setVisible(checkbox,elementName,elementValue,clearCheckName,clearSelectName)
  {
   
   //Find the element being referred to 
   var thisElement;

   thisElement = getElement(elementName)
   if(checkbox.checked)
    {
     thisElement.style.visibility = "visible";
     thisElement.selectedIndex = 0
     checkbox.value = elementValue
     if(clearCheckName && clearSelectName)
      {
       clearCheck(clearCheckName,clearSelectName,0)
      }
    }
   else
    {
     thisElement.style.visibility = "hidden";
     thisElement.selectedIndex = 0
     checkbox.value = ""
    }
 }

function setCheckValue(select,checkBoxName,checkboxValue)
 {
   thisCheck = getElement(checkBoxName)
   if(!thisCheck)
    {alert("checkbox  " + checkBoxName + " not found")} 
   else
    {
     if(select.selectedIndex <= 0)
      thisCheck.value = checkboxValue
     else
      thisCheck.value = "" 
    }
 }

function clearCheck(checkboxName, elementName, hideCheck, defaultSelection)
{
   //Find the checkbox being referred to 
   var thisCheck;
   thisCheck = getElement(checkboxName)

    //Find the element being referred to 
   var thisElement;
   thisElement = getElement(elementName)

   //Make sure the check box is unchecked

   if(!thisCheck)
    {alert("checkbox  " + checkboxName + " not found")} 
   else 
    {
       thisCheck.checked = false
       if(hideCheck == 1)
        thisCheck.style.visibility = "hidden"
       else
        thisCheck.style.visibility = "visible"
    }

   //Make sure that nothing is selected from the associated select list

   if(!thisElement)
    {alert("select  " + elementName + " not found")}
   else
    {
      thisElement.selectedIndex = 0
      thisElement.style.visibility = "hidden";
    }
}


function setFilterField(control,filterName,filterValue)
 {
   thisFilter = getElement(filterName)
   if(control.value)
      thisFilter.value = "¬"+filterValue+control.value;
   else
     thisFilter.value = ""
 }


function getElement(elementName)
{
   //Get the browser capabilities
   setBrowser()

   var thisElement;
   if(use_gebi && document.all)
    thisElement = document.all[elementName]
   if(use_gebi)
    thisElement = document.getElementById(elementName)
   if(use_layers)
    thisElement = document[elementName]
   return thisElement
}

function setBrowser()
 {
  // Browser capability sniffing
  if (document.getElementById) { use_gebi=true; }
  else if (document.all) { use_css=true; }
  else if (document.layers) { use_layers=true; }
}