
var arrImages = Array('images/TMEindex_pic1.jpg','images/TMEindex_picREThompson.jpg', 'images/TMEindex_picHBAR_Fall.jpg','images/TMEindex_pic3.jpg','images/TMEindex_pic5.jpg');
var intTimerId;
var intTime = 8500;		// how long image is displayed (1000 = 1 second)
var intDuration = 2500;	// how long the transition lasts (1000 = 1 second)
var intImage = 0;

function SwitchImage() {
	
	var inspector = $('banner');	// where the images will be placed
	var fx = new Fx.Morph(inspector, {duration: intDuration, transition: Fx.Transitions.Sine.easeOut});
	
	var largeImage = new Element('img', { 'src': arrImages[intImage] }); // create large image
	
	/* When the large image is loaded, fade out, fade in with new image */
	fx.start({ 
		'opacity' : 0
	}).chain(function(){
		inspector.empty();	           				// empty stage
		largeImage.inject(inspector); // insert new image
		fx.start({'opacity': 1});	 // then bring opacity of elements back to visible				
	});
	
	if(intImage == 4) {
		intImage = 0;
	} else {
		intImage++;
	}
	
}

function StartTimer() {
	
	SwitchImage();
	intTimerId = setTimeout('StartTimer()', intTime);
	
}

function InitBanner() {
	
	
	
}

window.onload = StartTimer;
