SportsShares.UI.Promo=new function(){var _c=SportsShares.Config.UI.Promo;var _u=SportsShares.Utils;
var _myImages=[];var _assHammer=[];var _getImages=function(index){if(index<=_c.ImageCount){var image=new Image();
image.onload=function(){jQuery(_u.GetCssIdSelector(_c.ProgressNodeId)).progressbar("value",((index/_c.ImageCount)*100));
_myImages.push(image);_getImages(index+1);};image.src=_c.PrimaryPromoImagePath+index+".jpg";
}else{var i=1;do{var index=i%2==0?0:1;var directions=_c.DirectionSets[index];var from=directions[0]+" "+_c.StartZoomLevel+"x";
var to=directions[1]+" "+_c.EndZoomLevel+"x";var img=_myImages[i-1];_assHammer.push({src:img.src,from:from,to:to,time:4});
i++;}while(i<_myImages.length+1);jQuery(_u.GetCssIdSelector(_c.PromoNodeId)).crossSlide({fade:1,shuffle:true},_assHammer);
jQuery(_u.GetCssIdSelector(_c.LoadingNodeId)).fadeOut();}};var _start=function(){jQuery(_u.GetCssIdSelector(_c.ProgressNodeId)).progressbar();
jQuery(_u.GetCssIdSelector(_c.LoadingNodeId)).fadeIn();_getImages(1);};var _animateProgressBar=function(max){var progressBar=jQuery(_u.GetCssIdSelector(_c.ProgressNodeId));
var value=parseInt(progressBar.progressbar("value"));if(value<max){progressBar.progressbar("value",value+1);
}progressBar=null;};return{Start:function(){_start();}};};