/**
 * Import EffectHandler.js first
 * (c) 2005 Mat Gessel
 */

/**
 * NervousTextEffect
 */
NervousTextEffect.prototype = new AbstractTextEffect();
NervousTextEffect.prototype.constructor = NervousTextEffect;

/**
 * Constructor
 * @param interval the animation delay in ms
 */
function NervousTextEffect(interval)
{
	this.initNervousTextEffect(interval);
}

NervousTextEffect.prototype.initNervousTextEffect = function(interval)
{
	this.initAbstractTextEffect(interval);
}

NervousTextEffect.prototype.doStart = function(target)
{
	this.startLoop();
}

NervousTextEffect.prototype.doStep = function(target)
{
	for (var i = 0; i < this.m_parts.length; i++)
	{
		this.m_parts[i].style.position = "relative";
		this.m_parts[i].style.left = Math.floor(Math.random() * 2) + "px";
	}
};

NervousTextEffect.prototype.doFinish = function(target)
{
	this.stopLoop();
	for (var i = 0; i < this.m_parts.length; i++)
	{
		this.m_parts[i].style.position = "";
		this.m_parts[i].style.left = "";
	}
};

