var MWJ_img_cache = new Object();

for( var i = 0; i < 2; i++ )
{
   var ar = i ? ( document.getElementsByTagName ? document.getElementsByTagName('input') : ( document.all ? document.all.tags('INPUT') : [] ) ) : document.images;
   
   for( var x = 0; ar[x]; x++ )
   {
      var im = ar[x];
      
      if ( im.getAttribute )
      {
         im.hoversrc = im.getAttribute( 'hoversrc' );
         im.activesrc = im.getAttribute( 'activesrc' );
      }
      
      if( im.hoversrc || im.activesrc )
      {
         im.rootsrc = im.src; 
         im.onmouseout = function () { this.src = this.rootsrc; }; 
      }

      if( im.hoversrc )
      {

         im.onmouseover = function () { this.src = this.hoversrc; };
      }

      if( im.activesrc )
      {
         im.onmousedown = function ( e )
         {
            e = e ? e : window.event;
            if ( e.button > 1
                  || e.which > 1 )
            {
               return;
            }
            
            this.src = this.activesrc;
         };

         im.onmouseup = function ( e )
         {
            e = e ? e : window.event;
            
            if ( e.button > 1
                  || e.which > 1 )
            {
               return;
            }
            
            this.src = this.hoversrc ? this.hoversrc : this.rootsrc;
         };
      }
   }
}

