function theRotator() {
	//Set the opacity of all images to 0
	$('div#rotator ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 8000 = change to next image after 6 seconds
	setInterval('rotate()',8000);
	
}

function rotate() {	
	//Get the first image
	var current = ($('div#rotator ul li.show')?  $('div#rotator ul li.show') : $('div#rotator ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') :current.next()) : $('div#rotator ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
};

$(document).ready(function() {		
	//Load the slideshow
	theRotator();
});



function theRotator2() {
	//Set the opacity of all images to 0
	$('div#rotator-2 ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator-2 ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 8000 = change to next image after 6 seconds
	setInterval('rotate2()',8000);
	
}

function rotate2() {	
	//Get the first image
	var current = ($('div#rotator-2 ul li.show-2')?  $('div#rotator-2 ul li.show-2') : $('div#rotator-2 ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show-2')) ? $('div#rotator-2 ul li:first') :current.next()) : $('div#rotator-2 ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show-2')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show-2');
	
};

$(document).ready(function() {		
	//Load the slideshow
	theRotator2();
});




function theRotator3() {
	//Set the opacity of all images to 0
	$('div#rotator-3 ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator-3 ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 8000 = change to next image after 6 seconds
	setInterval('rotate3()',8000);
	
}

function rotate3() {	
	//Get the first image
	var current = ($('div#rotator-3 ul li.show-3')?  $('div#rotator-3 ul li.show-3') : $('div#rotator-3 ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show-3')) ? $('div#rotator-3 ul li:first') :current.next()) : $('div#rotator-3 ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show-3')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show-3');
	
};

$(document).ready(function() {		
	//Load the slideshow
	theRotator3();
});



function theRotator4() {
	//Set the opacity of all images to 0
	$('div#rotator-4 ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator-4 ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 8000 = change to next image after 6 seconds
	setInterval('rotate4()',8000);
	
}

function rotate4() {	
	//Get the first image
	var current = ($('div#rotator-4 ul li.show-4')?  $('div#rotator-4 ul li.show-4') : $('div#rotator-4 ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show-4')) ? $('div#rotator-4 ul li:first') :current.next()) : $('div#rotator-4 ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show-4')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show-4');
	
};

$(document).ready(function() {		
	//Load the slideshow
	theRotator4();
});



function theRotator5() {
	//Set the opacity of all images to 0
	$('div#rotator-5 ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator-5 ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 8000 = change to next image after 6 seconds
	setInterval('rotate5()',8000);
	
}

function rotate5() {	
	//Get the first image
	var current = ($('div#rotator-5 ul li.show-5')?  $('div#rotator-5 ul li.show-5') : $('div#rotator-5 ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show-5')) ? $('div#rotator-5 ul li:first') :current.next()) : $('div#rotator-5 ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show-5')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show-5');
	
};

$(document).ready(function() {		
	//Load the slideshow
	theRotator5();
});



function theRotator6() {
	//Set the opacity of all images to 0
	$('div#rotator-6 ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator-6 ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 8000 = change to next image after 6 seconds
	setInterval('rotate6()',8000);
	
}

function rotate6() {	
	//Get the first image
	var current = ($('div#rotator-6 ul li.show-6')?  $('div#rotator-6 ul li.show-6') : $('div#rotator-6 ul li:first'));

	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show-6')) ? $('div#rotator-6 ul li:first') :current.next()) : $('div#rotator-6 ul li:first'));	
	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show-6')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show-6');
	
};

$(document).ready(function() {		
	//Load the slideshow
	theRotator6();
});
