// Jquery READY
$(document).ready(function(){
 
// выравнивание блоков новостей
function setEqualHeight(columns) {
	var tallestcolumn = 0;
	columns.each(
	function()	{
		currentHeight = $(this).height();
		if(currentHeight > tallestcolumn){
			tallestcolumn = currentHeight;
			}
	}
	);
	columns.height(tallestcolumn);
}

// выезжалка логина
$("#loginopen").click(function(){

		$("#loginlinks b").toggle();
		$("#loginform").animate({width:'toggle'});
    });


// главное меню
$("#mainmenu a.mlink").hover(function(){  
		$("a.mlink").removeClass("active");
		$(this).addClass("active");
		$(".submenu").hide();
		$(this).siblings(".submenu").show();
		
		
    });
// раскрывалка для заголовков H2	
$("h2.butt").click(function(){
		$(this).next(".h2content").slideToggle("fast");
		$(this).toggleClass("closed");
    });
// детали прогнозов
$(".pro_header").click(function(){
		$(this).next().find(".pro_details").slideToggle("fast");
		$(this).toggleClass("active");
    });
	
	
// ссылки "показать все описания"
$(".show_all").click(function(){
		$(this).parent().find(".pro_details").show();
		$(this).parent().find(".pro_header").addClass("active");
    });

// ссылки "скрыть все описания"
$(".hide_all").click(function(){
		$(this).parent().find(".pro_details").hide();
		$(this).parent().find(".pro_header").removeClass("active");		
    });

// показывает скрытые новости
$(".small_news").hover(function(){
		$(this).find(".late").slideToggle("fast");						
    });

// прячем логин
$("#loginform").hide();
// прячем все детали прогнозов
$(".pro_details").hide();
$("#prognoz1").show();
// показываем подменю активного раздела
$(".active").next(".submenu").show();
// прячем часть новостей
$(".late").hide();

$(".closed").next(".h2content").hide();

// делаем блоки новостей на главной странице одинаковой высотой
setEqualHeight($(".news"));		
		

 });      

