// See libraries.uta.edu/imageUpdate.txt for list of folders that need to have file updated when changes are made to this file.

// Size of the array, ie. number of links to be randomly chosen.
var maxsize = 3;

// Image's width and height.
var iwidth = 150;
var iheight = 56;

// Specify the links.
// Format: "URL,description,target,imageurl".
var link = new makeArray(maxsize);

link[0] = new LinkObj("http://www3.uta.edu/library/newsevents/#14", "the new Popular Reading Collection", "new", "http://www.uta.edu/library/spotlight/popread.gif");

link[1] = new LinkObj("http://www.uta.edu/library/faculty/depken.html", "Focus on Faculty - Dr. Craig Depken", "new", "http://www.uta.edu/library/spotlight/focusonfaculty_depken.gif");

link[2] = new LinkObj("http://www.uta.edu/library/redesign/preview.html", "the New Library Web Site - First Look", "new", "http://www.uta.edu/library/spotlight/previewsurvey.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;
}
var htmltag = "<a href=\"" + link[n].url + "\">";
htmltag += "<div align=center><img border=3 width=" + iwidth + " height=" + iheight + "name=\"bannerimg\" src=\"" + getImageName(n) + "\"></a><BR><font size=-1>More Information about <a href=\"" + link[n].url + "\">" + link[n].description + "\</a></font></div>";