Instead use 'display' attribute.
For toggling the value of display try:
var divs = document.getElementById ("treelist");
divs.style.display = "block";
divs.style.display = "none";