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);*/
//var works = new Array(1,5,77,108,129,147,186,187,218,312,324,328,378,544,614,615);
//works.shuffle();

var pos = 0;

window.addEvent('domready', function() {

    var img = $$('.rightbanner')[0].getElement('img');
	
	setTimeout(function() {
		setInterval(function() {
			var work = works[pos];
			img.set('src', 'http://gallery.tattooz.ru' + work);
			pos++;
			if (pos == works.length) {
				pos = 0;
			}
		}, 4000);
	}, 2000);
	
});

