﻿// iP DropDown Menus v2.0
function activateMenu(nav) {
   var navroot = document.getElementById(nav);     
   /* Get all the list items within the menu */
   if (navroot) {
     var lis = navroot.getElementsByTagName("LI");  
     for (i=0; i<lis.length; i++) {
       /* If the LI has another menu level */
       if(lis[i].lastChild.tagName=="UL"){   
         var objNewNode = document.createElement("iframe");
         objNewNode.setAttribute('class', 'invisible');
         objNewNode.setAttribute('src', 'javascript:false;');
         lis[i].lastChild.insertBefore(objNewNode, lis[i].lastChild.firstChild);

         /* assign the function to the LI */
         lis[i].onmouseover=function() {	      
           /* display the inner menu */
           this.lastChild.style.display="block";
           this.lastChild.firstChild.style.width = this.lastChild.offsetWidth;
    	   this.lastChild.firstChild.style.height = this.lastChild.offsetHeight;
           this.lastChild.firstChild.style.top = 0;
      	   this.lastChild.firstChild.style.left = 0;
   	   this.lastChild.firstChild.style.zIndex = this.lastChild.style.zIndex - 1;
    	   this.lastChild.firstChild.style.display = "list-item";
         }
         lis[i].onmouseout=function() {                       
           this.lastChild.style.display="none";
	   this.lastChild.firstChild.style.display = "none";
         }
       }
     }
   }
}

function fixPNGs(){
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])

  if ((version >= 5.5 && version < 7) && (document.body.filters)) 
  {
     for(var i=0; i<document.images.length; i++)
     {
        var img = document.images[i]
        var imgName = img.src.toUpperCase()
        if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
        {
           var imgID = (img.id) ? "id='" + img.id + "' " : ""
           var imgClass = (img.className) ? "class='" + img.className + "' " : ""
           var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
           var imgStyle = "display:inline-block;" + img.style.cssText 
           if (img.align == "left") imgStyle = "float:left;" + imgStyle
           if (img.align == "right") imgStyle = "float:right;" + imgStyle
           if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
           var strNewHTML = "<span " + imgID + imgClass + imgTitle
           + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
           + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
           + "(src=\'" + img.src + "\');\"></span>" 
           try
           {
             img.outerHTML = strNewHTML
             i = i-1
           }
           catch(err)
           {
           }           
        }
     }
  }
}