function calcParallax(tileheight, speedratio, scrollposition) {
	//    by Brett Taylor http://inner.geek.nz/
	//    originally published at http://inner.geek.nz/javascript/parallax/
	//    usable under terms of CC-BY 3.0 licence
	//    http://creativecommons.org/licenses/by/3.0/
	return (tileheight - (Math.floor(scrollposition / speedratio) % (tileheight+1)));
}
window.onload = function() {
var ground = document.getElementById('page');

	window.onscroll = function() {
		var posY = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : window.pageYOffset;
		
		var groundparallax = calcParallax(2000, 3, posY);
		
	
		
		if(groundparallax > 10){
		ground.style.backgroundPosition = ("0 " + groundparallax + "px");
		}
		else{
		ground.style.backgroundPosition = ("0 1px");
		}
	}
}

