﻿window.addEvent('domready', function() { 
        
        var sPath = window.location.pathname;
        var sPage = sPath.substring(sPath.lastIndexOf('/') + 1).toLowerCase();
        
        var as = $$("#Navigation ul li a");
        as.each(function(aHref){
            if(sPage.length > 0 && aHref.attributes["href"].value.substring(aHref.attributes["href"].value.lastIndexOf('/') + 1).toLowerCase()==sPage)
            {
                aHref.className = "currentPage";
            }
        });        
    
    var uls = $$("#Navigation ul li ul");
        uls.each(function(ulEvent){
                            ulEvent.addEvents({
                             'mouseenter' : function () {
                                this.parentNode.childNodes[0].style.backgroundColor = "#fbae3f";
                                this.parentNode.childNodes[0].style.color = "White";
                            },
                            'mouseleave' :function () {
                                this.parentNode.childNodes[0].style.backgroundColor = "";
                                this.parentNode.childNodes[0].style.color = "";
                            }
                           });
        });
    });