// timer.js - CTimer class

function CTimer()
{
	this.m_bStarted = false;
	this.m_nTimerId = false;

	this.Init = CTimer;

	this.StartTimeout = function( strOnTimerCall, nTimeout)
	{
		//alert( "StartTimeout");
		this.Stop();
		this.m_bStarted = true;
		//alert( "setTimeout( strOnTimerCall, nTimeout)");
		this.m_nTimerId = setTimeout( strOnTimerCall, nTimeout);
	}

	this.Stop = function()
	{
		if ( this.IsStarted())
		{
			//var strAlert = "clearTimeout( "+this.m_nTimerId+")";
			clearTimeout( this.m_nTimerId);
			this.m_nTimerId = false;
			this.m_bStarted = false;
			//alert( strAlert);
		}
	}

	this.IsStarted = function()
	{
		return this.m_bStarted;
	}

	this.SetTimerProcessed = function()
	{
		this.m_nTimerId = false;
		this.m_bStarted = false;
	}
}
