var Gallery = Class.create();
Gallery.prototype = {
	initialize: function(el) {
	this.el = $(el);

	var len = this.el.select('li').length;

		for(i =0;i<len;i++) {
			this.btn = this.el.select('a.tmb')[i];
			Event.observe(this.btn, 'click', this.onClick.bindAsEventListener(this.btn));
		}
	},
	onClick: function(event) {
    // var img = new Image();
    //     img.src = this.href;
    //     img.id  = "img_container";
    //     img.style.opacity = "0";
    var ref = this.href;

    Effect.Fade($("img_container"), {afterFinish: function(){
		//	$("img_container").replace(img);
		 new Ajax.Request(ref, {method: 'get',
              onSuccess: function(trans){
              $("img_container").innerHTML = trans.responseText;      

                }
              });
              Effect.Appear($("img_container"));
    }});

		Event.stop(event);
	}
}
