jQuery.extend(jQuery.easing,{easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a}});var LRCycle=function(b){var d={duration:600};var b=$.extend(d,b);this.options=b;b.LeftBtn=$(b.LeftBtnSel);b.RightBtn=$(b.LeftBtnSel);var c=$(b.ContentSep).length;this.NowContent=0;if((typeof this.options.sepWidth)=="undefined"){this.options.sepWidth=$(b.ContentSep).eq(0).width()}var a=this;this.Show=function(g){a.unbindClick();g=parseInt(g);if(g<0){g=c-2;var f="-"+(g+1)*this.options.sepWidth+"px";$(a.options.Content).css("left",f)}var e=g*this.options.sepWidth;$(a.options.Content).animate({top:0,left:"-"+e+"px"},{duration:a.options.duration,specialEasing:{top:"easeOutExpo"},complete:function(){a.bindClick();if(g>=(c-1)){$(a.options.Content).css("left","0px");a.NowContent=0}}});if(g<0){g=(c-1)}a.NowContent=g};this.next=function(){a.Show(a.NowContent+1)};this.pre=function(){a.Show(a.NowContent-1)};this.bindClick=function(){$(a.options.LeftBtnSel).bind("click",a.pre);$(a.options.RightBtnSel).bind("click",a.next)};this.unbindClick=function(){$(a.options.LeftBtnSel).unbind("click",a.pre);$(a.options.RightBtnSel).unbind("click",a.next)};this.bindClick()};var Cycle=function(m){var e={};var m=$.extend(e,m);var g=$(m.MainPicSel).length;var f=1;var l=0;var b=5000;var h=300;function a(){f=parseInt(f);var q=1+f;if(q>g){q=1}if(l==0){l=1;k();return}else{var p=$(m.MainPicSel+"["+m.GroupAttrName+"='"+q+"']").parents("a:first");var o=f;var n=q;$(m.MainPicSel+"["+m.GroupAttrName+"='"+o+"']").parents("a:first").fadeOut("fast",function(){p.fadeIn("fast");j(q);if(f>=g){f=1}else{f++}})}k()}function c(n){if(f==n){return}if(n<0||n>g){return false}if(window.lbt){clearTimeout(window.lbt)}window.lbt=setTimeout(function(){d(n)},h)}var d=function(q){var p=$(m.MainPicSel+"["+m.GroupAttrName+"='"+q+"']").parents("a:first");var o=f;var n=q;$(m.MainPicSel+"["+m.GroupAttrName+"='"+o+"']").parents("a:first").fadeOut("fast",function(){p.fadeIn("fast");j(q);f=q})};function j(n){for(i=1;i<=g;i++){$(m.ControlSel+"["+m.GroupAttrName+"='"+i+"']").removeClass("current")}$(m.ControlSel+"["+m.GroupAttrName+"='"+n+"']").addClass("current")}function k(){if(window.lbt){clearTimeout(window.lbt)}window.lbt=setTimeout(function(){a()},b)}a();$(m.ControlSel).each(function(){$(this).mouseover(function(){c($(this).attr("gid"))}).mouseout(function(){k()})})};var TDCycle=function(b){var c={};this.options=$.extend(c,b);var a=this;a.i=0;$(this.options.ControlSel).mouseover(function(){$(a.options.ImgContainerSel).hide();$(this).next(a.options.ImgContainerSel).eq(0).show()})};var TDCycleEffect=function(b){var c={};this.options=$.extend(c,b);var a=this;this.NowImg=$(a.options.ImgContainerSel).eq(0)[0];a.i=0;$(this.options.ControlSel).mouseover(function(){var d=$(this).next(a.options.ImgContainerSel).eq(0)[0];if(d==this.NowImg){return}$(a.NowImg).animate({height:0},{specialEasing:{height:"easeOutExpo"}});$(d).animate({height:"253px"},{specialEasing:{height:"easeOutExpo"}});a.NowImg=d})};$(document).ready(function(){var f=new LRCycle({LeftBtnSel:"#brandlist .bl1",RightBtnSel:"#brandlist .bl3",ContentSep:"#brand_list dl",Content:"#brand_list"});$("#dl0").html($("#dl1").html());});

(function(a){a.fn.jdSlide=function(k){var p=a.extend({width:null,height:null,pics:[],index:0,type:"num",current:"curr",delay1:100,delay2:5000},k||{});var i=this;var g,f,d,h=0,e=true,b=true;var n=p.pics.length;var o=function(){var q="<ul style='position:absolute;top:0;left:0;'><li><a href='"+p.pics[0].href+"' target='_blank'><img src='"+p.pics[0].src+"' width='"+p.width+"' height='"+p.height+"' /></a></li></ul>";i.css({position:"relative"}).html(q);a(function(){c();});};o();var j=function(){var s=[];s.push("<div>");var r;var q;for(var t=0;t<n;t++){r=(t==p.index)?p.current:"";switch(p.type){case"num":q=t+1;break;case"string":q=p.pics[t].alt;break;case"image":q="<img src='"+p.pics[t].breviary+"' />";default:break;}s.push("<span class='");s.push(r);s.push("'><a href='");s.push(p.pics[t].href);s.push("' target='_blank'>");s.push(q);s.push("</a></span>");}s.push("</div>");i.append(s.join(""));i.find("span").bind("mouseover",function(){b=false;clearTimeout(g);clearTimeout(d);var u=i.find("span").index(this);if(p.index==u){return;}else{d=setInterval(function(){if(e){l(u);}},p.delay1);}}).bind("mouseleave",function(){b=true;clearTimeout(g);clearTimeout(d);g=setTimeout(function(){l(p.index+1,true);},p.delay2);});};var l=function(r,q){if(r==n){r=0;}f=setTimeout(function(){i.find("span").eq(p.index).removeClass(p.current);i.find("span").eq(r).addClass(p.current);m(r,q);},20);};var m=function(u,q){var s=parseInt(h);var v=Math.abs(s+p.index*p.height);var t=Math.abs(u-p.index)*p.height;var r=Math.ceil((t-v)/4);if(v==t){clearTimeout(f);if(q){p.index++;if(p.index==n){p.index=0;}}else{p.index=u;}e=true;if(e&&b){clearTimeout(g);g=setTimeout(function(){l(p.index+1,true);},p.delay2);}}else{if(p.index<u){h=s-r;i.find("ul").css({top:h+"px"});}else{h=s+r;i.find("ul").css({top:h+"px"});}e=false;f=setTimeout(function(){m(u,q);},20);}};var c=function(){var q=[];for(var r=1;r<n;r++){q.push("<li><a href='");q.push(p.pics[r].href);q.push("' target='_blank'><img src='");q.push(p.pics[r].src);q.push("' width='");q.push(p.width);q.push("' height='");q.push(p.height);q.push("' /></a></li>");}i.find("ul").append(q.join(""));g=setTimeout(function(){l(p.index+1,true);},p.delay2);if(p.type){j();}};};})(jQuery);
