var PictureMini = new Class({
		
	Extends:Picture,
	
	Implements: [Options, Events],
	options:{
		filename:null,
		width:null,
		height:null,
		parent:null,
		reduce:null
	},
	
	initialize:function(options) {
		this.setOptions(options);
		//debug('Picture:initialize');
		
		this.path = ROOT_URL+'upload/profils/images/minis/';
		
		this.initContainer();
	},
	
	
	loadComplete:function() {
		this.fireEvent('loadComplete');
		this.target = this.target[0];
		this.target.setStyles({
			'position':'absolute',
			'display':'block',
			'z-index': 0
		});
		this.target.inject(this.options.parent);
		this.target.erase('width');
		this.target.erase('height');
		this.target.addEvents({
			'mouseenter': function(e) {
				this.fireEvent('mouseenter', e);
			}.bind(this),
			'mouseleave': function(e) {
				this.fireEvent('mouseleave', e);
			}.bind(this),
			'click': function(e) {
				this.fireEvent('click', e);
			}.bind(this)
		});
		this.is_open = false;

		this.initFx();
		
		this.close();

	},
	
	initFx:function() {
		this.fx = new Fx.Morph(this.target, {
			transition: Fx.Transitions.Quad.easeOut,
			link:'cancel',
			duration:300
		});
		
		this.fx_init = {
			'width': this.options.width / 2,
			'height': this.options.height / 2,
			'opacity':0,
			'top': (this.options.height - (this.options.height / 2)) / 4,
			'left': (this.options.width - (this.options.width / 2))/4
		};
		
		this.fx_src = {
			'width': this.options.width / this.options.reduce,
			'height': this.options.height / this.options.reduce,
			'opacity':0.5,
			'top': (this.options.height - (this.options.height / this.options.reduce)) / 4,
			'left':0
		};
		
		this.fx_dest = {
			'width': this.options.width,
			'height': this.options.height,
			'opacity':1,
			'top': 0,
			'left': - (this.options.width - (this.options.width / this.options.reduce))/4
		};
		
		this.bound_open_complete = this.openComplete.bind(this);
		this.bound_close_complete = this.closeComplete.bind(this);
		this.bound_init_complete = this.initComplete.bind(this);
		
		this.fx.set(this.fx_init);
	}
			
});
