function DTHour (h) {
	if (h == "0") {
		h = "12";
	}
	return h;
}

function DTZeroFill (z) {
	if (z > "9") {
		return z;
	}
	return '0' + z;
}

function DynamicTime () {
	res = document.getElementById('DynamicTimeB');
	if (res) {
		now = new Date;
		res.innerHTML = DTHour(now.getHours()) + ':' + DTZeroFill(now.getMinutes()) + ':' + DTZeroFill(now.getSeconds());
		setTimeout("DynamicTime()",1000)
	}
}

function DoDate () {
	res = document.getElementById('DateB');
	if (res) {
	
	now = new Date;
	
	weekday=new Array(7);
	weekday[0]="Воскресенье, "; weekday[1]="Понедельник, "; weekday[2]="Вторник, "; weekday[3]="Среда, ";
	weekday[4]="Четверг, "; weekday[5]="Пятница, "; weekday[6]="Суббота, ";
	
	mon=new Array(12);
	mon[0]="января"; mon[1]="февраля"; mon[2]="марта"; mon[3]="апреля"; mon[4]="майя"; mon[5]="июня";
	mon[6]="июля"; mon[7]="августа"; mon[8]="сентября"; mon[9]="октября"; mon[10]="ноября"; mon[11]="декабря";

	res.innerHTML = weekday[now.getDay()] + now.getDate() + ' ' + mon[now.getMonth()] + ' 2010  ';
	}
}
