var gallery = null;
	

var Gallery = new Class ({
	
	offset: 150,
	
	initialize: function () {
		busy: false
	},
	
	init_gallery: function () {
		
		/*** ZMIANA PRZEZROCZYSTOSCI **/
		var products = $$('.product_box');		
		var fx_big_img = new Array()
		
		if ($chk(products)) {
			products.each(function(item, j){						
				
				var big_img = item.getFirst('.big_photos')	
							
				var big_images = big_img.getElements('.photo');
					
								
				fx_big_img[j] = new Fx.Elements (big_images);
				
				big_images.each (function (item2) {
		
					if (item2.getStyle('visibility') == 'hidden') {
						item2.fade('hide');
					}
				})
				



		
				var small_images = item.getFirst('.small_photos');
				
				
					small_images.getElements('img').each (function (item2, k) {
						
						item2.addEvent('click', function () {
							var obj = {}
							
							big_images.each(function(item2, i){
								if (i == k) {
									obj[i] = { 
										'opacity': 1
									}
								} else {
									obj[i] = { 
										'opacity': 0
									}						
								}
							})
							
							
							fx_big_img[j].start(obj);
											
						}.bind(this))	
					}.bind(this))
									
				
			})
		}

	}

})
