jQuery(function(){
	$("#pan_scrolling_top").hide().removeAttr("href");
	if ($(window).scrollTop()>="200") $("#pan_scrolling_top").fadeIn("slow");
		$(window).scroll(function(){
	if ($(window).scrollTop()<="200") $("#pan_scrolling_top").fadeOut("slow");
	else $("#pan_scrolling_top").fadeIn("slow");
	});

	$("#pan_scrolling_bottom").hide().removeAttr("href");
	if ($(window).scrollTop()<=$(document).height()-"999") $("#pan_scrolling_bottom").fadeIn("slow");
		$(window).scroll(function(){
	if ($(window).scrollTop()>=$(document).height()-"999") $("#pan_scrolling_bottom").fadeOut("slow");
	else $("#pan_scrolling_bottom").fadeIn("slow");
	});

	$("#pan_scrolling_top").click(function(){
	$("html, body").animate({scrollTop:0},"slow");
	});
	$("#pan_scrolling_bottom").click(function(){
	$("html, body").animate({scrollTop:$(document).height()},"slow");
	});
});