Концепт таймаут диалога

В результате сегодняшнего рефакторинга родился вот такой вот концепт


var Timer = function () {
	this.init.apply(this, arguments);
};

Timer.prototype = {
	interval:null,
	timeout:null,

	seconds:90, // 1.5 min
	current:0,
	time:120000, // 2 min

	dialog:null,
	counter:null,

	init:function (options) {
		$.extend(true, this, options);

		if (!this.dialog) {
			this.dialog = $("<div/>");
			this.counter = $("<div/>").appendTo(this.dialog);
		}

		this.dialog.dialog({
			modal:true,
			autoOpen:false,
			open:this.start.bind(this),
			close:this.reset.bind(this),
			buttons:[
				{
					text:"Ok",
					click:this.hide.bind(this)
				},
				{
					text:"Cancel",
					click:this.redirect.bind(this)
				}
			]
		});
		$("body").click(this.reset.bind(this));
		this.activate();
	},
	activate:function () {
		this.reset();
	},
	deactivate:function () {
		clearInterval(this.interval);
		clearTimeout(this.timeout);
	},
	start:function () {
		this.current = this.seconds;
		this.counter.text(this.current);
		clearTimeout(this.timeout);
		this.interval = setInterval(this.update.bind(this), 1000);
	},
	stop:function () {
		clearInterval(this.interval);
		this.timeout = setTimeout(this.show.bind(this), this.time);
	},
	hide:function () {
		this.dialog.dialog("close");
	},
	show:function () {
		this.dialog.dialog("open");
	},
	reset:function () {
		if (this.dialog.dialog("isOpen")) {
			return;
		}
		clearTimeout(this.timeout);
		this.stop();
	},
	redirect:function () {
		this.hide();
		this.deactivate();
		window.location = 'index.html';
	},
	update:function () {
		if (!this.current) {
			this.redirect();
		} else {
			this.counter.text(--this.current);
		}
	}
};