function SetCalendar(date_str)
{
	date=date_str.split('&');
	monthArr=date[0].split('=');
	yearArr=date[1].split('=');
	region=date[2].split('=');
   	url='/soulex/components/calendar/calendar_template.php?month='+monthArr[1]+'&year='+yearArr[1]+'&region='+region[1];

		do_request_function = function()
		{
			//----------------------------------
			// Ignore unless we're ready to go
			//----------------------------------
			
			if ( ! xmlobj.readystate_ready_and_ok() )
			{
				return;
			}
			
			//----------------------------------
			// INIT
			//----------------------------------
			var dynamic_content = document.getElementById('calendar_container');
			var html = xmlobj.xmlhandler.responseText;
			dynamic_content.innerHTML = html;
			
			
		}
		xmlobj = new ajax_request();
		xmlobj.onreadystatechange( do_request_function );
		xmlobj.process( url );

}

function SetDate() {
	var m = document.getElementById('month_select');
	var y = document.getElementById('year_select');
	m_val = m.options[m.selectedIndex].value;
	m_val++;
	y_val = y.options[y.selectedIndex].value;
	url = '/soulex/components/calendar/tools.php?month='+m_val+'&year='+y_val;
		do_request_function = function()
		{
			//----------------------------------
			// Ignore unless we're ready to go
			//----------------------------------
			
			if ( ! xmlobj.readystate_ready_and_ok() )
			{
				return;
			}
			
			//----------------------------------
			// INIT
			//----------------------------------
			var days = document.getElementById('day_select');
			var html = xmlobj.xmlhandler.responseText;
			days.outerHTML = html;
			
			
		}
		xmlobj = new ajax_request();
		xmlobj.onreadystatechange( do_request_function );
		xmlobj.process( url );	
}

function LookForDate() {
	var m = document.getElementById('month_select');
	var y = document.getElementById('year_select');
	var d = document.getElementById('day_select');

	m_val = parseInt(m.options[m.selectedIndex].value)+1;
	y_val = y.options[y.selectedIndex].value;
	d_val = d.options[d.selectedIndex].value;

	document.location.href = '/news/'+y_val+'/'+m_val+'/'+d_val+'/';

}

function SetCalendarExt(prefix, date_str)
{
	date=date_str.split('&');
	monthArr=date[0].split('=');
	yearArr=date[1].split('=');
   	url='/soulex/components/calendar.'+prefix+'/calendar_template.php?month='+monthArr[1]+'&year='+yearArr[1];

		do_request_function = function()
		{
			//----------------------------------
			// Ignore unless we're ready to go
			//----------------------------------
			
			if ( ! xmlobj.readystate_ready_and_ok() )
			{
				return;
			}
			
			//----------------------------------
			// INIT
			//----------------------------------
			var dynamic_content = document.getElementById(prefix+'calendar_container');
			var html = xmlobj.xmlhandler.responseText;

			dynamic_content.innerHTML = html;
			
			
		}
		xmlobj = new ajax_request();
		xmlobj.onreadystatechange( do_request_function );
		xmlobj.process( url );

}