/************************************************************\
* liniarHeight object v1                                     *
* By Andrew Green                                            *
*                                                            *
*                                                            *
*                                                            *
*                                                            *
*                                                            *
*                                                            *
*                                                            *
\************************************************************/
function linierHeight(elemObject){
	this._elemObject=elemObject;
	this._bottomEnd = this._elemObject.clientHeight;
	this._full = this._elemObject.clientHeight;

	this.liniar = function(time, bottomStart, bottomEnd){
		time /= 10;		
		clearInterval(self._intervalID);

		this._bottomCur = bottomStart;
		this._bottomEnd = bottomEnd;
		this._bottomStep = (bottomEnd - bottomStart) / time;

		
		this._intervalID = setInterval(this.clipping,10);
	}


	this.liniarTo = function(time, bottomEnd){
		time /= 10;		
		clearInterval(self._intervalID);

		this._bottomEnd = bottomEnd;
		this._bottomStep = (this._bottomEnd - this._bottomCur) / time;

			
		this._intervalID = setInterval(this.clipping,10);
	}

	this.liniarFull = function(time){
		time /= 10;
		clearInterval(self._intervalID);

		this._bottomEnd = self._full;
		this._bottomStep = (this._bottomEnd - this._bottomCur) / time;
		this._intervalID = setInterval(this.clipping,10);
	}

	this.height = function(bottom){
		
		clearInterval(self._intervalID);

		self._bottomCur = bottom;
		self._elemObject.style.height = self._bottomCur + "px";

	}

	this.clipping = function(){
		

		self._bottomCur += self._bottomStep;
		if((self._bottomCur >= self._bottomEnd && self._bottomStep > 0) || (self._bottomCur <= self._bottomEnd && self._bottomStep < 0)){
			self._bottomCur = self._bottomEnd;
		}

		self._elemObject.style.height = self._bottomCur + "px";


		if(self._bottomCur == self._bottomEnd){
			clearInterval(self._intervalID);
		}



	}
	

	var self = this;

}