window.onload = onLoad

function onLoad()
{
    var sa = document.getElementById("showAll")
	sa.checked = false
}

function clearCheckbox(checkBoxName)
{
    document.getElementById("showAll").checked = false;
}
/* Changes the status of an element to either visible or not */
function change(id)
{ 
    ID = document.getElementById(id); 
    
    if(document.getElementById(id).style.display == "")
        document.getElementById(id).style.display = "none"; 
    else 
        document.getElementById(id).style.display = ""; 
}

/*returns all elements of a certain class */
function getElementsByStyleClass (className) {
  var all = document.all ? document.all :
    document.getElementsByTagName('*');
  var elements = new Array();
  for (var e = 0; e < all.length; e++)
    if (all[e].className == className)
      elements[elements.length] = all[e];
  return elements;
}
/* changes all elements of a given class to displayed */
function changeAllToDisplay(className)
{ 
    var elements = getElementsByStyleClass(className)
    
    for (var e = 0; e <elements.length; e++)
        elements[e].style.display = ""; 
}

/*changes all elements of a certain class to hidden */
function changeAllToHidden(className)
{ 
    var elements = getElementsByStyleClass(className)
    
    for (var e = 0; e <elements.length; e++)
        elements[e].style.display = "none"; 
}

/* changes state of all elements of a given class depending of the checkbox status */
function changeViewState(className)
{
    if (document.getElementById("showAll").checked)
        changeAllToDisplay(className);
        else
        changeAllToHidden(className);
}
/* if (document.getElementByID(checkBoxName).checked)*/