

/**
 * @author yetik
 */


/** GALERIA NA STRONIE GLOWNEJ **/
var Gallery_Loader = new Class({
	
	initialize: function (photos) {			
		
		this.photos = photos
		
		this.home_gallery_cont = $$('.home_gallery_cont');
		
		var _photos = new Array();
		var delimiter = ',';
		this.photos.each(function(item) { 
			_photos.push(item.photo) 
		})

		
		this.myImage = Asset.images(_photos, {
		 	properties: {
		        alt: 'lampy producent'
		    },		    
		    onComplete: function(){
		        spinn.hide();
				this.setPhotos.delay(700, this)				
		    }.bind(this)			
		});		


		
				
	},
	
	setPhotos: function () {
		this.home_gallery_cont.each (function (item, i) {
			this.myImage[i].inject(item);
			
		}.bind(this))		
	}
	
	
})
