


//Top menu
mainMenuRollover = function() {
    if (document.getElementById) {
        
        var navRoot = document.getElementById("main_menu");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            
            if (node.nodeName=="LI") {
                node.onmouseover=function() {
                    if(document.all)
                      this.className+=" over";
                    var menu_img = this.getElementsByTagName("img")[0];
                    menu_img.src = menu_img.src.replace(".png", "_on.png");
                    if(this.getElementsByTagName("ul").length)
                      this.className+=" overflow";
                }
                node.onmouseout=function() {
                    this.className=this.className.replace("overflow", "");
                    if(document.all)
                      this.className=this.className.replace(" over", "");
                    var menu_img = this.getElementsByTagName("img")[0];
                    menu_img.src = menu_img.src.replace("_on", ""); 
                }
            }
        }
        
    }
    
}


//Circles menu
circleMenuRollover  = function() {
  var wakeUpIE6 = 0;
  var ol = document.getElementById("objective_links");
  if(!ol) ol = document.getElementById("objective_links_int");
  if(!ol) { ol = document.getElementById("objective_links_mid"); wakeUpIE6 = 1; };
  if(ol) {
     var navRoot = ol.getElementsByTagName("ul")[0];
     if(navRoot) {
     
       for(j=0; j<navRoot.childNodes.length; j++) { 
         var litem = navRoot.childNodes[j];
         if(wakeUpIE6) {
           if(litem.className=="ol4") {
             litem.style.width="78px";
           }
           else if (litem.className=="ol4 ol4_active") {
             litem.style.width="114px";
           }
         }
         for(i=0; i<navRoot.childNodes[j].childNodes.length; i++) {
           if(navRoot.childNodes[j].childNodes[i].nodeName == "A") {
             navRoot.childNodes[j].childNodes[i].onmouseover = function() {    
               navRoot.className = this.parentNode.className;
             }
             navRoot.childNodes[j].childNodes[i].onmouseout = function() {    
               navRoot.className = "";
             }               
           }
         }
       }
       
       
       
       
     }
  }   
}

//Circles menu 2
circleMenuMidRollover  = function() {
    if (document.all) {

        var list = document.getElementById("objective_links_mid");
        if(list) {
          list=list.getElementsByTagName("li");
        
          //alert(list.length);
          
          for (i=0; i<list.length; i++) {
              node = list[i];
              
              node.onmouseover=function() {
                  this.className+=" over";
              }
              node.onmouseout=function() {
                  this.className=this.className.replace(" over", "");
  
              }    
          }
        
        }
        
    }
}





//Adding Event Listeners
function addEvent(node, event, listener)
{
	if (node.addEventListener)
	{
		node.addEventListener(event, listener, false);
	}
	else
	{
		node.attachEvent("on"+event, listener);
	}
}

addEvent(window, "load", mainMenuRollover);
addEvent(window, "load", circleMenuRollover);
addEvent(window, "load", circleMenuMidRollover);

