/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initScrollLayer() {
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
  var wndo = new dw_scrollObj('wn', 'lyr1');
  dw_scrollObj.GeckoTableBugFix('wn'); 
}

//how many milliseconds to wait between different headers.
var intTimeout = 3000;

var intNumLayers = 3;

//keep track of which index in the array we are at, so we know which image to display next.
var intCurrentIndex = 1;

var intNextIndex = 2;

//This is a function which is called via the setTimeout() function
function rotateHeader()
{

	//Fade the current layer containing the image..
	Effect.Fade('headerLayer' + intCurrentIndex);
	
	//Make the current layer containing the image appear.
	Effect.Appear('headerLayer' + intNextIndex);
	
	intCurrentIndex++;
	intNextIndex++;
	
	//need to see if intCurrentIndex is equal to the number of layers.  If it is, reset it back to 1.
	if(intCurrentIndex > intNumLayers)
	{
		intCurrentIndex = 1;
	}
	if(intNextIndex > intNumLayers)
	{
		intNextIndex = 1;
	}
}

setInterval("rotateHeader()",intTimeout);