﻿// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
// This function finds the menu element that is selected and changes its class.
//
// Note: This function requires that the menu is an unordered list (ul) with
// the id "ulMenu" and that each menu element is an anchor tag.
// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
function selectMenuElement()
{
    var strURL = window.location.href;
    var doc = document.getElementById('ulMenu').getElementsByTagName('a');
    var bFound = false;
    
    for (var i = 0; i < doc.length; i++)
    {
        var strHref = doc[i].href;
        if (strHref == strURL)
        {
            doc[i].className = 'selected';
            bFound = true;
        }
    }
    
    if (bFound == false)
    {
        doc[0].className = 'selected';
    }
}
