// x_img.js, part of X, a Cross-Browser.com Javascript Library
// Copyright (C) 2001,2002,2003,2004,2005 Michael Foster - Distributed under the terms of the GNU LGPL - OSI Certified
// File Rev: 3

function xImgRollSetup(id, ovrImg, outImg) 
{
  var ele, id;
    if (ele = xGetElementById(id)) {
      ele.xOutUrl = outImg;
      ele.xOvrObj = new Image();
      ele.xOvrObj.src = ovrImg;
      ele.onmouseout = imgOnMouseout;
      ele.onmouseover = imgOnMouseover;
    }

  function imgOnMouseout(e)
  {
    if (this.xOutUrl) {
      this.src = this.xOutUrl;
    }
  }
  function imgOnMouseover(e)
  {
    if (this.xOvrObj && this.xOvrObj.complete) {
     this.src = this.xOvrObj.src;
    }
  }
} // end xImgRollSetup()  
