var yyyy = new Date().getFullYear();
var mm = new Date().getMonth() + 1;
var dd = new Date().getDate();
if(mm < 10 && mm > 0)
	mm = '0' + mm;
var cur_date = yyyy + '-' + mm + '-' + dd;

$(document).ready(function () {
	$('#calFront').jCal({
		day:		new Date( (new Date()).setMonth( (new Date()).getMonth() ) ),
		ml:			['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
		dow:		['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],
		dCheck:		function (day) {
				res = cur_date.split("-");
				if (day.getFullYear() == res[0] && (day.getMonth()+1) == res[1] && day.getDate() == res[2]) return false;
				return true;
			},
		callback:	function (day, days) {
				t_day = day.getDate();
				t_month = (day.getMonth()+1);
				if (t_month < 10) t_month = '0' + t_month;
				if (t_day < 10) t_day = '0' + t_day;
				location.href = calendar_front_url + '/archive/' + day.getFullYear() + '-' + t_month + '-' + t_day;
				return true;
			}
		});
});
