$(document).ready(function() {
	$(".plane2").fadeIn(2000);
	planeRepeat();
	$(".clouds").animate({
  		top:'25%'
  	}, 1000);
  	cloudBounce();
	$(".content").delay(100).fadeIn(700);
  	$(".contact").delay(250).fadeIn(600);
	$( ".chain_p" ).delay(4000).animate({
  		top: '-130'
  	},300);
  	$( ".chain_p" ).animate({
  		top: '-140'
  	},250);
	
	
function planeRepeat(){
  	$(".plane2").animate({
  		left:'0%',
  		top:'120%'
  	}, 17000, function(){$(this).css({left:'50%',top:'45%'})});
  	  	$(".plane1").delay(14000).animate({
  		left:'50%',
  		top:420
  	}, 20000, function(){$(this).css({left:'110%',top:0})});
  	$(".plane3").delay(6000).animate({
  		left:'50%',
  		top:450
  	}, 20000, function(){$(this).css({left:'-40%',top:500})});
   	$(".plane4").delay(20000).animate({
  		left:'110%',
  		top:'55%'
  	}, 20000, function(){
  			$(this).css({left:'20%',top:'110%'});
  			planeRepeat();
  			});
	}

function cloudBounce(){
	$(".clouds").animate({
  		top:'30%'
  	}, 3000, function(){
  			$(this).animate({top:'27%'}, 3000);
  			cloudBounce();
  			});
	}
	
	$("a.single_image").fancybox({
		'padding'		: 0,
		'opacity'		: true,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'none',
		'overlayColor'		: '#000',
		'overlayOpacity'	: 0.7,
	});
	$(".video").fancybox({
		'padding'		: 0,
		'width'				: 900,
		'height'			: 675,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'none',
		'overlayColor'		: '#000',
		'overlayOpacity'	: 0.85,
		'type'				: 'iframe'
	});
	$(".tall_iframe").fancybox({
		'padding'		: 0,
		'width'				: 830,
		'height'			: 700,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'none',
		'overlayColor'		: '#000',
		'overlayOpacity'	: 0.7,
		'type'				: 'iframe'
	});
});

