//
// Functions for handling banner rotation.
//

// Set slideshowSpeed (milliseconds)
var slideshowSpeed = 6000;
// Duration of blendTrans (seconds)
var blendDuration = 1.5;
// Duration of revealTrans (seconds)
var revealDuration = 1;
// reveal Transition style
var revealTransition = 7;
// global variable for timer
var slideshowTimer;
var slideCursor = 0;

var overSlide = false;


function goSlideshow()
{
	if (overSlide == false && slideCount >1)
	{
		if (document.all){
			container = document.getElementById('mainBannerContainer');
		  container.style.filter="blendTrans(duration=crossFadeDuration) revealTrans(duration="+revealDuration+",transition="+revealTransition+")";
		  container.filters(0).Apply();
		  container.filters(1).Apply();
		}
		// Increment the cursor to the next appropriate slide
		nextSlide = slideCursor + 1;
		if (nextSlide > (slideCount-1)) nextSlide=0;
		
		// Hide the current slide
		document.getElementById('mainBanner'+slideCursor).style.display = 'none';
		// Show the next slide
		document.getElementById('mainBanner'+nextSlide).style.display = 'block';
		
		slideCursor = nextSlide;
		if (document.all){
		  container.filters(0).Play();
		  container.filters(1).Play();
		}
		
	}
	slideshowTimer = setTimeout('goSlideshow()', slideshowSpeed);
}

