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 = '#edeef6';
	$('news_border_' + id).style.backgroundColor = '#edeef6';
// 	$('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 = '#cccccc';
			$('news_border_' + elem[i]).style.backgroundColor = '#cccccc';
			
		}
	}
	
	
	$('news_content_' + id).style.color = '#000000';
	$('news_content_' + id).style.backgroundColor = '#edeef6';
	$('news_border_' + id).style.backgroundColor = '#edeef6';
	$('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();'); 
// 	alert('');
	setTimeout('go2mars(' + id + ')',1000)
// 	window.location.href="#news_" + id;
// 	$('full_news_' + id).style.display = 'inline';
}

function go2mars(id)
{
	window.location.href="#news_" + id;
}

