﻿//change theme
function createMenu()
{
    if(document.getElementById)
    {
        if(document.getElementById("ctl00_fwRoot_fwContent_fwMenu_uxMenu"))
        {
            var menu = document.getElementById("ctl00_fwRoot_fwContent_fwMenu_uxMenu")
            var liList = menu.getElementsByTagName("li");
            for(i=0; i<liList.length; i++)
            {

                // markere parent
                if(liList[i].className.indexOf("Current") > -1)
                {
                    if(liList[i].parentNode.parentNode.tagName == "LI")
                    {
                        liList[i].parentNode.parentNode.className = "Current Top";
                    } 
                }

                // sjekk for undermeny
                sublist = liList[i].getElementsByTagName("ul");
                if(sublist.length > 0)
                {
                    if(liList[i].className == "")
                    {
                        liList[i].className = "Parent";
                    }
                    else
                    {
                        liList[i].className += " Parent Top";
                    }
                }   
            }
        }
    }
}

function addMenuItems()
{
    if(document.getElementById)
    {
        if(document.getElementById("ctl00_fwRoot_fwHeader_uxMenu"))
        {
            var menu = document.getElementById("ctl00_fwRoot_fwHeader_uxMenu");
            
            /*
            var newLi = document.createElement('li');
            newLi.innerHTML = 'adfafads';
            menu.appendChild(newLi);
            */
            
            /*
            var newA = document.createElement('a');
            newA.innerHTML = 'dette er en test!';
            
            newLi.appendChild(newA);
            */
            
        }
    }

}

