function createRandomImage() {
  var obj = new Object;
  obj.images = new Array;

  obj.push = function(src) {
    var img = new Image;
    img.src = src;
    this.images.push( img );
    if (!this.src) this.src = img.src;
  };
  obj.shuffle = function() {
    this.shuffled = true;
    this.images.sort( function() {
      return (Math.round(Math.random())-0.5)
    } );
    this.src = this.images[0].src;
  }
  obj.next = function() {
    if (!this.images.length) return null;
    if (!this.shuffled) this.shuffle();
    var img = this.images.shift();
    this.images.push( img );
    return img;
  }
  obj.MM_swapImage = function(strObj) {
    MM_swapImage(strObj,'',RandomImage.next().src,1);
  }

  return obj;
}
