$(document).ready( function(){
        var path = location.pathname.substring(1);
        $('a[@href$="' + path + '"]').parents("li").addClass('selected');
});
 