function SetTime(time)
{
	setCookie('time', time, 1, '/');


	var s = document.location.href.replace('http://' + document.domain, '').split('/');
	var module = s[s.length-1];
	if (module == ''){
		module = s[s.length-2];
	}

	if ( module != 'news' && module != 'exhibitions' ){
		if ( document.location.href.indexOf('/news') != -1 ){
			document.location.href = '/' + s[1] + '/news';
		}
		else if ( document.location.href.indexOf('/exhibitions') != -1 ){
			document.location.href = '/' + s[1] + '/exhibitions';
		}
		else {
			document.location.href = document.location.href = '/' + s[1] + '/exhibitions';
		}
	}
	else {
		document.location.reload();
	}
}
function GetCalendar(year, month)
{
	var data = {};
	year ? data['year'] = year : data['year'] = $('#year option:selected').attr('value');
	month ? data['month'] = month : data['month'] = $('#month option:selected').attr('value');;
	var data_string = JSON.stringify(data);
	$.post(window.location+'/', {func: 'GetCalendar', data: data_string}, GetCalendarResult, 'json');
}
function GetCalendarResult(result)
{
	$('#calendar').html(result);
}
