//var total = configArray.length;
var total = urlArray1.length;


var urlArray = new Array();
var bannerArray = new Array();
var banArray = new Array();

for(i = 0; i < total; i++)
{
	//repack array to work as before
	urlArray[i] = urlArray1[i];
	bannerArray[i] = bannerArray1[i];
}

var counter = 1;
var url = urlArray[0]; //initial URL

if(document.images) //pre-load all banner images
{
  for(i = 0; i < total; i++)
  {
    banArray[i] = new Image(468, 60);
    banArray[i].src = 'http://www.positivehealth.com/'+bannerArray[i];
  }
}


function changeBanner() //banner changer function
{
  if(counter > total-1)
   counter = 0;

  document.banner.src = banArray[counter].src; //sets a new banner

  url = urlArray[counter]; //sets a new URL to the banner
  counter++; //increase the counter for the next banner
}

//calls the changeBanner() function every 3 seconds
//change the timer as necessary (minutes * 60000) or (seconds * 1000)
//var timer = window.setInterval("changeBanner()", 6000);
