var ImageSlizee = new Class({
	i:'',
	loader:'./css/img/gui/_loading.gif',
	initialize:function(id){
		this.i=id;
		$$('#'+this.i+' img#imageslizee-loading')[0].src = this.loader;
		$$('#'+this.i+' img#imageslizee-loading')[0].style.display = 'inline';
		this.pe();
	},
	pe:function(){
		
		$$('#'+this.i+' #imageslizee')[0].set('morph',{ duration:1000, link:'cancel' ,transition:'quad:out' });
		
		$$('#'+this.i+' #imageslizee-load')[0].addEvent('load', function(){
			$$('#'+this.i+' img#imageslizee-loading')[0].style.display = 'none';
			$$('#'+this.i+' #imageslizee')[0].style.backgroundImage = 'url(' + $$('#'+this.i+' #imageslizee-load')[0].src + ')';
			$$('#'+this.i+' #imageslizee')[0].morph({opacity:[0,1]});
		}.bind(this));
		
		$$('#'+this.i+' #imageslizee-list a').each(function(el,i){
			el.addEvent('click', function(e){
				e.stop();
				$$('#'+this.i+' img#imageslizee-load')[0].src = (el.href);
				$$('#'+this.i+' img#imageslizee-loading')[0].style.display = 'inline';															
			}.bind(this));
			if(i==0){
				$$('#'+this.i+' img#imageslizee-load')[0].src = (el.href);	
			}
		}.bind(this));
		
		
	}
});
