$(function () {    //$('#meta_news_block1641 a').each(function () { $(this).attr('href','http://ubr.ua/goto/?url='+encodeURIComponent($(this).attr('href')))});    //$('#ad_ph_2').each(function () {alert(123)});	$('.glossary').columnize({width:340});        $('#inf_analytics').each(function () {         id = $('#newsId').val();        $('#inf_analytics_' + id).css('display','none');        if ($('#inf_analytics_' + id).length) $('#inf_analytics_4').css('display','');    });

	//var tabContainers = $('div.tabs > div');
	//tabContainers.hide().filter(':first').show();

    $('ul.tabNav li:nth-child(1),ul.tabNav3 li:nth-child(1)').addClass('first');

    $('div.tabs table tr').filter(':even').addClass('even');
    $('.tabl2 tr').filter(':odd').addClass('even');
	$('div.tabs ul.tabNav a,div.tabs ul.tabNav3 a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.tabs ul.tabNav a,div.tabs ul.tabNav3 a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();

	$('#menu ul li a').filter(':last').addClass('last');
	$('#level2 li a:first').addClass('first');
	$("a.last").hover(function () {
        $(this).parents("ul").addClass("hover");
    },
        function () {
		    $(this).parents("ul").removeClass("hover");
		}
	);

	$('#drop2, #dropd2 button').click(function () {
		$("#dropd2").toggle();
	});
	$('#drop').click(function () {
		$("#dropd").toggle();
	});
	$('#enter,.close').click(function () {
		$("#avtoriz,#avtoriz_bg").toggle();
	});
	$('.add_comment').click(function () {
		$(".comment_form").toggle();		if ($(".add_comment").hasClass('rise'))		{		    $(".add_comment").removeClass('rise');		}		else		{		    $(".add_comment").addClass('rise');		}
	});    $('.view_video').click(function () {        if ($(".view_video").hasClass('rise'))        {            $(".view_video").removeClass('rise');            $("#view_video").show();        }        else        {            $(".view_video").addClass('rise');            $("#view_video").hide();        }    });
	$('.more_info, .close2').click(function () {
		$("#info").toggle();
	});		if ($('#expertName').length)	{	    $.getJSON('/ajax/getRandomExpert/', function (data)	            {	                $('.expertBlock').attr('href', '/expert/'+data.abbr);	                $('#expertName').html(data.name);	                $('#expertField').html(data.title);	                $('#expertImage').attr('src', '/files/expert/'+data.id+'.jpg');	                $('#expertBlockLoader').hide();	                $('#expertBlockMain').show();	            }	    );	}
});