$(document).ready(function(){
	
	$('.main-menu a').hover(
		function(){
			$(this).parent('li').addClass('active').prev('li').not('.current').addClass('prev-active');
		},
		function(){
			$(this).parent('li').removeClass('active').prev('li').removeClass('prev-active');
	});
	$('.main-menu li:last-child').addClass('last');
	$('.main-menu li.current').prev('li').addClass('prev-current');
	
	$('.news, .right-bar .block-item').hover(
		function(){
			$(this).addClass('news-hover');
		},
		function(){
			$(this).removeClass('news-hover');
		}
	);
	
	$('.news, .block-item').blocklink();
	
});
(function($){
	
	$.fn.blocklink = function(){
		this.each(function(){
			var elem = $(this);
			elem.css({cursor:'pointer'}).click(function(){
				window.location = elem.find('a:first').attr('href');
			});
		});
		return this;
	}
	
})(jQuery);
