document.domain=TB.bom.pickDocumentDomain();Mercury=TB.namespace("app.Mercury");Mercury.LegacyJoint=Mercury.MercuryJoint=(function(){var I="http://favorite."+document.domain+"/popup/add_collection.htm";var A=function(O){var L={};var N=O.split("&");for(var K=0;K<N.length;K++){var M=N[K].split("=");if(M.length==2){var J=(M[1].split(",").length>1)?M[1].split(","):M[1];L[M[0]]=J}}return L};var C=function(){return false};var H={eventType:"click",width:440,height:260,autoFit:true,position:"top"};var G=function(K){var O=$D.generateId();var L=document.createElement("div");L.id="__mercury_popup_"+O;$D.setStyle(L,"position","absolute");$D.setStyle(L,"z-index",2008);var N=document.createElement("div");L.appendChild(N);N.style.cssText="position:absolute; top:5px; left:5px; width:442px; height:282px; background:#000;";$D.setStyle(N,"opacity","0.3");var P=document.createElement("div");L.appendChild(P);P.style.cssText="position:absolute; top:0; left:0; width:442px; height:282px; border:1px solid #95d3ff; background:#f0faff url(http://pics.taobao.com/bao/album/123/sk_loading.gif) no-repeat center center;";var Q=document.createElement("a");P.innerHTML='<a href="javascript:void(0)" onclick="window[\''+L.id+'\'].hide();" style="position: absolute;top: 2px;right: 2px;width:15px;background: url(http://pics.taobao.com/2k7/sys/favorites/close.gif) no-repeat right 0;text-decoration: none;text-indent:-999em;overflow:hidden;">X</a>';var J;try{J=document.createElement('<iframe name="__mercury_popup_iframe_'+O+'"></iframe>')}catch(M){J=document.createElement("iframe");J.name="__mercury_popup_iframe_"+O}J.setAttribute("src","about:blank");J.setAttribute("frameBorder",0);J.setAttribute("scrolling","no");$D.setStyle(J,"width","442px");$D.setStyle(J,"height","282px");P.appendChild(J);return L};var E=function(J,L){var K=$E.getTarget(J);if(L[0].clazz){while(!$D.hasClass(K,L[0].clazz)){K=K.parentNode}}else{if(L[0].id){if(K.id!=L[0].id){K=K.parentNode}}}F(K,L)};var F=function(N,O){var J=D(N,O[0]);var L=J.popup.getElementsByTagName("iframe")[0];var K=I+"?";for(p in O[1]){K+=p+"="+O[1][p]+"&"}K+="t="+new Date().getTime();if(!L.src||L.src=="about:blank"){L.src=K}else{try{window.frames[L.name].location=K}catch(M){}}};var D=function(L,Q){if(Q.clazz){var P=document.getElementsByTagName("iframe");for(var O=0;O<P.length;O++){var K=P[O].getAttribute("name");if(K&&K.indexOf("__mercury_popup_")==0){var N=K.replace("_iframe","");if(N!=L.getAttribute("mercury:popup")){window[N].hide()}}}}var J=L.getAttribute("mercury:popup");if(!J){var M=G(L);document.body.insertBefore(M,document.body.firstChild);J=M.id;L.setAttribute("mercury:popup",J);TB.applyIf(Q,H);var R=TB.widget.SimplePopup.decorate(L,M,Q);window[J]=R;R.show()}return window[J]};var B={popupParams:{},connect:function(J){var K=A($(J).getAttribute("mercury:params"));F(J,[this.popupParams,K]);return false},connectById:function(N,L){var J=$(N);if(J&&J.getAttribute("mercury:params")){var K=J.getElementsByTagName("a");if(K[0]){K[0].onclick=C}var M=A(J.getAttribute("mercury:params"));$E.on(J,"click",E,[L||this.popupParams,M])}},connectByClass:function(J,M){var L=$D.getElementsByClassName(J,M.tag,M.root);for(var K=0;K<L.length;K++){if(L[K].getAttribute("mercury:params")){if(L[K].tagName.toLowerCase()=="a"){L[K].onclick=C}var N=A(L[K].getAttribute("mercury:params"));$E.on(L[K],"click",E,[M||this.popupParams,N])}}},init:function(){var J=this.popupParams;if(J.id){this.connectById(J.id,J)}else{if(J.clazz){var K=function(){this.connectByClass(J.clazz,J)};$E.onDOMReady(K,this,true)}}}};B.popupParams=TB.dom.getScriptParams("mercury_joint");if(B.popupParams.auto!="false"&&B.popupParams.auto!=0){B.init()}return B})();
