var Fxable = new Class({
	Implements: [Options, Events],
	options:{
		target: null,
		type:null,
		src: null,
		dest: null,
		transition: Fx.Transitions.Sine.EaseOut,
		duration:300
	},
	
	initialize:function(options) {
		this.setOptions(options);
		
		this.is_open = false;
		this.fx = new Fx.Tween(this.options.target, {transition:this.options.transition, duration:this.options.duration, link:'cancel'});
		this.bound_complete = this.onComplete.bind(this);
		this.fx.addEvent('complete', this.bound_complete);
	},
	
	open:function() {
		this.fx.start(this.options.type, this.options.dest);
		this.is_open = true;
	},
	
	setOpen:function() {
		this.fx.set(this.options.type, this.options.dest);
		this.is_open = true;
	},
	
	close:function() {
		this.fx.start(this.options.type, this.options.src);
		this.is_open = false;
	},
	
	setClose:function() {
		this.fx.set(this.options.type, this.options.src);
		this.is_open = false;
	},
	
	goTo:function(dest) {
		this.fx.start(this.options.type, dest);
	},
	
	setTo:function(dest) {
		this.fx.set(this.options.type, dest);
	},
	
	onComplete:function() {
		this.fireEvent('complete');
	}
	
});
