/*********************************************************************************/
var hideBlock = new Class({

	initialize: function(oForm, oBloglink, oStatus) {
		var header = document.getElementById('headerImg');
		if (!$(oBloglink)) return;
		var lnk = $(oBloglink);
		var formEl = $(oForm);

		this.el = formEl;
		this.el.setStyle('display', 'block');
		this.el.setStyle('overflow', 'hidden');


		this.iniHeight = this.el.offsetHeight;
		if(this.iniHeight <=150)
		{	this.el.setStyle('cursor', 'default');
			return false;
		}

		this.el.setStyle('height', 150);


		this.fx = new Fx.Style(this.el, 'height', {
			wait: true,
			transitionStart: Fx.Transitions.cubicOut,
			transitionEnd: Fx.Transitions.cubicOut,
			onComplete: function() {
				window.onresize = this.iniHandler;

				if (this.el.getStyle('height').toInt() > 150) {
					
					this.el.setStyle('height', 'auto');
					this.iniHeight = this.el.offsetHeight;
					
				}
			}.bind(this)
		});

		lnk.addEvent('click', function() {
			this.iniHandler = window.onresize;
			window.onresize = Class.empty;

			if (this.el.getStyle('height').toInt() > 150 || this.el.getStyle('height') == 'auto') {
				this.el.setStyle('height', this.el.offsetHeight+'px');
				this.fx.start(150);
				header.className = 'down';
			}
			else {
				this.fx.start(this.iniHeight);
				header.className = 'up';
			}

		}.bind(this));


		//

	}

});

/*********************************************************************************/

