/* This Code Free To Use As Long As These Lines Remain */
/* DOM Image Rollover Code */
/* Created by Chris Poole <http://www.chrispoole.com> */
/* Featured at <http://www.DesignerWiz.com> */
/* Development Resource & JavaScript Public Archive Center */

function img_hover() {
  if (!document.getElementById) return;
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
      new Image().src = imgarr[i].getAttribute('hsrc'); // preload image
      imgarr[i].setAttribute('dsrc', imgarr[i].src);
      imgarr[i].onmouseover = function() { this.src = this.getAttribute('hsrc'); }
      imgarr[i].onmouseout = function() { this.src = this.getAttribute('dsrc'); }
    }
  }
}
