$(document).ready(function(){

	$(".top .top_show").click(function(e){

		$(".top .top_back").addClass("show");

		$(".top_back div").show();

		$(this).hide();

		$(".top .top_hide").show();

		

		HideAuthAndMore(e);

		

		return false;

	});	

	

	/*$(".o_s_arrow a").hover(function(){

		$(this).addClass("hover");

		}, function() {

		$(this).removeClass("hover");

	});*/

	

	

	$(".top .top_hide").click(function(){

		$(".top .top_back").removeClass("show");

		$(".top_back div").hide();

		$(this).hide();

		$(".top .top_show").show();

		

		$('#table').unbind('click');

		

		return false;

	});

	

	$(".left_menu li").hover(function(){

		$(this).addClass("hover");

	 }, function() {

		$(this).removeClass("hover");

	});

	$(".left_menu li").click(function(){

		$(".left_menu").find("li.active").removeClass("active");

		$(this).addClass("active");

	});

	$(".main_carusel td").hover(function(){

		$(this).addClass("hover");

	 }, function() {

		$(this).removeClass("hover");

	});

	$(".footer .foot_show").click(function(){

		$(".footer .footer_block_back").addClass("show");

		$(".footer .main_carusel_back").addClass("qwerty");

		$(this).hide();

		$(".footer .foot_hide").show();

		return false;

	});

	$(".footer .foot_hide").click(function(){

		$(".footer .footer_block_back").removeClass("show");

		$(".footer .main_carusel_back").removeClass("qwerty");

		$(this).hide();

		$(".footer .foot_show").show();

		return false;

	});

	$(".filter_selects div a").hover(function(){

		$(this).addClass("hover");

	 }, function() {

		$(this).removeClass("hover");

	});

	$(".footer .foot_tab a").click(function(){

		$(this).toggleClass('otkrep');

		$(".footer .fixed").toggleClass("fix");

		if($(".footer .fixed").hasClass("fix")) {

			var fix = "1";

		} else {

			var fix = "0";

		}

		document.cookie = "termopotok_js_bottom_basket_position=" + fix + "; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";

		return false;

	});

});


function HideAuthAndMore(ev){

	$('#table').bind('click', function(){
		$(".top .top_hide").click();	

		$('.swim_block').hide();
		$('#goBuy').hide();
		$('.block_hide').hide();
		$('.block_show').show();
	});

	

	$('.top, .swim_block , #goBuy').click(function(e){			

		even = e || window.event 			

		if (even.stopPropagation) {				

			even.stopPropagation()

		} else {				

			even.cancelBubble = true

		}						 

	});	

	

	even = ev || window.event 			

	if (even.stopPropagation) {				

		even.stopPropagation()

	} else {				

		even.cancelBubble = true

	}

}
