Fx.Height = Fx.Style.extend({

	initialize: function(el, options){
		$(el).setStyle('overflow', 'hidden');
		this.parent(el, 'height', options);
	},

	/*
	Property: toggle
		Toggles the height of an element from zero to it's scrollHeight, and vice-versa.
	*/

	toggle: function(){
		var style = this.element.getStyle('height').toInt();
		if (style > 0) return this.start(style, 0);
		else return this.start(0, this.element.scrollHeight);
	},

	/*
	Property: show
		Size the element to its full scrollHeight immediatly, without applying a transition.
	*/

	show: function(){
		return this.set(this.element.scrollHeight);
	}

});

