var blender_timeout = new Array();
var blender_onfinish = null;

function blender(id, type, min, max, unit , increment, onfinish)
{
	window.clearTimeout(blender_timeout[id]);

	blender_onfinish = onfinish?onfinish:null;

	if(increment == 0){increment == 10;}
	if(min > max){increment = - Math.abs(increment);}
	if(min < max){increment = Math.abs(increment);}
	
	if(type == 'horizontal')
	{	
		$(id).style.width = max + unit;
	}
	else if(type == 'vertical')
	{
		$(id).style.height = max + unit;
	}

	if((max > min && max - increment >= min) || (max < min && max - increment <= min))
	{
		blender_timeout[id] = window.setTimeout("blender('" + id + "', '" + type + "', " + min + ", " + (max - increment) + ", '" + unit + "', " + increment + ", blender_onfinish)", 10);
	}
	
	if(min == max && blender_onfinish != null)
	{
		blender_onfinish();
	}
}
