var XShop=TB.namespace("app.XShop");XShop=(function(){var B=YAHOO.lang;var A=new function(){var C=this;if(navigator.plugins&&navigator.plugins.length>0){var G="application/x-shockwave-flash";var F=navigator.mimeTypes;if(F&&F[G]&&F[G].enabledPlugin&&F[G].enabledPlugin.description){var J=F[G].enabledPlugin.description;var D=J.split(" ");C.installed=true;C.version=parseInt(D[2].split(".")[0],10)}}else{if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){try{var E=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");var I=E.GetVariable("$version");C.version=parseInt(I.split(",")[0].split(" ")[1],10);C.installed=true}catch(H){}}}};return{initInfoTab:function(){var G=$("detail:infoTab");if(!G){return }var H=[],K,D;K=$D.getChildrenBy(G.parentNode,function(L){if($D.hasClass(L,"detail:section")){if($D.hasClass(L,"CurInfo")){D=L}var M=L.getElementsByTagName("h2")[0];if($D.hasClass(M,"Title")){H[H.length]=M.textContent||M.innerText;return true}return false}return false});var F=function(N,L){if(N){$E.preventDefault(N)}var M=C.getElementsByTagName("li");$D.removeClass(M,"Selected");$D.removeClass(K,"CurInfo");$D.addClass(M[L],"Selected");if(L==0){$D.setStyle(K,"display","")}else{$D.setStyle(K,"display","none");$D.setStyle(K[L],"display","")}$D.addClass(K[L],"CurInfo")};var C=document.createElement("ul"),J,E;C.className="TabBarLevel1";C.id="InfoSelector";G.appendChild(C);for(var I=0;I<H.length;++I){J=document.createElement("li");C.appendChild(J);E=document.createElement("a");J.appendChild(E);E.href="#"+(K[I].id||"");E.appendChild(document.createTextNode(H[I]));$E.on(E,"click",F,I)}if(!D){F.call(null,null,0)}},autoAdjustImage:function(E,G,D,H){E=$(E);var F=new Image();F.src=E.src;var C=B.later(50,null,function(){if(F.complete){C.cancel();var J=F.width;var K=F.height;if(J>G||K>D){var I=Math.max(J/G,b=K/D);J=J/I;K=K/I}$D.setStyle(E,"width",J+"px");$D.setStyle(E,"height",K+"px");E.style.paddingTop=(D-K)/2+"px";if(H){H()}F=null}},E,true)},initImageViewer:function(E){var F=$("detail:imgbox");var J=250,D=250;var I=function(K){var N="";for(var L=0;L<K.length;++L){var M=K.charCodeAt(L);N+=String.fromCharCode(M^(L%5))}return N};var C=this;var H=function(){var K=document.createElement("a");K.target="_blank";K.href=E.linkUrl+"&d=1";var L=document.createElement("img");L.onerror=function(){F.innerHTML="\u52a0\u8f7d\u56fe\u7247\u8d85\u65f6"};L.src=(E.picServerPath||"http://image.taobao.com/bao/uploaded")+"/"+I(E.picUrl);C.autoAdjustImage(L,J,D,function(){K.appendChild(L)});F.appendChild(K);$E.onAvailable("detail:zoomInLink",function(){this.href=K.href})};window.commandDelegate=function(L){if(L=="jsShowImg"){var K=F.getElementsByTagName("embed")[0];K.style.display="none";B.later(1,null,H)}};var G=A.version;if(G>=8){F.innerHTML='<embed src="http://assets.taobaocdn.com/swf/detail080523.swf" quality="high" width="250" height="250" name="FlashShowImageObject" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="'+E.flashVars+("&fv="+G)+'" />';$E.onAvailable("detail:zoomInLink",function(){this.href=E.linkUrl+"&fv="+G})}else{H()}},filterQQ:(function(){var D=/([q\uff31\uff51]{1}[\s\xA0]*[q\uff31\uff51]{1}[\s\xA0\:\uff1a]*[0-9\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19]{4,15})/ig;var C=function(E){this._count=0;this.targets=[];this.replaceTo=E;this.doFilter=function(H){this._filter(H);for(var F=this.targets.length-1;F>=0;--F){var H=this.targets[F];if(H&&H.nodeValue&&H.parentNode){var G=document.createElement("span");G.innerHTML=H.nodeValue.replace(D,this.replaceTo);H.parentNode.replaceChild(G,H)}}};this._filter=function(H){if(!H||this._count++>1000){return }var G=H.nodeType;if(G==1){var J=H.childNodes;if(J){for(var F=0;F<J.length;++F){this._filter(J[F])}}}else{if(G==3){var I=H.nodeValue;if(I&&I.search(D)>=0){this.targets.push(H)}}}}};return function(I,G,F){var E=I.replace(/<\/?[^>]+>/gi,"");if(D.test(E)){var H=document.createElement("div");H.innerHTML=I;var J='$1 <span class="ww:token" ww:params="nick='+(G||"")+"&tnick="+(F||"")+'&display=inline"></span>';new C(J).doFilter(H);return H.innerHTML}else{return I}}})(),init:function(){this.initInfoTab()}}})();$E.onDOMReady(XShop.init,XShop,true);
