// 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 = 10;

// 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/#7","New in PULSe", "new", "http://www.uta.edu/library/spotlight/newpulseanime.gif");

link[1] = new LinkObj("http://libraries.uta.edu/javacity/", "Java City", "new", "http://www.uta.edu/library/spotlight/javacity_animated.gif");

link[2] = new LinkObj("http://www3.uta.edu/library/newsevents/#5", "Checking out Library Laptops", "new", "http://www.uta.edu/library/spotlight/laptops.gif");

link[3] = new LinkObj("http://www3.uta.edu/library/newsevents/#4", "the Library Wireless Network", "new", "http://www.uta.edu/library/spotlight/wireless.gif");

link[4] = new LinkObj("http://www.uta.edu/library/ref/chat.html", "UTA Libraries Online Chat", "new", "http://www.uta.edu/library/spotlight/virtual_librarian.gif");

link[5] = new LinkObj("http://www.uta.edu/library/faculty/medley.html", "Focus on Faculty - Dr. Paul Medley", "new", "http://www.uta.edu/library/spotlight/focusonfaculty_medley.gif");

link[6] = new LinkObj("http://www3.uta.edu/library/newsevents/#13", "Central Library's New Hours", "new", "http://www.uta.edu/library/spotlight/24_5.gif");

link[7] = new LinkObj("http://www3.uta.edu/library/newsevents/#14", "the new Popular Reading Collection", "new", "http://www.uta.edu/library/spotlight/popread.gif");

link[8] = 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[9] = new LinkObj("http://www3.uta.edu/library/newsevents/default.asp#19", "DMC Open House", "new", "http://www.uta.edu/library/spotlight/DMC_Open_House.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>";