$(function(){
	/* Блок новостей на главной странице */
	$(".top_news li").hover(
		function () {
			// неведение
			$(".top_news li").removeClass("current");
			$(this).addClass("current");
			id = $(this).attr('id');
			num = id.replace(/topnews(\d+)/gi, '$1');
			if ($("#newsimage"+num).css('display') == 'none'){
				$(".news_image").fadeOut("fast");
				setTimeout(function(){$("#newsimage"+num).fadeIn("slow");},300);
			}
		},
		function(){
			// отведение
		}
	);
	/* Всплывающее меню элемента главного меню */
	$("ul.nav_main").superfish({ 
				        animation: {height:'show'},   // slide-down effect without fade-in 
				        delay:     600                // second delay on mouseout 
				    });
	/* внешние ссылки -> <a> с аттрибутом rel=external и rel=_blank */
	$("a[rel=external], a[rel=_blank]").attr('target', '_blank');
	/* Добавление классов для полей форм */
	$("input:checkbox").addClass("icheckbox");
	$("input:radio").addClass("iradio");
	$("input:text, input:password, textarea").addClass("itext");
	$("input:button, input:submit, input:reset").addClass("ibutton");
	
	var boxlinks = $("div.boxlink"); 
	$(boxlinks).mouseenter(function(){$(this).addClass("hover");$(this).find("h4").addClass("hover");})
				.mouseleave(function(){$(this).removeClass("hover");$(this).find("h4").removeClass("hover");});
	//$(boxlinks).tooltip({ track: true, delay: 700, fixPNG: true, opacity: 0.95 });
});

function goLink(link){
	location.href = link;
};


