
function timeOut(Expr,Time,AutoRun)
{
	this.Expr=Expr;
	this.Time=Time;

	this.cancel=timeOut_Cancel;
	this.start=timeOut_Start;
	this.setExpr=timeOut_SetExpr;
	this.setTime=timeOut_SetTime;
	this.setParams=timeOut_SetParams;

	if (AutoRun!=false) this.start();
}

function timeOut_Cancel()
{
	if (this.timeouthandle!=0)
	{
		window.clearTimeout(this.timeouthandle);
		this.timeouthandle=0;
	}
}

function timeOut_Start()
{
	this.cancel();
	this.timeouthandle=window.setTimeout(this.Expr,this.Time);
}

function timeOut_SetExpr(Expr,restart)
{
	this.Expr=Expr;
	if (restart) this.start();
}

function timeOut_SetTime(Time,restart)
{
	this.Time=Time;
	if (restart) this.start();
}

function timeOut_SetParams(Expr,Time,restart)
{
	this.Expr=Expr;
	this.Time=Time;
	if (restart) this.start();
}

