
// Size of the array, ie. number of links to be randomly chosen.
var maxsize = 4;

// Image's width and height.
var iwidth = 318;
var iheight = 117;

// Specify the links.
// Format: "URL,description,target,imageurl".
var link = new makeArray(maxsize);
link[0] = new linkObj("http://www.westinghouselighting.com/fixtures/", "Fixtures Make Stylish Additions to Any Home", "_top", "images/promos/light01.jpg");
link[1] = new linkObj("http://wde.com/products/", "Westinghouse Digital", "_top", "images/promos/digital01.gif");
link[2] = new linkObj("http://www.westinghouse-home.com/intercoms.htm", "Westinghouse Intercoms", "_top", "images/promos/linear02.gif");
link[3] = new linkObj("http://www.ecologicComfort.com", "ecoLogic", "_top", "images/promos/nordyne01.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);
  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;
}

// HTML output

var banner1 = "<a href='javascript:gotoUrl(" + n + ")'    OnMouseOver=\"MM_swapImage('learnmore2','','images/features_roll-over.gif',1);showStatus(" + n + ");return true\" ";
banner1 += "OnMouseOut=\"MM_swapImage('learnmore2','','images/features_roll.gif',1);window.status=''\">";
banner1 += "<img border=0 width=" + iwidth + " height=" + iheight + "name=\"bannerimg\" src=\"" + getImageName(n) + "\"></a></td></tr><tr><td align=\"right\">";

var button1 = "<a href='javascript:gotoUrl(" + n + ")' ";
button1 += "onMouseOut=\"MM_swapImgRestore()\" ";
button1 += "onMouseOver=\"MM_swapImage('learnmore2','','../images/features_roll-over.gif',1); showStatus(" + n + ");return true\">";
button1 +="<img src=\"images/features_roll.gif\" alt=\"Learn More\" name=\"learnmore2\" width=\"141\" height=\"16\" border=\"0\"></a> ";


document.write(banner1);
document.write(button1);



