function imagerotation(images)
{
	var img = new Array();
	var tags = $$('img[class="imagerotation"]');
	images.each(function(uri, key){ img[key] = new Image(); img[key].src = uri });
	rotateImages(img, tags, 0);
}

var counter = new Array();
function rotateImages(images, tags, c)
{
	tags.each(function(tag, key){
			counter[key] = c;
			setTimeout(function(){ tag.fade({ duration: 0.5, from: 1, to: 0.3 }) }, 400*key);
			setTimeout(function(){ tag.src=images[counter[key]].src; tag.appear({ duration: 0.5, from: 0.3, to: 1 }); }, 400*key+500);
			c++;
			if(c==images.length) c = 0;
		});
	setTimeout(function(){ rotateImages(images, tags, c); }, tags.length*750+2000);
}


