// JavaScript Document

//Rollover Image Swap 
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 = thisImage.src;
  thisImage.onmouseout = rollOut;

  thisImage.overImage = new Image();
  thisImage.overImage.src = "http://www.dat1.co.uk/images/" + thisImage.id + "Over.jpg";
  thisImage.onmouseover = rollOver;
}

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

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

//preload images for dropdown background
if (document.images) {
  var img1, img2, img3, img4;
  
  img1 = new Image();
  img1.src = "http://www.dat1.co.uk/images/menuHeader.jpg";
  
  img2 = new Image();
  img2.src = "http://www.dat1.co.uk/images/menuBulletSelected.jpg";
  
  img3 = new Image();
  img3.src = "http://www.dat1.co.uk/images/menuBullet.jpg";
  
  img4 = new Image();
  img4.src = "http://www.dat1.co.uk/images/menuBulletOver.jpg";

}

