/* Author: David Rushton. Papertank.

*/

	$(document).ready(function(){
	
		var low_resolution = false;
		
		function scrolled() {
		
			if ( $(window).scrollTop() <= 100 )
			{
				if ($("#to_top").is(":visible")) { $("#to_top").fadeOut(); }
				if (!$("#to_content").is(":visible") && low_resolution) { $("#to_content").fadeIn(); }
			}
			else
			{
				if (!$("#to_top").is(":visible")) { $("#to_top").fadeIn(); }

				if ($("#to_content").is(":visible")  && low_resolution) { $("#to_content").fadeOut(); }
			}		
			
		}
		
		if ( ($(".wood").height() > 310) && ($(window).height() <= 660))
		{
			low_resolution = true;
		}
		
		scrolled();
		
		$(window).scroll(function(){
			scrolled();						
				
		});
		
		$("#to_top a").click(function(e){
		
			e.preventDefault();
			
			$.scrollTo(0,100);
		
		});
		
		$("#to_content a").click(function(e){
		
			e.preventDefault();
			
			$.scrollTo(600, 100);
		
		});	
		
		
	});
	

