// easing class
// had to make this as a class in order to have several easing elements on the one page
// main reason being that the timeouts were getting crossed over
function ease_div(){
		ease_div.prototype._easeto; // timeout
		ease_div.prototype._obj; // target object
		ease_div.prototype._targheight; // target height
		ease_div.prototype._togglestate; // lets the calling script decide whether it's on or off
		}

ease_div.prototype.ease = function ease(){
		clearTimeout(this._easeto);
		var currheight = parseInt(this._obj.style.height);
		var dist =  this._targheight - currheight;
		var speed = dist * 0.2;
		if(dist < 0){
			dist *= -1;
			}
		if (dist > 2){
				var travel = Math.round(currheight + speed);
				this._obj.style.height = travel+'px';
				this._easeto = setTimeout(curry(this.ease,this),1);
				} else {
				this._obj.style.height = this._targheight+'px';	
				}
		}
		
function curry (fn, scope) {
    var scope = scope || window;
    var args = [];
    for (var i=2, len = arguments.length; i < len; ++i) {
        args.push(arguments[i]);
    };
    return function() {
	    fn.apply(scope, args);
    };
}

		
		
		
		
		
		
/*function ease_div(targ,targheight){
		obj = document.getElementById(targ);
		currheight = parseInt(obj.style.height);
		var dist =  targheight - currheight;
		var speed = dist * 0.2;
		if(dist < 0){
			dist *= -1;
			}
		if (dist > 1){
				var travel = currheight + speed;
				obj.style.height = parseInt(travel)+'px';
				var easeto = setTimeout('ease_div("'+targ+'",'+targheight+')',1);
				}
		}*/