(function(a){function b(b,c){var d=a.extend({},{banner_width:"",banner_height:"",image_sprite:"//images.grelots.net/fmslideshow_assets/sprite.png",image_background:"",image_topShadow:"",image_bottomShadow:"",image_loader:"//images.grelots.net/fmslideshow_assets/loader_img.png",background_fullScreen:false,background_move:false,background_moveDistance:1250,dotButtons:true,button_next_previous:true,thumbnails_align:"BC",thumbnails_spacing:"0,0",buttons_type:0,buttons_autoHide:false,buttons_align:"BC",buttons_spacing:"15,0",button_nextPrevious_type:0,button_nextPrevious_autoHide:true,button_next_align:"RC",button_next_spacing:"20,0",button_previous_align:"LC",button_previous_spacing:"20,0",slideShow:true,slideShow_delayTime:1,slideShow_loop:true,slideShowAutoStop:true,thumb_next_preious_width:38,default_data_align:"LC",default_data_spacing:"70,0",default_data_inOutDirection:"LR",default_data_inOutDistance:"60",desktop_drag:true,changeBackgroundColor:false},c);var e=a.browser.msie&&parseInt(a.browser.version,10)==8?true:false;var f=a.browser.msie&&parseInt(a.browser.version,10)==7?true:false;var g=a.browser.msie&&parseInt(a.browser.version,10)==6?true:false;var h=a(b);var i;a(h.children()).each(function(){if(a(this).attr("id")=="fmslideshow"){i=a(this);i.removeAttr("id")}});i.removeClass();i.css({width:"100%",top:"0px",position:"relative",overflow:"hidden","background-color":"#f0f"});a(i.children()).wrapAll("
");var j=a(i.children());j.attr("id","fmslideshow");var k=d.image_sprite;var l=0;var m=0;var n=d.banner_width;var o=0;var p=0;var q=0;var r=0;var s=false;var t=false;var u=false;var v=[];var w=[];var x=400;var y=500;var z=200;var A=200;var B=100;var C=d.background_moveDistance;var D=d.background_move;var E="easeOutSine";var F="easeInQuad";var G="easeInOutQuad";var I=d.desktop_drag;var J=[];var K=0;var L=0;var M=-1;var N;var O;var P;var Q=[];var R;var S=d.slideShow;var T=S;var U=Number(d.slideShow_delayTime)*2500;var V=d.slideShowAutoStop;var X=[];var Y;var Z=Number(d.buttons_type)?Number(d.buttons_type)>0&&Number(d.buttons_type)<3?Number(d.buttons_type):0:0;var _=Z==0?24:Z==1?22:25;var ba=Z==0?24:Z==1?30:44;var bb=Z==0?0:Z==1?39:80;var bc=Z==1?15:Z==2?7:0;var bd;var be;var bf=d.slideShow_loop;var bg=Number(d.button_nextPrevious_type)?Number(d.button_nextPrevious_type):0;var bh=false;var bi=[];var bj=bg==2?36:bg==0?29:40;var bk=bg==2?0:bg==0?43:80;var bl=d.buttons_align.toUpperCase();var bm=d.buttons_spacing.split(",");var bn=d.button_next_align.toUpperCase();var bo=d.button_next_spacing.split(",");var bp=d.button_previous_align.toUpperCase();var bq=d.button_previous_spacing.split(",");var br=d.button_nextPrevious_autoHide||d.buttons_autoHide;var bs=d.button_next_previous?d.button_nextPrevious_autoHide:d.button_next_previous;var bt=[];var bu=d.dotButtons?d.buttons_autoHide:false;var bv;var bw=d.image_loader;var bx=d.changeBackgroundColor;var by;var bz=[];if("ontouchstart"in document.documentElement){bu=bs=false}if(g){var bA=k.split(".");k=bA[0]+"_ie6.gif"}var bB=[];var bC=-1;var bD=[];a("").appendTo(h);h.css({"background-position":"0px 0px",visibility:"hidden"});if(d.banner_height!=""){j.css({height:d.banner_height})}j.css({position:"relative",margin:"0 auto",visibility:"hidden"});a(j.children()).each(function(){bC=bC+1;w[bC]=[];bB[bC]=false;v[bC]=a(this);if(bx){bz[bC]=String(v[bC].attr("data-backgroundColor"))!="undefined"?v[bC].attr("data-backgroundColor"):h.css("background-color")}bi[bC]="";if(v[bC].attr("data-thumb")){bi[bC]=v[bC].attr("data-thumb");v[bC].removeAttr("data-thumb");bh=true}X[bC]=isNaN(v[bC].attr("data-slideDelayTime"))?U:Number(v[bC].attr("data-slideDelayTime"))*2500;var b=-1;a(this).children().each(function(){var c=a(this);b=b+1;if(c.get(0).nodeName.toUpperCase()=="A"){c=c.children()}c.wrap("");c.css({position:"absolute"});if(c.attr("data-align")){c.parent().data("data-align",c.attr("data-align").toUpperCase())}else{c.parent().data("data-align",d.default_data_align.toUpperCase());c.removeAttr("data-align")}if(c.attr("data-spacing")){c.parent().data("spacingObj",c.attr("data-spacing"))}else{c.parent().data("spacingObj",d.default_data_spacing);c.removeAttr("data-spacing")}if(c.attr("data-inOutDirection")){c.parent().data("inOutDirection",c.attr("data-inOutDirection").toUpperCase())}else{c.parent().data("inOutDirection",d.default_data_inOutDirection.toUpperCase());c.removeAttr("data-inOutDirection")}if(c.attr("data-inOutDirection")){c.parent().data("inOutDistance",c.attr("data-inOutDistance"))}else{c.parent().data("inOutDistance",d.default_data_inOutDistance);c.removeAttr("data-inOutDistance")}if(c.attr("data-startTime")){c.parent().data("startTime",Number(A)*Number(c.attr("data-startTime")))}else{c.parent().data("startTime",A*b);c.removeAttr("data-startTime")}if(c.attr("data-stayTime")){c.parent().data("endTime",Number(A)*Number(c.attr("data-stayTime")))}else{c.parent().data("endTime","undefined");c.removeAttr("data-stayTime")}if(c.attr("data-easeIn")){c.parent().data("easeIn",c.attr("data-easeIn"))}else{c.parent().data("easeIn",E);c.removeAttr("data-easeIn")}if(c.attr("data-easeOut")){c.parent().data("easeOut",c.attr("data-easeOut"))}else{c.parent().data("easeOut",F);c.removeAttr("data-easeOut")}if(c.attr("data-animationSpeed")){c.parent().data("speed",c.attr("data-animationSpeed"))}else{c.parent().data("speed",x);c.removeAttr("data-animationSpeed")}c.find(".video").each(function(){c.parent().data("video",this);a(this).remove()});if(c.children().length>1){var e;var f=false;var h;c.children().each(function(){h=a(this);if(h.attr("id")=="bg"){e=h;f=true}else{if(f){h.css({position:"relative"})}}});if(f){if(!g){e.css({width:"100%",height:"100%",position:"absolute"})}else{e.css({width:"100%",height:h.height()+12+"px",position:"absolute"})}}}if(c.html()==""){c.parent().data("img-src",c.attr("src"));c.attr("src","");c.parent().css({overflow:"hidden","background-repeat":"no-repeat",position:"absolute",visibility:"hidden"});c.parent().append("");w[bC][b]=c.parent()}else{c.parent().css({width:c.width(),height:c.height(),position:"absolute"})}w[bC][b]=c.parent();if(c.html()==""){c.remove()}w[bC][b].css({visibility:"hidden"})})});j.find(".nonDraggable").bind("mousedown",function(a){cL=false;a.stopImmediatePropagation()});if(!this.hasTouch){if(I){h.addClass("fm_drag-cursor");j.children().find("a").bind("click",function(a){if(!cL){a.preventDefault();return false}})}}else{j.children().find("a").each(function(){var b=a(this);b.attr("href","#");b.bind("click",{aLink:b.attr("href"),aTarget:b.attr("target")},function(a){a.preventDefault();if(!cL){return false}else{if(!a.data.aTarget||a.data.aTarget.toLowerCase()=="_self"){window.location.href=a.data.aLink}else{window.open(a.data.aLink)}}})})}a(j.children()).wrapAll("");var bE=a(j.children());bE.css({position:"absolute",left:"0px",visibility:"visible",width:"100%",height:j.height()+"px"});if(f||g){h.prepend("");bE=h.children(":first-child");bE.css({position:"absolute",left:"0px",visibility:"visible"})}if(bx){h.prepend("");by=h.children(":first-child");by.css({position:"absolute",visibility:"visible",width:"100%",height:"100%","background-color":bz[0]});by.css({opacity:0})}if(!d.background_fullScreen){h.css({width:n+"px"})}if(d.image_background!=""){J.push(d.image_background)}if(d.image_topShadow!=""){J.push(d.image_topShadow)}if(d.image_bottomShadow!=""){J.push(d.image_bottomShadow)}if(bw!=""){J.push(bw)}J.push(k);var bF=0;var bG=0;var bH=function(){if(K");b.hide();b.bind("load",function(){if(J[K]==d.image_topShadow){bF=b.height()}if(J[K]==d.image_bottomShadow){bG=b.height()}if(J[K]==k){l=b.width();m=b.height()}a(this).remove();K++;bH()}).error(function(){a(this).remove();K++;bH()});j.append(b);b.attr("src",J[K])}else{h.css({visibility:"hidden"});h.css({display:"none"});h.prepend("");N=h.children(":first-child");N.css({width:"100%",height:bF+"px","z-index":1,position:"absolute",top:"0px",left:"0px","background-repeat":"repeat-x"});h.prepend("");O=h.children(":first-child");O.css({width:"100%",height:bG+"px","z-index":2,position:"absolute",bottom:"0px",left:"0px","background-repeat":"repeat-x"});if(g){O.css({bottom:-bG+"px"})}if(d.image_background!=""){h.css({"background-image":"url("+d.image_background+")","background-position":"0px"})}if(d.image_topShadow!=""){N.css({"background-image":"url("+d.image_topShadow+")"})}if(d.image_bottomShadow!=""){O.css({"background-image":"url("+d.image_bottomShadow+")"})}h.css({visibility:"visible"});h.fadeIn(x);bI();cA(_,ba,v.length);bO();if(bh){cx()}var c;a(window).resize(function(){clearInterval(c);c=setInterval(function(){clearInterval(c);bJ()},200)})}};var bI=function(){if((h.css("width")=="0px"||h.css("width")=="auto")&&n==0){n=parseInt(h.css("width"))}if(n>a(window).width()){j.css("width","100%")}else{j.css("width",n+"px")}if(!t){t=true;if(parseInt(j.css("height"))==0){s=true;j.css("height",a(window).height()+"px")}}var b=w.length;for(var c=0;c");P=h.children(":first-child");P.css({position:"absolute","z-index":2});P.append("");R=a(P.children(":first-child"));P.css({display:"none"});j.prepend("");bv=j.children(":first-child");bv.css({position:"absolute",height:"18px","z-index":b+6,visibility:"visible",display:"none"});bv.prepend("");var e=bv.children(":first-child");e.css({position:"absolute",width:"22px",height:"18px",overflow:"hidden"});e.prepend("");var f=e.children(":first-child");f.css({position:"absolute",width:"22px",height:"200px",top:"0px",left:"0px"});if(a.browser.msie){f.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bw+", sizingMethod='noscale')"})}else{f.css({"background-image":"url("+bw+")"})}cl(bv,"C",[0,-11],parseInt(j.width())-parseInt(bv.width()),parseInt(i.height())-parseInt(bv.height()));bv.fadeIn(500);bK(f)};var bJ=function(){if(s){if(n>a(window).width()){j.css("width","100%");bE.css("width","100%")}else{j.css("width",n+"px");bE.css("width",n+"px")}}if(u){P.css({left:Math.round((parseInt(j.width())-parseInt(P.width()))/2)+"px"})}for(var b=0;b=w[L].length){M=0;bB[L]=true;L++}if(L==1&&M==0){bv.fadeOut(300);j.css({display:"show"});for(var a=0;a");d.hide();d.bind("load",function(){b.css({width:d.width()+"px",height:d.height()+"px"});c.css({width:d.width()+"px",height:d.height()+"px"});if(a.browser.msie){c.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+b.data("img-src")+", sizingMethod='noscale')"})}else{c.css({"background-image":"url("+b.data("img-src")+")"})}a(this).remove();bP=true}).error(function(){b.css({width:d.width()+"px",height:d.height()+"px"});c.css({width:d.width()+"px",height:d.height()+"px"});a(this).remove();bP=true});j.append(d);d.attr("src",b.data("img-src"))}else{bP=true}bQ=setInterval(function(){bR()},20)};var bT=function(b,c){for(var d=0;db){h.animate({"background-position-x":"+=1000"+"px"},{queue:false,duration:C,easing:G})}else{h.animate({"background-position-x":"-=1000"+"px"},{queue:false,duration:C,easing:G})}}else{if(q>b){h.animate({"background-position":"+=1000"+"px"},{queue:false,duration:C,easing:G})}else{h.animate({"background-position":"-=1000"+"px"},{queue:false,duration:C,easing:G})}}}else{h.animate({"background-position":"-="+cI*1e3+""+"px"},{queue:false,duration:C,easing:G})}cI=0}q=b;if(bE.css("opacity")==1){for(var g=0;g=w[o].length){bW()}}}}}else{p=w[o].length;cc(w[o].length-1,0)}}};var bU=function(b,c){var d=a(w[b][c]);var e=a(w[b][c-1]);d.css({left:"auto",right:"auto",top:"auto",bottom:"auto"});var f=String(d.data("data-align"));var g=[];g[0]=g[1]=0;if(String(d.data("spacingObj"))!="undefined"){g=d.data("spacingObj").split(",");g[0]=isNaN(g[0])?0:g[0];g[1]=isNaN(g[1])?0:g[1]}d.show();cl(d,f,g,parseInt(j.width())-parseInt(d.width()),parseInt(j.height())-parseInt(d.height()));if(d.children(":first-child").text()!=""){d.children(":first-child").css({position:""})}if(d.data("data-align")==e.data("data-align")){if(d.children(":first-child").html()!=""){if(f.substring(0,1)=="B"){d.css({bottom:Number(e.data("pB"))-Number(d.height())-Number(g[0])+"px"})}else{if(!isNaN(e.height())){if(f=="LC"||f=="RC"){d.css({top:Number(e.data("pT"))+Number(e.height())+Number(g[1])+"px"})}else{d.css({top:Number(e.data("pT"))+Number(e.height())+Number(g[0])+"px"})}}}}else{if(d.children(":first-child").html()==""){if(f.substring(0,1)=="L"){d.css({left:Number(e.data("pL"))+Number(e.width())+Number(g[0])+"px"})}else{d.css({right:Number(e.data("pR"))-Number(d.width())-Number(g[0])+"px"})}}}}if(d.children(":first-child").html()!=""){d.data({pT:parseInt(d.css("top"))});d.data({pB:parseInt(d.css("bottom"))})}if(d.children(":first-child").html()==""){d.data({pL:parseInt(d.css("left"))});d.data({pR:parseInt(d.css("right"))})}};var bV=function(b,c){var d=a(w[o][b]);var f=isNaN(d.data("inOutDistance"))?50:Number(d.data("inOutDistance"));var g=String(d.data("inOutDirection"));var h=0;if(c&&d.text()!=""&&!d.data("cufon")&&typeof Cufon!="undefined"){d.data("cufon",true);d.css({visibility:"visible"});d.show();Cufon.replace(d.find(".cufon_fm"));d.hide()}bU(o,b);if(c){if(d.data("video")){d.prepend(d.data("video"))}v[o].css({visibility:"visible",display:"show"});if(g.substring(0,1)=="T"||g.substring(0,1)=="B"){if(d.css("top")!="auto"){h=parseInt(d.css("top"));if(g.substring(0,1)=="T"){d.css({top:h-Number(f)+"px"})}else{d.css({top:h+Number(f)+"px"})}d.animate({top:h+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeIn")})}else{h=parseInt(d.css("bottom"));if(g.substring(0,1)=="T"){d.css({bottom:h+Number(f)+"px"})}else{d.css({bottom:h-Number(f)+"px"})}d.animate({bottom:h+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeIn")})}}h=0;if(g.substring(0,1)=="L"||g.substring(0,1)=="R"){if(d.css("left")!="auto"){h=parseInt(d.css("left"));if(g.substring(0,1)=="L"){d.css({left:h-Number(f)+"px"})}else{d.css({left:h+Number(f)+"px"})}d.animate({left:h+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeIn")})}else{h=parseInt(d.css("right"));if(g.substring(0,1)=="R"){d.css({right:h-Number(f)+"px"})}else{d.css({right:h+Number(f)+"px"})}d.animate({right:h+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeIn")})}}if(!e||d.text()==""){d.css({display:"none"});d.css({visibility:"visible"});d.fadeIn(i)}else{d.css({display:"show"});d.css({visibility:"hidden"});cB(d.get(0))}if(o!=q){if(r>=w[o].length){r=0;o=q;bT(o,false)}}else{if(d.data("endTime")!="undefined"&&!ca){cc(b,d.data("endTime"))}else{r++}bX()}}else{if(g.substring(1,2)=="T"||g.substring(1,2)=="B"){if(d.css("top")!="auto"){h=parseInt(d.css("top"));if(g.substring(1,2)=="T"){d.animate({top:h-Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}else{d.animate({top:h+Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}}else{h=parseInt(d.css("bottom"));if(g.substring(1,2)=="T"){d.animate({bottom:h+Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}else{d.animate({bottom:h-Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}}}if(g.substring(1,2)=="L"||g.substring(1,2)=="R"){if(d.css("left")!="auto"){h=parseInt(d.css("left"));if(g.substring(1,2)=="L"){d.animate({left:h-Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}else{d.animate({left:h+Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}}else{h=parseInt(d.css("right"));if(g.substring(1,2)=="R"){d.animate({right:h-Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}else{d.animate({right:h+Number(f)+"px"},{queue:false,duration:Number(d.data("speed")),easing:d.data("easeOut")})}}}var i=!e||d.text()==""?z:300;d.fadeOut(i,function(){d.css({display:"show"});d.css({visibility:"hidden"});p++;if(p>=w[o].length&&(o!=q||ca)){bW()}});if(d.data("endTime")!="undefined"&&!ca){r++;bX()}}};var bW=function(){p=0;o=q;for(var a=0;a=w[o].length){if(T){Y=setInterval(function(){cg()},X[o])}}};var bY=[];var bZ=[];var b$;var b_=0;var ca=false;var cb=function(b){var c=a(w[o][b]);clearInterval(bY[b]);bY[b]=setInterval(function(){cd(b)},c.data("startTime"))};var cc=function(a,b){clearInterval(bZ[a]);bZ[a]=setInterval(function(){ce(a)},b)};var cd=function(a){clearInterval(bY[a]);bV(a,true)};var ce=function(a){clearInterval(bZ[a]);bV(a,false)};var cf=function(){clearInterval(Y);if(bB[b_]){if(o!=b_||w.length==1){r=0;clearInterval(b$);j.find(".video").each(function(){a(this).remove()});bT(b_,false);if(bv){bv.fadeOut(300)}}}if(!bB[b_]){if(bv){bv.fadeIn(300)}}};var cg=function(){if(b_0){ci(Number(b_)-1)}else{if(bf){ci(w.length-1)}else{bE.stop();bE.animate({left:"0px"})}}};var ci=function(a){ca=true;Q[b_].css({"background-position":0+"px "+ -bb+"px"});b_=a;Q[b_].css({"background-position":-(_*2)+"px "+ -bb+"px"});bd.data("hid",false);be.data("hid",false);bd.css({cursor:"pointer"});be.css({cursor:"pointer"});if(!(Number(b_)>w.length-2&&Number(b_)<1)&&!T||!bs){bd.fadeTo("fast",1);be.fadeTo("fast",1)}if(!bf){if(b_>w.length-2){bd.children(":first-child").css({right:0+"px ",bottom:-bk+"px"});bd.data("hid",true);bd.css({cursor:"auto"});if(!T||!bs){bd.fadeTo("fast",.2);be.fadeTo("fast",1)}}if(b_<1){be.data("hid",true);be.children(":first-child").css({left:0+"px ",bottom:-bk+"px"});be.css({cursor:"auto"});if(!T||!bs){be.fadeTo("fast",.2);bd.fadeTo("fast",1)}}}if(bh){cn[q].children(":first-child").children(":last-child").removeClass("tint-over");cn[q].children(":first-child").children(":last-child").addClass("tint-normal");cn[b_].children(":first-child").children(":last-child").removeClass("tint-normal");cn[b_].children(":first-child").children(":last-child").addClass("tint-over");cn[q].removeClass("thumb-over");cn[q].addClass("thumb-normal");cn[b_].removeClass("thumb-normal");cn[b_].addClass("thumb-over");if(!cv){co.data("pos",-parseInt(cn[b_].css("left"))+Math.floor(ct/2)*(cq+cr));cz(cp.data("rBtnTh"),true);cz(cp.data("lBtnTh"),true);if(co.data("pos")>-1){cz(cp.data("lBtnTh"),false);co.data("pos",0)}if(co.data("pos")<-(co.width()-cp.width())+(cq+cr)){cz(cp.data("rBtnTh"),false)}if(co.data("pos")<-(co.width()-cp.width())){co.data("pos",-(co.width()-cp.width()))}cw=500;co.stop();co.animate({left:co.data("pos")+"px"},{queue:false,duration:cw,easing:"easeInOutQuad"})}}clearInterval(Y);b$=setInterval(function(){cf()},27)};var cj=function(){clearInterval(Y);if(!d.dotButtons){P.css({visibility:"hidden"});R.css({visibility:"hidden"})}else{if(!bu){if(a.browser.msie){P.show()}else{P.fadeIn()}}}if(!d.button_next_previous){rightBt.css({visibility:"hidden"});leftBt.css({visibility:"hidden"})}else{if(!bs){if(a.browser.msie){bd.show()}else{bd.fadeIn()}}}if(S||br){h.bind("mouseover mouseleave",function(a){ck(String(a.type))})}if(!d.dotButtons){P.css({visibility:"hidden"})}};var ck=function(b){if(b=="mouseover"){if(S&&V){T=false;clearInterval(Y)}if(br){if(a.browser.msie){P.fadeIn(100)}for(var c=0;cg){h=W/g;i=H/g}else{h=W/f;i=H/f}}if(String(d)=="0"){if(f>g){h=W/f;i=H/f}else{h=W/g;i=H/g}}a.attr({width:Math.round(h)});a.attr({height:Math.round(i)});if(e){a.css({"margin-left":Math.round((b-h)/2)+"px"});a.css({"margin-top":Math.round((c-i)/2)+"px"})}};var cn=[];var co;var cp;var cq;var cr;var cs=Number(d.thumb_next_preious_width);var ct=0;var cu;var cv=false;var cw=820;var cx=function(){h.prepend('');cu=h.children(":first-child");cu.prepend('');cp=cu.children(":first-child");cp.prepend('');co=cp.children(":first-child");cu.bind("mousedown",function(a){cL=false;a.stopImmediatePropagation();cv=true;return false});cu.bind("mouseover",function(b){a(this).css({cursor:"auto"})});var b=[];for(var c=0;c ');cn[c]=co.children(":first-child");var f=co.children(":first-child").children(":first-child");f.children(":first-child").css({width:f.width()+"px"});f.children(":first-child").css({height:f.height()+"px"});f.css({cursor:"pointer"});cy(f,c);if(c!=0){var g=co.children(":first-child");g.css({left:parseInt(e.css("margin-right"))+parseInt(e.css("left"))+parseInt(e.css("padding-right"))*2+e.width()+"px"})}b[c]=a("");b[c].hide();b[c].bind("load",function(){cm(a(this),a(this).parent().width(),a(this).parent().height(),1,true);a(this).fadeIn()}).error(function(){});f.append('');f.children(":first-child").append(b[c]);b[c].attr("src",bi[c])}cq=cn[0].width()+parseInt(cn[0].css("padding-right"))*2;cr=bi.length>1?parseInt(cn[0].css("margin-right")):0;co.data("pos",0);cn[0].children(":first-child").children(":last-child").addClass("tint-over");cn[0].addClass("thumb-over");co.css({height:g.height()+parseInt(g.css("padding-top"))+parseInt(g.css("padding-bottom"))+"px"});cp.css({height:g.height()+parseInt(g.css("padding-top"))+parseInt(g.css("padding-bottom"))+"px"});cu.css({height:g.height()+parseInt(g.css("padding-top"))+parseInt(g.css("padding-bottom"))+"px"});var i=(cq+cr)*bi.length-cr;if(parseInt(cu.css("width"))==0||parseInt(cu.css("width"))==h.width()){if(i>cu.width()){co.css({width:i+"px"});cp.css({width:Math.round(parseInt(cu.css("width"))-cs*2)+"px"})}}else{cp.css({width:Math.round(parseInt(cu.css("width"))-cs*2)+"px"});co.css({width:i+"px"})}co.css({left:"0px"});cp.css({left:cs+"px"});var j=[];j[0]=j[1]=0;if(String(d.thumbnails_spacing)!="undefined"){j=String(d.thumbnails_spacing).split(",");j[0]=isNaN(j[0])?0:j[0];j[1]=isNaN(j[1])?0:j[1]}cl(cu,d.thumbnails_align.toUpperCase(),j,h.width()-cu.width(),h.height()-cu.height());cu.prepend("");var n=cu.children(":first-child");n.css({width:cs+"px",height:cp.height()+"px",position:"absolute","z-index":"2",visibility:"visible",overflow:"hidden",cursor:"pointer"});n.prepend("");var o=n.children(":first-child");o.css({position:"absolute",visibility:"visible",width:l+"px",height:m+"px",right:"0px",top:Math.round((cp.height()-50)/2)+"px"});if(a.browser.msie){o.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+k+", sizingMethod='noscale')"})}else{o.css({"background-image":"url("+k+")"})}n.css({left:parseInt(cp.css("left"))+cp.width()+"px"});cu.prepend("");var p=cu.children(":first-child");p.css({width:cs+"px",height:cp.height()+"px",position:"absolute","z-index":"3",visibility:"visible",overflow:"hidden",cursor:"auto"});p.prepend("");var q=p.children(":first-child");q.css({position:"absolute",visibility:"visible",width:l+"px",height:m+"px",right:"-36px",top:Math.round((cp.height()-50)/2)+"px"});if(a.browser.msie){q.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+k+", sizingMethod='noscale')"})}else{q.css({"background-image":"url("+k+")"})}p.css({left:"0px"});n.addClass("thumb-next-previous-normal");n.data({nam:"rBtnTh",act:true});if(!bf){p.addClass("thumb-next-previous-over");p.data({nam:"lBtnTh",act:false})}else{p.data({nam:"lBtnTh",act:true});p.addClass("thumb-next-previous-normal")}cy(n,0);cy(p,0);cp.data({rBtnTh:n,lBtnTh:p});ct=Math.floor(cp.width()/(cq+cr)+.1)};var cy=function(b,c){b.bind("mouseover mouseup mouseleave",{no:c},function(c){if(S&&V){clearInterval(Y)}c.preventDefault();var d=a(this);if(b.data("nam")=="rBtnTh"||b.data("nam")=="lBtnTh"){if(b.data("act")){b.css({cursor:"pointer"});d.removeClass();d.addClass("thumb-next-previous-over")}}else{if(b_!=c.data.no){d.children(":last-child").removeClass("tint-normal");d.children(":last-child").addClass("tint-over");d.parent().removeClass("thumb-normal");d.parent().addClass("thumb-over")}}});b.bind("mouseout",{no:c},function(c){c.preventDefault();var d=a(this);if(b.data("nam")=="rBtnTh"||b.data("nam")=="lBtnTh"){if(b.data("act")){b.css({cursor:"pointer"});d.removeClass();d.addClass("thumb-next-previous-normal")}}else{if(b_!=c.data.no){d.children(":last-child").removeClass("tint-over");d.children(":last-child").addClass("tint-normal");d.parent().removeClass("thumb-over");d.parent().addClass("thumb-normal")}}});b.bind("click",{no:c},function(a){cv=true;if(S&&V){clearInterval(Y)}if(!cp.data("lBtnTh").data("act")){cz(cp.data("lBtnTh"),true)}if(!cp.data("rBtnTh").data("act")){cz(cp.data("rBtnTh"),true)}a.preventDefault();if(b.data("nam")=="rBtnTh"||b.data("nam")=="lBtnTh"){if(b.data("nam")=="rBtnTh"){if(b.data("act")){if(!bf){co.data("pos",co.data("pos")-ct*(cq+cr))}else{if(co.data("pos")<=-(co.width()-cp.width())){co.data("pos",0)}else{co.data("pos",co.data("pos")-ct*(cq+cr))}}}}else{if(b.data("act")){if(!bf){co.data("pos",co.data("pos")+ct*(cq+cr))}else{if(co.data("pos")>-1){co.data("pos",-(co.width()-cp.width()))}else{co.data("pos",co.data("pos")+ct*(cq+cr))}}}}cw=820}else{if(b_!=a.data.no){if(co.data("pos")+parseInt(cn[a.data.no].css("left"))<=cr){cw=500;co.data("pos",co.data("pos")+(cq+cr))}if(cp.width()-(co.data("pos")+parseInt(cn[a.data.no].css("left"))+cq)<=cr){cw=500;co.data("pos",co.data("pos")-(cq+cr))}ci(Number(a.data.no))}}if(co.data("pos")>-1){cz(cp.data("lBtnTh"),false);co.data("pos",0)}if(co.data("pos")<-(co.width()-cp.width())+(cq+cr)){cz(cp.data("rBtnTh"),false)}if(co.data("pos")<-(co.width()-cp.width())){co.data("pos",-(co.width()-cp.width()))}co.stop();co.animate({left:co.data("pos")+"px"},{queue:false,duration:cw,easing:"easeInOutQuad"})});b.bind("mousedown",{no:c},function(c){cL=false;c.stopImmediatePropagation();var d=a(this);if(b.data("nam")=="rBtnTh"&&b.data("act")){d.removeClass();d.addClass("thumb-next-previous-normal")}if(b.data("nam")=="lBtnTh"&&b.data("act")){d.removeClass();d.addClass("thumb-next-previous-normal")}return false});b.bind("mouseup",{no:c},function(c){cL=false;c.stopImmediatePropagation();var d=a(this);if(b.data("nam")=="rBtnTh"&&b.data("act")){d.removeClass();d.addClass("thumb-next-previous-over")}if(b.data("nam")=="lBtnTh"&&b.data("act")){d.removeClass();d.addClass("thumb-next-previous-over")}return false})};var cz=function(a,b){if(!bf||b){a.data("act",b);a.removeClass();if(b){a.addClass("thumb-next-previous-normal");a.data("act",true);a.css({cursor:"pointer"})}else{a.css({cursor:"auto"});a.data("act",false);a.addClass("thumb-next-previous-over")}}};var cA=function(b,c,d){R.css({top:"0px",left:"0"});R.prepend("");R.children(":first-child").css({width:bc+"px",height:ba+1+"px","background-image":"url("+k+")",position:"absolute",top:"0px",left:"0","background-repeat":"no-repeat"});if(Z==1){R.children(":first-child").css({"background-position":-65+"px "+ -bb+"px",left:"0px"})}if(Z==2){R.children(":first-child").css({"background-position":-77+"px "+ -bb+"px",left:"0px"})}for(var e=0;e");R.children(":last-child").css({left:(b-1)*e+bc+"px",position:"absolute",width:b-1,height:c,top:"0px",cursor:"pointer","background-image":"url("+k+")","background-position":"0px "+ -bb+"px"});Q[e]=R.children(":last-child");Q[e].data("nam",e);if(Z==2){Q[e].append("");Q[e].children(":last-child").text(e+1);Q[e].css({"padding-top":Q[e].height()/2-2+"px"})}Q[e].addClass("buttonText");cC(Q[e]);R.css({height:c+"px"})}R.prepend("");R.children(":first-child").css({width:bc+"px",height:ba+1+"px",left:(b-1)*e+bc+"px","background-image":"url("+k+")",position:"absolute","background-repeat":"no-repeat"});if(Z==1){R.children(":first-child").css({"background-position":-87+"px "+ -bb+"px"})}if(Z==2){R.children(":first-child").css({"background-position":-103+"px "+ -bb+"px"})}R.css({visibility:"visible"});P.css({width:parseInt(b*e)+bc*2+"px"});cl(P,bl,bm,parseInt(i.width())-parseInt(P.width()),parseInt(i.height())-parseInt(P.height()));R.fadeTo("fast",1);Q[0].css({"background-position":-(_*2)+"px "+ -bb+"px"});h.prepend("");bd=h.children(":first-child");bd.css({width:bj+"px",height:bj+"px",position:"absolute","z-index":w.length+2,visibility:"visible",overflow:"hidden",cursor:"pointer"});bd.prepend("");rightBt=bd.children(":first-child");rightBt.css({position:"absolute",visibility:"visible",width:l+"px",height:m+"px",right:"0px",bottom:-bk+"px"});if(a.browser.msie){rightBt.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+k+", sizingMethod='noscale')"})}else{rightBt.css({"background-image":"url("+k+")"})}bd.data({nam:"rBtn",hid:false});cC(bd);bd.show();cl(bd,bn,bo,parseInt(i.width())-parseInt(bd.width()),parseInt(j.height())-parseInt(bd.height()));h.prepend("");be=h.children(":first-child");be.css({position:"absolute",width:bj-1+"px",height:bj+"px","z-index":w.length+3,visibility:"visible",overflow:"hidden",cursor:"pointer"});be.prepend("");leftBt=be.children(":first-child");leftBt.css({position:"absolute",width:l+"px",height:m+"px",visibility:"visible",left:"0px",bottom:-bk+"px"});if(a.browser.msie){leftBt.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+k+", sizingMethod='noscale')"})}else{leftBt.css({"background-image":"url("+k+")"})}be.data({nam:"lBtn",hid:false});cC(be);bd.hide();be.hide();leftBt.fadeTo("fast",1);rightBt.fadeTo("fast",1);if(!bf){be.css({cursor:"auto"});be.data("hid",true)}cl(be,bp,bq,parseInt(i.width())-parseInt(be.width()),parseInt(j.height())-parseInt(be.height()));if(bs){bt=[be,bd]}if(!a.browser.msie){if(bu){bt.push(P)}}};var cB=function(a){a.style.filter="blendTrans(duration=.2)";if(a.filters.blendTrans.status!=2){a.filters.blendTrans.apply();a.style.visibility="visible";a.filters.blendTrans.play()}};var cC=function(a){a.bind("mouseover mouseup mouseleave",function(){if(S&&V){clearInterval(Y)}if(a.data("nam")!="rBtn"&&a.data("nam")!="lBtn"){if(b_!=a.data("nam")){a.css({"background-position":-_+"px "+ -bb+"px"})}}else{if(!a.data("hid")){if(a.data("nam")=="rBtn"){a.children(":first-child").css({right:-bj+"px ",bottom:-bk+"px"})}else{a.children(":first-child").css({left:-bj+"px ",bottom:-bk+"px"})}}}return false});a.bind("mouseout",function(){if(a.data("nam")!="rBtn"&&a.data("nam")!="lBtn"){if(b_!=a.data("nam")){a.css({"background-position":"0px "+ -bb+"px"})}}else{if(!a.data("hid")){if(a.data("nam")=="rBtn"){a.children(":first-child").css({right:0+"px ",bottom:-bk+"px"})}else{a.children(":first-child").css({left:0+"px ",bottom:-bk+"px"})}}}});a.bind("mousedown",function(){if(S&&V){clearInterval(Y)}if(a.data("nam")!="rBtn"&&a.data("nam")!="lBtn"){if(b_!=a.data("nam")){a.css({"background-position":-(_*2)+"px "+ -bb+"px"})}}else{if(!a.data("hid")){if(a.data("nam")=="rBtn"){a.children(":first-child").css({right:-bj*2+"px ",bottom:-bk+"px"})}else{a.children(":first-child").css({left:-bj*2+"px ",bottom:-bk+"px"})}}}return false});a.bind("click",function(){cv=false;if(S&&V){clearInterval(Y)}if(a.data("nam")!="rBtn"&&a.data("nam")!="lBtn"){if(b_!=a.data("nam")){ci(Number(a.data("nam")))}}else{if(a.data("nam")=="rBtn"){if(b_0){a.children(":first-child").css({left:-bj+"px ",bottom:-bk+"px"})}ch()}}return false})};var cD;var cE=[];var cF;var cG=false;var cH=0;var cI=0;var cJ=function(){if(cO!=cP){cL=true;cv=false}bE.stop();cD=Math.round(Math.abs(Number(cP)-Number(cO)))<101?Math.round(Math.abs(Number(cP)-Number(cO))):Math.round(100+Math.abs(100-Math.abs(Number(cP)-Number(cO)))*.2);if(Number(cP)>Number(cO)){bE.css({left:Number(cD)+"px"});if(a.browser.msie){h.css({"background-position-x":cH+cD+"px"})}else{h.css({"background-position":cH+cD+"px"})}}else{bE.css({left:-Number(cD)+"px"});if(a.browser.msie){h.css({"background-position-x":cH-cD+"px"})}else{h.css({"background-position":cH-cD+"px"})}}};var cK=function(){if(Number(cO)!=Number(cP)){if(Number(cO)>Number(cP)){if((Number(cO)-Number(cP)>50||cF>5)&&!cG){bE.stop();if(!a.browser.msie){bE.animate({left:Number(-cD-j.width()*.36)+"px",opacity:0},300)}else{bE.animate({left:Number(-cD-j.width()*.36)+"px"},300)}cI=1;cg()}else{bE.stop();bE.animate({left:"0px"})}}else{if((Number(cP)-Number(cO)>50||cF>5)&&!cG){bE.stop();if(!a.browser.msie){bE.animate({left:Number(cD+j.width()*.36)+"px",opacity:0},300)}else{bE.animate({left:Number(cD+j.width()*.36)+"px"},300)}cI=-1;ch()}else{bE.stop();bE.animate({left:"0px"})}}}cD=0};var cL=false;var cM=function(){a(document).bind("mousedown.fmDragEvent",function(b){cO=cP=Math.abs(b.clientX);cE=[];cE.push(cO);h.stop();if(a.browser.msie){cH=parseInt(h.css("background-position-x"))}else{cH=parseInt(h.css("background-position"))}a(document).bind("mousemove.fmDragEvent",function(a){cG=cP>Math.abs(a.clientX)?Number(cO)>Number(cP)?false:true:Number(cO)Math.abs(a.targetTouches[0].clientX)?Number(cO)>Number(cP)?false:true:Number(cO)