function Gallery(ID) {
	this.init(ID);	 
}

Gallery.prototype = {
	constructor: Gallery,
	
	init: function(ID) {
		this.bigPicID = "bigPic_"+ID;
		this.loadingPicID = "loadingPic_"+ID;
	},
	
	showImage: function(url) {
		var _this = this;
		Element.setStyle(this.loadingPicID,{display:'block'});
		new Effect.Appear(this.bigPicID,
		{
			duration:0.2,
			from:1,
			to:0,
			afterFinish: function() { 
				_this.loadImage(url);
			}
		});
	},
	
	loadImage:function(url){
		var _this = this;
		this.tempImage = new Image();
		this.tempImage.onload = function() {
			new Effect.Appear(_this.bigPicID,
			{
				duration:0.3,
				afterFinish: function() {
					Element.setStyle(_this.loadingPicID,{display:'none'});
				}
			});
			
			$(_this.bigPicID).src=url;
		}
		this.tempImage.src = url;
	}
}

var galleries = new Array();