📄 detail_v2.js
字号:
(function(){TB.namespace("FastBuy");var a=YAHOO.util.Dom;TB.FastBuy=function(){var b="";return{init:function(c){b=c},showFastBuyBtn:function(){a.setStyle("J_FastBuyBtn","visibility","visible")},hideFastBuyBtn:function(){a.setStyle("J_FastBuyBtn","visibility","hidden")},hidePopup:function(){a.setStyle("J_LoginPopup","display","none")},go:function(){var c=a.get("J_FrmBid");c.action=b;c.submit()}}}()})();(function(){TB.namespace("Detail");var YU=YAHOO.util,YL=YAHOO.lang,YEU=YAHOO.env.ua,YUA=YU.Anim,YUD=YU.Dom,YUE=YU.Event;var doc=document,docBody=doc.body;var isIE=(0<YEU.ie),isIE6=(6==YEU.ie),timestamp=(+new Date).toString();var clearNodes=function(elmt){while(elmt.lastChild){elmt.removeChild(elmt.lastChild)}};var halt=function(error){alert(error);return false};var flush=function(){if(true===isIE){flush=function(){CollectGarbage()}}else{flush=function(){return false}}return flush()};TB.Detail.ShopVipPopup=function(){var config={};var getElmt=function(shopVipData){var frag=document.createDocumentFragment();if(shopVipData.msg!=""){var neoDiv=doc.createElement("div");var neoUl=doc.createElement("ul");var neoli=doc.createElement("li");neoli.appendChild(doc.createTextNode(shopVipData.msg));neoUl.appendChild(neoli);neoDiv.appendChild(neoUl);frag.appendChild(neoDiv);var neoSpan2=doc.createElement("span");frag.appendChild(neoSpan2);return frag}var neoUl=doc.createElement("ul");for(var i=0;i<shopVipData.promo.length;i++){var neoLi=doc.createElement("li");neoLi.appendChild(doc.createTextNode(shopVipData.promo[i].type+"\uff1a"));var neoEm=doc.createElement("em");neoEm.appendChild(doc.createTextNode(shopVipData.promo[i].price+" \u5143"));neoLi.appendChild(neoEm);neoUl.appendChild(neoLi)}var neoDiv=doc.createElement("div");neoDiv.appendChild(neoUl);frag.appendChild(neoDiv);var neoSpan=doc.createElement("span");frag.appendChild(neoSpan);return frag};var getData=function(){if(!this.popup.innerHTML){var shopVipUrl=config.shopVipUrl;var that=this;YAHOO.util.Get.script(shopVipUrl,{onSuccess:function(){that.popup.appendChild(getElmt(shopVipData))},charset:"GBK"})}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}var shopVipPopup=doc.createElement("div");shopVipPopup.className="shop-vip-popup";docBody.appendChild(shopVipPopup);var imgShopVip=config.imgShopVip;YUD.setStyle(imgShopVip,"cursor","pointer");var hoverTimer=YL.later(0,this,function(){});TB.widget.SimplePopup.decorate(imgShopVip,shopVipPopup,{position:"bottom",offset:[0,0],eventType:"mouse",delay:0.1,onShow:getData})}}}();TB.Detail.VipPopup=function(){var config={};var getElmt=function(){var neoUl=doc.createElement("ul"),prices=config.valVipPrices;for(var vip in prices){var neoLi=doc.createElement("li");neoLi.appendChild(doc.createTextNode(vip+"\uff1a"));var neoEm=doc.createElement("em");neoEm.appendChild(doc.createTextNode(prices[vip]+" \u5143"));neoLi.appendChild(neoEm);neoUl.appendChild(neoLi)}var neoDiv=doc.createElement("div");neoDiv.appendChild(neoUl);var neoDiv2=doc.createElement("div");neoDiv2.className="vip-popup invisible";neoDiv2.appendChild(neoDiv);var neoSpan=doc.createElement("span");neoDiv2.appendChild(neoSpan);docBody.appendChild(neoDiv2);YUD.setXY(neoDiv2,[-222,-73]);getElmt=function(){return neoDiv2};return getElmt()};var decorate=function(){var vipPopup=getElmt(),imgVip=config.imgVip;YUD.setStyle(imgVip,"cursor","pointer");var hoverTimer=YL.later(0,this,function(){});YUE.on(imgVip,"mouseover",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==imgVip&&true!==YUD.isAncestor(imgVip,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){YUD.setXY(vipPopup,[YUD.getX(config.imgVip),YUD.getY(config.imgVip)+13]);YUD.removeClass(vipPopup,"invisible")})}});YUE.on(imgVip,"mouseout",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==imgVip&&true!==YUD.isAncestor(imgVip,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){YUD.addClass(vipPopup,"invisible")})}});YUE.on(vipPopup,"mouseover",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==vipPopup&&true!==YUD.isAncestor(vipPopup,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){YUD.removeClass(vipPopup,"invisible")})}});YUE.on(vipPopup,"mouseout",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==vipPopup&&true!==YUD.isAncestor(vipPopup,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){YUD.addClass(vipPopup,"invisible")})}})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.SafetyService=function(){var config={};var decorate=function(triggers,tips){var showing=tips[0];YUD.removeClass(showing,"hidden");var hoverTimer=YL.later(0,this,function(){});for(var i=triggers.length-1;0<=i;i--){(function(){var j=i,curTrigger=triggers[j],curTip=tips[j];YUE.on(curTrigger,"mouseover",function(evt){if(false===YUD.hasClass(curTip,"hidden")){return false}var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==curTrigger&&true!==YUD.isAncestor(curTrigger,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){YUD.addClass(showing,"hidden");YUD.removeClass(curTip,"hidden");showing=curTip})}});YUE.on(curTrigger,"mouseout",function(evt){if(false===YUD.hasClass(curTip,"hidden")){return false}var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==curTrigger&&true!==YUD.isAncestor(curTrigger,relTarget)){hoverTimer.cancel()}})})()}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}var triggers=config.liSafety.getElementsByTagName("em"),tips=config.liSafety.getElementsByTagName("dl");if(0<triggers.length&&triggers.length===tips.length){decorate(triggers,tips)}}}}();TB.Detail.PayMethods=function(){return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config||!config.liPayMethods){return false}var trigger=YUD.getElementsByClassName("toggler","A",config.liPayMethods)[0],contl,clsName="collapsed";var updateTitle=function(){trigger.title=YUD.hasClass(contl,clsName)?"\u663e\u793a\u6240\u6709\u4ed8\u6b3e\u65b9\u5f0f":"\u7cbe\u7b80\u663e\u793a\u4ed8\u6b3e\u65b9\u5f0f"};if(trigger){contl=trigger.parentNode;updateTitle()}YUE.on(trigger,"click",function(e){trigger.blur();YUE.preventDefault(e);YUD[YUD.hasClass(contl,clsName)?"removeClass":"addClass"](contl,clsName);updateTitle()})}}}();TB.Detail.ThumbViewer=function(){var config={},viewing=null;var getBoothes=function(){var thumbPics=config.ulThumb.getElementsByTagName("img"),boothPics=[];for(var i=thumbPics.length-1;0<=i;i--){boothPics.unshift(thumbPics[i].getAttribute("src").replace("40x40","310x310"))}getBoothes=function(){return boothPics};return getBoothes()};var decorate=function(thumbs){viewing=thumbs[0];var hoverTimer=YL.later(0,this,function(){});for(var i=thumbs.length-1;0<=i;i--){(function(){var j=i,curThumb=thumbs[j],curLink=curThumb.getElementsByTagName("a")[0];if(true===isIE){curLink.hideFocus=true}YUE.on(curLink,"click",function(evt){YUE.preventDefault(evt)});YUE.on(curThumb,"mouseover",function(evt){if(true===YUD.hasClass(curThumb,"selected")){return false}var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==curThumb&&true!==YUD.isAncestor(curThumb,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){YUD.removeClass(viewing,"selected");YUD.addClass(curThumb,"selected");viewing=curThumb;if(viewing.getElementsByTagName("img")[0].getAttribute("hasZoom")==="1"){YUD.removeClass("J_zoomIcon","hidden")}else{YUD.addClass("J_zoomIcon","hidden")}config.imgBooth.src=getBoothes()[j]})}});YUE.on(curThumb,"mouseout",function(evt){if(true===YUD.hasClass(curThumb,"selected")){return false}var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==curThumb&&true!==YUD.isAncestor(curThumb,relTarget)){hoverTimer.cancel()}})})()}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}var thumbs=config.ulThumb.getElementsByTagName("li");if(0<thumbs.length){decorate(thumbs)}else{config.valMode-=32}},show:function(imgSrc){if(config.imgBooth.src===imgSrc){return false}YUD.removeClass(viewing,"selected");viewing=null;config.imgBooth.src=imgSrc}}}();TB.Detail.LimitPromotion=function(){var config={};var eventTerminated=false;var validateLimitProm=function(setErrMsg){if(config.valMode&1024){validateLimitProm=function(doAlert){var errMsg="",amount=parseInt(config.iptAmount.value,10),limitCount=config.valLimitPromInfo.limitCount;if(eventTerminated){alert("\u6d3b\u52a8\u5df2\u7ecf\u7ed3\u675f\uff0c\u4f60\u53ea\u80fd\u7528\u539f\u4ef7\u8d2d\u4e70\u4e86");return false}if(limitCount>0&&amount>limitCount){errMsg="\u60a8\u6240\u586b\u5199\u7684\u5b9d\u8d1d\u6570\u91cf\u8d85\u8fc7\u9650\u8d2d\u6570\u91cf\uff01"}if(""!==errMsg){YUD.removeClass(setErrMsg(errMsg),"hidden");return false}else{YUD.addClass(setErrMsg(),"hidden");return true}}}else{validateLimitProm=function(){return true}}return validateLimitProm()};var countDown=function(elCountdown,leftTime){var endTime=new Date()*1+leftTime*1000;(function(){var left=Math.floor((endTime-(new Date().getTime()))/1000),hours=Math.floor(left/3600),minutes=Math.floor(left%3600/60),seconds=left%60,str=[];if(left<=0){eventTerminated=true;elCountdown.parentNode.innerHTML="(\u6d3b\u52a8\u7ed3\u675f)"}else{(hours>0)&&str.push(hours+"\u5c0f\u65f6");(minutes>0)&&str.push((minutes>9?"":"0")+minutes+"\u5206\u949f");(hours<1)&&str.push((seconds>9?"":"0")+seconds+"\u79d2");elCountdown.innerHTML=str.join("");setTimeout(arguments.callee,1000)}})()};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}countDown(YAHOO.util.Dom.get(config.emLimitPromCountdown),config.valLimitPromInfo.timeLeft)},validate:function(setErrMsg){return validateLimitProm(setErrMsg)}}}();TB.Detail.PropertyHandler=function(){var config={},propData=[],selProp=[],propLen=0,fieldData={skuId:"",skuInfo:"",amount:0};var showImg=function(imgSrc){if(config.valMode&32){showImg=function(img){TB.Detail.ThumbViewer.show(img)}}else{showImg=function(){return false}}return showImg(imgSrc)};var updateProp=function(index,value){if(config.valMode&16){var propList=[],fragment=doc.createDocumentFragment(),neoUl=doc.createElement("ul");neoUl.className="props";for(var i=propLen-1;0<=i;i--){var thisProp=propData[i],neoLi=doc.createElement("li");neoLi.appendChild(doc.createTextNode(thisProp.prop+"\uff1a"));var neoStr=doc.createElement("strong");neoStr.appendChild(doc.createTextNode("\u5c1a\u672a\u9009\u62e9"));neoLi.appendChild(neoStr);neoUl.insertBefore(neoLi,neoUl.firstChild||null);propList.unshift(neoStr)}fragment.appendChild(neoUl);var neoHr=doc.createElement("hr");fragment.appendChild(neoHr);config.ulChoice.parentNode.insertBefore(fragment,config.ulChoice);updateProp=function(idx,val){propList[idx].replaceChild(doc.createTextNode(val),propList[idx].firstChild)}}else{updateProp=function(){return false}}return updateProp(index,value)};var setErrMsg=function(errMsg){var neoDiv=doc.createElement("div");neoDiv.className="msg hidden";var neoP=doc.createElement("p");neoP.appendChild(doc.createTextNode("\u53d1\u751f\u9519\u8bef"));neoP.className="stop";neoDiv.appendChild(neoP);config.dlChoice.parentNode.insertBefore(neoDiv,config.dlChoice);setErrMsg=function(msg){if("undefined"!==typeof msg){neoP.replaceChild(doc.createTextNode(msg),neoP.firstChild)}return neoDiv};return setErrMsg(errMsg)};var validate=function(doAlert){doAlert=doAlert||false;var skuInfo=[];var errArr=[];for(var i=propLen-1;0<=i;i--){var thisProp=selProp[i];if(""===thisProp.pvid){YUD.addClass(propData[i].elmt,"h");errArr.push(thisProp.prop)}else{YUD.removeClass(propData[i].elmt,"h");skuInfo.unshift(thisProp.prop+":"+thisProp.name)}}var errLen=errArr.length;if(0<errLen){var fragment=doc.createDocumentFragment();var neoDt=doc.createElement("dt");neoDt.appendChild(doc.createTextNode("\u8bf7\u9009\u62e9\uff1a"));fragment.appendChild(neoDt);var neoDd=doc.createElement("dd");neoDd.className="h";for(var i=errLen-1;0<=i;i--){var neoEm=doc.createElement("em");neoEm.appendChild(doc.createTextNode('"'+errArr[i]+'"'));neoDd.appendChild(neoEm)}fragment.appendChild(neoDd);clearNodes(config.dlChoice);config.dlChoice.appendChild(fragment);YUD.addClass(config.dlChoice,"h")}else{YUD.removeClass(config.dlChoice,"h");fieldData.skuInfo=skuInfo.join(";")}var errMsg="",stock=parseInt(config.spanStock.firstChild.nodeValue,10),amount=parseInt(config.iptAmount.value,10);switch(true){case false===/^\d+$/.test(config.iptAmount.value)||0>=amount:errMsg="\u8bf7\u586b\u5199\u6b63\u786e\u7684\u5b9d\u8d1d\u6570\u91cf\uff01";break;case stock<amount:errMsg="\u60a8\u6240\u586b\u5199\u7684\u5b9d\u8d1d\u6570\u91cf\u8d85\u8fc7\u5e93\u5b58\uff01";break}if(""!==errMsg){YUD.removeClass(setErrMsg(errMsg),"hidden")}else{YUD.addClass(setErrMsg(),"hidden");fieldData.amount=amount}var ret=true;if(0<errLen||""!==errMsg){if(true===doAlert&&0<errLen){ret=halt("\u8bf7\u9009\u62e9\uff1a"+errArr.join(", "))}ret=false}ret=ret&&TB.Detail.LimitPromotion.validate(setErrMsg,doAlert);return ret};var unique=function(arr){if(arr.length<2){return arr}var a=[],b=[];for(var c in arr){var d=arr[c];if(d===a[c]){continue}if(1!==b[d]){a.push(d);b[d]=1}}return a};var updateComboPrice=function(){if(config.valMode&16){updateComboPrice=function(){TB.Detail.ComboHandler.syncPrice()}}else{updateComboPrice=function(){return false}}return updateComboPrice()};var updateVipPrice=function(price){if(config.valMode&8){var spanVip=config.spanVip;updateVipPrice=function(curPrice){spanVip.replaceChild(doc.createTextNode(curPrice),spanVip.firstChild)}}else{updateVipPrice=function(){return false}}return updateVipPrice(price)};var updatePointsBuyPrice=function(price){if(config.emPointsBuy){var emPoints=config.emPointsBuy;updatePointsBuyPrice=function(curPrice){emPoints.replaceChild(doc.createTextNode(curPrice),emPoints.firstChild)}}else{updatePointsBuyPrice=function(){return false}}return updatePointsBuyPrice(price)};var updateLimitPromPrice=function(price){if(config.valMode&1024){var spanLimitProm=config.spanLimitProm;updateLimitPromPrice=function(curPrice){spanLimitProm.replaceChild(doc.createTextNode(curPrice),spanLimitProm.firstChild)}}else{updateLimitPromPrice=function(){return false}}return updateLimitPromPrice(price)};var calVipPrice=function(price){if(config.valMode&8){var vipRate=config.valVipRate;calVipPrice=function(curPrice){return(curPrice*vipRate/100).toFixed(2)}}else{calVipPrice=function(curPrice){return curPrice}}return calVipPrice(price)};var calLimitPromPrice=function(price){if(config.valMode&1024){var discount=config.valLimitPromInfo.discount;calLimitPromPrice=function(curPrice){return(curPrice*discount/1000).toFixed(2)}}else{calLimitPromPrice=function(curPrice){return curPrice}}return calLimitPromPrice(price)};var updatePoint=function(point){if(config.valMode&512){var emPoint=config.emPoint;updatePoint=function(curPoint){emPoint.replaceChild(doc.createTextNode(curPoint),emPoint.firstChild)}}else{updatePoint=function(){return false}}return updatePoint(point)};var calPoint=function(price){if(config.valMode&512){var pointRate=config.valPointRate;calPoint=function(curPrice){return Math.floor(curPrice*pointRate)}}else{calPoint=function(curPrice){return curPrice}}return calPoint(price)};var decorate=function(){propLen=config.elmProps.length;var skuMap=config.valItemInfo.skuMap,strPrice=config.strPrice,defPrice=strPrice.firstChild.nodeValue,defPointsBuyPrice=config.emPointsBuy?config.emPointsBuy.innerHTML:0,vipPrice=(config.valMode&8)?config.spanVip.firstChild.nodeValue:0,limitPromPrice=(config.valMode&1024)?config.spanLimitProm.firstChild.nodeValue:0,spanStock=config.spanStock,spanPromLimitCount=config.spanPromLimitCount,defStock=config.spanStock.firstChild.nodeValue,defPoint=(config.valMode&512)?config.emPoint.firstChild.nodeValue:0,defSelQueue=[],defSel=config.valItemInfo.defSelected,doesDefSel=("undefined"!==typeof defSel&&propLen===defSel.length),skuFound=false,showPromLimitCount=config.valMode&1024;for(var i=propLen-1;0<=i;i--){var curElmt=config.elmProps[i],curProp=propData[i]={prop:"",elmt:null,data:[],hasImg:null},curSel=selProp[i]={pvid:"",prop:"",name:"",elmt:null,oos:[]};curProp.prop=curSel.prop=curElmt.getAttribute("data-property");curProp.elmt=YUD.getPreviousSibling(curElmt.parentNode);curProp.hasImg=YUD.hasClass(curElmt,"img");var selAnchor=doc.createElement("i");selAnchor.appendChild(doc.createTextNode("\u5df2\u9009\u4e2d"));var anchorFragment=doc.createDocumentFragment();anchorFragment.appendChild(selAnchor);var vals=curElmt.getElementsByTagName("span");for(var j=vals.length-1;0<=j;j--){var curSpan=vals[j],curLink=curSpan.parentNode,curItem=curLink.parentNode,curData={name:"",pvid:"",elmt:null,img:""};curData.name=curSpan.firstChild.nodeValue;curData.pvid=curItem.getAttribute("data-value");curData.elmt=curItem;if(true===curProp.hasImg){var bgImg=YUD.getStyle(curLink,"background-image");if(-1!==bgImg.indexOf("url(")){curData.img=bgImg.match(/url\(([^\)]*)/)[1].replace("30x30","310x310")}}curProp.data.unshift(curData);if(true===isIE){curLink.hideFocus=true}if((true===doesDefSel&&defSel[i]===curData.pvid)||1===vals.length){defSelQueue.push(curLink)}(function(){var idx=i,propName=curProp.prop,theItem=curItem,theLink=curLink,theData=curData,theSel=curSel,theAchr=selAnchor;YUE.on(theLink,"click",function(evt){if("undefined"!==typeof evt){YUE.preventDefault(evt)}if(YUD.hasClass(theItem,"out-of-stock")){return false}if(""!==theData.img){showImg(theData.img)}if(theSel.pvid===theData.pvid){YUD.removeClass(theItem,"selected");anchorFragment.appendChild(theAchr);theSel.pvid="";theSel.name="";theSel.elmt=null}else{YUD.addClass(theItem,"selected");theItem.appendChild(theAchr);YUD.removeClass(theSel.elmt,"selected");theSel.pvid=theData.pvid;theSel.name=theData.name;theSel.elmt=theItem}var selArr=[],nonSelArr=[];var fragment=doc.createDocumentFragment();var neoDt=doc.createElement("dt");neoDt.appendChild(doc.createTextNode("\u5df2\u9009\u62e9\uff1a"));fragment.appendChild(neoDt);var neoDd=doc.createElement("dd");neoDd.className="h";for(var k=0;propLen>k;k++){var thisProp=selProp[k],thisPvId=thisProp.pvid;if(""!==thisPvId){var neoEm=doc.createElement("em");neoEm.setAttribute("title",thisProp.prop);neoEm.appendChild(doc.createTextNode('"'+thisProp.name+'"'));neoDd.appendChild(neoEm);selArr.push(thisPvId)}else{nonSelArr.push(k)}}if(0===selArr.length){neoDt.replaceChild(doc.createTextNode("\u8bf7\u9009\u62e9\uff1a"),neoDt.firstChild);neoDt.className="h";for(var k=0;propLen>k;k++){var neoEm=doc.createElement("em");neoEm.appendChild(doc.createTextNode('"'+selProp[k].prop+'"'));neoDd.appendChild(neoEm)}}fragment.appendChild(neoDd);clearNodes(config.dlChoice);config.dlChoice.appendChild(fragment);while(0<theSel.oos.length){YUD.removeClass(theSel.oos.pop(),"out-of-stock")}if(theSel.pvid===theData.pvid){for(var k=0;propLen>k;k++){if(k===idx){continue}var curData=propData[k].data,curDataLen=curData.length;for(var l=0;l<curDataLen;l++){var thisData=curData[l],oosStatus=true;var pvStr="",pvSmall=theSel.pvid,pvBig=thisData.pvid,pvSwap="";if(parseInt(pvSmall.split(":")[0],10)>parseInt(pvBig.split(":")[0],10)){pvSwap=pvSmall;pvSmall=pvBig;pvBig=pvSwap}if(2===propLen){pvStr=";"+pvSmall+";"+pvBig+";";for(var sku in skuMap){if(-1!==sku.indexOf(pvStr)){oosStatus=false;break}}}else{pvStr=new RegExp(";"+pvSmall+";(\\d+:\\d+;)*"+pvBig+";");for(var sku in skuMap){if(true===pvStr.test(sku)){oosStatus=false;break}}}if(true===oosStatus){YUD.addClass(thisData.elmt,"out-of-stock");theSel.oos.push(thisData.elmt)}}}if(2<propLen){var nonSelLen=nonSelArr.length;for(var k=0;k<nonSelLen;k++){var curData=propData[nonSelArr[k]].data,curDataLen=curData.length;for(var l=0;l<curDataLen;l++){var thisData=curData[l],oosStatus=true;var pvArr=[].concat(selArr);pvArr.push(thisData.pvid);pvArr.sort(function(a,b){return(parseInt(a.split(":")[0],10)<parseInt(b.split(":")[0],10))?-1:1});var pvStr=new RegExp(";"+pvArr.join(";(\\d+:\\d+;)*")+";");for(var sku in skuMap){if(true===pvStr.test(sku)){oosStatus=false;break}}if(true===oosStatus){YUD.addClass(thisData.elmt,"out-of-stock");theSel.oos.push(thisData.elmt)}}}}}if(selArr.length===propLen){var skuFlag=";"+selArr.join(";")+";";if("undefined"!==typeof skuMap[skuFlag]){var curSku=skuMap[skuFlag];strPrice.replaceChild(doc.createTextNode(curSku.price),strPrice.firstChild);updatePointsBuyPrice((curSku.price*100).toFixed(0));var curPrice=calVipPrice(curSku.price);updateVipPrice(curPrice);curPrice=calLimitPromPrice(curPrice);updateLimitPromPrice(curPrice);updatePoint(calPoint(curPrice));updateComboPrice();spanStock.replaceChild(doc.createTextNode(curSku.stock),spanStock.firstChild);if(config.valMode&1024&&spanPromLimitCount){showPromLimitCount=curSku.stock>config.valLimitPromInfo.limitCount;YUD[showPromLimitCount?"removeClass":"addClass"](spanPromLimitCount.parentNode,"hidden");YUD[showPromLimitCount?"addClass":"removeClass"](spanStock.parentNode,"hidden")}fieldData.skuId=curSku.skuId;skuFound=true}}else{if(true===skuFound){strPrice.replaceChild(doc.createTextNode(defPrice),strPrice.firstChild);updatePointsBuyPrice(defPointsBuyPrice);updateLimitPromPrice(limitPromPrice);updateVipPrice(vipPrice);updatePoint(defPoint);updateComboPrice();spanStock.replaceChild(doc.createTextNode(defStock),spanStock.firstChild);if(config.valMode&1024&&spanPromLimitCount){showPromLimitCount=defStock>config.valLimitPromInfo.limitCount;YUD[showPromLimitCount?"removeClass":"addClass"](spanPromLimitCount.parentNode,"hidden");YUD[showPromLimitCount?"addClass":"removeClass"](spanStock.parentNode,"hidden")}skuFound=false}}})})()}}while(0<defSelQueue.length){YUE.getListeners(defSelQueue.pop(),"click")[0].fn()}YUE.on(config.linkBuy,"click",function(evt){YUE.preventDefault(evt);if(true===validate(true)){var formElm=config.frmBid.elements;formElm.quantity.value=fieldData.amount;formElm.skuId.value=fieldData.skuId;formElm.skuInfo.value=fieldData.skuInfo;TB.Detail.FastLogin.checkLogin()}});var hoverTimer=YL.later(0,this,function(){});YUE.on(config.linkBuy,"mouseover",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==config.linkBuy&&true!==YUD.isAncestor(config.linkBuy,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){validate()})}});YUE.on(config.linkBuy,"mouseout",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==config.linkBuy&&true!==YUD.isAncestor(config.linkBuy,relTarget)){hoverTimer.cancel()}});if(true===isIE6){var divKeyProp=config.divKeyProp,ie6HoverTimer=YL.later(0,this,function(){});YUE.on(divKeyProp,"mouseover",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==divKeyProp&&true!==YUD.isAncestor(divKeyProp,relTarget)){ie6HoverTimer.cancel();ie6HoverTimer=YL.later(100,this,function(){YUD.addClass(divKeyProp,"key-hover")})}});YUE.on(divKeyProp,"mouseout",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==divKeyProp&&true!==YUD.isAncestor(divKeyProp,relTarget)){ie6HoverTimer.cancel();ie6HoverTimer=YL.later(100,this,function(){YUD.removeClass(divKeyProp,"key-hover")})}})}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()},getFieldData:function(){return fieldData},validatePorp:function(doAlert){return validate(doAlert)},setErrMsg:function(msg){return setErrMsg(msg)}}}();TB.Detail.CartHandler=function(){var config={},isLoading=false;var showErrMsg=function(isMem){var neoDiv=doc.createElement("div");neoDiv.className="msg";var neoP=doc.createElement("p");neoP.appendChild(doc.createTextNode("\u53d1\u751f\u9519\u8bef"));neoP.className="stop";neoDiv.appendChild(neoP);config.linkAdd.parentNode.parentNode.parentNode.insertBefore(neoDiv,config.linkAdd.parentNode.parentNode);showErrMsg=function(isMember,hide){if(true!==hide){clearNodes(neoP);if(true===isMember){neoP.appendChild(doc.createTextNode("\u60a8\u6dfb\u52a0\u7684\u5b9d\u8d1d\u79cd\u7c7b\u5df2\u7ecf\u8fbe\u5230\u4e0a\u9650\u4e86"))}else{var fragment=doc.createDocumentFragment();fragment.appendChild(doc.createTextNode("\u60a8\u6dfb\u52a0\u7684\u5b9d\u8d1d\u79cd\u7c7b\u5df2\u7ecf\u8fbe\u5230\u4e0a\u9650\u4e86\uff0c"));var neoLink=doc.createElement("a");neoLink.href="http://member1.taobao.com/member/login.jhtml?redirectURL="+encodeURIComponent(location.href);neoLink.appendChild(doc.createTextNode("\u767b\u5f55"));fragment.appendChild(neoLink);fragment.appendChild(doc.createTextNode("\u540e\u53ef\u7ee7\u7eed\u6dfb\u52a0"));neoP.appendChild(fragment)}}return neoDiv};return showErrMsg(isMem)};var updateCart=function(result,comboMode){var neoDiv=doc.createElement("div");neoDiv.className="cart-info";var neoH4=doc.createElement("h4");neoH4.appendChild(doc.createTextNode("\u5b9d\u8d1d\u5df2\u6210\u529f\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\uff01"));neoDiv.appendChild(neoH4);var neoP=doc.createElement("p");var neoSpan=doc.createElement("span");neoSpan.appendChild(doc.createTextNode("\u8d2d\u7269\u8f66\u5171"));var neoStrong=doc.createElement("strong");neoStrong.appendChild(doc.createTextNode("0"));neoSpan.appendChild(neoStrong);neoSpan.appendChild(doc.createTextNode("\u79cd\u5b9d\u8d1d"));neoP.appendChild(neoSpan);var neoSpan2=doc.createElement("span");neoSpan2.appendChild(doc.createTextNode("\u5408\u8ba1\uff1a"));var neoStrong2=doc.createElement("strong");neoStrong2.className="price";neoStrong2.appendChild(doc.createTextNode("0.00"));neoSpan2.appendChild(neoStrong2);neoP.appendChild(neoSpan2);neoDiv.appendChild(neoP);var neoP2=doc.createElement("span");neoP2.className="skin-gray";var neoA2=doc.createElement("a");neoA2.className="btn";neoA2.href="#";neoA2.title="\u7ee7\u7eed\u6311\u5b9d\u8d1d";neoA2.appendChild(doc.createTextNode("\u518d\u901b\u901b"));neoP2.appendChild(neoA2);neoDiv.appendChild(neoP2);var neoP3=doc.createElement("span");neoP3.className="skin";var neoA=doc.createElement("a");neoA.className="long-btn";neoA.href=("undefined"!==typeof config.valCartInfo.cartUrl)?config.valCartInfo.cartUrl:"http://buy.taobao.com/auction/cart/my_cart.htm";neoA.title="\u53bb\u8d2d\u7269\u8f66\u7ed3\u7b97";neoA.appendChild(doc.createTextNode("\u53bb\u8d2d\u7269\u8f66\u7ed3\u7b97"));neoP3.appendChild(neoA);neoDiv.appendChild(neoP3);var neoA3=doc.createElement("a");neoA3.className="close";neoA3.href="#";neoA3.title="\u5173\u95ed";var neoSpan3=doc.createElement("span");neoSpan3.appendChild(doc.createTextNode("\u5173\u95ed"));neoA3.appendChild(neoSpan3);neoDiv.appendChild(neoA3);if(true===isIE){neoA3.hideFocus=true}var closeFunc=function(evt){YUE.preventDefault(evt);YUD.addClass(neoDiv,"hidden")};YUE.on(neoA2,"click",closeFunc);YUE.on(neoA3,"click",closeFunc);var linkAddContainer=config.linkAdd.parentNode.parentNode;if(config.valMode&16){var linkComboContainer=config.linkCombo.parentNode,comboCache=false===comboMode;updateCart=function(resObj,combo){if("undefined"!==typeof resObj){neoStrong.replaceChild(doc.createTextNode(resObj.cartQuantity),neoStrong.firstChild);neoStrong2.replaceChild(doc.createTextNode(resObj.cartPrice),neoStrong2.firstChild)}if(true===combo&&false===comboCache){linkComboContainer.appendChild(neoDiv);comboCache=!comboCache}else{if(false===combo&&true===comboCache){linkAddContainer.appendChild(neoDiv);comboCache=!comboCache}}YUD.removeClass(neoDiv,"hidden")}}else{linkAddContainer.appendChild(neoDiv);updateCart=function(resObj){if("undefined"!==typeof resObj){neoStrong.replaceChild(doc.createTextNode(resObj.cartQuantity),neoStrong.firstChild);neoStrong2.replaceChild(doc.createTextNode(resObj.cartPrice),neoStrong2.firstChild)}YUD.removeClass(neoDiv,"hidden")}}return updateCart(result,comboMode)};var doStats=function(comboMode){var statsUrl=config.valCartInfo.statsUrl;if("undefined"!==typeof statsUrl&&""!==statsUrl){var queryStr=statsUrl+((-1===statsUrl.indexOf("?"))?"?":"&")+"pre="+encodeURIComponent(doc.URL);doStats=function(combo){var statsImg=new Image(1,1);statsImg.src=queryStr.replace("{loc}",(true===combo)?"2":"1")+"&cache="+(+new Date());statsImg.onload=function(){statsImg=null}}}else{doStats=function(){return false}}return doStats(comboMode)};var decorate=function(){var hoverTimer=YL.later(200,this,function(){});YUE.on(config.linkAdd,"mouseover",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==config.linkAdd&&true!==YUD.isAncestor(config.linkAdd,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){TB.Detail.Validator.run()})}});YUE.on(config.linkAdd,"mouseout",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==config.linkAdd&&true!==YUD.isAncestor(config.linkAdd,relTarget)){hoverTimer.cancel()}});YUE.on(config.linkAdd,"click",function(evt,combo){YUE.preventDefault(evt);if(true===isLoading){return false}var comboMode=("undefined"!==typeof combo);if(true===TB.Detail.Validator.run(true)){if(config.valMode&1){var fieldData=TB.Detail.PropertyHandler.getFieldData(),outerType=2,outerId=fieldData.skuId,amount=fieldData.amount,dbNum=config.valCartInfo.dbNum}else{var outerType=1,outerId=config.valCartInfo.itemId,amount=(true===comboMode)?1:parseInt(config.iptAmount.value,10),dbNum=config.valCartInfo.dbNum}}else{if(true===comboMode){config.divDetail.scrollIntoView(true)}return}YUD.addClass(showErrMsg(false,true),"hidden");var queryStr=((-1===config.apiAddCart.indexOf("?"))?"?":"&")+"outer_id="+outerId+"&outer_id_type="+outerType+"&quantity="+amount+"&x_id="+dbNum;if(true===comboMode){queryStr+="&meal_ids="+combo}queryStr+="&nekot="+timestamp;queryStr+="&ct="+(("undefined"!==typeof config.valCartInfo.ct)?config.valCartInfo.ct:"");isLoading=true;YU.Get.script(config.apiAddCart+queryStr,{onSuccess:function(){if("undefined"===typeof TB.Detail.CartResult){isLoading=false;return halt("\u65e0\u6cd5\u52a0\u8f7d\u8d2d\u7269\u8f66\u6570\u636e")}var result=TB.Detail.CartResult;TB.Detail.CartResult=null;delete TB.Detail.CartResult;flush();if("undefined"!==typeof result.error){if("TrackCartIsFull"===result.error){YUD.removeClass(showErrMsg(),"hidden")}else{if("UserCartIsFull"===result.error){YUD.removeClass(showErrMsg(true),"hidden")}else{isLoading=false;return halt(result.error)}}}else{updateCart(result,comboMode);doStats(comboMode);isLoading=false}},onFailure:function(){isLoading=false;return halt("\u63a5\u53e3\u8bbf\u95ee\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002")},timeout:10000,autopurge:true,charset:doc.charset||doc.characterSet||"gb2312"})})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.ComboHandler=function(){var config={},itemData=[],itemLen=0,bitSel=0,comboParam=[],marketPrice=0,promotionPrice=0;var calBitVal=function(degree){return Math.round(Math.pow(2,degree))};var calPrice=function(price){if(config.valMode&8){var vipRate=config.valVipRate;calPrice=function(curPrice){return(curPrice*vipRate/100).toFixed(2)}}else{if(config.valMode&1024){var promRate=config.valLimitPromInfo.discount;calPrice=function(curPrice,itemPrice){itemPrice=itemPrice||0;return((itemPrice*promRate/1000)+(curPrice-itemPrice)).toFixed(2)}}else{calPrice=function(curPrice){return curPrice.toFixed(2)}}}return calPrice(price)};var updatePrice=function(reset){var priceNode=config.strPrice,marketNode=config.ulPrice.getElementsByTagName("del")[0],promotionNode=config.ulPrice.getElementsByTagName("strong")[0];updatePrice=function(resetMode){var itemPrice=parseFloat(priceNode.firstChild.nodeValue);if(true===isNaN(itemPrice)){return halt("\u4ef7\u683c\u8ba1\u7b97\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5")}if(true===resetMode){marketPrice=0;promotionPrice=0;comboParam=[];for(var i=itemLen-1;0<=i;i--){var curData=itemData[i];if(bitSel&curData.bit){marketPrice+=curData.market;promotionPrice+=curData.promo;comboParam.push(curData.id)}}}marketNode.firstChild.nodeValue=calPrice(marketPrice+itemPrice,itemPrice);var promoPrice=calPrice(promotionPrice+itemPrice,itemPrice);promotionNode.firstChild.nodeValue=promoPrice;updatePoint(promoPrice)};return updatePrice(reset)};var updatePoint=function(price){if(config.valMode&512){var pointNode=config.ulPrice.getElementsByTagName("em")[0];var pointRate=config.valPointRate;updatePoint=function(curPrice){var itemPoint=Math.floor(curPrice*pointRate);if(true===isNaN(itemPoint)){return halt("\u79ef\u5206\u8ba1\u7b97\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5")}pointNode.firstChild.nodeValue=itemPoint}}else{updatePoint=function(){return false}}return updatePoint(price)};var decorate=function(triggers,choices){itemLen=triggers.length;for(var i=itemLen-1;0<=i;i--){var curTrigger=triggers[i],curBit=calBitVal(i);(function(){var thisTrigger=curTrigger;setTimeout(function(){thisTrigger.checked=true},0)})();bitSel+=curBit;var curData=itemData[i]={id:curTrigger.value,bit:curBit,promo:parseFloat(curTrigger.getAttribute("data-promotion")),market:parseFloat(curTrigger.getAttribute("data-market"))};marketPrice+=curData.market;promotionPrice+=curData.promo;comboParam.push(curData.id);(function(){var thisBit=curBit,thisTrigger=curTrigger,thisChoice=choices[i],thisData=curData[i];YUE.on(curTrigger,"click",function(evt){YUE.preventDefault(evt);if(thisBit===bitSel){return halt("\u8bf7\u81f3\u5c11\u4fdd\u7559\u4e00\u4ef6\u5b9d\u8d1d")}if(bitSel&thisBit){bitSel-=thisBit;YUD.addClass(thisChoice,"hidden");setTimeout(function(){thisTrigger.checked=false},0)}else{bitSel+=thisBit;YUD.removeClass(thisChoice,"hidden");setTimeout(function(){thisTrigger.checked=true},0)}updatePrice(true)})})()}var itemImg=config.ulCombo.getElementsByTagName("img"),itemLink=config.ulCombo.getElementsByTagName("a");if(itemImg.length===itemLink.length){if(true===isIE6){var resizeImg=function(img){var width=img.width,height=img.height;if(width>80||height>80){var a=width/80,b=height/80;if(a<b){a=b}width=width/a;height=height/a}if(0<width&&0<height){img.width=width;img.height=height}}}for(var i=itemImg.length-1;0<=i;i--){(function(){var idx=i,curImg=itemImg[idx],curLink=itemLink[idx];if(true===isIE){curLink.hideFocus=true}if(true===isIE6){if(curImg.complete){resizeImg(curImg)}else{YUE.on(curImg,"load",function(evt){resizeImg(curImg)})}YUE.on(curImg,"error",function(evt){curImg.src="http://a.tbcdn.cn/app/tc/img/blank_80.png"})}if("_blank"!==curLink.target){YUD.setStyle(curLink,"cursor","default");YUE.on(curLink,"click",function(evt){YUE.preventDefault(evt)})}})()}}var comboAddFunc=YUE.getListeners(config.linkAdd,"click")[0].fn;YUE.on(config.linkCombo,"click",function(evt){YUE.preventDefault(evt);comboAddFunc(evt,comboParam.join(","))})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}var triggers=config.ulCombo.getElementsByTagName("input"),choices=config.ulChoice.getElementsByTagName("li");if(0<triggers.length&&triggers.length===choices.length){decorate(triggers,choices)}},syncPrice:function(){return updatePrice()}}}();TB.Detail.Validator=function(){var config={};var setErrMsg=function(errMsg){var neoDiv=doc.createElement("div");neoDiv.className="msg hidden";var neoP=doc.createElement("p");neoP.appendChild(doc.createTextNode("\u53d1\u751f\u9519\u8bef"));neoP.className="stop";neoDiv.appendChild(neoP);config.linkBuy.parentNode.parentNode.parentNode.insertBefore(neoDiv,config.linkBuy.parentNode.parentNode);setErrMsg=function(msg){if("undefined"!==typeof msg){neoP.replaceChild(doc.createTextNode(msg),neoP.firstChild)}return neoDiv};return setErrMsg(errMsg)};var validate=function(doAlert){if(config.valMode&1){validate=TB.Detail.PropertyHandler.validatePorp}else{if(null!==config.iptAmount){validate=function(){var errMsg="",stock=parseInt(config.spanStock.firstChild.nodeValue,10),amount=parseInt(config.iptAmount.value,10);switch(true){case false===/^\d+$/.test(config.iptAmount.value)||0>=amount:errMsg="\u8bf7\u586b\u5199\u6b63\u786e\u7684\u5b9d\u8d1d\u6570\u91cf\uff01";break;case stock<amount:errMsg="\u60a8\u6240\u586b\u5199\u7684\u5b9d\u8d1d\u6570\u91cf\u8d85\u8fc7\u5e93\u5b58\uff01";break}if(""!==errMsg){YUD.removeClass(setErrMsg(errMsg),"hidden");return false}else{YUD.addClass(setErrMsg(),"hidden");return TB.Detail.LimitPromotion.validate(setErrMsg)}}}else{validate=function(){return true}}}return validate(doAlert)};var decorate=function(){if(0===(config.valMode&1)){YUE.on(config.linkBuy,"click",function(evt){YUE.preventDefault(evt);if(true===validate(true)){var formElm=config.frmBid.elements;formElm.quantity.value=parseInt(config.iptAmount.value,10);TB.Detail.FastLogin.checkLogin()}});var hoverTimer=YL.later(200,this,function(){});YUE.on(config.linkBuy,"mouseover",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==config.linkBuy&&true!==YUD.isAncestor(config.linkBuy,relTarget)){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){validate()})}});YUE.on(config.linkBuy,"mouseout",function(evt){var relTarget=YUE.getRelatedTarget(evt);if(relTarget!==config.linkBuy&&true!==YUD.isAncestor(config.linkBuy,relTarget)){hoverTimer.cancel()}})}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()},run:function(doAlert){return validate(doAlert)},setErrMsg:setErrMsg}}();TB.Detail.CollapseSwitch=function(){var config={},switchElement=null,switchTrigger=null,detailContent=null;var getDoc=function(){if(0<YEU.webkit){getDoc=function(){return docBody}}else{getDoc=function(){return doc.documentElement}}return getDoc()};var calcPos=function(){var viewportHeight=YUD.getViewportHeight()-2;if(true===isIE6){calcPos=function(resizing){if(true===resizing){viewportHeight=YUD.getViewportHeight()-2}var docScrollTop=getDoc().scrollTop,detailRegion=YUD.getRegion(detailContent),detailTop=detailRegion.top,detailBottom=detailRegion.bottom;if(docScrollTop>=detailTop){YUD.setStyle(switchElement,"top",(getDoc().scrollTop-detailTop).toString()+"px");if(docScrollTop+viewportHeight<detailBottom){YUD.setStyle(switchTrigger,"height",viewportHeight+"px")}else{YUD.setStyle(switchTrigger,"height",detailBottom-docScrollTop+"px")}}else{YUD.setStyle(switchElement,"top","0px");YUD.setStyle(switchTrigger,"height",viewportHeight+docScrollTop-detailTop+"px")}}}else{calcPos=function(resizing){if(true===resizing){viewportHeight=YUD.getViewportHeight()-2}var docScrollTop=getDoc().scrollTop,detailRegion=YUD.getRegion(detailContent),detailTop=detailRegion.top,detailBottom=detailRegion.bottom;if(docScrollTop>=detailTop){YUD.setStyle(switchElement,"top","0px");YUD.setStyle(switchElement,"margin-top","0px");if(docScrollTop+viewportHeight<detailBottom){YUD.setStyle(switchTrigger,"height",viewportHeight+"px")}else{YUD.setStyle(switchTrigger,"height",detailBottom-docScrollTop+"px")}}else{YUD.setStyle(switchElement,"margin-top",0-getDoc().scrollTop+"px");YUD.setStyle(switchElement,"top","auto");YUD.setStyle(switchTrigger,"height",viewportHeight+docScrollTop-detailTop+"px")}}}return calcPos()};var decorate=function(){switchElement=doc.createElement("div");switchElement.className="switch-bar";switchTrigger=doc.createElement("a");switchTrigger.href="#";var neoSpan=doc.createElement("span");neoSpan.appendChild(doc.createTextNode("\u70b9\u6b64\u5c55\u5f00/\u6298\u53e0\u4fa7\u680f"));var divDetail=config.divDetail;detailContent=divDetail.parentNode.parentNode;if(1===config.expanded){YUD.addClass(detailContent,"expanded")}if(YUD.hasClass(detailContent,"expanded")){var expanded=1}else{var expanded=-1}if(true===isIE){switchTrigger.hideFocus=true}var mainWrap=divDetail;YUD.setStyle(mainWrap,"position","relative");switchTrigger.appendChild(neoSpan);switchElement.appendChild(switchTrigger);mainWrap.insertBefore(switchElement,$("detail"));calcPos();var anime=new YUA(switchElement,{opacity:{from:0,to:1}},0.3);anime.animate();var isHidden=false,scrollTimer=YL.later(0,this,function(){});YUE.on(window,"scroll",function(){calcPos()});var resizeTimer=YL.later(0,this,function(){});YUE.on(window,"resize",function(){calcPos(true)});YUE.on(switchTrigger,"click",function(evt){YUE.preventDefault(evt);if(1===expanded){YUD.removeClass(detailContent,"expanded")}else{YUD.addClass(detailContent,"expanded")}expanded*=-1})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.Countdown=function(){var config={};var decorate=function(){var timeLeft=parseInt(config.valTimeLeft,10),endText="\u6210\u4ea4\u7ed3\u675f";TB.util.CountdownTimer.attach(config.emCountdown,timeLeft,{timeoutText:endText,onEnd:function(){config.emCountdown.className="h"}});if(null!==config.emCountdown2){TB.util.CountdownTimer.attach(config.emCountdown2,timeLeft,{timeoutText:endText,onEnd:function(){config.emCountdown2.className="h"}})}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.ItemDesc=function(){var config={};var decorate=function(){var divDesc=config.divItemDesc;var successHandle=function(){if("undefined"===typeof desc){return false}var enableLazyLoad=window.KISSY&&KISSY.ImageLazyload&&typeof desc==="string"&&desc.length>0;if(enableLazyLoad){var count=0;desc=desc.replace(/(<img[^>]*)(src *= *("[^"]*"|'[^']*'|[^ >]*))/ig,function(m,p1,p2,p3){if(++count<11){return m}return[p1,'src="http://a.tbcdn.cn/kissy/1.0.0/build/imglazyload/spaceball.gif" data-lazyload-src=',p3].join("")})}if(true===isIE){divDesc.innerHTML=desc}else{var neoDiv=config.divItemDesc.cloneNode(false);neoDiv.innerHTML=desc;if(divDesc.parentNode){divDesc.parentNode.replaceChild(neoDiv,divDesc)}}if(enableLazyLoad){KISSY.ImageLazyload(divDesc.parentNode,{mod:"manual",diff:200})}if(window.Hubble&&Hubble.monitorSection){Hubble.monitorSection(divDesc)}if(config.valMode&128){if(true===isIE){var neoDiv=divDesc}var descLinks=neoDiv.getElementsByTagName("A");for(var i=descLinks.length-1;0<=i;i--){descLinks[i].href="#";(function(){var j=i;YUE.on(descLinks[j],"click",function(evt){YUE.preventDefault(evt)})})()}var descSpots=neoDiv.getElementsByTagName("A");for(var i=descSpots.length-1;0<=i;i--){descSpots[i].href="#";(function(){var j=i;YUE.on(descSpots[j],"click",function(evt){YUE.preventDefault(evt)})})()}}desc=null;flush()};window.g_decorateItemDesc=successHandle;if(!window.g_item_desc_requested){getScript(config.apiItemDesc,successHandle)}function getScript(url,callback){var scriptEl=doc.createElement("script");scriptEl.charset="gbk";scriptEl.src=url;if(window.ActiveXObject){scriptEl.onreadystatechange=function(){if("loaded"===scriptEl.readyState||"complete"===scriptEl.readyState){scriptEl.onreadystatechange=null;callback()}}}else{scriptEl.onload=callback}doc.getElementsByTagName("head")[0].appendChild(scriptEl)}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.FlashPlayer=function(){var Dom=YAHOO.util.Dom;var config={};var getFlashMainVer=function(){var mainVer=0,axo=null;if(navigator.plugins&&navigator.mimeTypes.length){var plugin=navigator.plugins["Shockwave Flash"];if(plugin&&plugin.description){mainVer=plugin.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".")[0]}}else{if(navigator.userAgent&&0<=navigator.userAgent.indexOf("Windows CE")){var counter=3;while(axo){try{counter++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);mainVer=counter}catch(e){axo=null}}}else{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");mainVer=6;axo.AllowScriptAccess="always"}catch(e){if(6===mainVer){return mainVer}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(null!==axo){mainVer=axo.GetVariable("$version").split(" ")[1].split(",")[0]}}}return mainVer};var decorate=function(){var swfWidth="480",swfHeight="388",swfId="itemFlashObject",swfSrc=config.valFlashUrl;var flashVer=getFlashMainVer();if(8<flashVer){var placeholder=doc.createElement("div");placeholder.id="item-flash";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){var swfHTML='<embed type="application/x-shockwave-flash" src="'+swfSrc+'" width="'+swfWidth+'" height="'+swfHeight+'" id="'+swfId+'" name="'+swfId+'" quality="high" wmode="'+((0<YEU.gecko)?"transparent":"opaque")+'" allowfullscreen="true" menu="false" flashvars="MMplayerType=PlugIn" />'}else{var swfHTML='<object id="'+swfId+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+swfWidth+'" height="'+swfHeight+'"><param name="movie" value="'+swfSrc+'" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="allowfullscreen" value="true" /><param name="menu" value="false" /><param name="flashvars" value="MMplayerType=ActiveX" /></object>'}placeholder.innerHTML=swfHTML;var det=Dom.get("detail");if(det){det.appendChild(placeholder)}}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.AjaxListLoader=function(){var config={},dataContainer=null;var listMsgOrBuyer=function(url,screenName){if(screenName=="J_ItemMsgList"||screenName=="itemMsgList"){dataContainer=$("J_ItemMsgList")}else{if(screenName=="showBuyerList"){dataContainer=$("J_showBuyerList")}else{window.location=url;return false}}YAHOO.util.Get.script(url+"&callback=TB.Detail.AjaxListLoader.reload",{onSuccess:function(){},onFailure:function(){return halt("\u63a5\u53e3\u8bbf\u95ee\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002")},timeout:10000,autopurge:true,charset:"GBK"});return false};var decorate=function(rootDiv){var navLinks={};if("undefined"!==typeof rootDiv&&rootDiv!=null){navLinks=YUD.getElementsByClassName("detailPageChanger","A",rootDiv);if(rootDiv=="J_showBuyerList"){var listBuyerOnViewBtn=YUD.get("J_listBuyerOnView");if(listBuyerOnViewBtn!=null){navLinks.push(listBuyerOnViewBtn)}}else{var showMsgList=YUD.get("J_listMsgOnView");if(showMsgList!=null){navLinks.push(showMsgList)}}}else{navLinks=YUD.getElementsByClassName("detailPageChanger","A");var listBuyerOnViewBtn=YUD.get("J_listBuyerOnView");if(listBuyerOnViewBtn!=null){navLinks.push(listBuyerOnViewBtn)}var showMsgList=YUD.get("J_listMsgOnView");if(showMsgList!=null){navLinks.push(showMsgList)}}for(var i=navLinks.length-1;0<=i;i--){(function(){var j=i,curLink=navLinks[j];YUE.on(curLink,"click",function(evt){YUE.preventDefault(evt);var params=curLink.getAttribute("detail:params");var url=params.split(",")[0];var screen=params.split(",")[1];listMsgOrBuyer(url,screen)})})()}};var showListOnVisible=function(){var showBuyerListTrigger=YUD.get("J_listBuyerOnView");if(showBuyerListTrigger!=null){var showTrigger=YUD.get("J_showBuyerList");var showListIndicator=YUD.get("J_showListIndicator");YUE.on(window,"scroll",function(ev){if(showTrigger!=null&&showListIndicator!=null){var triggerHight=YUD.getY(showTrigger);var currentHight=YUD.getDocumentScrollTop();var viewPort=YUD.getViewportHeight();currentHight+=viewPort;currentHight-=100;if(currentHight>=triggerHight){if(showListIndicator!=null){showListIndicator.innerHTML="\u6b63\u5728\u52a0\u8f7d\u6570\u636e..."}try{showBuyerListTrigger.click()}catch(e){showListIndicator.innerHTML="\u6570\u636e\u52a0\u8f7d\u5931\u8d25\u8bf7\u5237\u65b0\u91cd\u8bd5\u3002"}YUE.removeListener(window,"scroll",arguments.callee)}}})}};var showMsgListOnVisible=function(){var showMsgListTrigger=YUD.get("J_listMsgOnView");if(showMsgListTrigger!=null){var showTrigger=YUD.get("J_ItemMsgList");var showListIndicator=YUD.get("J_listMsgOnViewIndicator");YUE.on(window,"scroll",function(ev){if(showTrigger!=null&&showListIndicator!=null){var triggerHight=YUD.getY(showTrigger);var currentHight=YUD.getDocumentScrollTop();var viewPort=YUD.getViewportHeight();currentHight+=viewPort;currentHight-=0;if(currentHight>=triggerHight){if(showListIndicator!=null){showListIndicator.innerHTML="\u6b63\u5728\u52a0\u8f7d\u6570\u636e..."}try{showMsgListTrigger.click()}catch(e){showListIndicator.innerHTML="\u6570\u636e\u52a0\u8f7d\u5931\u8d25\u8bf7\u5237\u65b0\u91cd\u8bd5\u3002"}YUE.removeListener(window,"scroll",arguments.callee)}}})}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate(null);showListOnVisible();showMsgListOnVisible()},reload:function(content,container){if("undefined"!==typeof container&&container!=null){YUD.get(container).innerHTML=content;decorate(container)}else{dataContainer.innerHTML=content;decorate(dataContainer)}}}}();TB.Detail.ItemViews=function(){var config={};var decorate=function(){YU.Get.script(config.apiItemViews+((-1===config.apiItemViews.indexOf("?"))?"?":"&")+"var=itemViews",{onSuccess:function(){if("undefined"===typeof itemViews){return false}config.emItemViews.replaceChild(doc.createTextNode(parseInt(itemViews,10).toString()),config.emItemViews.firstChild);itemViews=null;flush()},onFailure:function(){return false},timeout:10000,autopurge:true,charset:doc.charset||doc.characterSet||"gb2312"})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.WangWang=function(){var config={};var decorate=function(){YU.Get.script(config.apiWangWang+((-1===config.apiWangWang.indexOf("?"))?"?":"&")+"auto=false&t=20090430",{onSuccess:function(){if("undefined"===typeof TB.ww){return false}TB.ww.lightAll(docBody,{item:config.valItemIdStr})},onFailure:function(){return false},timeout:10000,autopurge:false,charset:doc.charset||doc.characterSet||"gb2312"})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.GoTopTrigger=function(){var config={},divBar=null;var getDoc=function(){if(0<YEU.webkit){getDoc=function(){return docBody}}else{getDoc=function(){return doc.documentElement}}return getDoc()};var calcPos=function(){var contentWidth=950,paddingWidth=5;if(true===isIE6){calcPos=function(scrolling){var viewHeight=YUD.getViewportHeight(),bottomPadding=Math.floor(0.15*viewHeight),scrollTop=getDoc().scrollTop,yPos=viewHeight-bottomPadding+scrollTop;if(true===scrolling){YUD.setStyle(divBar,"top",yPos+"px");return}var viewWidth=YUD.getViewportWidth(),xPos=Math.floor((viewWidth-contentWidth)/2)+contentWidth+paddingWidth;YUD.setStyle(divBar,"left",xPos+"px");YUD.setStyle(divBar,"top",yPos+"px")}}else{calcPos=function(){var viewWidth=YUD.getViewportWidth(),xPos=Math.floor((viewWidth-contentWidth)/2)+contentWidth+paddingWidth;YUD.setStyle(divBar,"left",xPos+"px")}}return calcPos()};var decorate=function(){divBar=doc.createElement("div");divBar.className="go-top";var topLink=doc.createElement("a");topLink.href="#";var topText=doc.createElement("span");topText.appendChild(doc.createTextNode("\u8fd4\u56de\u9876\u90e8"));if(true===isIE){topLink.hideFocus=true}calcPos();topLink.appendChild(topText);divBar.appendChild(topLink);docBody.appendChild(divBar);var anime=new YUA(divBar,{opacity:{from:0,to:1}},0.3);anime.animate();var isHidden=false,scrollTimer=YL.later(0,this,function(){});if(true===isIE6){YUE.on(window,"scroll",function(){if(false===isHidden){if(true===anime.isAnimated()){anime.stop()}YUD.setStyle(divBar,"opacity","0");isHidden=true}scrollTimer.cancel();scrollTimer=YL.later(500,this,function(){if(true===isHidden&&0<getDoc().scrollTop){calcPos(true);anime.animate();isHidden=false}})})}else{YUE.on(window,"scroll",function(){if(true===isHidden){anime.animate();isHidden=false}scrollTimer.cancel();scrollTimer=YL.later(500,this,function(){if(false===isHidden&&0===getDoc().scrollTop){YUD.setStyle(divBar,"opacity","0");isHidden=true}})})}var resizeTimer=YL.later(0,this,function(){});YUE.on(window,"resize",function(){resizeTimer.cancel();resizeTimer=YL.later(500,this,calcPos)});YUE.on(topLink,"click",function(evt){YUE.preventDefault(evt);getDoc().scrollTop=0})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}YUE.on(window,"scroll",function(){YUE.removeListener(window,"scroll",arguments.callee);decorate()})}}}();TB.Detail.AtPanel=function(){return{doTrack:function(category){var img=document.createElement("IMG");img.src="http://www.atpanel.com/1.gif?cache="+(new Date().getTime())+"&category="+category+"&itemid="+TB.Detail.Setup.getConfig().valItemId}}}();TB.Detail.FastLogin=function(){var config={},divPopup=null;var loginWidth=460,loginHeight=320;var apiLoginIndicator="",apiLoginUrl="";var calcPos=function(){YUD.setStyle(divPopup,"top",YUD.getDocumentScrollTop()+(YUD.getViewportHeight()-loginHeight)/2+"px");YUD.setStyle(divPopup,"left",(YUD.getViewportWidth()-loginWidth)/2+"px")};var getElmt=function(loginUrl,isShowFastbuy){loginUrl=loginUrl||apiLoginUrl||"";var showFastbuy=loginUrl.indexOf("showfastbuy=true")>0;loginWidth=showFastbuy?640:460;divPopup=doc.createElement("div");divPopup.id="J_LoginPopup";divPopup.className="login-now shadow";YUD.setStyle(divPopup,"z-index","9999");divPopup.style.width=(loginWidth+2)+"px";divPopup.style.height=(loginHeight+2)+"px";var neoDiv=doc.createElement("div");neoDiv.className="skin";var neoIframe=doc.createElement("iframe");neoIframe.setAttribute("width",""+loginWidth);neoIframe.setAttribute("height",""+loginHeight);neoIframe.setAttribute("src",loginUrl);neoIframe.setAttribute("frameborder","0",0);neoIframe.setAttribute("scrolling","no");neoDiv.appendChild(neoIframe);var closeBtn=document.createElement("div");closeBtn.innerHTML="<a href='#' style='background:transparent url(http://img01.taobaocdn.com/tps/i1/T1EedkXbY_yJNsaZzT-300-812.png) no-repeat scroll -245px -32px; display:block; height:17px; position:absolute; right:5px; top:5px; width:17px;' title='\u5173\u95ed'><span style='display:none'>\u5173\u95ed</span></a>";closeBtn=closeBtn.firstChild;neoDiv.appendChild(closeBtn);YUE.on(closeBtn,"click",function(e){YUE.stopEvent(e);TB.FastBuy.hidePopup()});var fastbuyBtn=document.createElement("div");fastbuyBtn.innerHTML="<a id='J_FastBuyBtn' href='#' title='\u5feb\u901f\u8d2d\u4e70' style='background:white url(http://img01.taobaocdn.com/tps/i1/T1MedkXXj_yJQ5vBcy-220-240.png) no-repeat scroll -97px -151px; height:30px; width:123px; text-align:center; line-height:30px; color:white; font-size:14px; font-weight:bold; position:absolute; top:102px; left:36px; visibility:hidden;'>\u5feb\u901f\u8d2d\u4e70</a>";fastbuyBtn=fastbuyBtn.firstChild;neoDiv.appendChild(fastbuyBtn);YUE.on(fastbuyBtn,"click",function(e){YUE.stopEvent(e);TB.FastBuy.go()});divPopup.appendChild(neoDiv);docBody.appendChild(divPopup);var getDomain=function(hostname){var arr=hostname.split(".");var len=arr.length;if(len<2){return hostname}return arr[len-2]+"."+arr[len-1]};document.domain=getDomain(location.hostname);var scrollTimer=YL.later(0,this,function(){});YUE.on(window,"scroll",function(){if("block"===divPopup.style.display){scrollTimer.cancel();scrollTimer=YL.later(500,this,calcPos)}});var resizeTimer=YL.later(0,this,function(){});YUE.on(window,"resize",function(){if("block"===divPopup.style.display){resizeTimer.cancel();resizeTimer=YL.later(500,this,calcPos)}});var firstDisplay=true;getElmt=function(loginUrl){loginUrl=loginUrl||apiLoginUrl||"";var showFastbuy=loginUrl.indexOf("showfastbuy=true")>0;YUD.setStyle(fastbuyBtn,"display",showFastbuy?"block":"none");TB.FastBuy[showFastbuy?"showFastBuyBtn":"hideFastBuyBtn"]();var curUrl=neoIframe.getAttribute("src")+"";if(curUrl.substr(0,curUrl.lastIndexOf("t=")-1)!==loginUrl){loginWidth=showFastbuy?640:460;divPopup.style.width=(loginWidth+2)+"px";divPopup.style.height=(loginHeight+2)+"px";neoIframe.setAttribute("width",""+loginWidth);neoIframe.setAttribute("height",""+loginHeight);neoIframe.setAttribute("src","about:blank");neoIframe.setAttribute("src",loginUrl)}else{if(!firstDisplay){neoIframe.setAttribute("src",loginUrl+(loginUrl.indexOf("?")?"&":"?")+"t="+(new Date().getTime()))}firstDisplay=false}calcPos();divPopup.style.display="block"};return getElmt(loginUrl)};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}apiLoginIndicator=config.valLoginIndicator;apiLoginUrl=config.valLoginUrl},checkLogin:function(){var submitForm=function(){TB.Detail.Setup.getConfig().frmBid.submit()};if(apiLoginIndicator){var api=apiLoginIndicator+(apiLoginIndicator.indexOf("?")>0?"&":"?")+"var=login_indicator&t="+new Date().getTime();YAHOO.util.Get.script(api,{onSuccess:function(){var indicator=window.login_indicator;if(typeof indicator==="undefined"){return}if(indicator.success&&indicator.token&&indicator.token.length>0){var t=indicator.token;for(var i=0,l=t.length;i<l;i++){if(!YUD.get("J_"+t[i][0])){if(isIE){var _hidInput=document.createElement('<input name="'+t[i][0]+'">')}else{var _hidInput=document.createElement("input");_hidInput.name=t[i][0]}_hidInput.type="hidden";_hidInput.id="J_"+t[i][0];TB.Detail.Setup.getConfig().frmBid.appendChild(_hidInput)}else{_hidInput=YUD.get("J_"+t[i][0])}_hidInput.value=t[i][1]}}if((indicator.success&&indicator.hasLoggedIn)||!indicator.success){submitForm()}else{if(!indicator.hasLoggedIn){var oBtnBuy=YUD.get("J_LinkBuy"),popUrl="";TB.Detail.AtPanel.doTrack(indicator.hasPhantomLoggedIn?"itembuy_user":"itembuy_viewer");popUrl=indicator.popupWindow.replace("&showfastbuy=true","");popUrl=YAHOO.lang.trim(popUrl);if(YUD.getAttribute(oBtnBuy,"data-addFastBuy")){if(indicator.isFastBuy){TB.FastBuy.go()}else{if(popUrl){getElmt(popUrl)}else{submitForm()}}}else{if(!indicator.hasPhantomLoggedIn){TB.FastBuy.go()}else{getElmt(popUrl)}}}}},onFailure:submitForm,onTimeout:submitForm,timeout:5000})}else{submitForm()}},checkByCookie:function(){if(apiLoginUrl){TB.Detail.FastLogin.show()}else{TB.Detail.Setup.getConfig().frmBid.submit()}},show:function(loginUrl,isShowFastbuy){getElmt(loginUrl,isShowFastbuy)}}}();TB.Detail.GuestBook=function(){var config={};var decorate=function(){var smileyTrigger=$("J_SpanSmiley"),smileyList=$("J_DivSmileyList"),commentTextarea=$("J_TextareaMsg"),responseForm=$("J_FrmRespond"),captchaArea=$("J_CaptchaArea"),captchaValue=$("J_CaptchaValue"),captchaImage=$("J_CaptchaImage");if(null!==smileyTrigger&&null!==smileyList&&null!==commentTextarea){var isPopupHidden=1;var smileies=Array.copy(smileyList.getElementsByTagName("a"));YUE.on(smileyTrigger,"click",function(evt){YUE.preventDefault(evt);if(1===isPopupHidden){YUD.removeClass(smileyList,"hidden")}else{YUD.addClass(smileyList,"hidden")}isPopupHidden*=-1});YUE.on(smileyList,"click",function(evt){YUE.preventDefault(evt);var target=YUE.getTarget(evt),idx=smileies.indexOf(target)||0;commentTextarea.value+=":TSP"+(/^\w{1}$/.test(idx)?"0"+idx:idx)+":";commentTextarea.focus();YUD.addClass(smileyList,"hidden");isPopupHidden*=-1})}if(null!==commentTextarea&&null!==captchaArea&&null!==captchaValue&&null!==captchaImage){var captchaSrc=captchaImage.getAttribute("data-captcha"),changeCaptcha=function(){captchaImage.src=captchaSrc+"&t="+(+new Date()).toString()};YUE.on(captchaImage,"click",changeCaptcha);YUE.on(commentTextarea,"focus",function(evt){changeCaptcha();YUD.removeClass(captchaArea,"hidden");YUE.removeListener(commentTextarea,"focus",arguments.callee)})}if(null!==responseForm&&null!==captchaValue){YUE.on(responseForm,"submit",function(evt){YUE.stopEvent(evt);if(""===commentTextarea.value){return halt("\u8bf7\u8f93\u5165\u7559\u8a00\u5185\u5bb9")}if(""===captchaValue.value||4>captchaValue.value.length){return halt("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u9a8c\u8bc1\u7801")}responseForm.submit()})}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.ReviewTabTrigger=function(){var config={};var decorate=function(){var binding=function(tabTrigger){var infoTabBar=TB.Detail.InfoTabBar,tabUI=infoTabBar._tabUl,reviewsTab=$("reviews");if(null!==tabTrigger&&null!==tabUI&&null!==reviewsTab){var tabClickFunc=YUE.getListeners(tabUI,"click")[0].fn;var pos=YUD.getRegion(tabUI).top-150;YUE.on(tabTrigger,"click",function(evt){YUE.preventDefault(evt);infoTabBar._selectedSection=reviewsTab;tabClickFunc.call(infoTabBar);if(YAHOO.env.ua.webkit){document.body.scrollTop=pos}else{document.documentElement.scrollTop=pos}})}};if(config.valMode&128){YU.Get.script(config.apiMallReviews+((-1===config.apiMallReviews.indexOf("?"))?"?":"&")+"t="+timestamp,{onSuccess:function(){if("undefined"===typeof TB.Detail.MallReviews||""===TB.Detail.MallReviews){return false}var result=TB.Detail.MallReviews;TB.Detail.MallReviews=null;delete TB.Detail.MallReviews;flush();if(YUD.get("J_Stars")){YUD.get("J_Stars").innerHTML=result}else{YUD.getElementsByClassName("detail-hd","div",config.divDetail)[0].innerHTML+=result}binding($("J_MallReviewTabTrigger"))},onFailure:function(){return false},timeout:10000,autopurge:false,charset:doc.charset||doc.characterSet||"gb2312"})}else{binding(config.linkReviewTrigger);binding(config.linkReviewTrigger2)}};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.SafetyTips=function(){var config={};var decorate=function(){YU.Get.script(config.apiSafetyTips,{onSuccess:function(){if("undefined"===typeof TB.Detail.SafeTips||Array!==TB.Detail.SafeTips.constructor||0===TB.Detail.SafeTips.length){return false}var result=TB.Detail.SafeTips;TB.Detail.SafeTips=null;delete TB.Detail.SafeTips;flush();var randomIdx=Math.random()*result.length|0;var linkData=result[randomIdx],curLink=config.linkSafetyTips;curLink.href=linkData[0];curLink.replaceChild(doc.createTextNode(linkData[1]),curLink.firstChild)},onFailure:function(){return false},timeout:10000,autopurge:false,charset:doc.charset||doc.characterSet||"gb2312"})};return{init:function(){config=TB.Detail.Setup.getConfig();if("undefined"===typeof config){return false}decorate()}}}();TB.Detail.PostageFee=function(){var ORDINARY="1",FAST="2",EMS="7",CORPFAST="4",POSTFAST="5";var MODE_ARRAY=[ORDINARY,EMS,CORPFAST,POSTFAST];var MODENAME_MAP={};MODENAME_MAP[ORDINARY]="\u5e73\u90ae";MODENAME_MAP[CORPFAST]="\u5feb\u9012\u516c\u53f8";MODENAME_MAP[POSTFAST]="\u90ae\u653f\u5feb\u9012";MODENAME_MAP[EMS]="EMS";var NATIONWIDE_CODE="1";var DEST_MAP={"1":"\u5168\u56fd","110000":"\u5317\u4eac","120000":"\u5929\u6d25","130000":"\u6cb3\u5317","140000":"\u5c71\u897f","150000":"\u5185\u8499\u53e4","210000":"\u8fbd\u5b81","220000":"\u5409\u6797","230000":"\u9ed1\u9f99\u6c5f","310000":"\u4e0a\u6d77","320000":"\u6c5f\u82cf","330000":"\u6d59\u6c5f","340000":"\u5b89\u5fbd","350000":"\u798f\u5efa","360000":"\u6c5f\u897f","370000":"\u5c71\u4e1c","410000":"\u6cb3\u5357","420000":"\u6e56\u5317","430000":"\u6e56\u5357","440000":"\u5e7f\u4e1c","450000":"\u5e7f\u897f","460000":"\u6d77\u5357","500000":"\u91cd\u5e86","510000":"\u56db\u5ddd","520000":"\u8d35\u5dde","530000":"\u4e91\u5357","540000":"\u897f\u85cf","610000":"\u9655\u897f","620000":"\u7518\u8083","630000":"\u9752\u6d77","640000":"\u5b81\u590f","650000":"\u65b0\u7586","710000":"\u53f0\u6e7e","810000":"\u9999\u6e2f","820000":"\u6fb3\u95e8","990000":"\u6d77\u5916"};var DEST_MAP_UTF8={"1":"\u5168\u570b","110000":"\u5317\u4eac","120000":"\u5929\u6d25","130000":"\u6cb3\u5317","140000":"\u5c71\u897f","150000":"\u5167\u8499\u53e4","210000":"\u907c\u5be7","220000":"\u5409\u6797","230000":"\u9ed1\u9f8d\u6c5f","310000":"\u4e0a\u6d77","320000":"\u6c5f\u8607","330000":"\u6d59\u6c5f","340000":"\u5b89\u5fbd","350000":"\u798f\u5efa","360000":"\u6c5f\u897f","370000":"\u5c71\u6771","410000":"\u6cb3\u5357","420000":"\u6e56\u5317","430000":"\u6e56\u5357","440000":"\u5ee3\u6771","450000":"\u5ee3\u897f","460000":"\u6d77\u5357","500000":"\u91cd\u6176","510000":"\u56db\u5ddd","520000":"\u8cb4\u5dde","530000":"\u96f2\u5357","540000":"\u897f\u85cf","610000":"\u965d\u897f","620000":"\u7518\u8085","630000":"\u9752\u6d77","640000":"\u5be7\u590f","650000":"\u65b0\u7586","710000":"\u53f0\u7063","810000":"\u9999\u6e2f","820000":"\u6fb3\u9580","990000":"\u6d77\u5916"};var postageContId="J_PostageCont";var postageToggleID="J_PostageToggle";var postageListID="J_PostageList";var postageTableContID="J_PostageTableCont";var destPanelID="J_DestPanel";var isUTF8=(document.charset||document.characterSet).toLowerCase().indexOf("utf-8")!=-1;var getDestNameByCode=(function(){if(isUTF8){return function(destCode){return DEST_MAP_UTF8[destCode]||""}}else{return function(destCode){return DEST_MAP[destCode]||""}}})();var itemSorter=function(i,i2){if(i.mode==i2.mode){return(i.dest==NATIONWIDE_CODE)?1:-1}else{return i.mode-i2.mode}};return{_items:[],_itemMap:{},_memo:"",_addItem:function(arr){var item={id:arr[0],mode:arr[1],dest:arr[2],fee:arr[3],addon:arr[4]};this._items.push(item);if(!this._itemMap[item.mode]){this._itemMap[item.mode]=[item]}else{this._itemMap[item.mode].push(item)}},_getItemsByDestCode:function(destCode){var items=[];for(mode in this._itemMap){if(this._itemMap[mode].length===1){items.push(this._itemMap[mode][0])}else{if(this._itemMap[mode].length>1){var matchItem,tmpItem;for(var i=0,n=this._itemMap[mode].length;i<n;++i){tmpItem=this._itemMap[mode][i];if(tmpItem.dest.indexOf(destCode)!=-1){matchItem=tmpItem;break}else{if(tmpItem.dest==NATIONWIDE_CODE){matchItem=tmpItem}}}if(matchItem){items.push(matchItem)}}}}return items},_getDestNameByCode:function(destCodes){if(!destCodes){return""}var destCodes=destCodes.split(",");var destNames=Array.map(destCodes,function(code){return getDestNameByCode(code)}).join(",");return destNames},_getFeesByDestCode:function(destCode){var matchItems=this._getItemsByDestCode(destCode);var fees={};Array.forEach(matchItems,function(item){Array.forEach(MODE_ARRAY,function(mode){if(mode==item.mode){fees[mode]=item.fee}})});if(fees[CORPFAST]&&fees[POSTFAST]){fees[FAST]=Math.min(fees[CORPFAST],fees[POSTFAST])}else{fees[FAST]=fees[CORPFAST]}return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -