function reloadMonth()
{
	year = $('year').value;
	$('month').options.length = 0;
	count = eval('date_arr_' + year + '.length');
	for (var i=0; i<count; i++)
	{
// 		new Option("text", "value", isDefaultSelected, isSelected);
		$('month').options.length++;
		$('month').options[i].value = eval('date_arr_' + year + '[' + i + ']');
		$('month').options[i].text = eval('date_arr_' + year + '[' + i + ']');
		$('month').options[i].disabled =  eval('hide_arr_' + year + '[' + i + ']');
		if (sel_mon == i)
		{
			a = i - 1;
			$('month').options[a].selected = true;
		}
	}
	setSubmtBttn();
}

function setSubmtBttn()
{
	selInd = $('month').selectedIndex;
	if ($('month').options[selInd].disabled == true)
	{// заблокировать
		$('arhSubmit').disabled = true;
	}
	else
	{// разблокировать
		$('arhSubmit').disabled = false;
	}
}

function loadFullNews(id, controller)
{
// 	var mySlider = new Fx.Slide('news_border_' + id);
	// изменить стиль
	$('news_content_' + id).style.color = '#000000';
	$('news_content_' + id).style.backgroundColor = '#e6e6e6';
	$('news_border_' + id).style.backgroundColor = '#e6e6e6';
// 	$('news_content_' + id).innerHTML = 'Загружаю...';
	
// 	alert('/' + controller + '/show/id/' + id + '/get/full');
	var myAjax = new Ajax.Updater('news_content_' + id, '/' + controller + '/show/id/' + id + '/get/full', {method: 'post', parameters: ''}); 
// 	mySlider.toggle();
// 	alert('/' + controller + '/show/id/' + id + '/get/full');
// 	return false; 
}

function showFull(id)
{
	// find alredy opened news
// 	alert(elem[0]);
	for (i=0; i<elem.length; i++)
	{
// 		alert('full_news_' + elem[i]);
// 		alert(eval('news_full_' + elem[i] + '.el.offsetHeight'));
		if (eval('news_full_' + elem[i] + '.el.offsetHeight') > 0)
		{
			eval('news_full_' + elem[i] + '.toggle();');
			$('short_news_' + elem[i]).style.display = 'inline';
// 			$('full_news_' + elem[i]).style.display = 'none';
			
			$('news_content_' + elem[i]).style.color = '#4d4d4d';
			$('news_content_' + elem[i]).style.backgroundColor = '#ffffff';
			$('news_border_' + elem[i]).style.backgroundColor = '#ffffff';
		}
	}
	
	
	$('news_content_' + id).style.color = '#000000';
	$('news_content_' + id).style.backgroundColor = '#e6e6e6';
	$('news_border_' + id).style.backgroundColor = '#e6e6e6';
	$('news_border_' + id).style.height = '100%';
	$('short_news_' + id).style.display = 'none';
// 	
	eval('news_full_' + id + '.hide();');
	$('full_news_' + id).style.display = 'block';
	eval('news_full_' + id + '.toggle();'); 
// 	$('full_news_' + id).style.display = 'inline';
}

function  showForm()
{
	// block default choice
	var sel_chapter = $('humor_chapter');
	if (sel_chapter.value != '')
	{
		$('humor_default').disabled = true;
	}
	
	for (var i = 1; i <= 3; i++)
	{
		if (sel_chapter.value == i)
		{
			$('humor_chapter_' + i).style.display = 'block';
			$('humor_submit').disabled = false;
		}
		else
		{
			$('humor_chapter_' + i).style.display = 'none';
		}
	}
}

function checkVoteFrm(id, i)
{
	if ($('vote_' + id + '_' + i + '').value != '')
	{
		$('vote_frm_' + id).submit();
	}
}
