function toggle(x) {
  if (x.parentNode.className == "event2") {
    x.parentNode.className="event";
    x.firstChild.className="eventhed";
	if (x.parentNode.lastChild.nodeName == "DIV")
      x.parentNode.lastChild.className = "eventdetail";  
	else // hack to access DOM on Firefox
	  x.parentNode.lastChild.previousSibling.className = "eventdetail"; 

  } else {
    x.parentNode.className="event2";
    x.firstChild.className="eventhed2";
	if (x.parentNode.lastChild.nodeName == "DIV")
      x.parentNode.lastChild.className = "eventdetail2";  
	else // hack to access DOM on Firefox
	  x.parentNode.lastChild.previousSibling.className = "eventdetail2"; 
  }
}

 function expand_all() {
        var divCollection = document.getElementsByTagName("div");
        for (var i=0; i<divCollection.length; i++) {
            if ((divCollection[i].getAttribute("className") == "eventhed") || (divCollection[i].getAttribute("class") == "eventhed")) {
              toggle(divCollection[i].parentNode);
            } 
        }
    }
	function collapse_all() {
        var divCollection = document.getElementsByTagName("div");
        for (var i=0; i<divCollection.length; i++) {
if ((divCollection[i].getAttribute("className") == "eventhed2") || (divCollection[i].getAttribute("class") == "eventhed2")) {
                toggle(divCollection[i].parentNode);
            } 
        }
    }
