(function($){jshop.module.UserDefine={};$.extend(jshop.module.UserDefine,jshop.module);$.extend(jshop.module.UserDefine,{sideSlip:function(args){var imgs=$(this).find("img");imgs.each(function(index,n){$(n).attr("src",$(n).attr("original"));$(n).removeAttr("original");$(n).removeClass("J_imgLazyload");});if(args==undefined){if(validateData($(this).attr("module-param"))){var args=eval("("+$(this).attr("module-param")+")");}}var _this=this,param=$.extend({vertical:"top",verticalValue:170,horizontal:"left",horizontalValue:0,zindex:10},args),vertical=param.vertical,verticalValue=param.verticalValue,horizontal=param.horizontal,horizontalValue=param.horizontalValue,zindex=param.zindex;var count=0;for(var i in param){count++;}if(count==5&&vertical=="top"&&verticalValue>=170&&horizontal=="right"){setInterval(function(){verticalValue+=(getTop()+param.verticalValue-verticalValue)/20;$(_this).css({"position":"absolute","top":verticalValue,"right":horizontalValue,"zIndex":zindex});},20);}if(count==5&&vertical=="top"&&verticalValue>=170&&horizontal=="left"){setInterval(function(){verticalValue+=(getTop()+param.verticalValue-verticalValue)/20;$(_this).css({"position":"absolute","top":verticalValue,"left":horizontalValue,"zIndex":zindex});},20);}if(count==5&&vertical=="bottom"&&horizontal=="right"){var a=$(window).height()-$(_this).height()-param.verticalValue,b=a;setInterval(function(){a+=(getTop()+b-a)/20;$(_this).css({"position":"absolute","top":a,"right":horizontalValue,"zIndex":zindex});},20);}if(count==5&&vertical=="bottom"&&horizontal=="left"){var a=$(window).height()-$(_this).height()-param.verticalValue,b=a;setInterval(function(){a+=(getTop()+b-a)/20;$(_this).css({"position":"absolute","top":a,"left":horizontalValue,"zIndex":zindex});},20);}if(count==5&&vertical=="bottom"&&horizontal=="middle"){var a=$(window).height()-$(_this).height()-param.verticalValue,b=a;setInterval(function(){a+=(getTop()+b-a)/20;$(_this).css({"position":"absolute","top":a,"left":horizontalValue,"margin-left":-($(_this).width()/2),"zIndex":zindex}); },20);}function getTop(){return(document.documentElement.scrollTop||document.body.scrollTop||0)-(document.documentElement.clientTop||document.body.clientTop||0);}},addFavorite:function(args){if(args==undefined){if(validateData($(this).attr("module-param"))){var args=eval("("+$(this).attr("module-param")+")");}}var _this=this,param=$.extend({title:"京东商城",url:"http://www.jd.com"},args),title=param.title,url=param.url;$(_this).css("cursor","pointer");$(_this).click(function(e){if(document.all){window.external.AddFavorite(url,title);}else{if(window.sidebar){window.sidebar.addPanel(title,url,"");}else{alert("对不起,您的浏览器不支持此操作!\n请您使用菜单栏或Ctrl+D收藏本站。");}}});},autoCenter:function(args){var _this=$(this),param=$.extend({autoMiddleNode:".userDefinedArea"},args||{}),node=_this.find(param.autoMiddleNode);alignCenter();$(window).resize(function(){alignCenter();});function alignCenter(){var extra=node.width()-_this.width();if(extra>0){node.css({"margin-left":-extra/2});}else{node.css("margin","0 auto");}}}});})(jQuery); (function(){if(!window.JShop){window.JShop={};}var c=$.browser;function b(){oStorage=localStorage;_setItem=function(i,j){oStorage.setItem(i,j);};_getItem=function(i){return oStorage.getItem(i);};_removeItem=function(i){oStorage.removeItem(i);};_clear=function(){oStorage.clear();};}function e(){var i="IELocalDataStore";g();_setItem=function(j,k){try{oStorage.setAttribute(j,k);oStorage.save(i);}catch(l){}};_getItem=function(j){try{oStorage.load(i);return oStorage.getAttribute(j);}catch(k){}};_removeItem=function(j){try{oStorage.removeAttribute(j);oStorage.save(i);}catch(k){}};_clear=function(){try{oStorage.expires=h();oStorage.save(i);d();}catch(j){}};}function g(){var i=document;oStorage=i.createElement("link");if(oStorage.addBehavior){i.getElementsByTagName("head")[0].appendChild(oStorage);}}function d(){if(oStorage){try{document.body.removeChild(oStorage);}catch(i){}}g();}function h(){var i=new Date;i.setMinutes(i.getMinutes()-1);return i.toUTCString();}function f(){if(typeof localStorage!=="undefined"){b();}else{if(c.msie){e();}}}f();var a={setItem:_setItem,getItem:_getItem,removeItem:_removeItem,clear:_clear};window.JShop.JLocalStorage=a;})();(function($){var FORWARD="forward",BACKWARD="backward";var localStorage=window.JShop.JLocalStorage;function JSlide(container,config){var self=this,_config={slideInterval:5000,slideDuration:500,slideEasing:"swing",autoSlide:true,isMouseoverStop:true,steps:1};if(!container){return false;}self.container=$(container);self.timer=null;self.config=$.extend(_config,config);self._init();}JSlide.prototype={_init:function(){var self=this;self._parseMarkup();self.positionIndex=0;self.direction=FORWARD;self._getActive();self._setActive();self._initSlide();self._bind();},_parseMarkup:function(){var self=this,cfg=self.config,container=self.container,items=container.find(cfg.items);self.stepWidth=items.eq(0).outerWidth(true);self.len=items.length;if(container.find(cfg.content).length){items.parent().css("position","relative");items.each(function(i,item){item=$(item); item.attr("data-slide-idx",i);});}},_bind:function(){var self=this,cfg=self.config,container=self.container;if(container.find(cfg.content).length){self._bindContent();}self._bindTrigger();},_bindContent:function(){var self=this,cfg=self.config,container=self.container,imgs=container.find(cfg.itemImgs);container.delegate(cfg.items,"click",function(ev){var target=$(ev.currentTarget);ls={};self.activeIndex=target.attr("data-slide-idx");self.positionIndex=self.positionIndex;self.href=target.find("a").attr("href");self.__setActive();});if(!cfg.isMouseoverStop){return true;}container.delegate(cfg.items,"mouseenter mouseleave",function(ev){var type=ev.type;if(type==="mouseenter"){self._clearTimer();}else{self._initSlide();}});},_bindTrigger:function(){var self=this,cfg=self.config,container=self.container;container.delegate(cfg.prevTrigger,"click",function(ev){var target=$(ev.currentTarget),idx=self.positionIndex-cfg.steps;if(target.hasClass(cfg.prevTriggerDisableCls)){return false;}self.direction=BACKWARD;if(idx<0){idx=0;}self._slideTo(idx);});container.delegate(cfg.nextTrigger,"click",function(ev){var target=$(ev.currentTarget),steps=cfg.steps,idx=self.positionIndex+steps,len=self.len;if(target.hasClass(cfg.nextTriggerDisableCls)){return false;}self.direction=FORWARD;if(idx+steps>len){idx=len-steps;}self._slideTo(idx);});container.delegate(cfg.prevTrigger,"mouseenter mouseleave",function(ev){var type=ev.type,target=$(ev.currentTarget);if(type==="mouseenter"){target.removeClass(cfg.prevTriggerOutCls);target.addClass(cfg.prevTriggerOverCLs);}else{target.removeClass(cfg.prevTriggerOverCLs);target.addClass(cfg.prevTriggerOutCls);}});container.delegate(cfg.nextTrigger,"mouseenter mouseleave",function(ev){var type=ev.type,target=$(ev.currentTarget);if(type==="mouseenter"){target.removeClass(cfg.nextTriggerOutCls);target.addClass(cfg.nextTriggerOverCls);}else{target.removeClass(cfg.nextTriggerOverCls);target.addClass(cfg.nextTriggerOutCls);}});},_initSlide:function(){var self=this,cfg=self.config,container=self.container; if(!cfg.autoSlide){return false;}self.timer=setInterval(function(){var index=self.positionIndex,lastIdx=self.len-1;if(self.direction===BACKWARD){index-=7;if(index<0){index=0;}}else{index+=7;if(index+7>lastIdx){index=lastIdx-6;}}self._slideTo(index);},cfg.slideInterval);},_slideTo:function(index){var self=this,cfg=self.config,container=self.container,content=container.find(cfg.content),positionIndex=self.positionIndex,left,slideContent=container.find(cfg.items).parent();slideContent.stop(true,true);left=slideContent.css("left");if(left==="auto"){left=0;}else{left=parseInt(left,10);}distance=index*self.stepWidth+left;$(self).trigger("slideStart",[self.positionIndex,index]);self._dealTrigger(index);slideContent.animate({"left":"-="+distance+"px"},cfg.slideDuration,cfg.slideEasing,function(){$(self).trigger("slideEnd",[self.positionIndex,index]);});},_dealTrigger:function(index){var self=this,cfg=self.config,container=self.container,prevTrigger=container.find(cfg.prevTrigger),prevTriggerDisableCls=cfg.prevTriggerDisableCls,nextTrigger=container.find(cfg.nextTrigger),nextTriggerDisableCls=cfg.nextTriggerDisableCls;self.positionIndex=index;prevTrigger.removeClass(prevTriggerDisableCls);nextTrigger.removeClass(nextTriggerDisableCls);if(index===0){prevTrigger.addClass(prevTriggerDisableCls);self.direction=FORWARD;}else{if(index+cfg.steps===self.len){nextTrigger.addClass(nextTriggerDisableCls);self.direction=BACKWARD;}}},_getActive:function(){var self=this,cfg=self.config,href=window.location.href,items=self.container.find(cfg.items),len=self.len,steps=cfg.steps,ls;try{ls=$.parseJSON(localStorage.getItem(cfg.uid))||{};}catch(e){ls={};}if(href===ls.href){self.activeIndex=ls.activeIndex;self.positionIndex=ls.positionIndex;}else{items.each(function(i,item){if($(item).find("a").attr("href")===href){self.activeIndex=i;self.positionIndex=i;if(i+steps>len-1){self.positionIndex=len-steps;}}});}self.href=href;self.__setActive();return self;},_setActive:function(){var self=this,cfg=self.config,container=self.container,activeCls=cfg.activeCls,items=container.find(cfg.items),idx=self.activeIndex; items.removeClass(activeCls);if(idx>=0){items.eq(idx).addClass(activeCls);}self._slideTo(self.positionIndex);},__setActive:function(){var self=this,ls=[];ls.push('{"activeIndex":');ls.push(self.activeIndex+",");ls.push('"positionIndex":');ls.push(self.positionIndex+",");ls.push('"href":');ls.push('"'+self.href+'"}');localStorage.setItem(self.config.uid,ls.join(""));},_clearTimer:function(){var self=this;if(self.timer){clearInterval(self.timer);self.timer=null;}}};jshop.module.Banner={};$.extend(jshop.module.Banner,jshop.module);$.extend(jshop.module.Banner,{JSlide:function(args){if(args==undefined){if(validateData($(this).attr("module-param"))){var args=eval("("+$(this).attr("module-param")+")");}}var container=this;var slide=new JSlide(container,args);},errorMessage:function(message){message.show();setTimeout(function(){message.animate({top:-message.outerHeight(true)},200);},10000);},baseSlide:function(args){if(args==undefined){if(validateData($(this).attr("module-param"))){var args=eval("("+$(this).attr("module-param")+")");}}if(!$(this)[0]){return;}var _this=this,param=$.extend({imgArea:".jbannerImg",imgNode:".jbannerImg dl",tabArea:".jbannerTab",tabNode:".jbannerTab span",photoName:".jDesc",arrowLeft:".jPreOut",arrowRight:".jNextOut",arrowLeftOver:"jPreOver",arrowRightOver:"jNextOver",defaultClass:"show",message:".jMessageRemind",pageMode:".j-edit-page",slideDirection:"left",timer:"3"},args),imgArea=$(_this).find(param.imgArea),imgNode=$(_this).find(param.imgNode),tabArea=$(_this).find(param.tabArea),tabNode=$(_this).find(param.tabNode),photoName=$(_this).find(param.photoName),arrowLeft=$(_this).find(param.arrowLeft),arrowRight=$(_this).find(param.arrowRight),arrowLeftOver=param.arrowLeftOver,arrowRightOver=param.arrowRightOver,defaultClass=param.defaultClass,message=$(_this).find(param.message),pageMode=$(param.pageMode),slideDirection=param.slideDirection,timer=param.timer*1000,scroll;jshop.module.ridLazy(_this);scroll=(slideDirection=="top")?"scrollTop":"scrollLeft"; if(imgArea.find("img").width()!=$(_this).width()){if(pageMode[0]){jshop.module.Banner.errorMessage.call(this,message);}}imgNode.eq(0).addClass(defaultClass);tabNode.eq(0).addClass(defaultClass);photoName.text(imgNode.eq(0).find("img").attr("title"));var imgHeight=imgNode.find("img").height();$(_this).css({height:imgHeight});imgArea.css({width:$(_this).parent().width(),height:$(_this).parent().height()});if(slideDirection=="top"){imgArea.children().css({height:10000,width:"auto"});imgNode.css({width:$(_this).parent().width(),height:"auto","float":"none"});}else{imgArea.children().css({width:10000,height:"auto"});imgNode.css({width:$(_this).parent().width(),height:"100%","float":"left"});}imgNode.find("img").css({height:imgHeight,width:"100%"});var index=0,moveRange,partTime,direction=1;if(slideDirection=="top"){moveRange=imgNode.height();}else{moveRange=imgNode.width();}imgArea[0][scroll]=index*moveRange;var time=setInterval(imgMove,timer);tabNode.each(function(i,elem){$(this).click(function(){imgNode.eq(index).removeClass(defaultClass);tabNode.eq(index).removeClass(defaultClass);index=i;imgNode.eq(index).addClass(defaultClass);tabNode.eq(index).addClass(defaultClass);photoName.text(imgNode.eq(index).find("img").attr("title"));allImgMove();});});function allImgMove(){clearInterval(partTime);clearInterval(time);partTime=setInterval(oneImgMove,30);time=setInterval(imgMove,timer);}function oneImgMove(){var nowMoveRange=(index*moveRange)-imgArea[0][scroll],partImgRange=nowMoveRange>0?Math.ceil(nowMoveRange/10):Math.floor(nowMoveRange/10);imgArea[0][scroll]+=partImgRange;if(partImgRange==0){clearInterval(partTime);imgNode.eq(index).addClass(defaultClass);tabNode.eq(index).addClass(defaultClass);photoName.text(imgNode.eq(index).find("img").attr("title"));partImgRange=null;}}function imgMove(){if(direction==1){if(index0){classOper([imgNode,tabNode],defaultClass,false); }else{direction=1;classOper([imgNode,tabNode],defaultClass,true);}}photoName.text(imgNode.eq(index).find("img").attr("title"));allImgMove();}function classOper(arr,className,flag){arr.jBannerEach(function(ind,n){n.eq(index).removeClass(className);});flag?(index++):(index--);arr.jBannerEach(function(ind,n){n.eq(index).addClass(className);});}arrowLeft.bind({click:function(){if(index!=0){classOper([imgNode,tabNode],defaultClass,false);allImgMove();}},mouseover:function(){$(this).addClass(arrowLeftOver);},mouseout:function(){$(this).removeClass(arrowLeftOver);}});arrowRight.bind({click:function(){if(index0){imgArea.css({"margin-left":-extra/2});}else{imgArea.css("margin","0 auto");}}function triggerThumbnail(){tabNode.each(function(i,elem){$(elem)[eventType](function(){imgNode.eq(index).removeClass(defaultClass);tabNode.eq(index).removeClass(defaultClass);index=i;imgNode.eq(index).addClass(defaultClass);tabNode.eq(index).addClass(defaultClass);photoName.text(imgNode.eq(index).find("img").attr("title"));animate();return false;});});}function _stop(){clearTimeout(time);time=null;imgNodeArea.clearQueue();imgNode.eq(index).clearQueue();}function imgMove(){if(param.isCircular){if(index0){classOper([imgNode,tabNode],defaultClass,false);}else{direction=1;classOper([imgNode,tabNode],defaultClass,true);}}}photoName.text(imgNode.eq(index).find("img").attr("title"));animate();}function triggerArrow(){var arrowLeft=$(_this).find(param.arrowLeft),arrowRight=$(_this).find(param.arrowRight);$(_this).bind({mouseover:function(){arrowLeft.show();arrowRight.show();},mouseout:function(){arrowLeft.hide();arrowRight.hide();}});}function triggerDirection(){var arrowLeft=$(_this).find(param.arrowLeft),arrowRight=$(_this).find(param.arrowRight),arrowLeftOver=param.arrowLeftOver,arrowRightOver=param.arrowRightOver;arrowLeft.bind({click:function(){if(index!=0){classOper([imgNode,tabNode],defaultClass,false);animate();}else{if(param.isCircular){classOper([imgNode,tabNode],defaultClass,false);index=imgNode.length;classOper([imgNode,tabNode],defaultClass,false);animate();}}return false;},mouseover:function(){$(this).addClass(arrowLeftOver);},mouseout:function(){$(this).removeClass(arrowLeftOver);}});arrowRight.bind({click:function(){if(index0?Math.ceil(nowMoveRange/10):Math.floor(nowMoveRange/10); imgArea[0][scroll]+=partImgRange;if(partImgRange==0){imgNode.eq(index).addClass(defaultClass);tabNode.eq(index).addClass(defaultClass);photoName.text(imgNode.eq(index).find("img").attr("title"));partImgRange=null;_stop();if(!enterFlag){time=setTimeout(imgMove,timer);}}else{partTime=setTimeout(oneImgMove,30);}$(_this).css({"background-color":imgNode.eq(index).attr("background")});}function classOper(arr,className,flag){arr.each(function(ind,n){n.eq(index).removeClass(className);});flag?(index++):(index--);arr.each(function(ind,n){n.eq(index).addClass(className);});}},c_slide:function(args){var param=$.extend({node:"li",slideNext:".btn_next",slidePrev:".btn_prev",slideType:2,height:360,width:700,timer:2,slideShow:1},args||{}),_this=$(this),_currentSlide=0,imgArea=$(_this).find(param.node),FrameHeight=param.height,FrameWidth=param.width,slideNext=$(_this).find(param.slideNext),slidePrev=$(_this).find(param.slidePrev),slideLength=imgArea.length,scrollType="left",slideType=param.slideType,slideShow=param.slideShow,_duration=parseInt(parseFloat(param.timer||0.5)*1000),flag=true;if(!imgArea.length){return;}if(slideShow==1){slidePrev.hide();slideNext.hide();}_this.css({"height":FrameHeight});_this.find(".banner_left").css({"height":FrameHeight,"width":(_this.width()-FrameWidth)/2});_this.find(".banner_right").css({"height":FrameHeight,"width":(_this.width()-FrameWidth)/2,"left":parseInt(FrameWidth)+parseInt((_this.width()-FrameWidth)/2)});imgArea.css({"height":FrameHeight,"width":FrameWidth});imgArea.find("img").css({"height":FrameHeight,"width":FrameWidth});_this.find(".u_bannerpic").css({"height":FrameHeight,"width":_this.width()});_this.find("ul").css({"left":-(FrameWidth-((_this.width()-FrameWidth)/2))});slideNext.css({"top":(FrameHeight-slidePrev.height())/2,"right":((_this.width()-FrameWidth)/2)+20});slidePrev.css({"top":(FrameHeight-slidePrev.height())/2,"left":((_this.width()-FrameWidth)/2)+20});imgArea.eq(slideLength-1).after(imgArea.eq(0).clone());imgArea.eq(0).before(imgArea.eq(slideLength-1).clone()); function _event(){slideNext.bind({click:function(){if(_currentSlide0){_currentSlide-=1;_go(_currentSlide);}else{flag=false;}}});_this.bind("mouseover",function(){slidePrev.show();slideNext.show();clearTimeout(autoExt);});_this.bind("mouseout",function(){if(slideShow==1){slidePrev.hide();slideNext.hide();}clearTimeout(autoExt);autoExt=setTimeout(function(){extInterval();},_duration);});}function _go(index){_currentSlide=index;if(scrollType=="left"){$(_this).find("ul").animate({marginLeft:(-index*FrameWidth)+"px"},{duration:600,queue:false});}imgArea.removeClass("visited");imgArea.eq(index).addClass("visited");}function extInterval(){if(slideType==1){if(_currentSlide";w.css({position:"relative"}).html(c);b(function(){C();});};var v=function(){var d=[];d.push("
");var e;var f;for(var c=0;c";default:break; }d.push("");d.push(f);d.push("");}d.push("
");w.append(d.join(""));w.find("span").bind("mouseover",function(){D=false;clearTimeout(y);clearTimeout(B);var g=w.find("span").index(this);if(a.index==g){return;}else{B=setInterval(function(){if(A){t(g);}},a.delay1);}}).bind("mouseleave",function(){D=true;clearTimeout(y);clearTimeout(B);y=setTimeout(function(){t(a.index+1,true);},a.delay2);});};var t=function(c,d){if(c==r){c=0;}z=setTimeout(function(){w.find("span").eq(a.index).removeClass(a.current);w.find("span").eq(c).addClass(a.current);s(c,d);},20);};var s=function(d,h){var f=parseInt(x);var c=Math.abs(f+a.index*a.height);var e=Math.abs(d-a.index)*a.height;var g=Math.ceil((e-c)/4);if(c==e){clearTimeout(z);if(h){a.index++;if(a.index==r){a.index=0;}}else{a.index=d;}A=true;if(A&&D){clearTimeout(y);y=setTimeout(function(){t(a.index+1,true);},a.delay2);}}else{if(a.index");}w.find("ul").append(d.join(""));y=setTimeout(function(){t(a.index+1,true);},a.delay2);if(a.type){v();}};q();};})(jQuery);