Timer = function(obj){
	$.extend(this, obj);
	
	this.date = new Date()
	this.updateTimer();
	this.start();
};

Timer.prototype = {
	timestamp : 60,
	date : null,
	elm :null,
	samay : null,
	sep : ':',
	zone : 0,
	callback: null,
	showOnWindowTitle: false,
	changeUrl: false,
	start : function()
	{
		var th = this;
		this.samay = setInterval(function(){th.doCountDown();},1000);
	},
	doCountDown : function()
	{
		this.timestamp++;
		this.updateTimer();
	},
	updateTimer :  function()
	{
		this.date.setTime(this.timestamp * 1000);
		//var offset = this.date.getTimezoneOffset();
		var offset = 0;
		var hours = this.date.getHours() + offset / 60 + this.zone;
		var min = this.date.getMinutes() + offset % 60;
		var secs = this.date.getSeconds();
		hours = (hours < 10 ? '0'+hours : hours);
		min = (min < 10 ? '0'+min : min);
		secs = (secs < 10 ? '0'+secs : secs);
		//(this.elm).innerHTML = hours +(this.sep)+ min +(this.sep)+ secs;
		(this.elm).innerHTML = hours +(this.sep)+ min;
	},
	setZone: function(zone)
	{
		this.zone = zone*1;
		this.updateTimer();
	}
	
};
