var currentPage = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1);
var currentPage2 = String(window.location).substring(String(window.location).lastIndexOf('/')+1);



// -- Get a list of the pages in the menu
var menu = document.getElementById("left_menu_container");
if (menu != null)
{
    var node = menu.firstChild;
    var subMenuNode = null;
    do {

        if (node.className == "left_menu_item_st") {
            subMenuNode = node;

            node = node.firstChild;

            do {
                if (node.className == "left_menu_item_sm") {
                    var content = node.firstChild;
                    while (content != null) {
                        var href = content.href;

                        if (href != null) {
                            var thisnode=href.substring(href.lastIndexOf('/') +1);

                            //alert(" -- " + thisnode);

                            if (thisnode.indexOf('#') > 0)
                                thisnode = thisnode.substring(0, thisnode.indexOf('#'));

                            if (currentPage == thisnode) {

                                menu_click(node)
                                content.style.color = "#ff0000";
                            }

                            else if (currentPage2 == thisnode) {
                                menu_click(node)
                                content.style.color = "#ff0000";
                            }
                        }
                        content = content.nextSibling
                    }
                }

                node = node.nextSibling;
            } while (node != null);

            node = subMenuNode;
        }
        node = node.nextSibling;
    } while (node != null);
}