window.onload = rolloverInit;

function rolloverInit() {
 for (var i=0; i<document.images.length; i++) {
  if (document.images[i].parentNode.tagName == "A") {
   setupRollover(document.images[i]);
  }
 }
}

function setupRollover(thisImage) {
 thisImage.outImage = new Image();
 thisImage.outImage.src = "assets/ro/" + thisImage.id + "_o.gif";
 thisImage.onmouseout = rollOut;

 thisImage.overImage = new Image();
 thisImage.overImage.src = "assets/ro/" + thisImage.id + "_n.gif";
 thisImage.onmouseover = rollOver;

 thisImage.clickImage = new Image();
 thisImage.clickImage.src = "assets/ro/" + thisImage.id + "_c.gif";
 thisImage.onmousedown = rollClick;
}

function rollOut() {
 this.src = this.outImage.src;
}

function rollOver() {
 this.src = this.overImage.src;
}

function rollClick() {
 this.src = this.clickImage.src;
}
