function initMenu(){

 var nodes = document.getElementsByClassName("submenu");
 for (var i=0; i<nodes.length; i++)
 
 {
  nodes[i].onclick = function ()
  {
  if (this.parentNode.tagName == "LI"){
   if (this.parentNode.className.indexOf("active") !=-1)
   {
    this.parentNode.className = this.parentNode.className.replace("active", "");
   
   }
   else
   {
    this.parentNode.className += " active";
   }
   return false;
   }
  }
 }
}


if (window.addEventListener){
 window.addEventListener("load", initMenu, false);

 
 }
else if (window.attachEvent){
 window.attachEvent("onload", initMenu);

 }
 
