(function(){var D=YAHOO.util,C=D.Dom,A=D.Event,B=YAHOO.env.ua;A.onDOMReady(function(){var J="\u8bf7\u8f93\u5165\u8981\u641c\u7d22\u7684\u5185\u5bb9",K=C.get("title"),G=C.get("title2");var F=C.get("catId");var E=function(){this.value=this.value.replace(/(^\s*)|(\s*$)/g,"");if(this.value==""||this.value==J){this.value=J;C.setStyle(this,"color","#ccc")}};var L=function(){if(this.value==J){this.value=""}C.setStyle(this,"color","")};E.call(K);if(K.value==J){K.focus()}if(C.get("q_value")){K.value=C.get("q_value").value}if(K.value==J){E.call(K)}var M;setTimeout(function(){M=new TB.Suggest("title","http://suggest.taobao.com/sug",{showCloseBtn:true,resultFormat:"\u7ea6%result%\u4ef6\u5b9d\u8d1d",submitFormOnClickSelect:false});var N=true;M.subscribe("beforeShow",function(O){if(!N){return }C.setX(this.container,C.getX(this.container)-(TB.bom.isIE7?3:1));C.setStyle(this.container,"width",this.container.offsetWidth+"px");N=false});M.subscribe("onItemSelect",function(O){if(O){C.get("J_searchForm").submit()}})},10);var I=function(P){var N=this,O=P.keyCode;setTimeout(function(){if(O===13){N.blur();if(N.value!==J&&!M.selectedItem){N.form.submit()}}},10)};A.on(["title","title2"],"click",L);A.on(["title","title2"],"blur",E);A.on(["J_searchForm","J_searchForm2"],"submit",function(N){var O=this.q.value.replace(J,"");if(O==""){if(this.cat&&this.cat.value!=""){this.q.value=""}else{A.stopEvent(N)}}});A.on(["title","title2"],"keydown",function(N){L.call(this);I.call(this,N)});var H=function(){var S=C.get("J_toggleCates"),O=C.get("J_AllCates").getElementsByTagName("dl")[0];var R=S.getElementsByTagName("a")[0];var U=28;var N=Math.ceil(O.getElementsByTagName("dd").length/4)*U;var W=4*U;var Q=false;var X=function(){Q=true;R.innerHTML="\u66f4\u591a";C.replaceClass(R,"open","close")};var V=function(){Q=false;R.innerHTML="\u6536\u8d77";C.replaceClass(R,"close","open")};var P=new YAHOO.util.Anim(O,{height:{to:W}},0.3,YAHOO.util.Easing.easeIn);P.onComplete.subscribe(X);var T=new YAHOO.util.Anim(O,{height:{to:N}},0.3,YAHOO.util.Easing.easeIn);T.onComplete.subscribe(V);return{open:function(Y){if(!Y){O.style.height="auto";V();return }T.animate()},close:function(Y){if(!Y){O.style.height=W+"px";X();return }P.animate()},init:function(Z,Y){Z?this.close():this.open();A.on(S,"click",function(a){A.stopEvent(a);Q?this.open(Y):this.close(Y)},this,true)}}};if(C.get("J_toggleCates")){H().init(true,true)}(function(){var Q=C.get("J_ShowCate"),T=C.get("J_CateList");if(!Q||!T){return }var O=Q.getElementsByTagName("span")[0],R=C.get("catId");var S=T.getElementsByTagName("a")[0];var U,P;A.on(Q,"mouseover",function(){T.style.display="block";C.addClass(Q,"hover")});var N=function(){T.style.display="none";C.removeClass(Q,"hover")};A.on(Q,"mouseout",N);A.on(S,"click",function(W){A.stopEvent(W);var V=[O.innerHTML,R.value,O.title];O.innerHTML=this.innerHTML;O.title=this.title||"";R.value=this.getAttribute("val")||"";N();this.title=V[2];this.innerHTML=V[0];this.setAttribute("val",V[1])})})();(function(N){if(N&&YAHOO.env.ua.ie&&YAHOO.env.ua.ie<7){var O=N.getElementsByTagName("li");A.on(O,"mouseover",function(P){C.addClass(this,"hover")});A.on(O,"mouseout",function(P){C.removeClass(this,"hover")})}})(C.get("J_HotProduct"))})})();(function(){var D=YAHOO.util.Dom,E=YAHOO.util.Event;var YU=YAHOO.util,YL=YAHOO.lang,YEU=YAHOO.env.ua,YUA=YU.Anim,YUEA=YU.Easing;TB.namespace("app.Hesper");Hesper=TB.app.Hesper;Hesper.Small2Big=function(){var MAX_SIZE=220;var BLANK_SRC="http://pics.taobao.com/bao/album/sys/blank.gif";var smallList=D.get("list:content");return{init:function(){if(!smallList||!D.hasClass(smallList,"small-list")){return }var css="";css+=".bigpic {position:absolute;z-index:2007;padding-left:6px;display:none}";css+=".bigpic .arrow{width:7px;height:13px;position:absolute;left:0px;top:10px;background:url(http://image.taobao.com/2k6/sys/list/arrow.gif) 0 0 no-repeat;}";css+=".bigpic div{border:1px #666 solid;background:#fff;}";css+=".bigpic a {display: table-cell;vertical-align:middle;width:250px;height:250px;text-align:center;*display:block;*font-size:186px;border:4px #e8e8e8 solid;background:#fff;}";css+=".bigpic a.loading {background: url(http://image.taobao.com/2k6/sys/list/loading.gif) no-repeat center center;}";css+=".bigpic a img{border:1px #b6b6b6 solid;max-width:220px;max-height:220px;vertical-align:middle;}";TB.dom.addCSS(css);var pBox=document.createElement("div");D.addClass(pBox,"bigpic");pBox.innerHTML='<div><span class="arrow"></span><a href="javascript:void(0);" target="_blank" class="loading"><img oncontextmenu="return(false)" src="about:blank" border="0" /></a></div>';TB.dom.insertAfter(pBox,smallList);var pImg=pBox.getElementsByTagName("img")[0];var pArrow=pBox.getElementsByTagName("span")[0];var pics=D.getElementsByClassName("hesper:small2big","img",smallList);pics.forEach(function(o){o.alt=""});var cct=null;TB.widget.SimplePopup.decorate(pics,pBox,{position:"right",width:250,height:250,offset:[-5,0],disableClick:false,autoFit:true,eventType:"mouse",onShow:function(){var img=this.trigger;D.setXY(pBox,[D.getX(img)+82,D.getY(img)-2]);if(D.getY(pBox)+pBox.offsetHeight>D.getViewportHeight()+D.getDocumentScrollTop()){D.setY(pBox,D.getViewportHeight()+D.getDocumentScrollTop()-pBox.offsetHeight)}$D.addClass(pImg.parentNode,"loading");pImg.style.display="none";pImg.src="";pImg.parentNode.setAttribute("href",img.parentNode.parentNode.getAttribute("href"));pArrow.style.top=D.getY(img)-D.getY(pBox)+34+"px";var lImg=new Image();lImg.src=img.src.replace(/_sum\.jpg/,"");var cc=function(){if(lImg.complete){clearInterval(cct);pImg.style.width=pImg.style.height="";pImg.src=lImg.src;iImg=null;var w=lImg.width;var h=lImg.height;if(w>=h&&w>MAX_SIZE){pImg.style.width=MAX_SIZE+"px"}else{if(h>=w&&h>MAX_SIZE){pImg.style.height=MAX_SIZE+"px"}}pImg.style.display="";D.removeClass(pImg.parentNode,"loading")}};cct=setInterval(cc,10)},onHide:function(){clearInterval(cct);pImg.src=BLANK_SRC}})}}}();E.onDOMReady(Hesper.Small2Big.init);Hesper.SRP=function(){var doc=document,docForm=doc.forms;var isIE=(0<YEU.ie),isIE6=(6==YEU.ie),isWebkit=(0<YEU.webkit);var docRoot=doc.documentElement||doc.body;var config={lstToolbar:$("J_FilterToolbar"),linkOrderSelector:$("J_OrderSelector"),ulOrderOptions:$("J_OrderByList"),frmLocation:docForm.filterLocationForm};var handleSticky=function(){var toolbar=config.lstToolbar,isSticky=false;var placeHolder=doc.createElement("div");placeHolder.id="filterplaceholder";D.insertBefore(placeHolder,toolbar);placeHolder.appendChild(toolbar);var posY=D.getY(placeHolder);var stickyListener=function(){var curY=D.getDocumentScrollTop();if(isSticky&&posY>=curY){D.removeClass(placeHolder,"sticky");isSticky=false}else{if(!isSticky&&posY<=curY){D.addClass(placeHolder,"sticky");isSticky=true}}if(isIE6&&posY<=curY){placeHolder.style.top=curY+"px"}};stickyListener();E.on(window,"scroll",stickyListener)};var handleOrderSelector=function(){var orderSelector=config.linkOrderSelector,orderOptions=config.ulOrderOptions;E.on(orderSelector,"click",function(e){E.stopEvent(e)});E.on(orderOptions,"click",function(e){var target=E.getTarget(e);if("a"!==target.tagName.toLowerCase()){return }if(D.hasClass(target.parentNode,"selected")){E.stopEvent(e)}else{D.removeClass(orderOptions,"show")}});var hoverTimer=YL.later(0,this,function(){});E.on([orderSelector,orderOptions],"mouseover",function(e){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){D.addClass(orderOptions,"show")})});E.on([orderSelector,orderOptions],"mouseout",function(e){hoverTimer.cancel();hoverTimer=YL.later(200,this,function(){D.removeClass(orderOptions,"show")})})};var handleLocationList=function(){var locForm=config.frmLocation,locFormElmts=locForm.elements;var isSubmitted=false;var locSelector=locFormElmts.loc;if(!locSelector){return }E.on(locSelector,"change",function(r){var locVal=locSelector.value;if(isSubmitted&&locVal==""){return }if("other"===locVal){locVal=window.prompt("\u8bf7\u8f93\u5165\u6240\u5728\u5730\uff1a","");if(!locVal){locSelector.selectedIndex=0;return }else{locSelector.options[locSelector.selectedIndex].value=locVal}}locForm.submit();isSubmitted=true})};var decorate=function(){if(config.linkOrderSelector&&config.ulOrderOptions){handleOrderSelector()}if(config.frmLocation){handleLocationList()}};return{init:decorate}}();E.onDOMReady(Hesper.SRP.init);E.onDOMReady(function(){if(D.get("J_FilterPrice")){var timer=null,J_FilterPrice=D.get("J_FilterPrice"),priceForm=J_FilterPrice.getElementsByTagName("form")[0];price_inputs=D.getElementsBy(function(el){if(el.type==="text"){E.on(el,"focus",function(){timer&&timer.cancel();D.addClass("J_FilterPrice","price-selected")});E.on(el,"blur",function(){timer=YL.later(300,null,function(){D.removeClass("J_FilterPrice","price-selected")})});E.on(el,"keyup",function(){var _val=this.value;if(!/^\d+\.?\d*$/.test(_val)){_val=parseFloat(_val);this.value=isNaN(_val)?"":_val}});return true}},"input","J_FilterPrice");E.on(priceForm,"submit",function(e){var price_s=price_inputs[0].value,price_e=price_inputs[1].value,fstr="reserve_price";if(!price_s&&price_e>0){fstr+="[0,"+price_e+"]"}else{if(price_s>0&&!price_e){fstr+="["+price_s+",]"}else{if(price_s>=0&&price_e>=0){if(+price_s>+price_e){fstr+="["+price_e+","+price_s+"]"}else{fstr+="["+price_s+","+price_e+"]"}}}}if(fstr!=="reserve_price"){if(!D.get("filter")){var f=document.createElement("input");f.type="hidden";f.id="filter";f.name="filter";this.appendChild(f)}D.get("filter").value=fstr}else{if(D.get("filter")){D.get("filter").parentNode.removeChild(D.get("filter"))}}})}if(D.get("J_ProtectionTrigger")&&D.get("J_ProtectionList")){var timer=null,container=D.get("J_ProtectionTrigger").parentNode;E.on(container,"mouseover",function(e){var rt=E.getRelatedTarget(e);if(rt!==container&&!D.isAncestor(container,rt)){timer&&timer.cancel();timer=YL.later(300,null,function(){D.setStyle("J_ProtectionList","display","block")})}});E.on(container,"mouseout",function(e){var rt=E.getRelatedTarget(e);if(rt!==container&&!$D.isAncestor(container,rt)){timer&&timer.cancel();timer=YL.later(150,null,function(){D.setStyle("J_ProtectionList","display","none")})}});E.on("J_ProtectionTrigger","click",function(e){E.stopEvent(e)})}});var attrToggler=(function(){var hideEl=function(o){o.opened=false;o.innerHTML="\u66f4\u591a";D.removeClass(o,"open");D.setStyle(o.wrapper,"display","none")};var showEl=function(o){o.opened=true;o.innerHTML="\u6536\u8d77";D.addClass(o,"open");D.setStyle(o.wrapper,"display","")};var moreProp,viewMore,viewLink,collapsed;var lastRow1,lastRow2,maxHeight;return{init:function(config){var showMore=D.getElementsByClassName("more","a","auto-recommend");D.batch(showMore,function(o){attrToggler.bindList(o)});moreProp=D.get("J_moreProp");if(!moreProp){return }collapsed=moreProp.offsetHeight==0;lastRow1=(function(o){return o[o.length-1]})(D.get("auto-recommend").getElementsByTagName("table")[0].getElementsByTagName("tr"));D.addClass(lastRow1,"last");viewMore=D.get("J_ShowMore");if(viewMore&&moreProp){attrToggler.initAnim();attrToggler.bindAnim()}},initAnim:function(){viewLink=viewMore.getElementsByTagName("a")[0];lastRow2=(function(o){return o[o.length-1]})(moreProp.getElementsByTagName("tr"));if(collapsed){D.setStyle(moreProp,"display","");maxHeight=moreProp.offsetHeight;D.setStyle(moreProp,"display","none");D.setStyle(moreProp,"height",0)}else{maxHeight=moreProp.offsetHeight;D.removeClass(lastRow1,"last");D.addClass(lastRow2,"last")}this.openAnim=new YAHOO.util.Anim(moreProp,{height:{to:maxHeight}},0.3,YAHOO.util.Easing.easeIn);this.openAnim.onStart.subscribe(function(){D.setStyle(moreProp,"display","");this.attributes.height.to=maxHeight;D.removeClass(lastRow1,"last");D.addClass(lastRow2,"last")});this.openAnim.onComplete.subscribe(function(){viewLink.innerHTML="\u6536\u8d77";D.replaceClass(viewLink,"close","open");D.setStyle(moreProp,"height","auto");collapsed=false});this.closeAnim=new YAHOO.util.Anim(moreProp,{height:{to:0}},0.3,YAHOO.util.Easing.easeIn);this.closeAnim.onComplete.subscribe(function(){D.removeClass(lastRow2,"last");D.addClass(lastRow1,"last");viewLink.innerHTML="\u66f4\u591a";D.replaceClass(viewLink,"open","close");D.setStyle(moreProp,"display","none");collapsed=true})},bindAnim:function(){E.on(viewMore,"click",function(e){E.stopEvent(e);if(collapsed){attrToggler.openAnim.animate()}else{attrToggler.closeAnim.animate()}},this)},bindList:function(o){o.wrapper=D.getElementsByClassName("moreValue","li",o.parentNode)[0];o.opened=o.wrapper.offsetHeight>0;E.on(o,"click",function(e){E.stopEvent(e);(this.opened?hideEl:showEl)(this);if(!collapsed&&moreProp){maxHeight=moreProp.offsetHeight}})}}})();E.onDOMReady(attrToggler.init);E.onDOMReady(function(){var isShow=false,isLoading=false;var popup=D.get("J_adviseForm"),trigger=D.get("J_advise").parentNode;if(!popup||!trigger){return }document.body.appendChild(popup);document.body.appendChild(trigger);var badUA=YEU.ie&&YEU.ie<7,ie8=YEU.ie==8;if(badUA){var top=D.getRegion(trigger).top+72;var delay=500,curTop=0,scrolling=false,timer;var animTShow=new YAHOO.util.Anim(trigger,{opacity:{to:1}},0.2,YAHOO.util.Easing.easeIn);D.setStyle(trigger,"top",top+D.getDocumentScrollTop());E.on(window,"scroll",function(){curTop=D.getDocumentScrollTop();if(!scrolling){animTShow.isAnimated()&&animTShow.stop();D.setStyle(trigger,"opacity",0);scrolling=true}else{clearTimeout(timer);timer=setTimeout(function(){if(D.getDocumentScrollTop()==curTop){D.setStyle(trigger,"top",top+D.getDocumentScrollTop());animTShow.animate();scrolling=false}},delay)}});E.on(trigger,"mouseover",function(){D.setStyle(trigger,"left","2px")});E.on(trigger,"mouseout",function(){D.setStyle(trigger,"left","0")});var shadow=document.createElement("div");shadow.className="shadowDiv";popup.appendChild(shadow)}E.on(popup.getElementsByTagName("button")[0],"click",function(e){E.stopEvent(e);var form=popup.getElementsByTagName("form")[0],$C=YU.Connect,data="_nk_=";if(!YL.trim(form.content.value)){alert("\u8bf7\u8f93\u5165\u60a8\u5bf9\u6dd8\u5b9d\u641c\u7d22\u7684\u5efa\u8bae\uff01");return }var data=$C.setForm(form);var callback={success:function(o){eval("var data = "+o.responseText);alert(data.msg);animHide()},failure:function(o){animHideEnd();alert("\u670d\u52a1\u5668\u51fa\u9519!")}};var url=form.action+"?nk="+(unescape(decodeURIComponent(YAHOO.util.Cookie.get("_nk_")).replace(/\\u/g,"%u"))||"")+"&"+data;YU.Get.script(url,{onSuccess:function(){callback.success(adviseForm_data)},onFailure:callback.failure})});var formPos=[0,0],formSize=[475,375];var animShowEnd=function(){isLoading=false;isShow=true;popup.style.cssText=popup.style.cssText.replace(/(width:|height:|filter:)[^;$]+/ig,"");if(badUA){if(iframe){iframe.style.display="block"}shadow.style.display="block"}else{D.addClass(popup,"shadow")}};var animShowStart=function(){var region=YAHOO.util.Region.getRegion(trigger);popup.style.left=region.left+"px";popup.style.top=region.top+"px";popup.style.width=region.width+"px";popup.style.height=region.height+"px";!ie8&&D.setStyle(popup,"opacity","0.2");if(!badUA){popup.style.top=region.y-D.getDocumentScrollTop()+"px"}popup.style.display="block";isLoading=true};var animHideStart=function(){isLoading=true;if(badUA){if(iframe){iframe.style.display="none"}shadow.style.display="none"}else{D.removeClass(popup,"shadow")}};var animHideEnd=function(){isLoading=false;isShow=false;popup.style.display="none"};var iframe=popup.getElementsByTagName("iframe")[0];E.on(trigger,"click",function(e){E.stopEvent(e);if(isLoading){return }if(isShow){return animHide()}formPos=[Math.max((D.getViewportWidth()-formSize[0])/2,0),Math.max((D.getViewportHeight()-formSize[1])/2,0)];var animProp={width:{to:formSize[0]},height:{to:formSize[1]},top:{to:formPos[1]},left:{to:formPos[0]}};if(!ie8){animProp.opacity={to:1}}if(badUA){animProp.top={to:formPos[1]+D.getDocumentScrollTop()}}var anim=new YAHOO.util.Anim(popup,animProp,0.3,YAHOO.util.Easing.easeBoth);anim.onStart.subscribe(animShowStart);anim.onComplete.subscribe(animShowEnd);anim.animate()});var animHide=function(){var region=YAHOO.util.Region.getRegion(trigger);var animProp={width:{to:region.width},height:{to:region.height},top:{to:region.y},left:{to:region.x}};if(!ie8){animProp.opacity={to:0.2}}if(!badUA){animProp.top={to:region.y-D.getDocumentScrollTop()}}var anim=new YAHOO.util.Anim(popup,animProp,0.3,YAHOO.util.Easing.easeBoth);anim.onStart.subscribe(animHideStart);anim.onComplete.subscribe(animHideEnd);anim.animate()};E.on("J_closeForm","click",function(e){E.stopEvent(e);if(!isShow||isLoading){return }animHide()});if(badUA){E.on(window,"scroll",function(e){if(!isShow){return }popup.style.top=formPos[1]+D.getDocumentScrollTop()+"px"})}})})();
