<!-- Hide from JavaScript-Impaired Browsers

//return random number from 0 up to max-1
function banner_random(max) {
  return ((Math.round(Math.random()*100))  % max);
}

//define MyImage object:  image source, destination url, and description
function banner_MyImage(src, url, desc) {
  this.src  = src;
  this.url  = url;
  this.desc = desc;
  return this;
}


//start AdBoard rotation
function banner_start() {
  
  document.write('<A HREF="javascript:redirect(\''+this.adId+
                 '\')" onMouseOver="banner_showStatus(\''+this.adId+'\')"'+
                 ' onMouseOut="window.status=\'\'"' + ' ' + this.target + '>'+
                 '<IMG ' + this.alt + ' ' + this.align + ' ' + this.hspace + ' ' + this.vspace + ' ' + this.border + ' ' + 
                 'SRC="'+this.sponsors[this.curImage].src+
                 '"WIDTH="'+this.width+'" HEIGHT="'+this.height+'" NAME="'+this.adId + '" ></A>');

  if(this.staticMode)
    return;

  var cmd = "setTimeout('"+this.adId+".banner_rotate()', "+this.adId+".rotateDelay)";
  eval(cmd);
}

//rotate through available banners
function banner_rotate(){
  this.curImage++;
  this.curImage %= this.sponsors.length;
  var command = "document."+this.adId+".src='"+this.sponsors[this.curImage].src+"'";
  eval(command);
  var cmd = "setTimeout('"+this.adId+".banner_rotate()',"+this.adId+".rotateDelay)";
  eval(cmd);
}

//set redirect url
function banner_setRedirect(url) {
  this.redirectURL = url;
}

//set alt atribute
function banner_setAlt(alt) {
  this.alt = 'ALT="'+alt+'"';
}

//set align atribute
function banner_setAlign(align) {
  this.align = 'ALIGN="'+align+'"';
}

//set border atribute
function banner_setBorder(border) {
  this.border = 'BORDER="'+border+'"';
}                                 



//set hspace atribute
function banner_setHspace(hspace) {
  this.hspace = 'HSPACE="'+hspace+'"';
}

//set vspace atribute
function banner_setVspace(vspace) {
  this.vspace = 'VSPACE="'+vspace+'"';
}

//set vspace atribute
function banner_setTarget(target) {
  this.target = 'TARGET="'+target+'"';
}



//redirect to new url
function banner_redirect(adId) {
  var url = eval(adId+".sponsors["+adId+".curImage].url");
  var redirectURL = eval(adId+".redirectURL");
  url = ((redirectURL.lenght == 0) ? "" : redirectURL)+url;
  window.location = url;
}

function banner_showStatus(adId) {
  var cmd = 'window.status = '+adId+'.sponsors['+adId+'.curImage].desc';
  eval(cmd);
}

//preload necessary images
function banner_loadImages(adBoard) {
  if(adBoard.staticMode) {
    var image = new Image(adBoard.width, adBoard.height);
    image.src = adBoard.sponsors[adBoard.curImage].src;
  }
  else {
    for(var i = 0; i < adBoard.sponsors.length; i++) {
       var image = new Image(adBoard.width, adBoard.height);
       image.src = adBoard.sponsors[i].src;
    }
  }
}
                          
//define AdBoard object: a collection of images with the same width/height
//that should be rotated with rotateDelay
//boardId -- unique identifier for this adBoard (variable name)
//rotationType -- true -> rotate banners, false -> static, random banner
function AdBoard(adId, sponsors, width, height, rotateDelay, rotationType) {
  this.adId        = adId;
  this.sponsors    = sponsors;
  this.width       = width;
  this.height      = height;
  this.rotateDelay = rotateDelay;
  this.curImage    = banner_random(sponsors.length);
  this.staticMode  = !rotationType;
  this.redirectURL = "";
  this.alt         = "";
  this.align       = "";
  this.hspace      = "";
  this.vspace      = "";
  this.border      = "";
  this.target      = "";
  this.banner_setAlt      = banner_setAlt;
  this.banner_setAlign    = banner_setAlign;
  this.banner_setHspace   = banner_setHspace;
  this.banner_setVspace   = banner_setVspace;
  this.banner_setBorder   = banner_setBorder;
  this.banner_setTarget   = banner_setTarget;
  this.banner_start       = banner_start;
  this.banner_rotate      = banner_rotate;
  this.setRedirect = "";

  //ie 3.02 hack  
  if((navigator.appVersion + navigator.appName).length == 0)
      this.staticMode = true;
  else
      banner_loadImages(this);

  return this;
}

                           
// End Hiding -->

