jQuery.fn.log = function (msg) {console.log("%s: %o", msg, this); 	return this;}
log = function (msg, obj) {console.log("%s: %o", msg, obj);}
var calendar = false;
$(document).ready(function(){




	$(".cal-lnk").click(function(){
		$("#calendar").toggle();

		if(!calendar)
		{
			$('#calendar').jCal({
				dow:			['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],		// days of week - change this to reflect your dayOffset
				ml:				['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
				ms:				['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],

				day:			new Date( (new Date()).setMonth( (new Date()).getMonth() ) ),
				days:			1,
				showMonths:		1,
				monthSelect:	true,
				sDate:			new Date(),

				dCheck:			function (day) {
					return (day.getDay() != 7);
				},
				callback:		function (day, days) {
					document.location = "/archive/?date="+ day.getDate() + '.' + ( day.getMonth() + 1 ) + '.' + day.getFullYear();
					return true;
				}
			});
			calendar = true;
		}

	});

});
