var mySlide = new Class({
	// default options
	options: {
		wrapper: null,
		content: null,
		trigger: null,
		trigger_textHide: null,
		trigger_textShow: null,
		is_minime: false,
		default_hide: 0
	},
    // initialize function
    initialize: function(options) {
		// and then setOptions override default options
		this.setOptions(options);
		this.wrapper = this.options.wrapper;
		this.content = this.options.content;
		this.trigger = this.options.trigger;
		this.trigger_textHide = this.options.trigger_textHide;
		this.trigger_textShow = this.options.trigger_textShow;
		/*this.hidePosition = '-' + (this.wrapper.scrollHeight+4) + 'px'; //+4 is border*/
		this.hidePosition = '-' + this.wrapper.scrollHeight + 'px'; 
		this.default_hide = this.options.default_hide;
		this.is_minime = this.options.is_minime;
		//razz junta
		if(this.default_hide) {
			this.wrapper.setStyle('margin-top', this.hidePosition);
			if((ie) && (!this.is_minime)) $('container-quicklist').style.display = 'none';
		} 
		// wrapper
		this.wrapper.fxIn = new Fx.Style(this.wrapper, 'margin-top', { 
			duration: 500, 
			onComplete: function(){ 
				this.content.fxIn.start(1); 
				if((ie) && (!this.is_minime)) $('container-quicklist').style.display = 'block';
			}.bind(this)
		});
		this.wrapper.fxOut = new Fx.Style(this.wrapper, 'margin-top', { duration: 500 });
		// content
		this.content.fxIn = new Fx.Style(this.content, 'opacity', { 
			duration: 500
		}).set(1);//raz era 0
		this.content.fxOut = new Fx.Style(this.content, 'opacity', { 
			duration: 500, 
			onComplete: function(){
				this.wrapper.fxOut.start(this.hidePosition); 
			}.bind(this)
		});
		// trigger
		this.trigger.addEvent('mouseup', function(){
			if(this.wrapper.getStyle('margin-top').toInt() < 0){
				this.wrapper.fxIn.start(0);
				this.trigger.setHTML(this.trigger_textHide);
				this.trigger.style.backgroundPosition = '0 0';
				
			}else{
				this.content.fxOut.start(0);
				this.trigger.setHTML(this.trigger_textShow);
				this.trigger.style.backgroundPosition = '0 -29px';
			}
		}.bind(this));
	},
	open: function() {
		alert('apri calendario');
	},
	close: function() {
		alert('chiudi calendario');
	}
});
mySlide.implement(new Options);
