
//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/
var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus_horizontal(){
for (var i=0;i<menuids.length;i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
//ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
}
else{ //else if this is a sub level menu (ul)
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
//ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
}
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.visibility="visible"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.visibility="hidden"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)

///////

MarkMenu = function() 
{
    
    var arrSearchVariables = new Array();
    arrSearchVariables = getCategorySubCategory();

    if (document.getElementById&&arrSearchVariables[1]!=undefined) 
    {
         //Lets do the main menu marking        
        il=document.getElementById('treemenu1').getElementsByTagName('li');
         for(i=0;i<il.length;i++)
         {

            // grab first link in the LI
             anchorTag =il[i].getElementsByTagName('a')[0];
             if(anchorTag!=undefined)
             {
              //alert(anchorTag.innerText.ToUpper());
             // alert(arrSearchVariables[1].ToUpper());
                if(anchorTag.innerHTML.toUpperCase().replace(/^\s+|\s+$/g, '') == arrSearchVariables[1].toUpperCase().replace(/^\s+|\s+$/g, ''))//Top Level MenuItem
                {
                   anchorTag.style.backgroundColor="#fff";
                   anchorTag.style.fontWeight="bold";
                   anchorTag.style.color="#007bb6";
                  // background-color: #fff; font-weight: bold; color: #007bb6
                                
                  
                }
                 if(anchorTag.innerHTML.toUpperCase().replace(/^\s+|\s+$/g, '') == arrSearchVariables[2].toUpperCase().replace(/^\s+|\s+$/g, ''))//Child Level MenuItem
                {
                    //anchorTag.style.fontSize = "25px";
                   anchorTag.style.backgroundColor="#fff";
                   anchorTag.style.fontWeight="bold";
                   anchorTag.style.color="#007bb6";
                }
             }

         }
        //lets do the left nav menu marking
        ileft=document.getElementById('leftnav').getElementsByTagName('li');
        for(i=0;i<ileft.length;i++)
        {
           // grab first link in the LI
             anchorTag =ileft[i].getElementsByTagName('a')[0]; 
             if(anchorTag!=undefined)
             {
				var replacedTag = anchorTag.innerHTML.replace(/<br>/gim,'');
               replacedTag = replacedTag.replace(/\s/g, "") ;
                var arrReplaceSearch =  arrSearchVariables[2].replace(/\s/g, "");
               if(replacedTag.toUpperCase().replace(/^\s+|\s+$/g, '') == arrReplaceSearch.toUpperCase().replace(/^\s+|\s+$/g, ''))//left nav menuitem
                {
                   //font-weight: bold;color:#8dc1d4;}
                   anchorTag.style.fontWeight="bold";
                   anchorTag.style.color="#8dc1d4";
                }
                
             }
        }
         
    }
}

function getCategorySubCategory()
{
     if (document.getElementById)
     {
        if (document.getElementById("WhereAmI")!=null)
        {
            return document.getElementById("WhereAmI").innerHTML.split(" &gt; ");
        }
        else
        {
            return "";
        }
     }
     else
     {
        return "";
     }
}
//window.onload=MarkMenu;

if (window.addEventListener)
window.addEventListener("load", MarkMenu, false)
else if (window.attachEvent)
window.attachEvent("onload", MarkMenu)