jQuery(function($) {	

//header text animation function declaration		
function animateHeader()
{	
	//animate line1
	$('#t1').animate({left: '0px' }, {queue:false, duration:800, easing:'easeOutExpo'});
	
	//set timer for line 2
	var animateTimer01 = setTimeout(function(){
		//animate line 2
		$('#t2').animate({left: '0px' }, {queue:false, duration:800, easing:'easeOutExpo'});		
	},500);
	
	//set timer for line 3
	var animateTimer02 = setTimeout(function(){
		//animate line 
		$('#t3').animate({left: '0px' }, {queue:false, duration:800, easing:'easeOutExpo'});	
	},1000);
	
	
}


//box picture cycle funtion declaration
function animateBox(pictureNumber)
{
	//check to see if current picture is 1 or 2
	if (pictureNumber < 3){
	//current picture is 1 or 2 so increase by 1
	var nextPicture = pictureNumber + 1;
	}
	//when picture 3 is active, set the next picture to 1
	else{
	var nextPicture = 1;
	}

	//fades in current picture dynamicaally
	$('#p'+pictureNumber).fadeIn(800, function() { });
	
	//set timer for current pic fade out 
	var pictureTimer = setTimeout(function(){
		$('#p'+pictureNumber).fadeOut(800, function() {
			//calls same function with new variable (next picture)
			animateBox(nextPicture); 
			});	
	},4000);
}

//triggered when the page is fully loaded
function OnLoad(event)
{
	//timer for intro animation
	var animateTimer01 = setTimeout(function(){
		//start header animation
		animateHeader();
		//start box picture cycle
		animateBox(1);
	},300);
}

//detect when the page is fully loaded
$(window).load(function(){
	OnLoad();
});

});




	
