var g_featureScroller=new Object();g_featureScroller.m_bInDrag=false;g_featureScroller.m_aDragObjects=null;g_featureScroller.m_aGroupDivs=new Array();g_featureScroller.m_aGroupLocs=new Array();g_featureScroller.m_pScrollArea=null;g_featureScroller.m_iBaseX=0;g_featureScroller.m_iOffsetX=100;g_featureScroller.m_iMaxHandleLeft=400;g_featureScroller.m_iHandleRange=400;g_featureScroller.m_iScrollWidth=400;g_featureScroller.m_iScrollRange=400;g_featureScroller.HandleOnResize=function(){this.m_iBaseX=CyberCoreFindPosX("featurescrollbar");
this.m_iMaxHandleLeft=CyberCoreFindWidth("featurescrollbar")-CyberCoreFindWidth("featuresliderhandle");this.m_iOffsetX=parseInt(CyberCoreFindWidth("featuresliderhandle")/2);this.m_iHandleRange=CyberCoreFindWidth("featurescrollbar")-(this.m_iOffsetX*2);this.m_iScrollRange=this.m_iScrollWidth-CyberCoreFindWidth("featurescrollbar")+12};g_featureScroller.HandleOnMouseDown=function(B){if(!B){B=window.event}var A=B.target!=null?B.target:B.srcElement;document.onmouseup=function(C){g_featureScroller.HandleOnMouseUp(C)
};document.body.focus();document.onselectstart=function(){return false};A.ondragstart=function(){return false};this.m_bInDrag=true;document.onmousemove=function(C){g_featureScroller.HandleOnMouseMove(C)};this.Initialize();B.returnValue=false;return false};g_featureScroller.Initialize=function(){if(g_featureScroller.m_aDragObjects==null){this.m_aDragObjects=new Array(obj("featuresliderhandle"),obj("featuresliderhandlebg"));this.m_pScrollArea=obj("featurescrollcontainer");var B=this.m_pScrollArea.getElementsByTagName("div");
this.m_iScrollWidth=0;for(var A=0;A<B.length;A++){if(HasClass(B[A],"feature")){this.m_iScrollWidth+=CyberCoreFindWidth(B[A]);this.m_iScrollWidth+=10}else{if(HasClass(B[A],"separator")){this.m_aGroupDivs.push(B[A]);this.m_aGroupLocs[B[A].id]=this.m_iScrollWidth}}}this.m_pScrollArea.style.width=this.m_iScrollWidth+"px";this.HandleOnResize();CyberCoreAddEvent(window,"resize",function(){g_featureScroller.HandleOnResize()},false)}};g_featureScroller.HandleOnMouseUp=function(A){if(!A){A=window.event}document.onmouseup=null;
document.onmousemove=null;this.m_bInDrag=false};g_featureScroller.repositionHandle=function(F){F=Math.max(Math.min(F,this.m_iMaxHandleLeft),0);for(var E in g_featureScroller.m_aDragObjects){this.m_aDragObjects[E].style.left=F+"px"}var D=1-((this.m_iHandleRange-F)/this.m_iHandleRange);var C=parseInt(this.m_iScrollRange*D);this.m_pScrollArea.style.left=(-1*C)+"px";for(var E in this.m_aGroupDivs){RemoveClass(this.m_aGroupDivs[E],"active")}var B=1/(this.m_aGroupDivs.length-1);var A=Math.round(D/B);if(A<this.m_aGroupDivs.length){AddClass(this.m_aGroupDivs[A],"active")
}};g_featureScroller.HandleOnMouseMove=function(A){if(this.m_bInDrag){if(!A){A=window.event}var C=GetEventInformation(A);var B=C.iPosX-this.m_iBaseX-this.m_iOffsetX;this.repositionHandle(B)}};g_featureScroller.smoothMove=function(B,A){var C=A.updatePosition();this.repositionHandle(C);if(C!=B){window.setTimeout(function(){g_featureScroller.smoothMove(B,A)},15)}};g_featureScroller.ScrollToGroup=function(D,F,A){this.Initialize();if(this.m_aGroupLocs[F]!=null){var E=CyberCoreFindPosX(A.parentNode)-this.m_iBaseX;
var C=parseInt(this.m_aDragObjects[0].style.left);var B=new SmoothMovement(C,E,-0.5);this.smoothMove(E,B)}D.returnValue=false;return false};