$(function() {
	$('.button_right_sidebar').click(function() {
		var second_class = $('.button_right_sidebar').attr('class').split(' ')[1];
		if (second_class == 'right_menu') {
			$('.right_sidebar_hide').toggleClass('right_sidebar_show right_sidebar_hide');
			$('.right_sidebar').toggleClass('right_sidebar_show right_sidebar');
			$('.content').toggleClass('content_right_hide content');
			$('.right_menu').toggleClass('close_menu right_menu');
			$('.left_sidebar_show').toggleClass('left_sidebar_show left_sidebar');
			$('.button_left_sidebar.close_menu').toggleClass('close_menu left_menu');
			$('.content_left_hide').toggleClass('content_left_hide content_right_hide');
			$('.left_sidebar').toggleClass('left_sidebar_hide left_sidebar');
		}
		else {
			$('.right_sidebar_show').toggleClass('right_sidebar_show right_sidebar');
			$('.content_right_hide').toggleClass('content_right_hide content');
			$('.button_right_sidebar.close_menu').toggleClass('close_menu right_menu');
			$('.left_sidebar_hide').toggleClass('left_sidebar_hide left_sidebar');
		}
		$('.right_sidebar, .content, .right_sidebar') .theiaStickySidebar({additionalMarginTop: jQuery('header').outerHeight(), additionalMarginBottom: 0});
	});
});
$(window).resize(function () {
if (window.matchMedia('(min-width: 960px)').matches) {
	$('.right_sidebar_show').removeClass('right_sidebar_show').addClass('right_sidebar');
	$('.right_sidebar_hide').removeClass('right_sidebar_hide').addClass('right_sidebar');
	$('.left_sidebar_hide').removeClass('left_sidebar_hide').addClass('left_sidebar');
	$('.content_right_hide').removeClass('content_right_hide').addClass('content');
	$('.button_right_sidebar.close_menu').removeClass('close_menu').addClass('right_menu');
}
});