// JavaScript Document

function animateUp(){
$("body").css({"top":"500px", "opacity":"0"});
$("body").animate( { top:"0"}, { queue: false, duration:1000 })
         .animate( { opacity:"1" } , 2000 );
}

function animateLeft(){
$("body").css({"left":"500px", "opacity":"0"});
$("body").animate( {left:"0"}, { queue: false, duration:1000 })
         .animate( { opacity:"1" } , 2000 );
}

function animateRight(){
$("body").css({"right":"500px", "opacity":"0"});
$("body").animate( {right:"0"}, { queue: false, duration:1000 })
         .animate( { opacity:"1" } , 2000 );
}

function animateOut(){
$("body").css({"left":"500px", "opacity":"0"});
$("body").animate( {top:"0"}, { queue: false, duration:1000 })
         .animate( { opacity:"0" } , 6000 );
		 return true;
}

function animateNone(){
	return true;
}

$(document).ready(function() {
	var myPage = document.body.getAttribute("id");
		if (myPage == "contact"){
		animateNone();
		}
	else if (myPage == "schools"){
		animateUp();
		}
	else if (myPage == "abseiling"){
		animateUp();
		}
	else if (myPage == "team-building"){
		animateUp();
		}
		else if (myPage == "mobile-climbing-wall"){
		animateLeft();
		}
		else if (myPage == "outdoor-rock-climbing"){
		animateLeft();
		}
		else if (myPage == "guided-hillwalks"){
		animateLeft();
		}
	else if (myPage == "navigation"){
		animateLeft();
		}
	else animateRight();
});
