$(function() {
	$('div.nav ul li').each(function() {
		if(!$(this).hasClass('menu-item-209'))
		{
			$(this).children('a').attr('href', "javascript:;");
		}
		else
		{
			//do nothing
		}
	});
	
	$('div.nav ul li').each(function() {
		pageCount++;
		$(this).addClass('page-'+pageCount);
	});
	
	$('div.nav ul li a').each(function() {
		$(this).addClass($(this).html());
	});
	
	$('div.nav ul li a').each(function() {
		var link = $(this).html();
		$(this).click(function() {
			$('div.nav ul li a').removeClass('current');
			$(this).addClass('current');
		
			if($(this).parent().hasClass('page-1'))
			{
				if(!$('body, html').is(':animated'))
				{
					$('body, html').animate({
						scrollTop: 0
					}, 500);
				}
			}
			else
			{
				if(!$('body, html').is(':animated'))
				{
					$('body, html').animate({
						scrollTop: $('div.'+link.replace(/ /g, '-').toLowerCase()).offset().top+20
					}, 500);
				}
			}
		});
	});
});
