Array.prototype.shuffle = function( b )
{
 var i = this.length, j, t;
 while( i ) 
 {
  j = Math.floor( ( i-- ) * Math.random() );
  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
  this[i] = this[j];
  this[j] = t;
 }

 return this;
};
var works = new Array(8,16,37,35,49,44,55,61,60,78,87,108,106,124,157,282,262,246,245);
works.shuffle();
var pos=0;
window.addEvent('domready', function(){
    var img = $$('.rightbanner')[0].getElement('img');
    
    (function(){
        (function(){
		    var work = works[pos];
            img.set('src', '/images/testgallery/foto'+work+'_min2.jpg');
			pos++;
			if (pos==16) pos=0;
        }).periodical(4000);
    }).delay(2000);
});
