// Nephilistic functions
jQuery(document).ready(function($){
	$('#activate-js').hide();
	$('#animate-scroll').show();
	$('#PageNavNext').click(function(e){
		e.preventDefault();
		$('#PageNavPrev, #PageNavTop').removeClass('inactive');
		scrollTop = $(window).scrollTop();
		$('#Content>ul>li').each(function(i, h2){ // loop through article headings
			h2top = $(h2).offset().top; // get article heading top
			if (scrollTop < h2top) { // compare if document is below heading
				$.scrollTo(h2, 800); // scroll to in .8 of a second
				return false; // exit function
			}
		});
	});	
	$('#PageNavTop').click(function(e){
		e.preventDefault();
		$('#PageNavPrev, #PageNavTop').addClass('inactive');
		$.scrollTo($('#Content'), 1500)
	});
	jQuery.fn.reverse = function()
	{
	return this.pushStack(this.get().reverse(), arguments);
	};
	$('#PageNavPrev').click(function(e){
		e.preventDefault();
		scrollTop = $(window).scrollTop();
		$('#Content>ul>li').reverse().each(function(i, h2){ // loop through article headings
			h2top = $(h2).offset().top; // get article heading top
			if (scrollTop > h2top) { // compare if document is below heading
				$.scrollTo(h2, 800); // scroll to in .8 of a second
				return false; // exit function
			}
		});
	});	
	
});

