//var foo = null; // object
//
//function doMove() {
//	
//	if(parseInt(foo.style.left) < 0){
//  foo.style.left = parseInt(foo.style.left)+30+'px';
//  setTimeout(doMove,1);} // call doMove in 20msec
//}
//
//function init() {
//  foo = document.getElementById('picture'); // get the "foo" object
//  foo.style.left = '-620px'; // set its initial position to 0px
//  doMove(); // start animating
//}
//
//
//window.onload = init;

var animationCount = 1;
var currentFrame = 0;

function Picture1() {
 $('#picture1').animate({
    left: '+=620',
  }, 500, 'easeOutExpo');
  $(function() {
  setTimeout(heading1, 500);})
};
function heading1() {
 $('#text1').animate({
    left: '-=1000',
  }, 600, 'easeOutExpo');
};


function Picture2() {
 $('#picture2').animate({
    top: '-=464',
  }, 500, 'easeOutExpo');
    $(function() {
  setTimeout(heading2, 500);})
};
function heading2() {
 $('#text2').animate({
    top: '+=700',
  }, 600, 'easeOutExpo');
};



function Picture3() {
 $('#picture3').animate({
    left: '-=620',
  }, 500, 'easeOutExpo');
    $(function() {
  setTimeout(heading3, 500);})
};
function heading3() {
 $('#text3').animate({
    left: '+=1000',
  }, 600, 'easeOutExpo');
};




function Picture4() {
 $('#picture4').animate({
    top: '+=464',
  }, 500, 'easeOutExpo');
    $(function() {
  setTimeout(heading4, 500);})
};
function heading4() {
 $('#text4').animate({
    top: '-=960',
  }, 600, 'easeOutExpo');
};



//RESET

function Picture2out() {
 $('#picture2').animate({
    top: '+=464',
  }, 500, 'easeOutExpo');
    $(function() {
  setTimeout(heading2out, 500);})
};
function heading2out() {
 $('#text2').animate({
    top: '-=700',
  }, 600, 'easeOutExpo');
};



function Picture3out() {
 $('#picture3').animate({
    left: '+=620',
  }, 500, 'easeOutExpo');
    $(function() {
  setTimeout(heading3out, 500);})
};
function heading3out() {
 $('#text3').animate({
    left: '-=1000',
  }, 600, 'easeOutExpo');
};




function Picture4out() {
 $('#picture4').animate({
    top: '-=464',
  }, 500, 'easeOutExpo');
    $(function() {
  setTimeout(heading4out, 500);})
};
function heading4out() {
 $('#text4').animate({
    top: '+=960',
  }, 600, 'easeOutExpo');
};



function resetPics(){
	Picture2out();
	Picture3out();
	Picture4out();
	animationCount++;
}











function loop(){
	  $(function() {
  setTimeout(Picture2,5000);
  setTimeout(Picture3,10000);
  setTimeout(Picture4,15000);
  setTimeout(resetPics,20000);

});
}


















function navigation() {
	$( "#tipButton" ).hide();
 $('#navBarHome').animate({
    top: '+=600',
  }, 1000, 'easeOutExpo');
  $(function() {
  setTimeout(tipButtonPop, 1300);})
  
};

function tipButtonPop() {
	var options = {};
options = { to: { width: 280, height: 185 } };
			$( "#tipButton" ).show('bounce',options,600);
		};



function init() {
 Picture1();
 navigation();
 loop();
 for(var i=1;i<30;i++){
   $(function() {
  setTimeout(loop,22000*i);
});
 }
   // start animating
}


window.onload = init;




// JavaScript Document
