function Animation() {
		
	this.resize = function(element, width, height, step, callback, fixW, fixH) {
		this.onProcess.__element = element;
		this.onProcess.__width = width;
		this.onProcess.__height = height;
		this.onProcess.__step = step;
		this.onProcess.__fixW = fixW?fixW:0;
		this.onProcess.__fixH = fixH?fixH:0;
		this.onProcess.__callback = callback;
		this.onProcess.__duration = 1;
		
		var currentW = element.offsetWidth;
		var currentH = element.offsetHeight;
				
		this.onProcess.__operationW = (currentW < width) ? "+" : "-";
		this.onProcess.__operationH = (currentH < height) ? "+" : "-";
		
		var stepDuration = 1;//Math.round(this.onProcess.__duration / this.onProcess.__step);
		return new Thread(this.onProcess, this.onComplete, stepDuration);
	};
	
	this.move = function(element, x, y, step, callback) {
		this.onProcess.__element = element;
		this.onProcess.__x = x;
		this.onProcess.__y = y;
		this.onProcess.__step = step;
		this.onProcess.__callback = callback;
		this.onProcess.__duration = 1;
		
		var currentX = element.offsetLeft;
		var currentY = element.offsetTop;
 
		this.onProcess.__operationX = (currentX < x) ? "+" : "-";
		this.onProcess.__operationY = (currentY < y) ? "+" : "-";
		
		var stepDuration = 1;//Math.round(this.onProcess.__duration / this.onProcess.__step);
		return new Thread(this.onProcess, this.onComplete, stepDuration);
	};
	
	this.onProcess = function() {
		this.target.__completeW = true;
		this.target.__completeH = true;
		this.target.__completeX = true;
		this.target.__completeY = true;
	  
		var operationW = this.target.__operationW;
		var operationH = this.target.__operationH;
		var operationX = this.target.__operationX;
		var operationY = this.target.__operationY;
	  
		var element = this.target.__element;
		var width   = this.target.__width;
		var height  = this.target.__height;
		var x   = this.target.__x;
		var y  = this.target.__y;
		var step    = this.target.__step;
		var fixW     = this.target.__fixW;
		var fixH     = this.target.__fixH;
		var currentW = element.offsetWidth - fixW;
		var currentH = element.offsetHeight - fixH;
		var currentX = element.offsetLeft;
 		var currentY = element.offsetTop;
	  
		if(width) {
			this.target.__completeW = false;
			if(operationW == "+"){
				if(currentW < width) element.style.width = parseInt(currentW + step) + "px";
				else this.target.__completeW = true;
			}else if(operationW == "-"){
				if(currentW > width) element.style.width = parseInt(currentW - step) + "px";
				else this.target.__completeW = true;
			}
		}
		
		if(height) {
			this.target.__completeH = false;
			if(operationH == "+"){
                var H = (currentH + step <= height)?parseInt(currentH + step):parseInt(height)+5;
				if(currentH < height) element.style.height = H + "px";
				else this.target.__completeH = true;
			}else if(operationH == "-"){
                var H = (currentH - step >= height)?parseInt(currentH - step):parseInt(height);
				if(currentH > height) element.style.height = H + "px";
				else this.target.__completeH = true;
			}
		}
		
		if(x){
			this.target.__completeX = false;
			if(operationX == "+"){
				if(currentX < x) element.style.left = parseInt(currentX + step) + "px";
				else this.target.__completeX = true;
			}else if(operationX == "-"){
				if(currentX > x) element.style.left = parseInt(currentX - step) + "px";
				else this.target.__completeX = true;
			}
		}
		
		if(y){
			this.target.__completeY = false;
			if(operationY == "+"){
				if(currentY < y) element.style.top = parseInt(currentY + step) + "px";
				else this.target.__completeY = true;
			}else if(operationY == "-"){
				if(currentY > y) element.style.top = parseInt(currentY - step) + "px";
				else this.target.__completeY = true;
			}
		}
		
		return (this.target.__completeW && this.target.__completeH && this.target.__completeX && this.target.__completeY);
	};
	
	this.onComplete = function(){
		if(this.target.__callback && this.target.__element) {
			this.target.__callback(this.target.__element);
		}
	};
};