function brand_scroll(direction, obj) {
	if (!jQuery) return false;
	var step = 19;
	$ = jQuery;
	var $b_brands = $(obj).parent();
	var $ul = $b_brands.find('.b-brands__i UL');
	var offset = parseInt($ul.css('margin-top'));
	var newoffset = offset-direction*step;
	if (newoffset>=0) {
		newoffset = 0;
		$b_brands.find('I.t').hide();
		$b_brands.find('.ctrlup').addClass('inactive');
		
	} else {
		$b_brands.find('I.t').show();
		$b_brands.find('.ctrlup').removeClass('inactive');
	}
	if (newoffset<=-$ul.height()+178) {
		$b_brands.find('I.b').hide();
		$b_brands.find('.ctrldown').addClass('inactive');
	} else {
		$b_brands.find('I.b').show();
		$b_brands.find('.ctrldown').removeClass('inactive');
	}
	if (newoffset<=-$ul.height()+170) {
		newoffset = offset;
	}
	$ul.css('margin-top', newoffset+'px');
}

function brand_switch(open, obj) {
	if (!jQuery) return false;
	var $ = jQuery;
	$obj = $(obj);
	if (open) {
		$('#menuScrollOpened').show();
		$('.menuList3 .butUp, .menuList3 .butDown').show();
		$('#menuScrollClosed').hide();
		$obj.parent().find('A').removeClass('menuList3LinkActive').addClass('menuList3Link');
	} else {
		$('#menuScrollOpened').hide();
		$('.menuList3 .butUp, .menuList3 .butDown').hide();
		$('#menuScrollClosed').show();
		$obj.parent().parent().find('A').removeClass('menuList3LinkActive').addClass('menuList3Link');
	}
	$obj.removeClass('menuList3Link').addClass('menuList3LinkActive');
}
