// JavaScript Document
$(document).ready(function(event){	
		jumplist();
});

function jumplist() {
	if ($('.visible')){
		$('.visible li a').click(function(event){
			var iD = $(this).attr('href');
			var position = $(iD).offset();
			if(position == null) {
				return;
			}
			else {
			event.preventDefault();
			target = $(this);
			$('.highlight').removeClass('highlight', 500);
			scrollhere(target);
			}
		});	
	}
}
function scrollhere(){
	iD = target.attr('href');
	position = $(iD).offset();
	if(position == null) {
		//alert('There is a problem on the page');
		return;
	}
	else {
	position = position.top
	$("html, body").animate({
		scrollTop: position - 10
	}, 1500, 'easeOutCirc', function(){
		$(iD).addClass('highlight', 500);
		});
}
}
