function redirect()
{
	this.seconds = 0;
	this.timer = "";
	this.timerStop = false;

	this.redirStart = function()
	{
		this.seconds = document.getElementById("secs").innerHTML;
		if ( ! this.timerStop )
			this.timer = setTimeout("redirect.doSecs();", 1000);
	}

	this.doSecs = function()
	{
		if ( ! this.timerStop )
		{
			this.seconds = this.seconds-1;
			if ( this.seconds < 0 )
			{
				window.location = document.getElementById("redirlink").href;
			}
			else
			{
				document.getElementById("secs").innerHTML = this.seconds;
				this.timer = setTimeout("redirect.doSecs();", 1000);
			}
		}
	}

	this.redirStop = function()
	{
		this.timer = "";
		this.timerStop = true;
		document.getElementById("stopText").innerHTML = "Redirection has been stopped by user.";
	}
}

var redirect = new redirect();
