function adArray(args) {
  var i;
  for (i=0; i*2<args.length; i++) {
    this[i] = new Object();
    this[i].src = args[i*2];
    this[i].href = args[i*2+1];
  }
  this.length = i;
  this.num = getAdNum(this);
  this.link = 0;
  this.image = 0;
}

function getAdNum(ads) {
  dat = new Date();
  dat = (dat.getTime()+"").charAt(8);
  if (dat.length == 1)
    ad_num = dat%ads.length;
  else
    ad_num = 0;
  return ad_num;
}

var adslist = new Array;

function timed_banner() {
  if(!timed_banner.arguments.length) {
    return;
  }
  var ads = new adArray(timed_banner.arguments);
  adslist[adslist.length] = ads;
  var ads_index = adslist.length -1;

  document.write('<img src="'+ads[ads.num].src+'" border="0" alt="">');

  ads.link = document.links.length-1;
  ads.image = document.images.length-1;
}

function rotateSponsor() {
  var ads;
  if (document.images) {
    
    for(ads_index=0;ads_index<adslist.length;ads_index++) {
      ads = adslist[ads_index];
      ads.num = (ads.num+1)%ads.length;
    //  alert(adslist.length+" "+ads.length+" "+ads.image+" "+ads.link);
      document.images[ads.image].src = ads[ads.num].src;
    }
    setTimeout("rotateSponsor()",3000);
  }
}

setTimeout("rotateSponsor()",3000);
