
/*******************************************
*	JavaScript Functions Module for
*	www.optima-finance.ru company site
*	Copyright (C) 2005 Optima-Finance LTD
*	support@optima-finance.ru
*	version 1.2a 30.10.2006
********************************************/
/*	Electro Clock AJAX-input script
/*******************************************/

function getCurrentTime() {        
	var now = new Date();
	document.timeform.ChonggingTime.value = GetStrTime(480);
	document.timeform.DetroitTime.value = GetStrTime(-240);
	setTimeout('getCurrentTime()', 1000);
}

function GetStrTime(Delta) {
	var now = new Date();
	var h = now.getHours();
	var m = now.getMinutes();
	var s = now.getSeconds();
	var of = now.getTimezoneOffset();
	m += of + Delta;
	h += Math.round((m-30)/60);
	m %= 60;
	if (m<0) m += 60;
	h %= 24;
	if (h<0) h+=24;
	if (m<10) m = '0' + m;
	if (s<10) s = '0' + s;
	var str = h + ':' + m + ':' + s;
	return str;
}
