function onLoadFEvents()
{
	s = "<select name='years' id='el_F_years' onChange='updateMonth(this.value)';>"
	t = 1
	for (i in month){
		s += '<option value=\''+i+'\'>'+i+'</option>'
		if (t == 1) 
			t = i
	}
	s += "</select>"	
	document.getElementById('el_F_yearsH').innerHTML = s
	updateMonth(t)
	return false
}

function updateMonth(key)
{
	s = "<select name='month' id='el_F_month' onChange='OnChangeMonth();'>"
	for (i in month[key]) {	
		s += '<option value=\''+i+'\'>'+month[key][i]+'</option>'
	}
	s += '</select>'	
	document.getElementById('el_F_monthH').innerHTML = s
	document.getElementById('el_F_month').options[0].selected = true
	OnChangeMonth()
	return false
}

function OnChangeMonth()
{
	y = document.getElementById('el_F_years').value
	m = document.getElementById('el_F_month').value
	if (m<=9)
		div_id = y+'_0'+m
	else
		div_id = y+'_'+m
	//d = document.getElementById(div_id)
	document.getElementById(div_id).style.display = 'block';
	if (document.getElementById('cur_div').value != '') {
		cur_div_id = document.getElementById('cur_div').value
		document.getElementById(cur_div_id).style.display = 'none'
	}
	document.getElementById('cur_div').value = div_id
	return false;			
}

function ShowSocialEvent(id)
{
	url = "show_social_event.php?event_id="+id;
	eval("window.open(url, 'showSocialEvent"+id+"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=300');");
}

function ShowEventsByDate(year, month, day)
{
	if (day < 10)
		d = year+"-"+month+"-0"+day
	else
		d = year+"-"+month+"-"+day
	url = "show_social_event.php?date="+d;
	eval("window.open(url, 'showSocialEvent"+day+"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=300');");
}
