/* -----------------------------------
	Script that runs the home page image marquee rotation on:
	BioDiversity Research Institute Web site: 
	http://www.briloon.org
	
	Developed by: Pemaquid Communications, LLC
	Web site: http://www.pemaquid.com
	Date: 3/28/07
----------------------------------- */

// this array consists of the id attributes of the divs we wish to alternate between
var divs_to_fade = new Array('m1', 'm2', 'm3', 'm4', 'm5');

// the starting index in the above array.  It should be set to the value of the div which doesn't have the CSS Display property set to "none"
var i = 0;
// the number of milliseconds between swaps.  Default is five seconds.
var wait = 5000;

// the function that performs the fade
function swapFade() {
	var subnav = document.getElementById('second_nav');
	var hi_links = subnav.getElementsByTagName('a');
	Effect.Fade(divs_to_fade[i], { duration:1, from:1.0, to:0.0 });
	hi_links[i].style.color = '#999999';
	i++;
	if (i == 5) i = 0; //adjust this # to the number of divs to fade
	Effect.Appear(divs_to_fade[i], { duration:1, from:0.0, to:1.0 });
	hi_links[i].style.color = '#FFFFFF';
}

// the onload event handler that starts the fading.
function startPage() {
	// first 2 lines are for initialization; could be written into the CSS file
	var subnav = document.getElementById('second_nav');
	var hi_links = subnav.getElementsByTagName('a');
	hi_links[i].style.color = '#FFFFFF';
	setInterval('swapFade()',wait);
}