function Ajax() {
	$("ul#gallery li:nth-child(1)").addClass('hero');
	$("ul#gallery li").hover(function() {
		$(this).children("span").stop(true, true);
		$(this).children("span").animate( { bottom: "19px", opacity: "show" }, 200);
	}, function(){
		$(this).children("span").animate( { bottom: "24px", opacity: "hide" }, 300);
	});
}

$(document).ready(function() {
	
	/* PNG Fix */
	$(document).pngFix(); 
	
	/* Enter the Cufon */
	Cufon.replace("dt, .switch li, .switcher li, .features h3", {textShadow: '#fff 0px 1px'});
	Cufon.replace(".island strong", {textShadow: '#000 0px 1px'});
	Cufon.replace(".plus h3", {textShadow: '#b6b7b0 0px 1px'});
	
	/* The Island */	
	$(".island li").hover(function() {
		$(this).children(".explore, .unlocked").stop(true, true);
		$(this).children(".explore, .unlocked").animate( { bottom: "19px", opacity: "show" }, 200);
	}, function(){
		$(this).children(".explore, .unlocked").animate( { bottom: "24px", opacity: "hide" }, 300);
	});
	$(".island li a.video").click(function(){
		$(".images, .gallery").fadeOut();
		$(".player .video, .playlist").fadeIn();
		$("ul.switch li").removeClass("active");
		$("ul.switch li#video-switch").addClass("active");
	});
	$(".island li a.screenshots.shores").click(function(){
		$(".player .video, .playlist").fadeOut();
		$(".images, .gallery").fadeIn();
		$(".images .portraits").animate( { left: "-480px" } );
		$(".gallery a.left, .gallery a.left2, .gallery a.left3, .gallery a.left4, .gallery a.left-1, .gallery a.right3, .gallery a.right2, .gallery a.right4, .gallery a.right-1, ").fadeOut();
		$(".gallery a.left-1").fadeIn();
		$(".gallery a.right").fadeIn();
		$(".gallery img.jungle, .gallery img.temple, .gallery img.caves, .gallery img.mountain").fadeOut("fast");
		$(".gallery img.shores").fadeIn("fast");
		$("ul.switch li").removeClass("active");
		$("ul.switch li#image-switch").addClass("active");
		return false;
	});
	$(".island li a.screenshots.jungle").click(function(){
		$(".player .video, .playlist").fadeOut();
		$(".images, .gallery").fadeIn();
		$(".images .portraits").animate( { left: "-960px" } );
		$(".gallery a.left-1, .gallery a.left2, .gallery a.left3, .gallery a.left4, .gallery a.left-1, .gallery a.right3, .gallery a.right, .gallery a.right4, .gallery a.right-1, ").fadeOut();
		$(".gallery a.left").fadeIn();
		$(".gallery a.right2").fadeIn();
		$(".gallery img.shores, .gallery img.temple, .gallery img.caves, .gallery img.mountain").fadeOut("fast");
		$(".gallery img.jungle").fadeIn("fast");
		$("ul.switch li").removeClass("active");
		$("ul.switch li#image-switch").addClass("active");
		return false;
	});
	$(".island li a.screenshots.temple").click(function(){
		$(".player .video, .playlist").fadeOut();
		$(".images, .gallery").fadeIn();
		$(".images .portraits").animate( { left: "-1440px" } );
		$(".gallery a.left-1, .gallery a.left, .gallery a.left3, .gallery a.left4, .gallery a.left-1, .gallery a.right2, .gallery a.right, .gallery a.right4, .gallery a.right-1, ").fadeOut();
		$(".gallery a.left2").fadeIn();
		$(".gallery a.right3").fadeIn();
		$(".gallery img.shores, .gallery img.jungle, .gallery img.caves, .gallery img.mountain").fadeOut("fast");
		$(".gallery img.temple").fadeIn("fast");
		$("ul.switch li").removeClass("active");
		$("ul.switch li#image-switch").addClass("active");
		return false;
	});
	$(".island li a.screenshots.caves").click(function(){
		$(".player .video, .playlist").fadeOut();
		$(".images, .gallery").fadeIn();
		$(".images .portraits").animate( { left: "-1920px" } );
		$(".gallery a.left-1, .gallery a.left, .gallery a.left2, .gallery a.left4, .gallery a.left-1, .gallery a.right2, .gallery a.right, .gallery a.right3, .gallery a.right-1, ").fadeOut();
		$(".gallery a.left3").fadeIn();
		$(".gallery a.right4").fadeIn();
		$(".gallery img.shores, .gallery img.jungle, .gallery img.temple, .gallery img.mountain").fadeOut("fast");
		$(".gallery img.caves").fadeIn("fast");
		$("ul.switch li").removeClass("active");
		$("ul.switch li#image-switch").addClass("active");
		return false;
	});
	$(".island li a.screenshots.mountain").click(function(){
		$(".player .video, .playlist").fadeOut();
		$(".images, .gallery").fadeIn();
		$(".images .portraits").animate( { left: "-2400px" } );
		$(".gallery a.left-1, .gallery a.left, .gallery a.left2, .gallery a.left4, .gallery a.left-1, .gallery a.right2, .gallery a.right, .gallery a.right4, .gallery a.right3, .gallery a.right-1, ").fadeOut();
		$(".gallery a.left4").fadeIn();
		$(".gallery img.shores, .gallery img.jungle, .gallery img.temple, .gallery img.caves").fadeOut("fast");
		$(".gallery img.mountain").fadeIn("fast");
		$("ul.switch li").removeClass("active");
		$("ul.switch li#image-switch").addClass("active");
		return false;
	});
	
	/* Media Player */
	$("ul.switch li#image-switch").click(function(){
		$("ul.switch li").removeClass("active");
		$(this).addClass("active");
		$(".player .video, .playlist").fadeOut();
		$(".images, .gallery").fadeIn();
		return false;
	});
	$("ul.switch li#video-switch").click(function(){
		$("ul.switch li").removeClass("active");
		$(this).addClass("active");
		$(".images, .gallery").fadeOut();
		$(".player .video, .playlist").fadeIn();
		return false;
	});
	$(".playlist a.right").click(function(){
		$(".playlist .carousel ul").animate( { left: "-382px" } );
		$(".playlist a.left").fadeIn();
		$(this).fadeOut("fast");
		return false;
	});
	$(".playlist a.left").click(function(){
		$(".playlist .carousel ul").animate( { left: "0px" } );
		$(".playlist a.right").fadeIn();
		$(this).fadeOut("fast");
		return false;
	});
	$(".gallery a.right").click(function(){
		$(".images .portraits").animate( { left: "-960px" } );
		$(".gallery a.left").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery a.right2").fadeIn();
		$(".gallery img.shores").fadeOut("fast");
		$(".gallery img.jungle").fadeIn("fast");
		return false;
	});
	$(".gallery a.right2").click(function(){
		$(".images .portraits").animate( { left: "-1440px" } );
		$(".gallery a.left, .gallery a.left3, .gallery a.left4, .gallery a.left-1").fadeOut();
		$(".gallery a.left2").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery a.right3").fadeIn();
		$(".gallery img.jungle").fadeOut("fast");
		$(".gallery img.temple").fadeIn("fast");
		return false;
	});
	$(".gallery a.right3").click(function(){
		$(".images .portraits").animate( { left: "-1920px" } );
		$(".gallery a.left, .gallery a.left2, .gallery a.left4, .gallery a.left-1").fadeOut();
		$(".gallery a.left3").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery a.right4").fadeIn();
		$(".gallery img.temple").fadeOut("fast");
		$(".gallery img.caves").fadeIn("fast");
		return false;
	});
	$(".gallery a.right4").click(function(){
		$(".images .portraits").animate( { left: "-2400px" } );
		$(".gallery a.left3, .gallery a.left, .gallery a.left2, .gallery a.left-1").fadeOut();
		$(".gallery a.left4").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery img.caves").fadeOut("fast");
		$(".gallery img.mountain").fadeIn("fast");
		return false;
	});
	$(".gallery a.right-1").click(function(){
		$(".images .portraits").animate( { left: "-480px" } );
		$(".gallery a.left3, .gallery a.left, .gallery a.left2").fadeOut();
		$(".gallery a.left-1, .gallery a.right").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery img.shores").fadeIn("fast");
		return false;
	});
	$(".gallery a.left").click(function(){
		$(".images .portraits").animate( { left: "-480px" } );
		$(".gallery a.right, .gallery a.left-1").fadeIn();
		$(".gallery a.right2, .gallery a.right3, .gallery a.right4").fadeOut();
		$(this).fadeOut("fast");
		$(".gallery img.jungle").fadeOut("fast");
		$(".gallery img.shores").fadeIn("fast");
		return false;
	});
	$(".gallery a.left2").click(function(){
		$(".images .portraits").animate( { left: "-960px" } );
		$(".gallery a.right, .gallery a.right3, .gallery a.right4, .gallery a.right-1").fadeOut();
		$(".gallery a.right2").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery a.left").fadeIn();
		$(".gallery img.temple").fadeOut("fast");
		$(".gallery img.jungle").fadeIn("fast");
		return false;
	});
	$(".gallery a.left3").click(function(){
		$(".images .portraits").animate( { left: "-1440px" } );
		$(".gallery a.right, .gallery a.right2, .gallery a.right4, .gallery a.right-1").fadeOut();
		$(".gallery a.right3").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery a.left2").fadeIn();
		$(".gallery img.caves").fadeOut("fast");
		$(".gallery img.temple").fadeIn("fast");
		return false;
	});
	$(".gallery a.left4").click(function(){
		$(".images .portraits").animate( { left: "-1920px" } );
		$(".gallery a.right, .gallery a.right2, .gallery a.right3, .gallery a.right-1").fadeOut();
		$(".gallery a.right4").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery a.left3").fadeIn();
		$(".gallery img.mountain").fadeOut("fast");
		$(".gallery img.caves").fadeIn("fast");
		return false;
	});
	$(".gallery a.left-1").click(function(){
		$(".images .portraits").animate( { left: "0px" } );
		$(".gallery a.right, .gallery a.right2, .gallery a.right3, .gallery a.right4").fadeOut();
		$(".gallery a.right-1").fadeIn();
		$(this).fadeOut("fast");
		$(".gallery img.shores").fadeOut("fast");
		return false;
	});
	$(".playlist .carousel ul li:nth-child(4)").addClass("push");
	
	/* Features */
	$(".features a.right").click(function(){
		$(".features .carousel ul").animate( { left: "-708px" } );
		$(".features a.left").fadeIn();
		$(this).fadeOut();
		return false;
	});
	$(".features a.left").click(function(){
		$(".carousel ul").animate( { left: "0px" } );
		$(".features a.right").fadeIn();
		$(this).fadeOut();
		return false;
	});
	$(".features .right, .features .left").hover(function() {
		$(this).stop(true, true);
		$(this).children().animate( { opacity: "0" }, 200);
	}, function(){
		$(this).children().animate( { opacity: "1.0" }, 200);
	});
	$("ul.switcher h2, ul.switch a").hover(function() {
		$(this).stop(true, true);
		$(this).animate( { bottom: "19px", opacity: "0.7" }, 200);
	}, function(){
		$(this).animate( { bottom: "24px", opacity: "1.0" }, 100);
	});
	
	/* The Characters */	
	$("ul.explorer li").hover(function() {
		$(this).children("strong, p").stop(true, true);
		$(this).children("strong").animate( { marginTop: "0px", opacity: "show" }, 200);
		$(this).children("p").animate( { marginBottom: "0px", opacity: "show" }, 300);
	}, function(){
		$(this).children("strong").animate( { marginTop: "-5px", opacity: "hide" }, 200);
		$(this).children("p").animate( { marginBottom: "-5px", opacity: "hide" }, 200);
	});
	$("ul.front-row li, ul.back-row li").hover(function() {
		$(this).children("strong, p").stop(true, true);
		$(this).addClass("elevate");
		$(this).parent().addClass("elevate");
		$(this).children("strong").animate( { marginTop: "0px", opacity: "show" }, 200);
		$(this).children("p").animate( { marginBottom: "5px", opacity: "show" }, 300);
	}, function(){
		$(this).removeClass("elevate");
		$(this).parent().removeClass("elevate");
		$(this).children("strong").animate( { marginTop: "-5px", opacity: "hide" }, 200);
		$(this).children("p").animate( { marginBottom: "0px", opacity: "hide" }, 200);
	});
	
	/* Foot */
	$("ul.studios a, #foot a, li.copyright a").hover(function() {
		$(this).stop(true, true);
		$(this).animate( { opacity: "0.7" }, 200);
	}, function(){
		$(this).animate( { opacity: "1.0" }, 100);
	});
	
	/* Hover Fades */
	$(".playlist .carousel img").hover(function(){
		$(this).stop(true, true);
    	$(this).animate( { opacity: 0.6 }, 200);
	},
	function(){
		$(this).animate( { opacity: 1.0 }, 200);
	});
	$(".portraits img").hover(function(){
		$(this).stop(true, true);
    	$(this).animate( { opacity: 0.9 }, 200);
	},
	function(){
		$(this).animate( { opacity: 1.0 }, 200);
	});
	
	/* Fancyzoom */
	$(".portraits a").fancybox();
	
	//$(".vote a").hover(function(){
	//	$("#fancy_outer").removeClass("the-creator");
	//},
	//function(){
	//	
	//});
	
	//$(".vote a").hover(function(){
	//	$("#fancy_outer").addClass("the-creator");
	//},
	//function(){
		
	//});
	
	//$(".portraits a").hover(function(){
	//	$("#fancy_outer").removeClass("the-creator");
	//},
	//function(){
	//	
	//});
	
	$(".vote a, a.scruff").fancybox({
		'frameWidth':		956,
		'frameHeight':		658,
		'padding':			0,
		'imageScale':		false,
		'overlayShow':		true
	});
	
	//$(".prop a").fancybox({
	//	'frameWidth':		320,
	//	'frameHeight':		620,
	//	'padding':			0,
	//	'imageScale':		false,
	//	'overlayShow':		true
	//});
	
	//$(".prop a").hover(function(){
	//	$("#fancy_outer").addClass("the-creator");
	//},
	//function(){
	//	
	//});
	
});

