var splash = new Array();
splash[0] = "images/corvette-size.jpg";
splash[1] = "images/tractor-size.jpg";
splash[2] = "images/mri-size.jpg";
splash[3] = "images/military-size.jpg";

var splashCount = splash.length;
var changeimg = true;
var splashCurrentIndex = 0;
var millisec = 3000;

function adjustOpacity(opacityIndex, id) 
{
   	var object = document.getElementById(id).style;
   	object.opacity = (opacityIndex / 100);
    object.MozOpacity = (opacityIndex / 100);
    object.KhtmlOpacity = (opacityIndex / 100);
   	object.filter = "alpha(opacity=" + opacityIndex + ")";
}


function imageRotate()
{
	var speed = Math.round(millisec / 2000);
    var timer = 0;
	if (changeimg) {
		document.getElementById('SlideShowImg').src = splash[splashCurrentIndex];
		changeimg = false;
		for(opacityIndex = 0; opacityIndex <= 100; opacityIndex++) 
		{			
			setTimeout("adjustOpacity(" + opacityIndex + ",'" + "SlideShowImg" + "')",(timer * speed));
			timer++;
		}	
	} else {
		document.getElementById('SlideShowDiv').style.backgroundImage = "url(" + splash[splashCurrentIndex] + ")";
		changeimg = true;
		for(opacityIndex = 100; opacityIndex >= 0; opacityIndex--) 
		{			
			setTimeout("adjustOpacity(" + opacityIndex + ",'" + "SlideShowImg" + "')",(timer * speed));
			timer++;
		}	
	}
	splashCurrentIndex++;
	if (splashCurrentIndex == splash.length) splashCurrentIndex = 0;
	setTimeout("imageRotate()",millisec*2);
}


function startRotate() {
	document.getElementById('SlideShowDiv').style.backgroundImage = "url(" + splash[0] + ")";
	document.getElementById('SlideShowImg').src = splash[0];
	setTimeout("imageRotate()","0");
}

