﻿(function($) {
    $.fn.StyleCurrentMenu = function(className, startPage) {
        var aAdress = location.href.split("/");
        var sPage = aAdress[aAdress.length - 1];
        
        if (sPage.length == 0) { sPage = startPage }
        $("#" + this.attr("id") + " a").each(function() {
            if ($(this).attr("href") == sPage) {
                return $(this).parent().addClass(className);
            }
        });
    }
})(jQuery);