function scrollPositionCheck() {
	if ($(window).scrollTop() >= 200) {
		buttonUp();
	} else {
		buttonDown();
	}
}
	
function buttonUp() {
	$('.back_to_top').stop();
	$('.back_to_top').clearQueue();
	$('.back_to_top').animate({marginTop:0}, 200);
}

function buttonDown() {
	$('.back_to_top').stop();
	$('.back_to_top').clearQueue();
	$('.back_to_top').animate({marginTop:-30}, 200);
}
	
function scrollWin() {
	$('html , body').stop();
	$('html , body').clearQueue();
	$('html , body').animate({scrollTop : 0},300,"easeInOutQuart");
	buttonUp();
}

$('.back_to_top').click(function() {
	scrollWin();
	return false;	
});
