//configure the below five variables to change the style of the mid

//configure the below five variables to change the style of the mid
var middelay='5000' //delay between msg mids. 3000=3 seconds.
var leftdelay='6000' //delay between msg mids. 3000=3 seconds.
var rightdelay='5500' //delay between msg mids. 3000=3 seconds.
var modulesStarted = 0;
var midIndex=0;
var leftIndex=0;
var rightIndex=0;

var lefts=new Array();
lefts[lefts.length]='<a href="../../html/drs/dr-g3.shtml"><img src="../../images/features/home_dr-g.gif" width="124" height="162" border="0" alt="Free Advice - The Therapist is In"></a>';
lefts[lefts.length]='<a href="../../html/drs/dr-debo.shtml"><img src="../../images/features/home_dr-debo.gif" width="124" height="162" border="0" alt="Ask Dr. Debo"></a>';
lefts[lefts.length]='<a href="../../html/things/things.shtml"><img src="../../images/features/home_things.gif" width="124" height="162" border="0" alt="Almost 100 free or cheap things to do in NYC with kids"></a>';

var mids=new Array();
mids[mids.length]='<a href="../../html/books/books.shtml"><img src="../../images/features/home_books.jpg" width="179" height="162" border="0" alt="Great Books for you and your kids"></a>';
mids[mids.length]='<a href="../../html/notable/notable.shtml"><img src="../../images/features/home_notable.jpg" width="179" height="162" border="0" alt="Notable Dads"></a>';
mids[mids.length]='<a href="../../html/gallery/gallery.shtml"><img src="../../images/features/home_gallery.jpg" width="179" height="162" border="0" alt="NYC DADS Photo Gallery" /></a>';

var rights=new Array();
rights[rights.length]='<a href="../../downloads/pdf/michael_mitchell.pdf"><img src="../../images/features/mitchell_icon.jpg" width="251" height="162" border="0" alt="Ad Dad" /></a>';


function startModules(){
	// make sure function doesn't fun twice
	if (modulesStarted != 0)
		return

	modulesStarted++;
	document.getElementById('midContent').innerHTML=mids[0];
	document.getElementById('leftContent').innerHTML=lefts[0];
	document.getElementById('rightContent').innerHTML=rights[0];
	setTimeout("nextMid()",middelay);
	setTimeout("nextLeft()",leftdelay);
	setTimeout("nextRight()",rightdelay);
}

function nextMid(){
	if(midIndex==mids.length-1){
		midIndex=0;
	}else{
		midIndex++;
	}
	document.getElementById('midContent').innerHTML=mids[midIndex];
	setTimeout("nextMid()",middelay);
}

function nextLeft(){
	if(leftIndex==lefts.length-1){
		leftIndex=0;
	}else{
		leftIndex++;
	}
	document.getElementById('leftContent').innerHTML=lefts[leftIndex];
	setTimeout("nextLeft()",leftdelay);
}

function nextRight(){
	if(rightIndex==rights.length-1){
		rightIndex=0;
	}else{
		rightIndex++;
	}
	document.getElementById('rightContent').innerHTML=rights[rightIndex];
	setTimeout("nextRight()",rightdelay);
}