var elem;
function animate (obj, elm, begin, end, duration, fps, easing, remove) {
	//set duration
	if (!duration)
		duration = 1000;
	//set fps --> frames per second
	if (!fps)
		fps = 20;
		
	//change values to float
	begin = parseFloat(begin);
	end = parseFloat(end);
	duration = parseFloat(duration);
	fps = parseFloat(fps);
	
	var change = end - begin;
	var interval = Math.ceil(1000/fps);
	var totalFrames = Math.ceil(duration/interval);
	var step = change/totalFrames;
	
	for (i=1; i <= totalFrames; i++) {
		(function() {
			var frame=i;
			function innerChangeWidth() {
				var s = eval(easing);
				var increase = s(frame, begin, change, totalFrames);
				var slope = increase - begin;
				unit=(elm=='opacity') ? '' : 'px';
				if(window.attachEvent && !unit) {
					increase *= 100;
					obj.style.zoom = 1;
					obj.style.filter = "alpha(opacity=" + increase + ")";
				}
				else {
					obj.style[elm] = increase + unit;
				}
			}
			timer = setTimeout(innerChangeWidth, interval*frame);
		})();
	}
	if (remove) {
		elem = obj;
		setTimeout("temp()", 2000);		
	}
}

linear = function (t,b,c,d) {
	var m=c/d;
	var a=t/d;
	return m*t + b;
};

function temp() {
	elem.style.display = 'none';
}