/*
 * payoff.js
 * Controls the dynamic switching of the payoff texts
 *
 * Part of the dan pearlman theme
 *
 * @author Jack Weinert (lieblinx/CodeMonkz)
 */
var payoffInterval = 30000;
var currentPayoffIndex = 0;

function SwitchPayoff()
{
	var curPayoff = HTML.GetElementByID('payoff_' + currentPayoffIndex);
	if (curPayoff)
	{
		var nextPayoffIndex = (currentPayoffIndex + 1);
		var nextPayoff = HTML.GetElementByID('payoff_' + nextPayoffIndex);
		if (!(nextPayoff))
		{
			nextPayoff = HTML.GetElementByID('payoff_0');
			nextPayoffIndex = 0;
		}
		
		if ((nextPayoff) && (nextPayoffIndex != currentPayoffIndex))
		{
			HTML.AppendElementClass(curPayoff,'hidden');
			HTML.RemoveElementClass(nextPayoff,'hidden');
			
			currentPayoffIndex = nextPayoffIndex;
		}
	}
	
	window.setTimeout('SwitchPayoff();',payoffInterval);
}

window.setTimeout('SwitchPayoff();',payoffInterval);

