		var total = 0;
		
		var autotimer;
		
		//Speed of the fade in milliseconds
		var fadespeed = 1500;
		
		//Speed of the automatic rotator in milliseconds
		var autospeed = 10000;

		function loadFirst(first, totalnum){

			//This function loads the first image
			
			//Define the total
			total = totalnum;

			//Get the div of the first image
			var firstdivtext = document.getElementById(first+'text');

			//Fade in the first image
			firstdivtext.style.display='';
			new Fx.Style(firstdivtext, 'opacity', {duration: fadespeed} ).start(1);
			
			//After loading the first image, call auto to make the images rotate after a certain period of time
			auto(first);

		}

		function switchId(id,nextid) {

			//This function fades out the current Id while fading in the next Id
			
			//Get the divs of the current and next images
			var divtext = document.getElementById(id+'text');
			var nextdivtext = document.getElementById(nextid+'text');
			
			//Fade out the current image and fade in the next image
			//new Fx.Style(divtext, 'opacity', {duration: fadespeed} ).start(0);
			divtext.style.opacity='0';
			divtext.style.display='none';
			nextdivtext.style.display='';
			new Fx.Style(nextdivtext, 'opacity', {duration: fadespeed} ).start(1);
			
			//Afterswitching the images, call auto to make the images rotate after a certain period of time
			auto(nextid);

		}
		
		function auto(current){
		
			//If the current image is the last image, the next image will be the beginning
			if(current==total) var thenextid=1;
			else var thenextid=current+1;
			
			//Clear any existing timeouts so there are not simultaneous timeouts running
			clearTimeout(autotimer);
			
			//Set timeout to run switchId after the designated time
			autotimer = setTimeout(function (){switchId(current,thenextid,total)},autospeed);
			
		}