function show_menu()
{
	$('#left_menu_show').toggle('fast');
	$('#our-goods-bottom2').toggle();
	$('#our-goods-bottom').toggle();
}

$(function(){
	var hEls = document.getElementsByTagName("LI");
	for (var i=0, len=hEls.length; i<len; i++) {
		hEls[i].onmouseover=function() { this.className+=" jshover"; }
		hEls[i].onmouseout=function() { this.className=this.className.replace(" jshover", ""); }
	}

	$('#left_menu_hide').click(function(){
		//show_menu();
		//return false;
	});
	$('#sidebar-hypermarkets-list a.level_one').click(function () {
		$(this).siblings().toggle();
		return false;
	});
	$('#sidebar-hypermarkets-list-active').parent().parent().show().parent().addClass('hypermarket-active');
	$('#our-hypermarkets a.city').click(function(){
		$(this).parent().toggleClass('hypermarket-active');
		$(this).parent().find('ul').toggle('fast');
		return false;
	});
	$('#our-hypermarkets2 a.city').click(function(){
		$(this).parent().toggleClass('hypermarket-active');
		$(this).parent().find('ul').toggle('fast');
		if($(this).parent().find('ul li').length>0)
			return false;
		else
			return true;
	});
});
function complite()
{
	$(".TB_closeWindowButton").click(tb_remove);
	$('.form-error').html('');
	$('.sendnewsSubscribe').submit(function(){
		$.ajax({type: 'POST',url: '/emails/subscribe/',
			data: {'email':$(this).find('#email').val()},
			success: function(data){
				if (!data.success)
				{
					$('.form-error').html(data.msg);
				}
				else
				{
					$('.form-error').html('Ваш Email добавлен к рассылке');
					setTimeout(function(){
						tb_remove();
						$('.form-error').html('');
					},2000);
				}
			},
			dataType: 'json'
		});
		return false;
	});
}

