// Size of the array, ie. number of links to be randomly chosen.
var maxsize = 8;

// Image's width and height.
var iwidth = 154;
var iheight = 220;

// Windows properties
var winprops = 'height=150,width=340,top=60,left=60,scrollbars=no,resizable';

// Specify the links.
// Format: "URL,description,target,imageurl".
var link = new makeArray(maxsize);
link[0] = new LinkObj("buzz_0.html", "Why are roses planted in vineyards?", "new", "images/home_buzz_0.gif");
link[1] = new LinkObj("buzz_1.html", "What's Vin Santo?", "new", "images/home_buzz_1.gif");
link[2] = new LinkObj("buzz_2.html", "What's Claret?", "new", "images/home_buzz_2.gif");
link[3] = new LinkObj("buzz_3.html", "What's Finish?", "new", "images/home_buzz_3.gif");
link[4] = new LinkObj("buzz_4.html", "What do Zinfandels often taste and smell like?", "new", "images/home_buzz_4.gif");
link[5] = new LinkObj("buzz_5.html", "What's Graves?", "new", "images/home_buzz_5.gif");
link[6] = new LinkObj("buzz_6.html", "Who are the Rhône Rangers?", "new", "images/home_buzz_6.gif");
link[7] = new LinkObj("buzz_7.html", "What's the Médoc?", "new", "images/home_buzz_7.gif");

var n = 0;

function LinkObj(url, description, target, img) {
  this.url = url;
  this.description = description;
  this.target = (target != null) ? target : "_top";
  this.image = img;
  return this;
}

function gotoUrl(x) {
  if (link[x].target != null)
    window.open(link[x].url, link[x].target, winprops);
  else
    location.href = link[x].url;
}

function makeArray(size) {
  this.length = size;
  return this;
}

function showStatus(x) {
  window.status = link[x].description;
}

function getImageName(x) {
  return link[x].image;
}

while (1) {
  n = Math.round(Math.random() * 10);
  if (n >= 0 && n < maxsize)
    break;
}
var htmltag = "<a href='javascript:gotoUrl(" + n + ")' OnMouseOver=\"showStatus(" + n + ");return true\" ";
htmltag += "OnMouseOut=\"window.status=''\">";
htmltag += "<img border=0 width=" + iwidth + " height=" + iheight + "name=\"bannerimg\" src=\"" + getImageName(n) + "\"></a>";
