var lastID=0;
var currentID=0;

function FadeEffect(element){
	new Effect.Appear(element, 
	{duration:1, from:1.0, to:0.0});
}
function ShowEffect(element){
	new Effect.Appear(element, 
	{duration:1, from:0.0, to:1.0});
}
function GrowEffect(element,dir){
	new Effect.Grow(element, {duration: 4,direction:dir , from: 0.0, to: 1.0, transition: Effect.Transitions.spring});

}

function fadeTextIn(){
	var textdivs = new Array("txtimg1","txtimg2","txtimg3","txtimg4","txtimg5","txtimg6");
	for(x=0;x<10;x++){
		var eID=Math.round(Math.random()*5)
		if(eID!=currentID && eID!=lastID && eID!=(currentID-1) &&eID!=(currentID+1)){
			lastID=currentID;
			currentID=eID;
			break;
		} else {
			x--;
		}
	}
	
	el=textdivs[eID];
	ShowEffect(el);
	setTimeout("FadeEffect(el)",2000);
	t=setTimeout("fadeTextIn()",2005);
}

function loadHp(){
	window.location='Argos-graduate-careers.html';
}

/* Fade in straplines */
function revealStrapline1(){
	ShowEffect('strapline1');
	t=setTimeout("revealCherry1()",2000);
}
function revelaStrapline2(){
	ShowEffect('strapline2');
	setTimeout("revealMainText()",20000);
	
	t=setTimeout("fadeTextIn()",2000);
}
/* Fade in cherries */
function revealCherry1(){
	//GrowEffect('cherry1','bottom-right');
	ShowEffect('cherry1');
	t=setTimeout("revealCherry2()",500);
}
function revealCherry2(){
	//GrowEffect('cherry2','bottom-left');
	ShowEffect('cherry2');
	t=setTimeout("revealCherry3()",500);
}
function revealCherry3(){
	//GrowEffect('cherry3','top-right');
	ShowEffect('cherry3');
	t=setTimeout("revelaStrapline2()",1000);
}

function revealMainText(){
	clearTimeout(t);
	FadeEffect('hpanimation');
	setTimeout("loadHp()",1000);
}

