Array.prototype.each=function(B){if(!B.constructor==Function){return ;}for(var C=0,A=this.length;C0;B--){if(this[B-1]==A){return true;}}return false;};Array.prototype.getIndex=function(B){for(var C=0,A=this.length;C0){H.scrollTop=D;}H.focus();J+=I.length;H.selectionStart=H.selectionEnd=J;}else{H.value+=I;H.focus();}}};})(jQuery,window);(function(B,A){A.gBase=A.gBase||{};B.extend(A.gBase,{nMaxZIndex:null,isIE6:(function(){if(window.ActiveXObject){if(document.documentElement&&typeof document.documentElement.style.maxHeight!="undefined"){return false;}else{return true;}}else{return false;}})(),fGetUrlParms:function(){var D=new Object(),F=location.search.substring(1),G=F.split("&");for(var E=0;E').appendTo("body");B.browser.msie?B(E).css("filter","alpha(opacity="+D+")"):B(E).css("opacity",D/100);}B('
').appendTo("body").fadeTo(200,D/100);},fMaskHide:function(C){B("#"+C+"_ie6_mask,#"+C+"_mask").remove();},addFavorite:function(G,C){var E=C;var D=G;try{if(document.all){window.external.AddFavorite(E,D);}else{if(window.sidebar){window.sidebar.addPanel(D,E,"");}else{alert("对不起,您的浏览器不支持此操作!\n请您使用菜单栏或Ctrl+D收藏本站。");}}}catch(F){alert("对不起,您的浏览器不支持此操作!\n请您使用菜单栏或Ctrl+D收藏本站。");}},JSONClone:function(E){var D={};for(var C in E){D[C]=E[C];}return D;}});})(jQuery,window);$.fn.extend({imgOnload:function(){}});$(function(){gBase.nMaxZIndex=gBase.fGetMaxZIndex();}); message_box=(function(){var H=null,B,C=2000,D=300,E=[];function I(K){if(!H){var J=UI.dialog.open({type:1,sContent:K,nBtn:2,sStyle:"userDef",sAnimate:{left:0,top:1}});H=J.oPopup;H.css("zIndex",2147483640);}}function A(J){var K=!E.length&!B;E.push(J);if(!!K){F();}}function F(){var K=arguments.callee;if(E.length){var J=E.shift();H.html(J);H.show().animate({top:"-4px"},D,function(){B=setTimeout(function(){H.animate({top:-H.outerHeight()+"px"},D,function(){G();K();});},C);});}}function G(){clearTimeout(B);B=null;H.clearQueue();}return function(K,J){var L='
'+gConfig.assembles.dialog_content(K,J)+"
";I("");A(L);};})();(function(D,B){var G="J_imgLazyload",A="original",E=[];function F(){E=D("body ."+G);}function C(){var L=D(window).scrollTop()+D(window).height(),J=[];for(var K=0,H=E.length;KT.offset().top){Q[P.getIndex(U)]=O[S];R[U]=T.offset().top;}}}return Q;}L.JD_local_price=function(Q){var O=Q.find('span[jshop="price"]').toArray();for(var P=0,N=O.length;P=0?E.p:C;B("span[jdprice="+E.id+"]").each(function(F,G){B(G).html(D);});},_set_sale_price:function(E,C){var D=E.m>=0?E.m:C;B("span[jsprice="+E.id+"]").each(function(F,G){B(G).html(D);});},_set_sku_price:function(E,C){var D=E.m>=0?E.m:C;B("span[jskuprice="+E.id+"]").each(function(F,G){B(G).html(D);});},_set_save_price:function(C){var E=C.p>=0?C.p:0,D=C.m>=0?C.m:0;B("span[saprice="+C.id+"]").each(function(F,G){B(G).html(JD_price._get_save(D,E));});},_set_save_sale_price:function(D){var E=D.p>=0?D.p:0,C=D.m>=0?D.m:0;B("span[ssprice="+D.id+"]").each(function(F,G){B(G).html(JD_price._get_save(C,E));});},_set_discount_sale_price:function(D){var E=D.p>=0?D.p:0,C=D.m>=0?D.m:0;B("span[dsaleprice="+D.id+"]").each(function(F,G){B(G).html(JD_price._get_discount(C,E));});},_set_discount_sku_price:function(D){var E=D.p>=0?D.p:0,C=D.m>=0?D.m:0;B("span[dskuprice="+D.id+"]").each(function(F,G){B(G).html(JD_price._get_discount(C,E));});}};A.getNumPriceService=function(D){if(!D){return ;}var C="暂无定价";JD_price._set_jd_price(D,C);JD_price._set_sale_price(D,C);JD_price._set_sku_price(D,C);JD_price._set_save_price(D);JD_price._set_save_sale_price(D);JD_price._set_discount_sale_price(D);JD_price._set_discount_sku_price(D); };})(jQuery,window);function thick_login(B,A){if(typeof B!="function"){throw new Error("Self-defined login argments should be a function!");}$.extend(jdModelCallCenter,{jshop_login:function(C){$.login({modal:true,complete:function(D){if(D&&D.IsAuthenticated){B.call(A||this,D);}else{jdModelCallCenter.settings.fn=B;}}});}});$.extend(jdModelCallCenter.settings,{object:this,fn:function(){jdModelCallCenter.jshop_login(this);}});jdModelCallCenter.settings.fn();}$(function(){$(".layout-main").delegate("btn-attention","click",function(){var B=$(this),A=parseInt(B.attr("id").replace("coll",""));$.extend(jdModeCallCenter.settings,{clstag1:"login|keycount|5|3",clstag2:"login|keycount|5|4",id:A,fn:function(){jdModeCallCenter.doAttention(this.id);}});});});(function(){var A=".J-cart";$(function(){$(".layout-main").delegate(A,"click",function(){var D=$(this).attr("itemid");try{$.ajax({url:"http://cart.jd.com/cart/dynamic/gate.action?pid="+D+"&pcount=1&ptype=1&callback=?",type:"get",dataType:"jsonp",success:function(){}});}catch(C){}var B="";B+='
';B+='
';B+='
';B+='
添加成功
';B+='×
';B+="";$.jdThickBox({source:B,width:492,height:90,title:"加入购物车"});});$(".button01").click(function(){var C=$.trim($("#key01").val()),B="http://mall.jd.com/advance_search-"+$("#pageInstance_appId").val()+"-"+$("#vender_id").val()+"-"+shopId+"-0-0-0-1-1-24.html";C=encodeURIComponent(encodeURIComponent(C));if(C!=""){B+="?keyword="+C;}location.href=B;});});})(); (function(B,A){B(function(){function D(){B(".J-layout").each(function(F,H){var E=B(H),G=true;E.children("div").each(function(I,J){if(B(J).children("[instanceid]").length){G=false;}});if(!G){E.parents(".J-layout-area").addClass("no-margin");}});}function C(){if(B(".layout-main").length){var E=parseInt(B(".layout-main").attr("isfixed")),G=B(".layout-main").offset().top,F=typeof gConfig!="undefined";}if(E){B(F?".layout-container":window).scroll(function(){var H=B(this).scrollTop();if(H>=G){B(".layout-main").css("background-attachment","fixed");}else{B(".layout-main").css("background-attachment","scroll");}});}}D();C();});A.window2013CSS=function(H,F){var G=F,E=gBase.JSONClone(F),D=B("#slide_bar_area"),C=D.length&&!D.hasClass("off")?185:0;if(!B("#slide_bar_area").length){H.css(G);return ;}if(E.left){E.left=E.left.match(/%/g)?(B(window).width()+C)*parseInt(E.left)/100+"px":E.left;}if(E.right){E.right=E.right.match(/%/g)?(B(window).width()-C)*parseInt(E.right)/100+"px":E.right;}if(typeof gBase.fGetUrlParms()["veBean.open"]=="undefined"||gBase.fGetUrlParms()["veBean.open"]==="1"){H.css(E);}else{H.css(G);}B(window).bind("sidebarchange",function(I,J){if(J){H.css(E);}else{H.css(G);}});};A.window2013scroll=function(C){if(B("#slide_bar_area").length){B(".J-layout-container").scroll(function(){C.call(this);});}else{B(window).scroll(function(){C.call(this);});}};A.window2013scrollTop=function(){return B("#slide_bar_area").length?B(".J-layout-container").scrollTop():B(window).scrollTop();};})(jQuery,window); (function($,w){w.jshop={};w.jshop.module={};$.extend(w.jshop.module,{ridLazy:function(obj){$(obj).find("img.J_imgLazyload").each(function(){$(this).attr("src",$(this).attr("original"));$(this).removeAttr("original");$(this).removeClass("J_imgLazyload");});},changeStyle:function(args){var param=$.extend({node:"li",defaultClass:"jCurrent",defaultShow:0},args),elem=$(this).find(param.node),defaultClass=param.defaultClass,defaultShow=param.defaultShow;elem.eq(defaultShow).addClass(defaultClass);elem.each(function(index,n){$(n).mouseover(function(e){$(this).addClass(defaultClass).siblings().removeClass(defaultClass);});});},changeClass:function(args){var param=$.extend({node:"li",defaultClass:"jCurrent",defaultShow:0},args),elem=$(this).find(param.node),defaultClass=param.defaultClass,defaultShow=param.defaultShow;elem.eq(defaultShow).addClass(defaultClass);elem.each(function(index,n){$(n).mouseover(function(e){$(this).addClass(defaultClass).siblings().removeClass(defaultClass);});});},tabClass:function(args){var param=$.extend({node:"li",defaultClass:"current"},args),elem=$(this).find(param.node).length?$(this).find(param.node):$(this),defaultClass=param.defaultClass,defaultShow=param.defaultShow;if(defaultShow){elem.eq(defaultShow).addClass(defaultClass);}elem.bind({mouseenter:function(){$(this).addClass(defaultClass).siblings().removeClass(defaultClass);},mouseleave:function(){$(this).removeClass(defaultClass);}});},tab:function(args){var param=$.extend({tabNode:".jSortTab span",arrow:".jSortTabArrow",defaultClass:"current",tabContent:".jSortContent ul"},args),_this=this,tabNode=$(_this).find(param.tabNode),tabContent=$(_this).find(param.tabContent),arrow=$(_this).find(param.arrow);tabNode.eq(0).addClass(param.defaultClass);tabContent.eq(0).addClass(param.defaultClass);tabNode.each(function(i,n){$(n).attr("data-num",i);});var width=0;if(param.setUpWidth){if(tabNode.width()>0){width=tabNode.width();}else{width=(tabNode.parent().parent().width()-0.03)/tabNode.length;}}else{width=(tabNode.parent().parent().width()-0.03)/tabNode.length; }tabNode.css({width:width});arrow.css({width:width});tabNode.bind({mouseenter:function(){$(this).addClass(param.defaultClass).siblings().removeClass(param.defaultClass);tabContent.eq($(this).attr("data-num")).addClass(param.defaultClass).siblings().removeClass(param.defaultClass);arrow.animate({left:($(this).attr("data-num"))*width},300,function(){});}});},tabShow:function(args){var param=$.extend({eventNode:".jClick",parentNode:".jSortContent",childNode:"ul",defaultClass:"current",eventType:"click",num:0,tabTime:500,subFunction:"circle"},args),_this=$(this),eventNode=_this.find(param.eventNode),parent=_this.find(param.parentNode),child=_this.find(param.childNode),defaultClass=param.defaultClass,eventType=param.eventType,num=(param.num===Number&¶m.num<=len)?param.num:0,tabTime=param.tabTime,subFunction=param.subFunction,len=child.length,isLeft=true;child.eq(num).addClass(defaultClass);eventNode[eventType](function(){if(param.subFunction){showStyle[param.subFunction].call(_this);}callBack();});var showStyle={circle:function(){num=(num+1)%len;},direction:function(){if(isLeft){num++;if(num==len-1){isLeft=false;}}else{num--;if(num==0){isLeft=true;}}},random:function(){num=parseInt(Math.random()*len);}};function callBack(){child.eq(num).addClass(defaultClass).siblings().removeClass(defaultClass);child.animate({opacity:0},0,function(){});child.eq(num).animate({opacity:1},param.tabTime,function(){});}},autoLayout:function(args){var _para=$.extend({node:"li",spacingType:"margin",size:1},args||{}),_this=$(this),_elem=_this.find(_para.node),_qty=parseInt(_elem.parent().parent().width()/_elem.outerWidth(true)),_ie=$.browser.msie&&parseInt($.browser.version)<=7?"i":"",_spacing=_para.spacingType.match(/^m/)?"m":"p",_size=_para.size==0.5?"OneHalf":"One",_arr=["qOne","qTwo","qThree","qFour","qFive","qSix","qSeven","qEight","qNine","qTen","qEleven","qTwelve"];_elem.addClass(_ie+_arr[_qty-1]+_size).addClass(_spacing+_size);},autoWidth:function(args){var _para=$.extend({node:"li",extra:{}},args||{}),_this=this,elems=$(_this).find(_para.node),elem=elems.eq(0); elems.css(_para.extra);var outerWidth=parseInt(elem.data("outerWidth")||elem.outerWidth(true)),width=parseInt(elem.data("width")||elem.css("width")),qty=parseInt(elem.parent().parent().width()/outerWidth);elem.data({"outerWidth":outerWidth,"width":width});var extraWidth=outerWidth-width;var newWidth=(elem.parent().parent().width()-extraWidth*qty-0.03)/qty;elems.css({width:newWidth});},equallyWidth:function(args){var param=$.extend({equallyNode:".jSortTab span",equallyParentNode:null},args),_this=$(this),nodeParent=(_this.find(param.equallyParentNode).length>0)?_this.find(param.equallyParentNode):_this,elems=_this.find(param.equallyNode),elem=elems.eq(0);var outerWidth=parseInt(elem.data("outerWidth")||elem.outerWidth(true)),width=parseInt(elem.data("width")||elem.css("width")),qty=elems.length;elem.data({"outerWidth":outerWidth,"width":width});var extraWidth=outerWidth-width;var newWidth=(nodeParent.width()-extraWidth*qty-0.03)/qty;elems.css({width:newWidth});},fullHeight:function(args){var param=$.extend({fullHeightNode:"li",fullNode:".jShade"},args),elem=$(this).find(param.fullHeightNode),fullNode;elem.bind({mouseenter:function(){fullNode=$(this).find(param.fullNode);fullNode.css({height:$(this).height()});}});},waterfallFlow:function(args){var param=jQuery.extend({area:".goodsArea",node:"li",topSpac:10},args),_this=$(this),area=_this.find(param.area),elem=_this.find(param.node),outerWidth=parseInt(elem.data("outerWidth")||elem.outerWidth(true)),qty=parseInt(elem.parent().width()/outerWidth),topPos,array=[];elem.data({"outerWidth":outerWidth});elem.each(function(index,e){var row=parseInt(index/qty),col=index%qty,leftPos=col*jQuery(e).outerWidth(true);if(row==0){topPos=parseInt((col%2)*param.topSpac);}else{var topNode=jQuery(elem.get((row-1)*qty+col));topPos=topNode.outerHeight(true)+parseInt(topNode.css("top"));}jQuery(e).css({left:leftPos,top:topPos});array.push(parseInt(jQuery(e).css("top"))+jQuery(e).outerHeight(true));});function compare(value1,value2){if(value1value2){return 1;}else{return 0;}}}array.sort(compare);area.css("height",array[array.length-1]);},slidePhoto:function(args){var _this=this,param=$.extend({imgArea:".jbannerImg",imgNodeArea:".jImgNodeArea",imgNode:".jbannerImg dl",tabArea:".jbannerTab",tabNode:".jbannerTab span",photoName:".jDesc",arrowLeft:".jPreOut",arrowRight:".jNextOut",arrowLeftOver:"jPreOver",arrowRightOver:"jNextOver",defaultClass:"show",slideDirection:"left",timer:"3",subFunction:"transparentEffect",eventType:"click",showArrow:1},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),defaultClass=param.defaultClass,eventType=param.eventType,timer=!param.timer*1000?3000:param.timer*1000,scroll,imgNodeArea=$(_this).find(param.imgNodeArea),isFull=param.isFull;var index=0,direction=1,time=null,moveRange=0,partTime=null,animate=null;if(!imgNode.length){return ;}var banner={transparentEffect:function(){$(_this).css({"background-color":imgNode.eq(index).attr("background")});init();triggerThumbnail();triggerDirection();if(param.showArrow!=1){triggerArrow();}animate=transparent;time=setTimeout(imgMove,timer);},moveEffect:function(){var isTop=(param.slideDirection=="top")?true:false;scroll=(isTop)?"scrollTop":"scrollLeft";$(_this).css({"background-color":imgNode.eq(index).attr("background")});if(isTop){imgNodeArea.css({height:20000,width:$(_this).width()});imgNode.css({width:imgNodeArea.width(),height:"auto","float":"none"});moveRange=imgNode.height();imgArea[0][scroll]=index*moveRange;}else{imgNodeArea.css({width:20000});imgNode.css({width:imgNode.find("img").width(),height:"100%","float":"left"});moveRange=imgNode.width();imgArea[0][scroll]=index*moveRange;}init();triggerThumbnail();triggerDirection();if(param.showArrow!=1){triggerArrow();}animate=oneImgMove;time=setTimeout(imgMove,timer);}};if(banner[param.subFunction]){banner[param.subFunction].call(_this); }function init(){$(_this).css({cursor:"pointer"});imgArea.css({width:imgNode.find("img").width(),height:imgNode.find("img").height()});imgNode.eq(0).addClass(defaultClass);tabNode.eq(0).addClass(defaultClass);photoName.text(imgNode.eq(0).find("img").attr("title"));$(_this).click(function(){window.open(imgNode.eq(index).attr("ref"));});autoMiddle();$(window).resize(function(){autoMiddle();});}function autoMiddle(){var extra=imgArea.width()-$(_this).width();if(extra>0){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;clearTimeout(partTime);partTime=null;imgNodeArea.clearQueue();imgNode.eq(index).clearQueue();}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"));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();}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();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);});}},slideHtml:function(args){var _this=this,param=$.extend({imgArea:".jbannerImg",imgNodeArea:".jImgNodeArea",imgNode:".jbannerImg li",tabArea:".jbannerTab",tabNode:".jbannerTab span",arrowLeft:".jPreOut",arrowRight:".jNextOut",arrowLeftOver:"jPreOver",arrowRightOver:"jNextOver",defaultClass:"show",slideDirection:"left",timer:"3",subFunction:"transparentEffect",eventType:"click",showArrow:1},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),defaultClass=param.defaultClass,eventType=param.eventType,timer=!param.timer*1000?3000:param.timer*1000,scroll,ul=$(_this).find(param.imgNodeArea+">ul"),imgNodeArea=$(_this).find(param.imgNodeArea),isFull=param.isFull; var index=0,direction=1,time=null,moveRange=0,partTime=null,animate=null;if(!imgNode.length){return ;}var banner={transparentEffect:function(){$(_this).css({"background-color":imgNode.eq(index).attr("background")});init();triggerThumbnail();triggerDirection();if(param.showArrow!=1){triggerArrow();}animate=transparent;time=setTimeout(imgMove,timer);},moveEffect:function(){var isTop=(param.slideDirection=="top")?true:false;scroll=(isTop)?"scrollTop":"scrollLeft";$(_this).css({"background-color":imgNode.eq(index).attr("background")});if(isTop){imgNodeArea.css({height:20000});imgNode.css({width:imgNode.attr("width"),height:imgNode.attr("height")});moveRange=imgNode.height();imgArea[0][scroll]=index*moveRange;}else{imgNodeArea.css({width:20000});imgNode.css({width:imgNode.attr("width"),height:imgNode.attr("height"),"float":"left"});moveRange=imgNode.width();imgArea[0][scroll]=index*moveRange;}init();triggerThumbnail();triggerDirection();if(param.showArrow!=1){triggerArrow();}animate=oneImgMove;time=setTimeout(imgMove,timer);}};if(banner[param.subFunction]){banner[param.subFunction].call(_this);}function init(){imgArea.css({width:imgNode.attr("width"),height:imgNode.attr("height")});imgNode.eq(0).addClass(defaultClass);tabNode.eq(0).addClass(defaultClass);autoMiddle();$(window).resize(function(){autoMiddle();});}function autoMiddle(){var extra=imgArea.width()-$(_this).width();if(extra>0){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);animate();return false;});});}function _stop(){clearTimeout(time);time=null;clearTimeout(partTime);partTime=null;ul.clearQueue();imgNode.eq(index).clearQueue();}function imgMove(){if(direction==1){if(index0){classOper([imgNode,tabNode],defaultClass,false);}else{direction=1;classOper([imgNode,tabNode],defaultClass,true);}}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();}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);partImgRange=null;_stop();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); });}},changePhoto:function(args){var param=$.extend({changePhotoNode:".jPic img",smallPhoto:".jScrollWrap li",title:".jDesc a",defaultClass:"jCurrent",eventType:"click"},args||{}),_this=$(this),largePhoto=_this.find(param.changePhotoNode),smallPhoto=_this.find(param.smallPhoto),title=_this.find(param.title);largePhoto.attr("src",smallPhoto.eq(0).attr("data-src"));largePhoto.parent().attr("href",smallPhoto.eq(0).attr("data-href"));title.attr("href",smallPhoto.eq(0).attr("data-href"));smallPhoto.eq(0).addClass(param.defaultClass);smallPhoto[param.eventType](function(){var _target=this;largePhoto.attr("src",$(_target).attr("data-src"));largePhoto.parent().attr("href",$(_target).attr("data-href"));title.attr("href",$(_target).attr("data-href"));var goodsFollow=$(_target).parents("li.jSubObject");if(typeof goodsFollow!="undefined"&&typeof $(_target).attr("sid")!="undefined"){var btnColl=jQuery(goodsFollow).find(".btn-coll");if(typeof btnColl.attr("id")!="undefined"){btnColl.attr("id","coll"+$(_target).attr("sid"));}}$(_target).addClass(param.defaultClass).siblings().removeClass(param.defaultClass);});},movePhoto:function(args){var param=$.extend({movePhotoNode:".jScrollWrap li",arrowPrev:".jScrollPrev",arrowNext:".jScrollNext",defaultClass:"disabled"},args||{}),_this=$(this),node=_this.find(param.movePhotoNode),prev=_this.find(param.arrowPrev),next=_this.find(param.arrowNext),visibleNode=parseInt(node.parent().parent().width()/node.width()),index=0,length=node.length;if(length>visibleNode){prev.addClass(param.defaultClass).show();next.show();node.parent().css("width",node.width()*length);}next.click(function(){var _this=this;if(length-visibleNode){prev.removeClass(param.defaultClass);}if(index0){index--;node.parent().animate({left:-node.eq(0).outerWidth(true)*index},function(){if(!index){$(_this).addClass(param.defaultClass);}});}});},operateNode:function(args){var param=$.extend({operateNode:"li",operateParentNode:null,defaultClass:"jCurrent",length:0,subFunction:null,number:[],callBack:null},args||{}),_this=$(this),node=_this.find(param.operateNode),nodeParent=(_this.find(param.operateParentNode).length>0)?_this.find(param.operateParentNode):_this.parent().parent().parent(),defaultClass=param.defaultClass,number=param.number,length=(param.length!=0)?param.length:parseInt(nodeParent.outerWidth(true)/node.outerWidth(true)),callBack=typeof (param.callBack)==="function"?param.callBack:function(a){a.addClass(defaultClass);};if(node.length===0){return ;}var rowLen=0;var nowTop=$(node[0]).offset().top;node.each(function(index,dom){if(index>0){rowLen++;var _top=$(dom).offset().top;if(nowTop!==_top){return false;}else{nowTop=_top;}}});var operate={getNode:function(){return node.map(function(i,e){for(var j=0;j=length*(number[j]-1)&&i=param.count){textNode.replaceData(param.count,textNode.length,param.text);}});},shopSearch:function(args){jshop.module.search.shopSearch.call(this,args);},follow:(function(){var _default={shopApi:"http://follow.soa.jd.com/vender/follow",actApi:"http://follow.soa.jd.com/activity/follow",shopCountApi:"http://follow.soa.jd.com/vender/queryForCount",actCountApi:"http://follow.soa.jd.com/activity/queryForCount",goodsApi:"",type:"shopId"};function newTagOnfocus(){var val=jQuery("#newTag").val();val=val.trim();if(val==jQuery("#newTag").attr("placeholder")){jQuery("#newTag").val("");}}function checkLength(node){if(node.value.length>10){node.value=node.value.substring(0,10);}}function Follow(cfg,scope){this.config=jQuery.extend({},cfg);var config=jQuery.extend({},this.config);this.container=$(config.node,cope);this.get=function(p){return config[p];};this.set=function(p,v){config[p]=v;};this.init();}Follow.FollowVMContent='
'+'
'+'

关注成功!

'+'

'+'查看我的关注>>'+"

"+'
'+"

选择标签(最多可选3个)

"+'
'+'
'+'
'+'确定'+'取消'+'
'+"
"+'
'+'
'+'
'+'

关注成功

'+'

'+'查看我的关注 >>'+"

"+'
'+'关闭'+"
"+'
'+'
'+'
'+''+'

关注失败

'+'

查看我的关注 >>

'+'
'+'
'+'
'+'
'+''+'
'+"

关注数量达到最大限制

"+'

查看我的关注 >>

'+'
'+'
'+'
'+''+'
'+"
"; Follow.prototype={init:function(){var _this=this;_this.bindEvent();},bindEvent:function(){var _this=this;_this.container.click(function(){thick_login(function(){_this.addFollow();});});jQuery("body").delegate(".att-btn-ok","click",function(){_this.doSubmit();});},addFollow:function(){var _this=this,api;if(_this.get("type")=="shopId"){api=_this.get("shopApi");api+="?venderId="+_this.get("id");}else{api=_this.get("actApi");api+="?activityId="+_this.get("id");api+="&srcType=0";}Follow.followVM=jQuery(Follow.FollowVMContent);jQuery.ajax({async:false,url:api,dataType:"jsonp",success:function(data){_this.followSuccess(data);},error:function(data,xhr){_this.followShopFail();}});},followSuccess:function(data){this.checkResult(data,this.followSuccessCallBack,this.followed,this.followShopMax);},checkResult:function(data,callback,followed,max){switch(data.code){case"F10000":callback&&callback.call(this);break;case"F0409":followed&&followed.call(this);break;case"F0410":max&&max.call(this);break;default:this.followShopFail.call(this);}},followSuccessCallBack:function(){var _this=this,api,type=_this.get("type");if(type=="shopId"){api=_this.get("shopCountApi");}else{api=_this.get("actCountApi");}_this.getFollowNum(api,function(data){if(data.code=="F10000"){var outStr;if(type=="shopId"){outStr="您已关注"+data.data+"个店铺";Follow.followVM.find("#followNum").html(outStr);}else{outStr="您已关注"+data.data+"个活动";Follow.followVM.find("#followTopicNum").html(outStr);}}if(type=="shopId"){_this.getFollowTags();}else{_this.ShowFollowTopicSuc();}});},getFollowNum:function(url,cb){var _this=this;jQuery.ajax({async:false,url:url,dataType:"jsonp",success:function(data){cb&&cb(data);},error:function(data,shr){_this.followShopFail();}});},getFollowTags:function(){var _this=this;jQuery.ajax({async:false,url:"http://follow.soa.jd.com/vender/queryTagForListByCount?count=5",dataType:"jsonp",success:function(data){_this.fillInTags(data);_this.ShowFollowSuc();},error:function(data,D){_this.followShopFail();}});},fillInTags:function(data){var _this=this,obj=data,len=obj.data.length,dom=""; dom+="
    ";var str;for(var i=0;i"+str+"";}dom+="
";dom+="
    ";dom+="
  • 添加
  • ";dom+="
";dom+="";Follow.followVM.find("#followTags").html(dom);},ShowFollowSuc:function(){var _this=this,title="提示",node=jQuery("#dialogDiv");node.html('');$.jdThickBox({width:510,height:260,title:title,_box:"btn_coll_shop_pop",source:Follow.followVM.find("#followSuccessDiv").html()},function(){var spop=jQuery("#btn_coll_shop_pop"),spop_mc=jQuery("#attention-tags").find(".mc");spop.find(".thickcon").css("height","auto");spop.css("height","auto");jQuery("#newTag").val(jQuery("#newTag").attr("placeholder"));jQuery("#newTag").unbind("focus").focus(function(){newTagOnfocus();});jQuery("#newTag").unbind("keyup").keyup(function(){checkLength(this);});jQuery(".J_ChooseTagOne").unbind("click").click(function(){_this.chooseTag.call(_this,this);});jQuery("#J_SaveTagOneBtn").unbind("click").click(function(){_this.saveNewTag.call(_this);});});},ShowFollowTopicSuc:function(){var title="提示",node=jQuery("#dialogDiv");node.html('');$.jdThickBox({width:300,height:80,title:title,_box:"btn_coll_shop_pop",source:Follow.followVM.find("#followTopicSuccessDiv").html()});},followShopFail:function(){var node=jQuery("#dialogDiv");node.html('');if(this.get("type")=="shopId"){Follow.followVM.find("#followFailSeeFollowUrl").attr("href","http://t.jd.com/vender/followVenderList.action");}else{Follow.followVM.find("#followFailSeeFollowUrl").attr("href","http://t.jd.com/activity/followActivityList.action");}$.jdThickBox({width:300,height:80,title:"提示",source:Follow.followVM.find("#followFailDiv").html()}); return ;},followShopMax:function(){var node=jQuery("#dialogDiv");node.html('');if(this.get("type")=="shopId"){Follow.followVM.find("#followMaxSeeFollowUrl").attr("href","http://t.jd.com/vender/followVenderList.action");}else{Follow.followVM.find("#followMaxSeeFollowUrl").attr("href","http://t.jd.com/activity/followActivityList.action");}$.jdThickBox({width:300,height:80,title:"提示",source:Follow.followVM.find("#followMaxDiv").html()});return ;},followed:function(){var _this=this,tip="",url,type=this.get("type");if(type=="shopId"){tip="已关注过该店铺";url="http://follow.soa.jd.com/vender/queryForCount";Follow.followVM.find("#followedSeeFollowUrl").attr("href","http://t.jd.com/vender/followVenderList.action");}else{tip="已关注过该活动";url="http://follow.soa.jd.com/activity/queryForCount";Follow.followVM.find("#followedSeeFollowUrl").attr("href","http://t.jd.com/activity/followActivityList.action");}Follow.followVM.find("#followedTitle").html(tip);this.getFollowNum(url,function(data){if(data.code=="F10000"){var outStr;if(type=="shopId"){outStr="您已关注"+data.data+"个店铺";}else{outStr="您已关注"+data.data+"个活动";}Follow.followVM.find("#followedNum").html(outStr);}var dialog=jQuery("#dialogDiv");dialog.html('');$.jdThickBox({width:300,height:80,title:"提示",source:Follow.followVM.find("#followedDiv").html()});});},doSubmit:function(){var _this=this,str="",counter=0;jQuery("#oldTags").find("a").each(function(index,item){if("true"==jQuery(this).attr("isCheck")){counter++;if(str==""){str=jQuery(this).html();}else{str=str+","+jQuery(this).html();}}});jQuery("#newTags").find("a").each(function(index,item){if("true"==jQuery(this).attr("isCheck")){counter++;if(str==""){str=jQuery(this).html();}else{str=str+","+jQuery(this).html();}}});if(str==""){_this.showErrorMsg("请至少提供1个标签");return ;}if(counter>3){_this.showErrorMsg("最多可选择3个标签");return ;}str=encodeURIComponent(str);var url="http://follow.soa.jd.com/vender/editTag";jQuery.ajax({async:false,url:url,dataType:"jsonp",data:{venderId:_this.get("id"),tagNames:str},success:function(data){if(data.code=="F10000"){jQuery("#follow_error_msg").removeClass(); jQuery("#follow_error_msg").addClass("hl_green fl");jQuery("#follow_error_msg").html("设置成功");jQuery("#follow_error_msg").show();setTimeout(function(){jdThickBoxclose();},5000);}else{if(data.code=="F0410"){_this.showErrorMsg("设置的标签数超过最大限制");}else{_this.showErrorMsg("设置失败");}}},error:function(data,xhr){_this.showErrorMsg("设置失败");}});},showErrorMsg:function(err){jQuery("#follow_error_msg").removeClass();jQuery("#follow_error_msg").addClass("att-tips fl");jQuery("#follow_error_msg").html(err);jQuery("#follow_error_msg").show();setTimeout(function(){jQuery("#follow_error_msg").hide();},3000);},saveNewTag:function(){var _this=this,val=jQuery("#newTag").val();val=val.trim();if(val.trim().length>10){this.showErrorMsg("长度不能超过10个字符");return ;}var valid=this.validateNewTag(val);if(!valid){this.showErrorMsg("标签数字、字母、汉字组成");return ;}if(val==""||val==jQuery("#newTag").attr("placeholder")){this.showErrorMsg("请输入自定义名称!");jQuery("#newTag").val(jQuery("#newTag").attr("placeholder"));return ;}jQuery("
  • "+val+"
  • ").insertBefore(jQuery("#att-tag-new"));var content=jQuery("li[isNewAdd]"),tags=jQuery("li[isNewAdd] > .current");if(content.length>=3){jQuery("#att-tag-new").attr("style","display:none");}tags.unbind("click").click(function(){_this.chooseTag(this);});jQuery("#newTag").val(jQuery("#newTag").attr("placeholder"));},chooseTag:function(tag){var tNode=jQuery(tag),flag=tNode.attr("isCheck");if("undefined"==typeof flag||flag=="false"){tNode.attr("isCheck","true");tNode.addClass("current");}else{tNode.attr("isCheck","false");tNode.removeClass("current");}},validateNewTag:function(tag){var rTag=/[\u4e00-\u9fa5]|[0-9]|[a-z]|[A-Z]/g;var rArr=tag.match(rTag);var len=0;if(rArr!=null){len=rArr.length;}if(len!=tag.length){return false;}return true;},getFollowedCount:function(id){jQuery.ajax({async:false,url:"http://follow.soa.jd.com/vender/queryForCountByVid",dataType:"jsonp",data:{venderId:id},success:function(data){var count=data.data; if(count>500){if(count>10000){count=parseInt(count/10000);count=count+"万";}jQuery("#followedCount").html(count);}},error:function(data,shr){}});}};return function(arg){var cfg=$.extend({},_default,arg);new Follow(cfg,$(this));};})()});function _execute(module){var _function=$(module).attr("module-function"),_module_name=$(module).parents("[module-name]").attr("module-name"),_param;if(typeof _function=="undefined"){return ;}try{_param=eval("("+$(module).attr("module-param")+")");}catch(e){_param={};}var _functions=_function.split(",");_functions.each(function(index,n){if(jshop.module[_module_name]&&jshop.module[_module_name][n]){if(_param.subObj){$(module).find(_param.subObj).each(function(ind,q){jshop.module[_module_name][n].call(q,_param);});}else{jshop.module[_module_name][n].call(module,_param);}}else{if(jshop.module[n]){if(_param.subObj){$(module).find(_param.subObj).each(function(ind,q){jshop.module[n].call(q,_param);});}else{jshop.module[n].call(module,_param);}}}});}$(function(){$("div.j-module").each(function(index,n){if(!$(n).attr("panda")){_execute(n);}});});w.moduleRefresh=function(){var _this=$(this);if(!_this.attr("panda")){_execute(_this);}else{moduleRefreshforPanda.call(this);}};})(jQuery,window);(function(C,B){B.gModules=[];if(!Array.prototype.aUnique){Array.prototype.aUnique=function(E){if(E.constructor!=Array){throw new Error("Array:aUnique, arguments error");}var F=[];if(this.length==0||(!E.length)){return E;}else{for(var G=0,D=E.length;G