function scbInitialize2(a,b,c,d,e,f,g,h){$(a).scb({displaySlideQty:b,auto:c,autoHover:true,infiniteLoop:d,controls:e,pause:f,speed:g,buttonSpacing:h})}function scbInitialize(a,b,c,d,e,f,g,h,i){var j=parseFloat(f)*1e3;var k=parseFloat(.3)*1e3;if(g!=0){k=parseFloat(g)*1e3}var l=parseFloat(e+10)/2-9;var m=$(b+" li").size();var n=Math.floor((a-22)/(d+8));var o;var p;var q;var r;var s;if(n!=0){if(m<n){r=(a-(22+m*(d+4)))/m}else{r=(a-(22+n*(d+4)))/n}}else{n=1;s=true;r=a-(d+2)}if(a<d+8){$(b).css("visibility","hidden");n=0}var t=parseFloat(d)+r;var u=parseFloat(e)+4;$(b+" li").css({width:t,height:u});$(b+" .scbHighlightInner").css({width:parseFloat(d)+4,height:parseFloat(e)+4});if(m<n+1){n=m;o=false;p=false;q=false}else{o=true;p=true;q=true}if(j==0){o=false}if(s==true){if(m>1){o=true;p=true;if(j==0){j=2e3}}}if(i==false){o=false}scbInitialize2(b,n,o,p,q,j,k,r);$(c+" .scbHighlightInner").addClass("gmvHighlight");$(c+" .scb-bx-next").css("top",l+"px");$(c+" .scb-bx-prev").css("top",l+"px");if(h=="light"){h="0%"}else{h="100%"}$(c+" .scb-bx-prev").css("background-position",h+" 0%");$(c+" .scb-bx-prev").hover(function(){$(c+" .scb-bx-prev").css("background-position",h+" 100%")},function(){$(c+" .scb-bx-prev").css("background-position",h+" 0%")});$(c+" .scb-bx-next").css("background-position",h+" 0%");$(c+" .scb-bx-next").hover(function(){$(c+" .scb-bx-next").css("background-position",h+" 100%")},function(){$(c+" .scb-bx-next").css("background-position",h+" 0%")});$(c+" .bx-window").css({"padding-top":"10px","padding-bottom":"10px","padding-left":2});if(a<d+22+8){$(c+" .scb-bx-prev"+","+c+" .scb-bx-next").css("visibility","hidden")}if(s!=true){$(c+" .bx-window").css("left",11+r/2+n*2-2)}else{$(c+" .bx-window").css("left",r/2+n*2-2)}$(c+" .scb-bx-prev").css("left",0);$(c+" .scb-bx-next").css("left",a-11);$(b+" li .scbImg").attr({width:d,height:e});$(b+" li .scbImg").hover(function(){$(this).parents("li").find(".scbHighlight").css("visibility","visible")},function(){$(this).parents("li").find(".scbHighlight").css("visibility","hidden")});$(c+" .scbArrowRollOverArea").css({height:e+"px",top:-(e/2-13)+"px"})}function GetScrollingButtonImages(a,b,c,d,e,f,g){if(g==undefined){g=true}a="#"+a;var h="#"+$(a).parent().attr("id");$(h).css("height","100%");var i=parseFloat($(h).css("width").split("px").join(""));$(a).addClass("scbInner");$(h+" .scbInner").css("width",i);scbInitialize(i,a,h,b,c,d,e,f,g)}(function(a){a.fn.scb=function(b){function F(b,c,d,e){var f=[];var g=d;var h=false;if(e=="backward"){b=a.makeArray(b);b.reverse()}while(g>0){a.each(b,function(b,d){if(g>0){if(!h){if(b==c){h=true;f.push(a(this).clone());g--}}else{f.push(a(this).clone());g--}}else{return false}})}return f}function E(){var a=h.outerHeight()*b.displaySlideQty;return a}function D(){var a=h.outerWidth()*b.displaySlideQty;return a}function C(b,c){if(c=="left"){var d=a(".pager",g).eq(b).position().left}else if(c=="top"){var d=a(".pager",g).eq(b).position().top}return d}function B(){if(!b.infiniteLoop&&b.hideControlOnEnd){if(p==u){a(".scb-bx-prev",g).hide()}else{a(".scb-bx-prev",g).show()}if(p==v){a(".scb-bx-next",g).hide()}else{a(".scb-bx-next",g).show()}}}function A(){var b=a('<div class="scb-bx-next"><div style="position:relative;"><div class="scbArrowRollOverArea"></div></div></div>');var c=a('<div class="scb-bx-prev"><div style="position:relative;"><div class="scbArrowRollOverArea"></div></div></div>');g.append(c);g.append(b);b.click(function(){d.goToNextSlide();return false});c.click(function(){d.goToPreviousSlide();return false})}function z(){g.find(".bx-window").hover(function(){if(t){d.stopShow(false)}},function(){if(t){d.startShow(false)}});g.find(".scb-bx-prev").hover(function(){if(t){d.stopShow(false)}},function(){if(t){d.startShow(false)}});g.find(".scb-bx-next").hover(function(){if(t){d.stopShow(false)}},function(){if(t){d.startShow(false)}})}function y(){if(b.auto){if(!b.infiniteLoop){if(b.autoDirection=="next"){s=setInterval(function(){p+=b.moveSlideQty;if(p>v){p=p%f.length}d.goToSlide(p,false)},b.pause)}else if(b.autoDirection=="prev"){s=setInterval(function(){p-=b.moveSlideQty;if(p<0){negativeOffset=p%f.length;if(negativeOffset==0){p=0}else{p=f.length+negativeOffset}}d.goToSlide(p,false)},b.pause)}}else{if(b.autoDirection=="next"){s=setInterval(function(){d.goToNextSlide(false)},b.pause)}else if(b.autoDirection=="prev"){s=setInterval(function(){d.goToPreviousSlide(false)},b.pause)}}}}function x(){var c=F(f,0,b.moveSlideQty,"backward");a.each(c,function(b){e.prepend(a(this))});var d=f.length+b.moveSlideQty-1;var g=f.length-b.displaySlideQty;var h=d-g;var i=F(f,0,h,"forward");a.each(i,function(b){e.append(a(this))})}function w(){x(b.startingSlide);e.wrap('<div class="'+b.wrapperClass+'" style="width:'+m+'px; position:relative;"></div>').wrap('<div class="bx-window" style="position:relative; overflow:hidden; width:100%;"></div>').css({width:"99999px",position:"relative",left:"-"+q+"px"});e.children().css({width:i,"float":"left",listStyle:"none"});g=e.parent().parent();f.addClass("pager")}var c={infiniteLoop:true,hideControlOnEnd:false,controls:true,speed:500,auto:false,autoDirection:"next",autoHover:false,pause:3e3,wrapperClass:"scb-bx-wrapper",startingSlide:0,displaySlideQty:1,moveSlideQty:1,buttonSpacing:0};var b=a.extend(c,b);var d=this;var e=a(this);var f=e.children();var g="";var h=e.children(":first");var i=h.width();var j=0;var k=h.outerWidth();var l=0;var m=D()-(b.buttonSpacing-2);var n=E();var o=false;var p=0;var q=0;var r=0;var s="";var t=true;f.each(function(b){if(a(this).outerHeight()>l){l=a(this).outerHeight()}if(a(this).outerWidth()>j){j=a(this).outerWidth()}});p=b.startingSlide;q=k*(b.moveSlideQty+b.startingSlide);r=l*(b.moveSlideQty+b.startingSlide);var u=0;var v=f.length-1;this.goToSlide=function(a,c){if(!o){o=true;p=a;if(typeof c=="undefined"){var c=true}if(c){if(b.auto){d.stopShow(true)}}if(!b.infiniteLoop){if(p>v-b.displaySlideQty){slide=v-b.displaySlideQty+1}else{slide=a}}else{slide=a}e.animate({left:"-"+C(slide,"left")+"px"},b.speed,function(){o=false});B()}};this.goToNextSlide=function(a){if(typeof a=="undefined"){var a=true}if(a){if(b.auto){d.stopShow(true)}}if(!b.infiniteLoop){if(!o){var c=false;p=p+b.moveSlideQty;if(p>=v){p=v}B();d.goToSlide(p)}}else{if(!o){o=true;var c=false;p=p+b.moveSlideQty;if(p>v){p=p%f.length;c=true}var g=b.moveSlideQty*k;e.animate({left:"-="+g+"px"},b.speed,function(){o=false;if(c){e.css("left","-"+C(p,"left")+"px")}})}}};this.goToPreviousSlide=function(c){if(typeof c=="undefined"){var c=true}if(c){if(b.auto){d.stopShow(true)}}if(!b.infiniteLoop){if(!o){var h=false;p=p-b.moveSlideQty;if(p<0){p=0;if(b.hideControlOnEnd){a(".scb-bx-prev",g).hide()}}B();d.goToSlide(p)}}else{if(!o){o=true;var h=false;p=p-b.moveSlideQty;if(p<0){negativeOffset=p%f.length;if(negativeOffset==0){p=0}else{p=f.length+negativeOffset}h=true}var i=b.moveSlideQty*k;e.animate({left:"+="+i+"px"},b.speed,function(){o=false;if(h){e.css("left","-"+C(p,"left")+"px")}})}}};this.goToFirstSlide=function(a){if(typeof a=="undefined"){var a=true}d.goToSlide(u,a)};this.goToLastSlide=function(){if(typeof a=="undefined"){var a=true}d.goToSlide(v,a)};this.getCurrentSlide=function(){return p};this.getSlideCount=function(){return f.length};this.stopShow=function(a){clearInterval(s);if(typeof a=="undefined"){var a=true}};this.startShow=function(a){if(typeof a=="undefined"){var a=true}y()};this.initShow=function(){w();if(b.controls){A()}if(b.auto){d.startShow(true);if(b.autoHover){z()}}B()};this.each(function(){d.initShow()});return this}})(jQuery)
