

/* PARALLAX BACKGROUND  ---------------------------------- */

function calcParallax(tileheight, speedratio, scrollposition) {
	return (tileheight - (Math.floor(scrollposition / speedratio) % (tileheight+1)));
}

$(document).ready(function () {
	window.onscroll = function() {
		var posY = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : window.pageYOffset;
		
		var plane = document.getElementById('plane');
		var planeparallax = calcParallax(3000, 8, posY);
		plane.style.backgroundPosition = "0 " + planeparallax + "px"; 

		var midplane = document.getElementById('midplane');
		var midplaneparallax = calcParallax(2800, 3, posY);
		midplane.style.backgroundPosition = "0 " + midplaneparallax + "px"; 
		
	}
});


/* SLIDES NAV ROLLOVERS 1  ---------------------------------- */

$(function(){
	$('.prevButton img').css({'left':0});

	$(".prevButton a").hover(function(){
		$("img", this).stop().animate({left:"-50px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({left:"0px"},{queue:false,duration:200});
	});
	
});

$(function(){
	$('.nextButton img').css({'right':0});

	$(".nextButton a").hover(function(){
		$("img", this).stop().animate({right:"-50px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({right:"0px"},{queue:false,duration:200});
	});
});



/* BACK TO TOP  ---------------------------------- */

	function resetFunction()
	{
	$('html, body').animate({scrollTop:0}, 1500, 'easeOutQuint');

	}

	

/* FADE IN SITE  ---------------------------------- */

    $(document).ready(function () {
		$('#plane').hide().delay(500).fadeIn(1000);
    });
	
	
	
	
