function CInf( Link, Numads, ID ) {
  this.Link = Link;
  this.Numads = Numads;
  this.ID = ID;
}

function BInf( Image, ID ) {
  this.Image = Image;
  this.ID = ID;
}

// Get banner info via AJAX
var p;
if(document.all) {
 p = new ActiveXObject("Microsoft.XMLHTTP"); //For IE, create ActiveX Object instance 
 } 
 else {
 p = new XMLHttpRequest(); //For mozilla, create instance of XMLHttpRequest.
 }
// Open url, write out response
if( typeof(region)=="undefined" ) region="";
p.open("GET","/getbanners.asp?region="+region,false);
p.send(null);
eval(p.responseText);

// JavaScript Ad Rotator
// pick an ad to display given client ID
function PickBan(cid) {
var i;
  for(i=0; i<nBanners; i++)
    { // Locate first banner for this client
    if(B[i].ID == cid) break;
    }
  if(C[cid].Numads==1) //One banner or several?
    {
    return(i);  //Just one banner
    }
  else
    { //pick random offset from 0 to Numads-1
    var r = Math.ceil(C[cid].Numads*Math.random())-1;
    return(i+r);
    }
}

var cT = new Date();
var timer = null;
var cc = Math.floor((cT.getMilliseconds()/1000)*nClients);

// Rotates through clients.
function banner() {
  cc++;
  if(cc >= nClients) cc = 0;
  document.bannerad.src = B[PickBan(cc)].Image;
  timer = setTimeout("banner()", 6000);
}

function gothere() {
  window.location.href = C[cc].Link;
}

window.onload=banner;
// - End of JavaScript
