// iP DropDown Menus v2.0
function activateMenu(nav) {
   var navroot = document.getElementById(nav);     
   /* Get all the list items within the menu */
   if (navroot && !window.XMLHttpRequest) {
     var lis = navroot.getElementsByTagName("LI");  
     
     for (var i=0; i<lis.length; i++) {
       /* If the LI has another menu level */
       if (lis[i].lastChild.tagName == "UL") {
         /* assign the function to the LI */
         lis[i].onmouseover=function() {	      
           /* display the inner menu */
	   var currentUL = this.lastChild;
           currentUL.style.display = "block";
           currentUL.firstChild.style.width = currentUL.offsetWidth;
    	   currentUL.firstChild.style.height = 0;
           currentUL.firstChild.style.top = 0;
      	   currentUL.firstChild.style.left = 0;
   	   currentUL.firstChild.style.zIndex = this.style.zIndex - 1;
    	   currentUL.firstChild.style.display = "list-item";
    	   currentUL.firstChild.style.listStyleType = "circle";
         }
         lis[i].onmouseout=function() {                       
           this.lastChild.style.display = "none";
	   this.lastChild.firstChild.style.display = "none";
         }
       }
     }
   }
}

function highlightParent(obj, type) {
  if (type=='Active') {
    obj.parentNode.getElementsByTagName('a').item(0).style.backgroundColor='#969696';
    obj.parentNode.getElementsByTagName('a').item(0).style.color='#FFFFFF';
  } else {
    obj.parentNode.getElementsByTagName('a').item(0).style.backgroundColor='';
    obj.parentNode.getElementsByTagName('a').item(0).style.color='';
  }
}

function highlightListItem(obj, type) {
  if (type=='Active') {
    obj.style.backgroundColor='#FFFF01';
    obj.getElementsByTagName('a').item(0).style.backgroundColor='#FFFF01';
  } else {
    obj.style.backgroundColor='#969696';
    obj.getElementsByTagName('a').item(0).style.backgroundColor='#969696';
  }
}

