		window.onload = function() {
			// You can set this timeout to be different than actual loop
			// It will keep the initial div visible longer on initial pageload
			window.loop = setTimeout("rotatedivswnavi()", 4000);
			} 
			
		function rotatedivswnavi(command) {
			// Set Params
			var interval = 4000;
			var numofdivs = 3;
			var divprefix = 'rotating_content';
			var startstopbutton = 'rotatestartstop';
			
			// If a command is defined, clear all timeouts
			if (command != undefined) {
				if (typeof(window.fade) == 'number') { clearTimeout(window.fade); }
				if (typeof(window.appear) == 'number') { clearTimeout(window.appear); }
				if (typeof(window.loop) == 'number') { clearTimeout(window.loop); }
				// If using a combined start/stop button, set onclick
				if ($(startstopbutton) != null) {
					var setstartstop = (command != 'start') ? $(startstopbutton).setAttribute("onclick", "rotatedivswnavi('start');") : $(startstopbutton).setAttribute("onclick", "rotatedivswnavi('stop');") ;
				}
			}
			
			// Get current visible div
			for (i=1; i<=numofdivs; i++) { 
				if ( $(divprefix+i).style.display != 'none' ) { 
					var currentdiv = i;
				}
			}
			
			// Set next div according to command and number of divs in loop
			var nextdiv = (currentdiv < numofdivs) ? parseFloat(currentdiv) + 1 : 1;
			if (command == 'back') { nextdiv = (currentdiv != 1) ? parseFloat(currentdiv) - 1 : numofdivs; }
			
			// Fade and Appear for all commands except stop
			if (command != 'stop') {
				window.fade = Effect.Fade(divprefix+currentdiv, {duration: 1});
				window.appear = setTimeout("Effect.Appear('"+divprefix+nextdiv+"', {duration: 1, to: 0.999})", 1000);
			}
			
			// Loop if command is undefined or start
			if (command == undefined || command == 'start') { window.loop = setTimeout("rotatedivswnavi()", interval); }
			
		}
		
		function rotatedivsnoeffect() {
			setTimeout("$('rotating_content1').style.display='none'", 5000);
			setTimeout("$('rotating_content2').style.display='block'", 5001);
			setTimeout("$('rotating_content2').style.display='none'", 10000);
			setTimeout("$('rotating_content3').style.display='block'", 10001);
			setTimeout("$('rotating_content3').style.display='none'", 15000);
			setTimeout("$('rotating_content1').style.display='block'", 15001);
			setTimeout("rotatedivs()", 15002);
		}
		function rotatedivseffect() {
			setTimeout("Effect.Fade('rotating_content1', {duration: 1})", 5000);
			setTimeout("Effect.Appear('rotating_content2', {duration: 1, to: 0.999})", 6000);
			setTimeout("Effect.Fade('rotating_content2', {duration: 1})", 11000);
			setTimeout("Effect.Appear('rotating_content3', {duration: 1, to: 0.999})", 12000);
			setTimeout("Effect.Fade('rotating_content3', {duration: 1})", 17000);
			setTimeout("Effect.Appear('rotating_content1', {duration: 1, to: 0.999})", 18000);
			setTimeout("rotatedivs()", 18001);
		}
		
		