$(document).ready(function(){
	$("a[rel='fancy']").fancybox();
	$("a.external-link").click(function(event){
		event.preventDefault();
		window.open($(this).attr("href"));
	});
	
	MoveImg1();
});


function MoveImg1() {
	$(".pushLeft_container")
	.css('left','0px')
	.animate(
		{left:'-=240px'},
		7000,
		'easeInOutCubic',
		function(){
			$(".pushLeft_container img").css('opacity','0');
			$(".pushLeft_container img:nth-child(5)").animate({opacity:'1'},500,function(){
				MoveImg2();
			});
		}
	);
}

function MoveImg2() {
	$(".pushLeft_container")
	.css('left','-240px')
	.animate(
		{left:'+=240px'},
		7000,
		'easeInOutCubic',
		function(){
			$(".pushLeft_container img").css('opacity','0');
			$(".pushLeft_container img:nth-child(4)").animate({opacity:'1'},500,function(){
				MoveImg3();
			});
		}
	);
}

function MoveImg3() {
	$(".pushLeft_container")
	.css('left','0px')
	.animate(
		{left:'-=240px'},
		7000,
		'easeInOutCubic',
		function(){
			$(".pushLeft_container img").css('opacity','0');
			$(".pushLeft_container img:nth-child(3)").animate({opacity:'1'},500,function(){
				MoveImg4();
			});
		}
	);
}

function MoveImg4() {
	$(".pushLeft_container")
	.css('left','-240px')
	.animate(
		{left:'+=240px'},
		7000,
		'easeInOutCubic',
		function(){
			$(".pushLeft_container img").css('opacity','0');
			$(".pushLeft_container img:nth-child(2)").animate({opacity:'1'},500,function(){
				MoveImg5();
			});
		}
	);
}

function MoveImg5() {
	$(".pushLeft_container")
	.css('left','0px')
	.animate(
		{left:'-=240px'},
		7000,
		'easeInOutCubic',
		function(){
			$(".pushLeft_container img").css('opacity','0');
			$(".pushLeft_container img:nth-child(1)").animate({opacity:'1'},500,function(){
				MoveImg6();
			});
		}
	);
}

function MoveImg6() {
	$(".pushLeft_container")
	.css('left','-240px')
	.animate(
		{left:'+=240px'},
		7000,
		'easeInOutCubic',
		function(){
			$(".pushLeft_container img").css('opacity','0');
			$(".pushLeft_container img:nth-child(6)").animate({opacity:'1'},500,function(){
				MoveImg1();
			});
		}
	);
}
