$(document).ready(function () {

	$('#calFront').jCal({
		day:		new Date( (new Date()).setMonth( (new Date()).getMonth() ) ),
		ml:			['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
		//dow:		['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
		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;
			},
		//days:		1,
		//showMonths:	1,
		//sDate:		new Date(),
		//eDate:		new Date(),
/*		dCheck:		function (day) {
				return (day.getDay() != 6);
			},*/
		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 + '/date/' + day.getFullYear() + '-' + t_month + '-' + t_day;
				return true;
			}
		});
	$('#calAdmin').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_admin_url + '/type/news/date/' + day.getFullYear() + '-' + t_month + '-' + t_day;
				return true;
			}
		});	
	$('#calNewsext').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_newsext_url + '/date/' + day.getFullYear() + '-' + t_month + '-' + t_day;
				return true;
			}
		});	
	$('.dellink').click(function(){
		return confirm('Точно удалить?');
	});
});

