//JAVA

var DayNam = new Array('Воскресенье','Понедельник','Вторник','Среда','Четверг','Пятница','Суббота');
var MnthNam = new Array('Января','Февраля','Марта','Апреля','Мая','Июня','Июля','Августа','Сентября','Октября','Ноября','Декабря');

function theme_Engine() {
	this.cookievalue = '';
	this.basedir = false;
};

theme_Engine.prototype = {
	init : function(settings) {
		this.settings = settings;
		this.basedir = this.settings['basedir'];
	},
	tick : function() {
		var hours,minutes,seconds,ap,intHours,intMinutes,intSeconds,today;
		today = new Date();
		intDay = today.getDay();
		intDate = today.getDate();
		intMonth = today.getMonth();
		intYear = today.getYear();
		intHours = today.getHours();
		intMinutes = today.getMinutes();
		intSeconds = today.getSeconds();
		timeString = DayNam[intDay]+', '+intDate;
		if (intDate == 1 || intDate == 21 || intDate == 31) {
			timeString= timeString + ' ';
		} else if (intDate == 2 || intDate == 22) {
			timeString= timeString + ' ';
		} else if (intDate == 3 || intDate == 23) {
			timeString= timeString + ' ';
		} else {
			timeString = timeString + ' ';
		} 
		if (intYear < 2000){
			intYear += 1900;
		}
		timeString = timeString+' '+MnthNam[intMonth]+' '+intYear+' года';
		if (intHours == 0) {
			hours = '00:';
			ap = '';
		} else if (intHours < 12) { 
			hours = intHours+':';
			ap = '';
		} else if (intHours == 12) {
			hours = '12:';
			ap = '';
		} else {
			intHours = intHours
			hours = intHours + ':';
			ap = '';
		}
		if (intMinutes < 10) {
			minutes = '0'+intMinutes;
		} else {
			minutes = intMinutes;
		}
		if (intSeconds < 10) {
			seconds = ':0'+intSeconds;
		} else {
			seconds = ':'+intSeconds;
		}
		timeString = document.all ? timeString+', '+hours+minutes+seconds+' '+ap : timeString+', '+hours+minutes+seconds+' '+ap;
		var clock = document.all ? document.all('Clock') : document.getElementById('Clock');
  		clock.innerHTML = timeString;
	  	(document.all) ? window.setTimeout(theme_Engine.prototype.tick, 1000) : window.setTimeout(theme_Engine.prototype.tick, 1000);
	}
};

var theme = new theme_Engine;