$(function(){
	var $bslider = $('.b-slider');
	$bslider.each(function(){
		if ($(this).find('.m-wrap a').length == 1) {
			$(this).find('.m-wrap a').css({position:'absolute', top:'1px', right:0});
		} else {
			var w = 0;
			$(this).find('.m-wrap a').each(function(){
				w = w + $(this).width();
			});
			if (w > 984) {
				$(this).find('.m-wrap').scrollingCarousel({looped:false});
			} else {
				$(this).find('ul').css({position:'absolute', top:'1px', right:0});
			}
		}
		
		$(this).mouseenter(function(){
			$(this).find('.m-top').stop(true,true).animate({top:-56}, 500);
			$(this).find('.m-rules').stop(true,true).fadeOut(500);
		}).mouseleave(function(){
			$(this).find('.m-top').stop(true,true).animate({top:0}, 500);
			$(this).find('.m-rules').stop(true,true).fadeIn(500);
		});
		
		$(this).find('.m-wrap a').fadeTo(0, 0.4);
		$(this).find('.m-wrap a').mouseenter(function(){
			$(this).stop(true,true).fadeTo(500, 1);
		}).mouseleave(function(){
			$(this).stop(true,true).fadeTo(500, 0.4);
		});
	});
});
