﻿//highlight the current link in the footer menu
function highlightCurrentLinkInFooter() {
    var currentUrl = location.href;
    var mainNavDiv = typeof div;
    mainNavDiv = document.getElementById("footer_nav");
    var allHrefsInMainDiv = mainNavDiv.getElementsByTagName("a");
    for (var i = 0; i < allHrefsInMainDiv.length; i++) {
        var currentLink = typeof DispHTMLAnchorElement;
        currentLink = allHrefsInMainDiv[i];
        //hard code check for the redirect link (latest news = current news and events)

        if (currentLink.href == currentUrl
            || (currentUrl.match("LatestNews.aspx") != null && currentLink.href.match("Redirect.aspx") != null)) {
            currentLink.className += " currentFooterLink";
            break;
        }
    }
}
