var path = "/888333888/cms/design/news/images/";
var temp, temp2;
function initiate(){
  
  temp=document.getElementById("containerul");
  for(var o=0;o<temp.getElementsByTagName("li").length;o++){
    if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul").length>0){
      temp2 = document.createElement("span");
      temp2.className = "symbols";
      if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].className == "open")
				temp2.style.backgroundImage = "url("+path+"content_tree-close.gif)";
			else
				temp2.style.backgroundImage = "url("+path+"content_tree-open.gif)"; 
			 
      temp2.onclick=function(){
        showhide(this.parentNode);
       
      }
      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild)
      temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].className == "open" ? temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "block" : temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "none";
      
      
    }
    else{
      temp2 = document.createElement("span");
      temp2.className = "symbols";
     
      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild);
    }
  }
}


function showhide(el){
  el.getElementsByTagName("ul")[0].style.display=(el.getElementsByTagName("ul")[0].style.display=="block")?"none":"block";
  el.getElementsByTagName("span")[0].style.backgroundImage=(el.getElementsByTagName("ul")[0].style.display=="block")?"url("+path+"content_tree-close.gif)":"url("+path+"content_tree-open.gif)";
}

/*
var path = "/888333888/cms/design/news/images/";
var temp, temp2;
function initiate(){
  
  temp=document.getElementById("containerul");
  for(var o=0;o<temp.getElementsByTagName("li").length;o++){
    if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul").length>0){
      temp2 = document.createElement("span");
      temp2.className = "symbols";
      temp2.style.backgroundImage = "url("+path+"content_tree-open.gif)"; 
      temp2.onclick=function(){
        showhide(this.parentNode);
       
      }
      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild)
      temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "none";
      
      
    }
    else{
      temp2 = document.createElement("span");
      temp2.className = "symbols";
     
      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild);
    }
  }
}


function showhide(el){
  el.getElementsByTagName("ul")[0].style.display=(el.getElementsByTagName("ul")[0].style.display=="block")?"none":"block";
  el.getElementsByTagName("span")[0].style.backgroundImage=(el.getElementsByTagName("ul")[0].style.display=="block")?"url("+path+"content_tree-close.gif)":"url("+path+"content_tree-open.gif)";
}


*/
