jQuery(function() {

	var first = window.location.pathname;
    

    /*
     * This adds the class 'sub' to the <li> elements that
     * have an <ul> within
     */
    jQuery('div#menu ul li').has('ul').addClass('sub');
     
    
	/*
	 * This adds the class 'active' to the <a> elements
	 * whom 'href' attribute matches to the url path
	 */
	jQuery('div#menu ul li a').each(function(){
		if (first.match(jQuery(this).attr('href'))) {
			jQuery(this).addClass('active');
		}
	});

	/*
	 * This adds the class 'nav' to the <li> element that has
	 * the <a> with class 'active' within it
	 */
	jQuery('div#menu ul li').has('a.active').addClass('nav');
	jQuery('div#menu ul li').has('a.active').children('a').addClass('active');

    jQuery('div#content').tinyscrollbar();
    
});


