function animCalc(minValue, maxValue, totalSteps, actualStep, powr)
{
	var delta = maxValue - minValue; 
	var stepp = minValue + (Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
	return Math.ceil(stepp) 
}

function createFX(obj, vals, dur, pwr, ajax)
{
	if (typeof obj == "string") obj = document.getElementById(obj);
	var actStep = 0;
	var duration = dur / 1000;
	
	for (var i in vals)
	{
		if (i == "height")
		{
			if (obj.heightFX) window.clearInterval(obj.heightFX);
			if (obj.offsetHeight) obj.currentHeight = obj.offsetHeight;
			else if (obj.pixelHeight) obj.currentHeight = obj.pixelHeight;
			
			if (vals[i] != obj.currentHeight)
			{
				var steps = Math.abs(vals[i] - obj.currentHeight) / 2;
			
				obj.heightFX = window.setInterval(
					function() { 
						obj.currentHeight = animCalc(obj.currentHeight, vals[i], steps, actStep, pwr);
						obj.style.height = obj.currentHeight + "px"; 
						actStep++;
						
						if (actStep >= steps)
						{
							obj.style.height = vals[i] + "px";
							window.clearInterval(obj.heightFX);
						}
					}, duration);
			}
		}
		else if (i == "width")
		{
			if (obj.widthFX) window.clearInterval(obj.widthFX);
			if (obj.offsetWidth) obj.currentWidth = obj.offsetWidth;
			else if (obj.pixelWidth) obj.currentWidth = obj.pixelWidth;
			
			if (vals[i] != obj.currentWidth)
			{
				var steps = Math.abs(vals[i] - obj.currentWidth) / 2;
			
				obj.widthFX = window.setInterval(
					function() { 
						obj.currentWidth = animCalc(obj.currentWidth, vals[i], steps, actStep, pwr);
						obj.style.width = obj.currentWidth + "px"; 
						actStep++;
						
						if (actStep >= steps)
						{
							obj.style.width = vals[i] + "px";
							window.clearInterval(obj.widthFX);
						}
					}, duration);
			}
		}
		else if (i == "opacity")
		{
			if (obj.transFX) window.clearInterval(obj.transFX);
			if (obj.style.opacity) obj.currentOpacity = obj.style.opacity * 100;
			else if (obj.style.filter) obj.currentOpacity = obj.style.filter.substr(13, (obj.style.filter.length - 15));
			else obj.currentOpacity = 0;
			
			if (obj.currentOpacity == "=") obj.currentOpacity = 0;
			
			if (vals[i] != obj.currentOpacity)
			{
				if (obj.style.display == "none")
				{
					if (window.ActiveXObject) obj.style.filter = "alpha(opacity=0)";
					obj.style.opacity = 0;
				}
				
				obj.style.display = "inline";
				
				var steps = Math.floor(Math.abs(vals[i] - obj.currentOpacity)) / 2;
				
				obj.transFX = window.setInterval(
					function() { 
						obj.currentOpacity = animCalc(obj.currentOpacity, vals[i], steps, actStep, pwr);
						if (window.ActiveXObject) obj.style.filter = "alpha(opacity=" + obj.currentOpacity + ")";
						obj.style.opacity = obj.currentOpacity / 100; 
						actStep++;
						
						if (actStep >= steps)
						{
							if (window.ActiveXObject) obj.style.filter = "alpha(opacity=" + vals[i] + ")";
							obj.style.opacity = vals[i] / 100;
							window.clearInterval(obj.transFX);
							if (vals[i] == 0) obj.style.display = "none";
							if (ajax) sendAJAXRequest(ajax["obj"], ajax["url"]);
						}
					}, duration);
			}
		}
	}
}