/* file: https://fm-preview.cnbc.com/applications/cnbc.com/resources/files/2016/09/07/slide-fix.js?vn=1473270928*/
$(window).load(function(){
	var resizeTimer;
	if (typeof myCarousel_carouselWrapper === 'object'){
		fixSlide(myCarousel_carouselWrapper)
	} else if (typeof myCarousel_tray_1 === 'object' || typeof myCarousel_tab_0 === 'object') {
		multiTray('.carousel_asset');
		$(window).on('resize',function(){
			clearTimeout(resizeTimer);
			resizeTimer = setTimeout(function(){
				multiTray('.carousel_asset')
			},60)
		})
	}
	function fixSlide(carouselObject){
		if (typeof carouselObject === 'object'){
			carouselObject.itemWidth = carouselObject.itemWidth - 1;
			CNBC_Carousel3.Objs.push(carouselObject);
		}
	}
	function multiTray(el){
		$(el).each(function(){
			var idMatch = $(this).attr('id');
			if (idMatch.match(/tray/) || idMatch.match(/latest/) || idMatch.match(/tab/)){
				var cObject = 'myCarousel_'+idMatch;
				fixSlide(window[cObject]);
			}
		});	
	}
});
