
var arrImages = Array('images/index_barn.jpg','images/index_Lot10C.jpg','images/index_Lot17A.jpg','images/index_Lot1.jpg','images/index_Lot52.jpg','images/index_Lot51A.jpg','images/index_commercials.jpg');
var intTimerId;
var intTime = 9000;		// how long image is displayed (1000 = 1 second)
var intDuration = 3500;	// 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 == 6) {          // number minus 1 of the photos in rotation
		intImage = 0;
	} else {
		intImage++;
	}
	
}

function StartTimer() {
	
	SwitchImage();
	intTimerId = setTimeout('StartTimer()', intTime);
	
}

function InitBanner() {
	
	
	
}

window.onload = StartTimer;

