jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};(function(a){a.fn.imgscroller=function(b){var c={controllId:"",vertical:true,speed:1000,auto:true,pause:4000,continuous:true,effect:"scroll",fadeTime:0};var b=a.extend(c,b);this.each(function(){var g=a(this);var f=a("ul:first",g);var v=a("li",f).length;var r=a("li",f).width();var j=a("li",f).height();var o=f.height();var n=a("img",f).height();b.initSpeed=b.speed;var l=j>o?o:j;var l=l>n?n:l;g.height(l);g.css("overflow","hidden");var m=v-1;var u=0;if(!b.vertical){a("li",f).css("float","left")}a("li",f).hover(function(){q()},function(){e()});if(b.controllId){var k=a("#"+b.controllId);if(!b.vertical){a("li",k).css("float","left")}a("li",k).each(function(s,h){a(h).hover(function(){q();d(s)},function(){if(b.auto){e()}})})}function e(){g.imgscrollTime=setInterval(function(){d("next")},b.pause)}function q(){clearInterval(g.imgscrollTime)}function d(s){var t=u;switch(s){case"next":u=(t>=m)?(b.continuous?0:m):u+1;var h=b.speed;if(t>=m){b.speed=b.speed/2}else{b.speed=b.initSpeed}break;case"prev":u=(u<=0)?(b.continuous?m:0):u-1;break;case"first":u=0;break;case"last":u=m;break;default:break}var w=b.speed;if(typeof s=="number"){u=s;w=w/2}if(b.controllId){a("li",k).removeClass("current");a("li:eq("+u+")",k).addClass("current")}if(!b.vertical){p=(u*r*-1);if(b.effect=="scroll"){f.stop().animate({marginLeft:p},w)}else{if(b.effect=="fade"){f.css("margin-left",p).css("opacity",1);f.stop().hide().fadeIn(b.fadeTime)}}}else{p=(u*j*-1);if(b.effect=="scroll"){f.stop().animate({marginTop:p},w)}else{if(b.effect=="fade"){f.css("margin-top",p).css("opacity",1);f.stop().hide().fadeIn(b.fadeTime)}}}}if(b.auto){e()}})};a.fn.imgPlayer=function(b){var c=a.extend({},a.fn.imgPlayer.defaults,b);this.each(function(){var L=a(this);var s=L.get(0);var B=L.width();var g=L.height();var w=L.children();var H=w.children();var h=0;var G=(c.direction=="left"||c.direction=="right")?1:0;var x,f,z,l;var u,M,K,J,I;var k,N;var A,O;var C=[];var n=0;var v=0;var o=0;w.css(G?"width":"height",10000);var F="<ul>";if(c.isEqual){k=H[G?"outerWidth":"outerHeight"]();if(G==1){k+=parseInt(a(H.get(0)).css("margin-left")=="auto"?0:a(H.get(0)).css("margin-left"))+parseInt(a(H.get(0)).css("margin-right")=="auto"?0:a(H.get(0)).css("margin-right"))}else{k+=parseInt(a(H.get(0)).css("margin-top")=="auto"?0:a(H.get(0)).css("margin-top"))+parseInt(a(H.get(0)).css("margin-bottom")=="auto"?0:a(H.get(0)).css("margin-bottom"))}N=H.length;h=k*N;for(var E=0;E<N;E++){C.push(E*k);F+="<li>"+(E+1)+"</li>"}}else{H.each(function(d){C.push(h);h+=a(this)[G?"outerWidth":"outerHeight"]();if(G==1){h+=parseInt(a(H.get(0)).css("margin-left"))+parseInt(a(H.get(0)).css("margin-right"))}else{h+=parseInt(a(H.get(0)).css("margin-top"))+parseInt(a(H.get(0)).css("margin-bottom"))}F+="<li>"+(d+1)+"</li>"})}F+="</ul>";if(h<(G?B:g)){return}w.append(H.clone()).css(G?"width":"height",h*2);if(c.navId){A=a(c.navId).append(F).hover(y,m);O=a("li",A);O.each(function(d){a(this).bind(c.eventNav,function(){if(z){return}if(n==d){return}j(C[d]);O.eq(n).removeClass("navOn");n=d;a(this).addClass("navOn")})});O.eq(n).addClass("navOn")}if(c.direction=="right"||c.direction=="down"){s[G?"scrollLeft":"scrollTop"]=h}else{s[G?"scrollLeft":"scrollTop"]=0}if(c.isMarquee){l=setTimeout(D,c.scrollDelay);L.hover(function(){clearInterval(l)},function(){clearInterval(l);l=setTimeout(D,c.scrollDelay)});if(c.controlBtn){a.each(c.controlBtn,function(d,e){a(e).bind(c.eventA,function(){c.direction=d;c.oldAmount=c.scrollAmount;c.scrollAmount=c.newAmount}).bind(c.eventB,function(){c.scrollAmount=c.oldAmount})})}}else{if(c.isAuto){m();L.hover(y,m)}if(c.btnGo){a.each(c.btnGo,function(d,e){a(e).bind(c.eventGo,function(){if(z==true){return}c.direction=d;j();if(c.isAuto){y();m()}})})}}function D(){var e=(c.direction=="left"||c.direction=="right")?"scrollLeft":"scrollTop";if(c.isMarquee){if(c.loop>0){o+=c.scrollAmount;if(o>h*c.loop){s[e]=0;return clearInterval(l)}}var d=s[e]+(c.direction=="left"||c.direction=="up"?1:-1)*c.scrollAmount}else{if(c.duration){if(u++<J){z=true;var d=Math.ceil(r(u,M,K,J));if(u==J){d=I}}else{d=I;clearInterval(x);z=false;return}}else{var d=I;clearInterval(x)}}if(c.direction=="left"||c.direction=="up"){if(d>=h){d-=h}}else{if(d<=0){d+=h}}s[e]=d;if(c.isMarquee){l=setTimeout(D,c.scrollDelay)}else{if(u<J){if(x){clearTimeout(x)}x=setTimeout(D,c.scrollDelay)}else{z=false}}}function j(t){z=true;var P=(c.direction=="left"||c.direction=="right")?"scrollLeft":"scrollTop";var e=c.direction=="left"||c.direction=="up"?1:-1;v=v+e;if(t==undefined&&c.navId){O.eq(n).removeClass("navOn");n+=e;if(n>=N){n=0}else{if(n<0){n=N-1}}O.eq(n).addClass("navOn");v=n}var d=v<0?h:0;u=0;M=s[P];I=(t!=undefined)?t:d+(c.distance*v)%h;if(e==1){if(I>M){K=I-M}else{K=I+h-M}}else{if(I>M){K=I-h-M}else{K=I-M}}J=c.duration;if(x){clearTimeout(x)}x=setTimeout(D,c.scrollDelay)}function m(){f=setInterval(function(){j()},c.time*1000)}function y(){clearInterval(f)}function r(P,e,R,Q){return -R*(P/=Q)*(P-2)+e}function q(P,e,R,Q){return R*((P=P/Q-1)*P*P*P*P+1)+e}})};a.fn.imgPlayer.defaults={isMarquee:false,isEqual:true,loop:0,newAmount:3,eventA:"mousedown",eventB:"mouseup",isAuto:true,time:5,duration:50,eventGo:"click",direction:"left",scrollAmount:1,scrollDelay:10,eventNav:"click"};a.fn.imgPlayer.setDefaults=function(b){a.extend(a.fn.imgPlayer.defaults,b)}})(jQuery);(function(a){a.fn.lazyload=function(b){var c={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window,realsrc:"realsrc"};if(b){a.extend(c,b)}var d=this;d.sort(function(f,e){return a(f).offset().top-a(e).offset().top});if("scroll"==c.event){a(c.container).bind("scroll",function(g){var e=0;g.stopPropagation();d.each(function(){if(a.abovethetop(this,c)){}else{if(!a.belowthefold(this,c)){a(this).trigger("appear")}else{if(e++>c.failurelimit){return false}}}});var f=a.grep(d,function(h){return !h.loaded});d=a(f);if(f.length<=0){a(c.container).unbind("scroll")}})}this.each(function(){var e=this;if("scroll"!=c.event||undefined==a(e).attr("src")||(a.abovethetop(e,c)||a.belowthefold(e,c))){if(c.placeholder){}else{}e.loaded=false}else{a(e).attr("src",a(e).attr(c.realsrc));e.loaded=true}a(e).one("appear",function(){if(!this.loaded){a("<img />").bind("load",function(){a(e).hide().attr("src",a(e).attr(c.realsrc))[c.effect](c.effectspeed);e.loaded=true});e.loaded=true;a(e).attr("src",a(e).attr(c.realsrc))}});if("scroll"!=c.event){a(e).bind(c.event,function(f){if(!e.loaded){a(e).trigger("appear")}})}});a(c.container).trigger(c.event);return this};a.belowthefold=function(d,f){if(f.container===undefined||f.container===window){var b=a(window).height()+a(window).scrollTop()}else{var b=a(f.container).offset().top+a(f.container).height()}var g=b;var e=a(d).offset().top;var c=a(d).offset().top;return b<=a(d).offset().top-f.threshold};a.rightoffold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).width()+a(window).scrollLeft()}else{var b=a(d.container).offset().left+a(d.container).width()}return b<=a(c).offset().left-d.threshold};a.abovethetop=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollTop()}else{var b=a(d.container).offset().top}return b>=a(c).offset().top+d.threshold+a(c).height()};a.leftofbegin=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollLeft()}else{var b=a(d.container).offset().left}return b>=a(c).offset().left+d.threshold+a(c).width()};a.extend(a.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);function headTagImgShow(b){var a=$("#"+b+" img:first").attr("orignalsrc");if(a){$("#"+b+" img:first").attr("src",a).removeAttr("orignalsrc")}$("#"+b).show()}function addFavorite(a){var b=location.href;try{window.external.addFavorite(b,a)}catch(c){try{if(document.all){window.external.addFavorite(b,a)}else{if(window.sidebar){window.sidebar.addPanel(a,b,"")}}}catch(c){alert("加入收藏失败，请使用Ctrl+D进行添加")}}}function setTab(a,d){var c=document.getElementById("menu"+a).getElementsByTagName("li");var b=document.getElementById("main"+a).getElementsByTagName("ol");for(i=0;i<c.length;i++){c[i].className=i==d?"tabSelect":"";b[i].style.display=i==d?"block":"none"}}function S_and_H(b,a){if(document.getElementById(b).offsetHeight<=96){document.getElementById(b).style.height="auto";document.getElementById(a).style.background="url(/core/app/theme/skin/image/front/productBrandArrow.gif) center -43px no-repeat"}else{document.getElementById(b).style.height="96px";document.getElementById(a).style.background="url(/core/app/theme/skin/image/front/productBrandArrow.gif) center 7px no-repeat"}}function productExchangeToCart(c,b){if($(".color").length>0){if($(".size").length>0&&$(".productMotherYards ul.size").find("a.chooseYards").length<=0){alert("请您选择尺码！");return false}}if($(".color").length<=0&&$(".size").length>0){if($(".productMotherYards ul.size").find("a.chooseYards").length<=0){alert("请您选择尺码！");return false}}if($(".size").length<=0&&$(".color").length>0){if($(".productMotherYards ul.color").find("a.chooseYards").length<=0){alert("请您选择颜色！");return false}}var a="addPointExchangeToCart("+c+");";userIsLogin2(b,false,a)}function addPointExchangeToCart(f,a,c,b,e,d){if(a!="false"){a="true"}if(c!="true"){c="false"}if(!f){f=0}if(!b){b=0}if(!d){d=""}$.get("/sales/cart/checkPoints",{productId:f},function(g){if(g=="success"){addToCart(f,1,a,c,0,1,b,e,d)}else{if(g=="none"){alert("该兑换商品未启用，无法兑换！")}else{if(g=="nouser"){showPopupLogin(true,null,"fShopCart_loginReload()")}else{integralLoginInfo();alert("积分不足，无法兑换！")}}}})}function addPlusToCart(a,c,b){$.get("/sales/cart/addPlusProduct",{productId:c,activityId:a,alliance:b,flag:1},function(d){if(d=="CANNOT"){alert("您未满足条件，不能换购该商品！")}else{if(d=="ADDED"){alert("您已经换购过该商品，不能多次换购！")}else{window.location.href="/shoppingcart.htm?alliance="+b}}})}function addToCart(b,k,e,f,a,g,c,d,j,l){if(b==""){b=0}if(k==""){k=1}if(e==""){e="true"}if(f==""){f="false"}if(a==""){a=0}if(g==""){g=0}if(c==""){c=0}if(j==""){j="/"}if(l==""){l=0}if(e=="false"){controlCartPopup(d);$("#popupcontent").hide()}var h=false;if(c==1){$.post("/customer/account/isLogin",{beforeloginurl:$("#currentUrl").val()},function(n){if(n=="NO"){var m="addToCartSub("+b+","+k+",'"+e+"','"+f+"',"+a+","+g+",'"+j+"',"+l+");";showPopupLogin(true,null,m)}else{if(n=="OK"){addToCartSub(b,k,e,f,a,g,j,l)}}})}else{addToCartSub(b,k,e,f,a,g,j,l)}return h}function addToCartSub(c,h,d,e,b,f,g,j){if(c==""){c=0}if(h==""){h=1}if(d==""){d="true"}if(e==""){e="false"}if(b==""){b=0}if(f==""){f=0}if(g==""){g="/"}if(j==""){j=0}if(d=="false"){if(!b){b=0}$.getJSON("/addsuccess.htm",{productId:c,qty:1,flag:d,activityId:b,isPoint:f,isBuyAgain:j},function(o){if(o){if(o.stock_out==1&&(o.stock_out_prods=="all"||!o.stock_out_prods)){if(o.stock_out_prods=="all"){alert("所有商品已下架或暂时缺货，无法加入购物车，请购买其他商品！")}else{if(o.stock_out_prods){alert("商品"+o.stock_out_prods+"已下架或暂时缺货，无法加入购物车，请购买其他商品！")}else{alert("此商品已下架或暂时缺货，无法加入购物车，请购买其他商品！")}}}else{if(o.points_out==1&&o.stock_out!=1){integralLoginInfo();alert("积分不足，无法兑换！")}else{if(o.is_config==1&&o.stock_out!=1){window.open(g)}else{if(o.login_need==1&&o.stock_out!=1){var m="addToCartSub("+c+","+h+",'"+d+"','"+e+"',"+b+","+f+",'"+g+"',"+j+");";showPopupLogin(true,null,m)}else{if(f==1){integralLoginInfo()}$("#cartQty").text(o.qty);$("#cartTotalPrice").text(o.amount.toFixed(2));if(o.finalAmount.toFixed(2)&&o.amount.toFixed(2)!=o.finalAmount.toFixed(2)){$("#cartTotalFinal").html('，折后<font class="font_red">'+o.finalAmount.toFixed(2)+"</font>元")}else{$("#cartTotalFinal").text("")}$("#shoppingCartDownlist .total span:first").text(o.qty);$("#shoppingCartDownlist .total span:eq(1)").html("金额总计：<font>￥"+o.amount.toFixed(2)+"</font>");$("#shoppingCartDownlist").next().next().find("span").text(o.qty);var n=o.list;if(n){for(var l=0;l<n.length;l++){if(!b){b=0}var k=$("#MiniDel_"+n[l].alliance+"_"+n[l].type+"_"+b+"_"+n[l].id);if(k.attr("id")){k.parents(".goods").replaceWith(n[l].data)}else{$("#shoppingCartDownlist .total").before(n[l].data)}}}$("#popupcontent").show();if(o.stock_out==1&&o.stock_out_prods){alert("商品"+o.stock_out_prods+"已下架或暂时缺货，无法加入购物车，请购买其他商品！")}}}}}}else{alert("添加失败!")}});return false}else{if(!h){h=1}var a="/addsuccess.htm?productId="+c+"&qty="+h;if(b){a+="&activityId="+b}if(f==1){a+="&isPoint=1"}if(e=="true"){window.open(a)}else{window.location.href=a}}}function addToWishList(b,c,a){$.post("/customer/account/isLogin",{beforeloginurl:$("#currentUrl").val()},function(e){if(e=="NO"){var d="realAddToWishList("+c+",'"+a+"');";showPopupLogin(false,b,d)}else{if(e=="OK"){realAddToWishList(c,a)}}})}function realAddToWishList(b,a){$.post("/customer/account/addToWishList",{product_id:b,description:"",displayjsondata:a},function(c){if(c=="OK"){alert("收藏成功!")}else{if(c=="NO"){alert("此商品已经收藏过了!")}}})}function showPopupLogin(c,b,a){if($("div.popupLogin").length==0){$.get("/customer/account/tempLogin",{isCenter:c,tourl:a},function(d){$(d).appendTo("body");calPopupLogin(c,b);$("input[name='login[username]']").focus()})}else{calPopupLogin(c,b);$("input[name='login[username]']").focus()}}function calPopupLogin(g,f){var d=$(document).scrollTop();var c=$(document).scrollLeft();var j=document.documentElement.clientWidth;var k=document.documentElement.clientHeight;var h=0;var b=0;if(g){h=d+k/2-$("div.popupLogin").outerHeight()/2;b=c+j/2-$("div.popupLogin").outerWidth()/2;$("div.popupLoginOverlay").show()}else{var e=$(f).offset();h=e.top+$(f).outerHeight();b=e.left;if(j<b+$("div.popupLogin").outerWidth()){b=j-$("div.popupLogin").outerWidth()}var a=document.documentElement.scrollTop+$(window).height();if(a<h+$("div.popupLogin").outerHeight()){h=a-$("div.popupLogin").outerHeight()}}$("div.popupLogin").css({top:h,left:b});$("div.popupLogin").show()}function addToShoppingCart(g,f,a,d,c,b){var e=false;if(b==1){$.ajax({type:"POST",async:false,url:"/customer/account/isLogin",data:"beforeloginurl="+$("#currentUrl").val(),dataType:"text",success:function(j){if(j=="NO"){var h="addToShoppingCartSub("+g+","+f+",'"+a+"',"+d+","+c+");";showPopupLogin(false,f,h);e=false}else{if(j=="OK"){e=addToShoppingCartSub(g,f,a,d,c)}}}})}else{e=addToShoppingCartSub(g,f,a,d,c)}return e}function addToShoppingCartSub(h,g,b,f,d){_gaq.push(["_trackEvent","加入购物车",d,f+h]);var c="/addsuccess.htm";var e="qty=1&flag=false&productId="+h;var a=false;$.ajax({type:"get",url:c,async:false,data:e,dataType:"json",success:function(m){if(m.is_config==1){a=true}else{if(m.stock_out==1){alert("此商品暂时缺货！")}else{$("#cartQty").text(m.qty);$("#cartTotalPrice").text(m.amount.toFixed(2));if(m.finalAmount.toFixed(2)&&m.amount.toFixed(2)!=m.finalAmount.toFixed(2)){$("#cartTotalFinal").html('，折后<font class="font_red">'+m.finalAmount.toFixed(2)+"</font>元")}else{$("#cartTotalFinal").text("")}$("#shoppingCartDownlist .total span:first").text(m.qty);$("#shoppingCartDownlist .total span:eq(1)").html("金额总计：<font>￥"+m.amount.toFixed(2)+"</font>");$("#shoppingCartDownlist").next().next().find("span").text(m.qty);var l=m.list;if(l){for(var k=0;k<l.length;k++){var j=$("#MiniDel_"+l[k].alliance+"_0_0_"+l[k].id);if(j.attr("id")){j.parents(".goods").replaceWith(l[k].data)}else{$("#shoppingCartDownlist .total").before(l[k].data)}}}if(b==1){controlRelatedCartPopup(g)}else{controlCartPopup(g)}}}}});return a}function hidePopup(){$("#popupcontent").hide()}function controlCartPopup(f){var d=$(document).scrollTop();var c=$(document).scrollLeft();var h=document.documentElement.clientWidth;var j=document.documentElement.clientHeight;var g=0;var b=0;var e=$(f).offset();g=e.top+$(f).outerHeight();b=e.left;if(h<b+$("#popupcontent").outerWidth()){b=h-$("#popupcontent").outerWidth()}var a=d+$(window).height();if(a<g+$("#popupcontent").outerHeight()){$(document).scrollTop(d+g+$("#popupcontent").outerHeight()-a)}$("#popupcontent").css({top:g,left:b});$("#popupcontent").show()}function controlRelatedCartPopup(f){var d=$(document).scrollTop();var c=$(document).scrollLeft();var h=document.documentElement.clientWidth;var j=document.documentElement.clientHeight;var g=0;var b=0;var e=$(f).offset();g=e.top-60;b=e.left+140;if(h<b+$("#popupcontent").outerWidth()){b=h-$("#popupcontent").outerWidth()}var a=d+$(window).height();if(a<g+$("#popupcontent").outerHeight()){$(document).scrollTop(d+g+$("#popupcontent").outerHeight()-a)}$("#popupcontent").css({top:g,left:b});$("#popupcontent").show()}function ajaxPriceAndGiftInfo(){var a=[];$(".ajaxSalePrice1").each(function(){var c=$(this).attr("product_id");a.push(c)});var b=a.join(",");if(b!=""&&b!=null){$.ajax({type:"POST",async:true,url:"/catalog/category/getPriceInfo",data:"ids="+b,dataType:"json",success:function(e){if(e!=null){var d=b.split(",");for(var c=0;c<d.length;c++){if(isUndefined(d[c])){continue}if(isUndefined(e[d[c]])){continue}$("#marketPrice"+d[c]).text("￥"+e[d[c]].market_price);$("#price"+d[c]).text("￥"+e[d[c]].price);if(e[d[c]].is_has_largess=="1"){}if(e[d[c]].is_special_price=="1"){$("#specialPrice"+d[c]).addClass("globalFloatTe")}}}}})}}function isUndefined(a){return typeof a=="undefined"?true:false}function userIsLogin(e,b,a,c,d){if(d==""){d=0}$.post("/customer/account/isLogin",{beforeloginurl:$("#currentUrl").val()},function(f){if(f=="NO"){if(a=="rating"){showPopupLogin(false,e,"userHasRatingOrBuy("+c+",'"+b+"',"+d+")")}else{if(a=="consultation"){showPopupLogin(false,e,"goConsultationBox()")}else{if(a=="jifen"){showPopupLogin(false,e,"couponUrl('"+b+"')")}else{showPopupLogin(false,e,"toReplyPage('"+b+"')")}}}}else{if(f=="OK"){if(a=="rating"){userHasRatingOrBuy(c,b,d)}else{if(a=="consultation"){goConsultationBox()}else{if(a=="jifen"){couponUrl(b)}else{toReplyPage(b)}}}}}})}function toReload(){javascript:window.location.reload()}function couponUrl(a){window.location.href=a}function userIsLogin2(obj,isbagFrame,callfunction){$.post("/customer/account/isLogin",{beforeloginurl:$("#currentUrl").val()},function(msg){if(msg=="NO"){showPopupLogin(isbagFrame,obj,callfunction)}else{if(msg=="OK"){eval(callfunction)}}})}function userIsLogin3(num){$.post("/customer/account/isLogin",{beforeloginurl:"/catalogsubscription.htm?catalog="+num},function(msg){var callfunction="couponUrl('/catalogsubscription.htm?catalog="+num+"')";if(msg=="NO"){opencataBg(1);showPopupLogin(true,this,callfunction)}else{if(msg=="OK"){eval(callfunction)}}})}function opencataBg(c){if(c==1){$("#catalogFloatBg").css("display","block");var b=document.body.clientHeight>document.documentElement.offsetHeight?document.body.clientHeight:document.documentElement.offsetHeight;var a=document.body.clientWidth>document.documentElement.offsetWidth?document.body.clientWidth:document.documentElement.offsetWidth;$("#catalogFloatBg").css("height",b+"px");$("#catalogFloatBg").css("width",a+"px")}else{$("#catalogFloatBg").css("display","none")}}function replyRating(e,c,a,d){var b=d+"-4-"+a+"-1.html#productReply";userIsLogin(e,b,"reply",c)}function toReplyPage(a){$("#productReply").show();window.location.href=a}function goConsultationBox(){$("#productConsulation").show();window.location.href="#productConsulation"}function userHasRatingOrBuy(c,b,e){var a="/rating/rating/userHasRatingOrBuy";if(typeof(e)=="undefined"){var d="product_id="+c}else{var d="product_id="+c+"&ordrid="+e}$.ajax({type:"POST",url:a,data:d,dataType:"json",success:function(f){$("#productConsulation").show();if(f==-2){alert("您已经对此商品评价过了！")}else{if(f==-1){alert("抱歉，只有购买或兑换过该商品且签收后才能评价！")}else{$("#productComment").show();window.location.href=b+"#productComment"}}}})}function setReviewUse(d,a,b,c){$.post("/customer/account/isLogin",{beforeloginurl:$("#currentUrl").val()},function(f){var e=false;if(f=="NO"){showPopupLogin(false,c,"setReviewUse2("+d+","+a+","+b+")")}else{setReviewUse2(d,a,b)}})}function setReviewUse2(e,a,c){var b="/rating/rating/setIsUseful";var d="id="+a+"&is_useful="+e+"&product_id="+c;$.ajax({type:"POST",url:b,data:d,dataType:"json",success:function(f){$("#productConsulation").show();if(f.has_vote==1){alert("您已经投过票了！")}else{if(e==1){$("#review_useful"+a).replaceWith("("+f.useful_count+")");alert("您认为此评价有用！")}else{$("#review_useless"+a).replaceWith("("+f.useless_count+")");alert("您认为此评价无用！")}}}})}function setAnswerApprove(a,c,b,d){$.post("/customer/account/isLogin",{beforeloginurl:$("#currentUrl").val()},function(e){if(e=="NO"){showPopupLogin(false,d,"setAnswerApprove2("+a+","+c+","+b+")")}else{if(e=="OK"){setAnswerApprove2(a,c,b)}}})}function setAnswerApprove2(a,e,c){var b="/consultation/consultation/setIsApprove";var d="id="+e+"&is_approve="+a+"&product_id="+c;$.ajax({type:"POST",url:b,data:d,dataType:"json",success:function(f){$("#productConsulation").show();if(f.has_vote==1){$("#isApproveMsg"+e).html("您已经投过票了！")}else{if(a==1){$("#isApproveMsg"+e).html("您对此回复满意！");$("#answer_approve"+e).replaceWith("("+f.approve_count+")")}else{$("#isApproveMsg"+e).html("您对此回复不满意！");$("#answer_oppose"+e).replaceWith("("+f.oppose_count+")")}}}})}function ChangeStarBg(b,f,a){var h="starHover";if(b!=""){h="starClick"}var d=document.getElementById(h);if(d){var e="auto";if(f!=""){e="-999em";d.className="starNone"}else{d.className="starBg"+a+"0"}if(b!=""&&f==""){$("#optionId").val(a);var g="";if(a==1){g="1分 很不满意"}else{if(a==2){g="2分 不满意"}else{if(a==3){g="3分 一般"}else{if(a==4){g="4分 满意"}else{if(a==5){g="5分 非常满意"}}}}}$("#starMsg").replaceWith("<div class='productCommentsScores font_yellow' id='starMsg'>"+g+"</div>")}var c=document.getElementById("note"+a);if(c){c.style.left=e}}}function addRating(){var f=$("#optionId").val();var g=$("#title").val();var d=$("#detail").val();var c=$("#ordrid").val();if(f==""){alert("请选择您要评价的分数！");return false}if($.trim($("#title").val()).length<5||$.trim($("#title").val()).length>=30){alert("您填写评价的标题长度应当在5-30个汉字之间！");return false}if($.trim($("#detail").val()).length<5||$.trim($("#detail").val()).length>300){alert("您填写评价的内容长度应当在5-300个汉字之间！");return false}var a="/rating/rating/addRating";var b=$("#productId").val();var e="product_id="+b+"&option_id="+f+"&title="+g+"&detail="+d+"&ordrid="+c;$.ajax({type:"POST",url:a,data:e,dataType:"json",success:function(h){if(h.productId>0){if(h.autoVerify==1){var j="<input id='ratingcontent' type='hidden' value='"+h.content+"' />";var k="<div class='goodsName' id='sharedetail'>我买了"+$("#pName > a").text()+","+h.content+"，只要"+$("#pPrice span").text()+"元，觉得不错，分享给大家，快来看看吧~ </div>";$("#sharedetail").replaceWith(k);$("#ratingcontent").replaceWith(j);opencataBg(1);openCommentYes(1)}else{alert("您的评价已提交成功，待管理员审核后方可显示!")}$("#ratingForm").resetForm();$("#addRating").attr("disabled","disabled");$("#detail").replaceWith("<textarea id='detail' disabled='disabled'>您已经对此商品评价过了！</textarea>")}else{if(h.productId==-1){alert("抱歉，只有购买或兑换过该商品且签收后才能评价！")}else{if(h.productId==-2){alert("您已经对此商品评价过了！")}else{alert("您的评价提交失败, 请过段时间提交!")}}}}})}function shareproduct(json,type,page){var _top=(window.screen.height-500)/2;var _left=(window.screen.width-607)/2;if(type=="kaixin"&&page=="product"){var shareurl="http://www.kaixin001.com/rshare/share.php?rpara="+json;window.open(encodeURI(shareurl),"","innerWidth=607px,innerHeight=500px,scrollbar=no,left="+_left+"px,top="+_top+"px,titlebar:no,toolbar:no,menubar:no,location:no,directories:no");return}if(page=="invite"||page=="pintui"){if(page=="invite"){var hostname=$("input[name='hostpanding']").val();var rtitle="嗨，最近发现了一个好地方："+hostname+"，真的便宜，很不错！"}else{if(page=="pintui"){var rtitle="快来参与缤购网推荐好友注册活动，就有机会参与每周的抽奖活动哦~";var rpic="http://img01.bgoimg.com/core/app/theme/skin/image/front/cetaphilcj.jpg"}}var hosturl=$("input[name='hosturl']").val();var rurl=json;var rmtest=json.match(/rmtest/);var rbtest=json.match(/rbtest/);var binggo=json.match(/binggo/);var redbaby=json.match(/redbaby/);if(rmtest||rbtest){var rbhost="rbtest";var rmhost="rmtest";var host=rmtest?rmtest:rbtest}else{if(binggo||redbaby){var rbhost="redbaby";var rmhost="binggo";var host=binggo?binggo:redbaby}}}else{var obj=eval("("+json+")");var host=obj.webHost;var rmhost=obj.webHost_rm;var rbhost=obj.webHost_rb;if(page=="product"){if(obj.havespec){var jia="，特价"}else{var jia="，会员价"}var productname=obj.productname.replace(/&quot;/g,'"');var rtitle=productname.replace(/&#039;/g,"'")+jia+obj.price+"元，觉得不错，分享给大家，快来看看吧~"}else{if(page=="rating"){var sharedetail=$("#sharedetail").html();sharedetail=$.trim(sharedetail);var rtitle=sharedetail}else{if(page=="feature"){var topicname=obj.title.replace(/&quot;/g,'"');var rtitle=topicname.replace(/&#039;/g,"'")+",我觉得挺不错的，分享给大家，快来看看吧~"}}}var rpic=obj.pictureurl;var rurl=obj.producturl}if(type=="sina"){if(host==rmhost){var title="@缤购网：";var appkey="2638250623"}else{if(host==rbhost){var title="@红孩子母婴网：";var appkey="2050249842"}}if(page=="invite"){var shareurl="http://v.t.sina.com.cn/share/share.php?appkey="+appkey+"&title="+title+rtitle+"&url="+rurl}else{var shareurl="http://v.t.sina.com.cn/share/share.php?appkey="+appkey+"&title="+title+rtitle+"&pic="+rpic+"&url="+rurl}}else{if(type=="tengxun"){if(host==rmhost){var appkey="49eea3293ebd4491bbaebe5da944c518";var assname="binggo1850663574"}else{if(host==rbhost){var appkey="79552a958b064ecc851d14a05c108714";var assname="redbaby"}}var title="@"+assname+":";if(page=="invite"){var shareurl="http://v.t.qq.com/share/share.php?url="+rurl+"&appkey="+appkey+"&site="+host+"&title="+title+rtitle+"&assname="+assname}else{var shareurl="http://v.t.qq.com/share/share.php?url="+rurl+"&appkey="+appkey+"&site="+host+"&title="+title+rtitle+"&assname="+assname+"&pic="+rpic}}else{if(type=="renren"){if(host==rmhost){var title="缤购网："}else{if(host==rbhost){var title="红孩子母婴网："}}if(page=="invite"){var shareurl="http://share.renren.com/share/buttonshare/post/4001?url="+rurl+"&title="+title+rtitle+"&content="+rtitle}else{var shareurl="http://share.renren.com/share/buttonshare/post/4001?url="+rurl+"&title="+title+rtitle+"&content="+rtitle+"&pic="+rpic}}else{if(type=="kaixin"){if(host==rmhost){var title="缤购网："}else{if(host==rbhost){var title="红孩子母婴网："}}if(page=="invite"){var shareurl="http://www.kaixin001.com/repaste/bshare.php?rurl="+rurl+"&rtitle="+title+rtitle+"&rcontent="+rtitle}else{var shareurl="http://www.kaixin001.com/repaste/bshare.php?rurl="+rurl+"&rtitle="+title+rtitle+"&rcontent="+rtitle+"&rpic="+rpic}}else{if(type=="sohu"){if(host==rmhost){var title="@缤女郎：";var appkey="XHkhe0EmEanrd5g4bAe2"}else{if(host==rbhost){var title="@红孩子的妈妈：";var appkey="uNZDmmWjhgNsvXOOXzhI"}}if(page=="invite"){var shareurl="http://t.sohu.com/third/post.jsp?appkey="+appkey+"&title="+title+rtitle+"&url="+rurl+"&content=utf-8"}else{var shareurl="http://t.sohu.com/third/post.jsp?appkey="+appkey+"&title="+title+rtitle+"&pic="+rpic+"&url="+rurl+"&content=utf-8"}}else{if(type=="kongjian"){if(host==rmhost){var title="缤购网："}else{if(host==rbhost){var title="红孩子母婴网："}}if(page=="invite"){var shareurl="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+rurl+"&title="+title+rtitle+"&summary="+rtitle}else{var shareurl="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+rurl+"&title="+title+rtitle+"&summary="+rtitle+"&pics="+rpic}}else{if(type=="douban"){if(host==rmhost){var title="缤购网："}else{if(host==rbhost){var title="红孩子母婴网："}}if(page=="invite"){var shareurl="http://www.douban.com/recommend/?title="+title+rtitle+"&comment="+rtitle+"&url="+rurl}else{var shareurl="http://www.douban.com/recommend/?title="+title+rtitle+"&comment="+rtitle+"&url="+rurl}}else{if(type=="msn"){if(host==rmhost){var title="缤购网："}else{if(host==rbhost){var title="红孩子母婴网："}}if(page=="invite"){var shareurl="http://profile.live.com/badge/?url="+rurl+"&title="+title+rtitle+"&description="+rtitle}else{var shareurl="http://profile.live.com/badge/?url="+rurl+"&title="+title+rtitle+"&description="+rtitle+"&screenshot="+rpic}}}}}}}}}window.open(encodeURI(shareurl),"","innerWidth=607px,innerHeight=500px,scrollbar=no,left="+_left+"px,top="+_top+"px,titlebar:no,toolbar:no,menubar:no,location:no,directories:no")}function mycopyLink(l){var b=navigator.userAgent.toLowerCase();if(!(b.match(/msie ([\d.]+)/)||b.match(/firefox\/([\d.]+)/))){alert("您的浏览器不支持自动复制，请将方框中的内容复制并发送给您的QQ、MSN好友，感谢您对红孩子的支持！");return}var f=false;var g=$(l).val();if(window.clipboardData){window.clipboardData.clearData();window.clipboardData.setData("Text",g);alert("地址复制成功,请过QQ,MSN发送给你的好友吧，感谢您对红孩子的支持！");f=true}else{if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(j){alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将 'signed.applets.codebase_principal_support'设置为'true'");f=true}var d=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!d){return}var m=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!m){return}m.addDataFlavor("text/unicode");var k=new Object();var h=new Object();var k=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);var c=g;k.data=c;m.setTransferData("text/unicode",k,c.length*2);var a=Components.interfaces.nsIClipboard;if(!d){return false}d.setData(m,null,a.kGlobalClipboard);alert("地址复制成功,请通过QQ,MSN发送给你的好友吧，感谢您对红孩子的支持！");f=true}}if(!f){alert("您的浏览器不支持自动复制，请在地址栏复制链接发送给您的QQ、MSN好友，感谢您对红孩子的支持！")}}function replySumbit(){var d=$.trim($("#detail").val());if($.trim($("#detail").val()).length<5||$.trim($("#detail").val()).length>300){alert("您填写回复的内容长度在5-300个汉字之间！");return false}var b="/rating/rating/reply";var c=$("#productId").val();var a=$("#reviewId").val();var e="product_id="+c+"&parent_id="+a+"&detail="+d;$.ajax({type:"POST",url:b,data:e,success:function(g){if(g=="-1"){alert("您的回复失败, 请登陆后发表您的回复！");$("#detail").val("")}else{var k=new String(g);var j=k.split("|");var h=j[0];var f=j[1];alert("您的回复已经提交, 我们会尽快审核并显示！");$("#detail").val("")}}})}function addQuestion(a){var e=$("input[name='question']:checked").val();var b=$("#question").val();var g=$("input[name='is_anonymous']:checked").val();if("undefined"==typeof(e)){alert("请选择您要咨询的类型！");return false}if($.trim($("#question").val()).length<5||$.trim($("#question").val()).length>300){alert("您填写咨询的问题长度在5-300个汉字之间！");return false}if(g!=1){g=0}var c="/consultation/consultation/addQuestion";var d=$("#productId").val();var f="product_id="+d+"&type="+e+"&question="+b+"&is_anonymous="+g;$.ajax({type:"POST",url:c,data:f,success:function(h){if(h){alert("您的咨询已经提交成功, 待管理员回复后显示!");$("#questionForm").resetForm()}else{alert("您的咨询提交失败, 请过段时间提交!")}}})}function filter_S_and_H(b,a){if(document.getElementById(b).offsetHeight<=290){document.getElementById(b).style.height="auto";document.getElementById(a).style.background="url(/core/app/theme/skin/image/front/publicMore.gif) 75px -3px no-repeat";document.getElementById(a).innerHTML="收起"}else{document.getElementById(b).style.height="290px";document.getElementById(a).style.background="url(/core/app/theme/skin/image/front/publicMore.gif) right -21px no-repeat";document.getElementById(a).innerHTML="显示全部分类"}}function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3){with(document){if(getElementById&&((obj=getElementById(args[i]))!=null)){v=args[i+2];if(obj.style){obj=obj.style;v=(v=="show")?"visible":(v=="hide")?"hidden":v}obj.visibility=v}}}}function isIE6(){if(window.XMLHttpRequest){return false}else{if(window.ActiveXObject){var b=navigator.appName;var d=navigator.appVersion;var a=d.split(";");var c=a[1].replace(/[ ]/g,"");if(b=="Microsoft Internet Explorer"&&c=="MSIE7.0"){return false}else{if(b=="Microsoft Internet Explorer"&&c=="MSIE6.0"){return true}}}}}function showKaixinDlg(a){var c=100004;var d=(window.screen.height-420)/2;var b=(window.screen.width-545)/2;if(navigator.userAgent.indexOf("MSIE")!=-1){if(navigator.userAgent.indexOf("MSIE 6")!=-1){window.showModalDialog(" http://www.kaixin001.com/rshare/share.php?rpara="+a+"&r="+Math.random(),"","dialogWidth=552px;dialogHeight=400px;scroll=no;center=1;titlebar:no;toolbar:no;menubar:no;location:no;directories:no")}else{window.showModalDialog(" http://www.kaixin001.com/rshare/share.php?rpara="+a+"&r="+Math.random(),"","dialogWidth=545px;dialogHeight=350px;scroll=no;center=1;titlebar:no;toolbar:no;menubar:no;location:no;directories:no")}}else{window.showModalDialog(" http://www.kaixin001.com/rshare/share.php?rpara="+a+"&r="+Math.random(),"","dialogWidth=545px;dialogHeight=350px;scroll=no;dialogLeft="+b+"px;dialogTop="+d+"px;center=1;titlebar:no;toolbar:no;menubar:no;location:no;directories:no")}}function checkout(){$("#miniCartForm").submit()}function isEmail(a){var b=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;return b.test($.trim(a))}function getChildArea(c,a,b){var d=$(c).val();if(d==-1){if(a==2){$("#SHR_address_cityid").hide();$("#SHR_address_areaid").hide();$("#payment").html("")}else{if(a==3){$("#SHR_address_areaid").hide();$("#payment").html("")}}}else{$.ajax({url:"/sales/order/getChildArea",dataType:"json",async:true,data:{cantCode:d,cantType:a,productId:b},success:function(e){var g="";var f=e.childArea;var h=e.shippingMoney;if(f.length){if(a==2){g="<option selected='selected' value='-1'>--请选择--</option>"}else{if(a==3){g="<option selected='selected' value='-1'>--请选择--</option>"}}for(i=0;i<f.length;i++){g+="<option value='"+f[i].cant_code+"'>"+f[i].cant_name+"</option> "}if(a==2){$("#SHR_address_cityid").show();$("#SHR_address_areaid").hide();$("#payment").html("");$("#SHR_address_cityid").html(g)}else{if(a==3){$("#SHR_address_areaid").show();$("#payment").html("");$("#SHR_address_areaid").html(g)}}}else{if(h>0){$("#payment").html(h)}else{$("#payment").html("0.00<span>（免运费）</span>")}}}})}}function getPhoneCodeandSendtophone(message,callfunction){if(message==null||message==""){message="NO"}var phonenumber=$("input[name='phonenumber']").val();if(phonenumber==""){alert("手机号码不能为空！");return}var reg=getphonereg();if(!reg.test(phonenumber)){alert("手机号码格式不对！");return}mobilephone=phonenumber;$.ajax({url:"/customer/account/sendMessage",async:false,type:"POST",data:"phonenumber="+phonenumber+"&message="+message,success:function(data){data=$.trim(data);if(data=="OK"){alert("验证码已经发到你的手机，请查收！");if(callfunction!=null&&callfunction!=""){eval(callfunction)}}else{if(data=="NO"){alert("验证码发送失败，请稍后再试！")}else{if(data=="hasvalidate"){alert("此手机已经验证过，无法再次验证！")}else{alert(data)}}}}})}function bondphone(calfun,calfun2){var getjssuijicode=$("input[name='getjssuijicode']").val();getjssuijicode=$.trim(getjssuijicode);$.ajax({url:"/customer/account/activeMobile",async:false,type:"POST",data:"phonecode="+getjssuijicode,success:function(data){data=$.trim(data);if(data=="OK"){if(calfun!=null){eval(calfun)}else{alert("手机激活成功！")}}else{if(data=="nocode"){if(calfun2!=null){alert("没有验证码！");eval(calfun2)}else{alert("没有验证码！")}}else{if(data=="isnotright"){if(calfun2!=null){alert("验证码不正确！");eval(calfun2)}else{alert("验证码不正确！")}}else{if(data=="nomobile"){if(calfun2!=null){alert("没有手机号！");eval(calfun2)}else{alert("没有手机号！")}}else{if(data=="NO"){if(calfun2!=null){alert("此手机已经验证过，无法再次验证！");eval(calfun2)}else{alert("此手机已经验证过，无法再次验证！")}}}}}}}})}function randomChar(b){var a="123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ";var d="";for(var c=0;c<b;c++){d+=a.charAt(Math.ceil(Math.random()*100000000)%a.length)}return d}function sednActiveMail(a,b){$.ajax({url:"/customer/account/sednActiveMail",async:true,type:"POST",data:"email="+a+"&custid="+b,success:function(c){if($.trim(c)=="OK"){alert("激活邮件已经发送到"+a+"!请登录邮箱进行邮箱激活。")}else{alert("激活邮件发送失败，请稍后再试！")}}})}function ajaxZiMuMaProductInfo(a){$.ajax({type:"GET",async:false,url:"/catalog/product/getZiMaProductInfo",data:a,dataType:"json",success:function(b){if(b.idNo!="NO"){if(b.pic!=""){$("#Product_BigImage1").replaceWith(b.pic);picReady(b.location)}areaPriceChange();$(".productInfoBrand .font_gary").html(b.productId);$("#productId").val(b.productId);if(b.marketPrice!=""){$("#marketP .delete").html(b.marketPrice)}if(b.priceHtml!=""){$("#priceP").replaceWith(b.priceHtml)}if(b.specHtml!=""){if($("#specP").length>0){$("#specP").replaceWith(b.specHtml)}else{$("#priceP").before(b.specHtml)}}else{if($("#specP").length>0){$("#specP").remove()}}if(b.memberHtml!=""){if($("#memberP").length>0){$("#marketP").replaceWith(b.memberHtml)}else{$("#marketP").after(b.memberHtml)}}if(b.tierHtml!=""){if($("#tierP").length>0){$("#tierP").replaceWith(b.tierHtml)}else{$(".productInfoBrand").before(b.tierHtml)}}if(b.colorSizeHtml!=""){$("#colorSize").replaceWith(b.colorSizeHtml)}if(b.memberHtml==""&&b.tierHtml==""){$("#marketP").addClass("productInfoPriceLine")}if(b.areaHtml!=""){$("#stockD").next().replaceWith(b.areaHtml.replace(/\\/g,""))}if(b.giftHtml!=""){$(".productInfoGifts").replaceWith("<div class='productInfoGifts'>"+b.giftHtml+"</div>")}else{$(".productInfoGifts").html("").hide()}if(b.buyHtml!=""){$(".amount").next().replaceWith(b.buyHtml.replace(/\\/g,""));$("#underBuyButton a").replaceWith(b.buyButton.replace(/\\/g,""))}if(b.historyHtml!=""){$("#historyP").replaceWith("<div class='body' id='historyP'>"+b.historyHtml+"</div>")}}else{if(b.colorSizeHtml!=""){$("#colorSize").replaceWith(b.colorSizeHtml)}}ziMuMaSelectColorSize()}})}function ziMuMaSelectColorSize(){var a=$("#integralPage").val();$(".productMotherYards .color li").click(function(){if($(this).find("a.none").length==0){var c=$(".productMotherYards ul.size").find("a.chooseYards").parent().attr("name");var b=$(this).attr("name");var e=$(this).parent().attr("name");if(a){var d=e+"&color="+b+"&p_size="+c+"&"+$("#picO").attr("name")+"&flag=color&intr=true"}else{var d=e+"&color="+b+"&p_size="+c+"&"+$("#picO").attr("name")+"&flag=color"}ajaxZiMuMaProductInfo(encodeURIComponent(d))}});$(".productMotherYards .size li").click(function(){if($(this).find("a.none").length==0){var c=$(this).attr("name");var b=$(".productMotherYards ul.color").find("a.chooseYards").parent().attr("name");var e=$(this).parent().attr("name");if(a){var d=e+"&color="+b+"&p_size="+c+"&"+$("#picO").attr("name")+"&flag=p_size&intr=true"}else{var d=e+"&color="+b+"&p_size="+c+"&"+$("#picO").attr("name")+"&flag=p_size"}ajaxZiMuMaProductInfo(encodeURIComponent(d))}})}function showTime(){var h=$("#clientInitTime").val();var j=new Date().getTime();var c=(j-h)/1000;var a=leaveTime-c;if(c>=0&&a>=0){a=Math.round(a);var g=Math.floor((a/3600)/24);var b=Math.floor((a-g*24*3600)/3600);var f=Math.floor((a-g*24*3600-b*3600)/60);var d=(a-b*3600)%60;var e="还剩 ";if(g!=0){e+="<span class='font_red'>"+g+"</span>天"}e+="<span class='font_red'>"+b+"</span>小时";e+="<span class='font_red'>"+f+"</span>分";e+="<span class='font_red'>"+d+"</span>秒";e+="结束";$("#clock0").html(e)}else{$("#clock0").html("已结束");clearInterval(clock0)}}function changeQty(a){var e=$("#pqty").val();var d=parseInt($("#shoppingcart_max_qty").val());var c=parseInt($("#shoppingcart_min_qty").val());var b=false;if(e==""){b=true}else{b=new RegExp("^[1-9]\\d*$").test(e)}if(b){if(a=="add"){e++;if(e<=d){$("#pqty").val(e)}else{$("#pqty").val(d);alert("最大购买数量为"+d);$("#pqty").focus();$("#pqty").val(d);return false}}if(a=="reduce"){e--;if(e>=c){$("#pqty").val(e)}else{alert("您至少购买"+c+"件商品!");$("#pqty").focus();$("#pqty").val(c);return false}}if(a=="change"){if(e<c||e>d){alert("请输入正确的数量!");$("#pqty").focus();$("#pqty").val(c);return false}if(e<c){alert("您至少购买"+c+"件商品!");$("#pqty").focus();$("#pqty").val(c);return false}if(e>d){$("#pqty").val(d);alert("最大购买数量为"+d);$("#pqty").focus();$("#pqty").val(d);return false}}}else{alert("请输入正确的数量!");$("#pqty").focus();$("#pqty").val(c);return false}}function cart(c,d,b,a){if($(".color").length>0){if($(".size").length>0&&$(".productMotherYards ul.size").find("a.chooseYards").length<=0){alert("请您选择尺码！");return false}}if($(".color").length<=0&&$(".size").length>0){if($(".productMotherYards ul.size").find("a.chooseYards").length<=0){alert("请您选择尺码！");return false}}if($(".size").length<=0&&$(".color").length>0){if($(".productMotherYards ul.color").find("a.chooseYards").length<=0){alert("请您选择颜色！");return false}}var e=$("#pqty").val();if(e==0||e==""){$("#buy_num_text").replaceWith("<span id='buy_num_text' class='price font_red'>您至少购买一件商品! </span>");$("#pqty").focus();return false}else{addToCart(c,e,"true","false",0,0,a)}_gaq.push(["_trackEvent","加入购物车",b,d+c])}function picReady(a){if(a=="default"){$(".jqzoom").jqueryzoom({xzoom:400,yzoom:400,offset:10,position:"right",preload:1,lens:1});$("#picList").jdMarquee({deriction:"left",width:350,height:56,step:2,speed:4,delay:10,control:true,_front:"#picRight",_back:"#picLeft"})}else{$(".jqzoom").jqueryzoom({xzoom:470,yzoom:470,offset:10,position:"right",preload:1,lens:1});$("#picList").jdMarquee({deriction:"left",width:470,height:56,step:2,speed:4,delay:10,control:true,_front:"#picRight",_back:"#picLeft"})}$("#picList img").bind("mouseover",function(){var b=$(this).attr("src");$("#jqzoomDiv img").eq(0).attr({src:b.replace("/small/","/middle/"),jqimg:b.replace("/small/","/big/")});$(this).css({border:"2px solid #ff6600",padding:"1px"})}).bind("mouseout",function(){$(this).css({border:"1px solid #ccc",padding:"2px"})});$("#jqzoomDiv").click(function(){var c=$("#jqzoomDiv img").attr("src").split("-");var b=$("#mainUrl").val();if(c.length==1){b=b+"-3-0.html"}else{b=b+"-3-"+c[1].substr(0,1)+".html"}window.open(b)})}function picReadyLuxury(){$(".jqzoom").jqueryzoom({xzoom:400,yzoom:400,offset:10,position:"right",preload:1,lens:1});$("#picList").jdMarquee({deriction:"left",width:350,height:56,step:2,speed:4,delay:10,control:true,_front:"#picRight",_back:"#picLeft"});$("#picList img").bind("mouseover",function(){var a=$(this).attr("src");$("#jqzoomDiv img").eq(0).attr({src:a.replace("/small/","/middle/"),jqimg:a.replace("/small/","/big/")})}).bind("mouseout",function(){});$("#jqzoomDiv").click(function(){var b=$("#jqzoomDiv img").attr("src").split("-");var a=$("#mainUrl").val();if(b.length==1){a=a+"-3-0.html"}else{a=a+"-3-"+b[1].substr(0,1)+".html"}window.open(a)})}function areaPriceChange(){$("#huabeiB").click(function(){$("#price").html($("#huabeiB").attr("name"));$("#huadongB").removeClass("choose");$("#huabeiB").addClass("choose")});$("#huadongB").click(function(){$("#price").html($("#huadongB").attr("name"));$("#huabeiB").removeClass("choose");$("#huadongB").addClass("choose")})}function needChangeCheckbox(){if(isAllChecked()){$("input[name='allselectcheckbox']").attr("checked",true)}else{$("input[name='allselectcheckbox']").attr("checked",false)}}function isAllChecked(){var c=true;var b=0;var a=$(":checkbox[name!='allselectcheckbox']").length;$(":checkbox[name!='allselectcheckbox']").each(function(){var d=$(this).attr("checked");if(!d){c=false;return false}else{b++}});if((!c)&&(b!=a)){return false}return true}function checkboxtoggle(b){var a=$(b).attr("checked");if(a){$(":checkbox").each(function(){$(this).attr("checked",true)})}else{$(":checkbox").each(function(){$(this).attr("checked",false)})}}function showPrompt(a){$.ajax({type:"GET",url:"/prompt",data:"keyword="+$(a).val(),dataType:"text",success:function(j){var h=j.split("|");var b="";if(h.length>0){for(var c=0;c<h.length;c++){var d=h[c].split(",");if(d.length>0){b+="<li onmouseout='out(this);' onmouseover='over(this);' onclick='selected(this);'><span>约"+d[1]+"条</span> <div>"+d[0]+"</div></li>"}}b+="<li class='close'><a onclick='hidePrompt();' herf='javascript:void(0)'>关闭</a></li>";$("#tie").append(b);var f=0;var e=0;var g=$(a).offset();f=g.top+$(a).outerHeight()+3;e=g.left-25;$("#tie").css({top:f,left:e});$("#tie").show();$("#tie").removeClass("hide")}}})}function over(a){$(a).addClass("bg")}function out(a){$(a).removeClass("bg")}function selected(a){$("#searchInput").val($(a).find("div").text());$("#tie").hide();$("#searchForm").submit()}function keyselected(a){$("#searchInput").val($(a).find("div").text())}function hidePrompt(){$("#tie").hide()}function widget_show_third_categorys(a,e,b){if(b){if(document.getElementById("headSortChannelBody")){if(!$("#allCategoryList").categoryLoaded){$("#allCategoryList").categoryLoaded=true;var d=document.createElement("script");d.type="text/javascript";d.async=true;d.src=b;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}}}if(isMouseLeaveOrEnter(a,e)){$(e).addClass("mhover")}}function widget_hide_third_categorys(a,b){if(isMouseLeaveOrEnter(a,b)){$(b).removeClass("mhover")}}function isMouseLeaveOrEnter(c,b){if(c.type!="mouseout"&&c.type!="mouseover"){return false}var a=c.relatedTarget?c.relatedTarget:c.type=="mouseout"?c.toElement:c.fromElement;while(a&&a!=b){a=a.parentNode}return(a!=b)}function home_allCategory_showDiv(a,e,b){if(b){if(!document.getElementById("headSortChannelBody")&&!$("#headSortChannelBody").categoryLoaded){$("#allCategoryList").categoryLoaded=true;var d=document.createElement("script");d.type="text/javascript";d.async=true;d.src=b;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}}if(a){if(isMouseLeaveOrEnter(a,e)){document.getElementById("headSortChannelBody").style.display=""}}else{document.getElementById("headSortChannelBody").style.display=""}}function home_allCategory_hideDiv(a,b){if(a){if(isMouseLeaveOrEnter(a,b)){document.getElementById("headSortChannelBody").style.display="none"}}else{document.getElementById("headSortChannelBody").style.display="none"}}function duihuanCoupon(a,b){$.ajax({url:"/customer/account/scoreToProduct",async:true,type:"POST",data:"points="+a+"&couponNum="+b,success:function(c){if($.trim(c)=="OK"){alert("兑换成功,优惠券已到你的账户！");javascript:window.location.reload()}else{alert("兑换失败！")}}})}function logout(a){$("body").append('<img src="http://ucenter.redmama.com.cn/log.aspx?tp=1" width="1" height="1"/>');$.ajax({url:"/customer/account/logout",async:true,success:function(c){var b=$("#currentisaccount").val();b=$.trim(b);if(b=="isdoaccount"){window.location.href="/"}else{if(b=="ispeisi"){updateTobarHead(true)}else{if(b=="jifen"){jifenpagetoProcesslogout()}else{javascript:window.location.reload()}}}}})}function login(){var a=document.URL;if(a==null||a==""){a=self.location}$.ajax({url:"/customer/account/tologin",async:true,data:"url="+a,success:function(b){b=$.trim(b);javascript:window.location.href=b}})}function historyProduct(b){var a="/catalog/product/getHistoryProductInfo?productId="+b;$.ajax({type:"GET",url:a,dataType:"json",success:function(g){var f="";var d="";if(g!=-1){var c="productBrowse";$.each(g,function(h,j){d=j.url;if(h==g.length-1){c="productBrowse last"}f=f+"<div class='"+c+"'><div class='pic'><a href='"+d+"' ><img src='"+j.small_image+"' /></a></div><div class='name'><a href='"+d+"' >"+j.name+"</a></div><div class='price font_red'>￥"+j.price+"</div><div class='clear'></div></div>"});if(f!=""){var e=document.getElementById("historyP");e.innerHTML=f}}}})}function showBlock(a){document.getElementById(a).style.display="block"}function hideBlock(a){document.getElementById(a).style.display="none"}function changeSign(b,a){if(document.getElementById(b).style.display=="none"){document.getElementById(b).style.display="";document.getElementById(a).src="http://img01.bgoimg.com/core/app/theme/skin/image/front/product_less.gif"}else{document.getElementById(b).style.display="none";document.getElementById(a).src="http://img01.bgoimg.com/core/app/theme/skin/image/front/product_add.gif"}}function catalog_selectAddressInfo(d){var b=$(d).attr("name");var e=$(d).val();var a=2;var c="";if(b=="SHR_address_cityid"){a=3;c=$('select[name="SHR_address_districtid"]').children("option:selected").html()}else{if(b=="SHR_address_areaid"){c=$('select[name="SHR_address_districtid"]').children("option:selected").html()+$('select[name="SHR_address_cityid"]').children("option:selected").html()}}if(e!=-1){c+=$(d).children("option:selected").html()}if(b!="SHR_address_areaid"){$.ajax({url:"/sales/order/getChildArea",dataType:"json",async:true,data:{cantCode:e,cantType:a},success:function(f){if(f){var h=f.childArea;var g="";for(i=0;i<h.length;i++){g+="<option value='"+h[i].cant_code+"'>"+h[i].cant_name+"</option> "}if(b=="SHR_address_districtid"){$('select[name="SHR_address_cityid"]').html("<option value='-1'>选择城市</option>"+g);$('select[name="SHR_address_areaid"]').html("<option value='-1'>选择区/县</option>")}else{if(b=="SHR_address_cityid"){$('select[name="SHR_address_areaid"]').html("<option value='-1'>选择区/县</option>"+g)}}}}})}}function getphonereg(){var a=/^(13[0-9]|15[0|1|2|3|5|6|7|8|9]|18[0|2|6|7|8|9]|14[5|7])\d{8}$/;return a}function home_MM_showHideLayers(){var i,p,v,obj,args=home_MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3){with(document){if(getElementById&&((obj=getElementById(args[i]))!=null)){v=args[i+2];if(obj.style){obj=obj.style;v=(v=="show")?"visible":(v=="hide")?"hidden":v}obj.visibility=v}}}}function home_MM_gotoCheckout(){window.location.href="/shoppingcart.htm"}function home_widget_products_getSalePrice(){var a=[];$(".ajaxSalePrice").each(function(){var c=$(this).attr("product_id");a.push(c)});var b=a.join(",");if(b){$.ajax({type:"POST",async:true,url:"/catalog/category/getPriceInfo",data:"ids="+b,dataType:"json",success:function(c){if(c!=null){$(".ajaxSalePrice").each(function(){var d=$(this).attr("product_id");if(c[d]){var e=c[d].price;$(this).html(e)}})}}})}}function homepage_subscribe_send(){var d=$("input[name='subscribe_email']").val();var c=$("input[name='subscribe_box']:checked");var e="";var a=c.length;for(var b=0;b<a;b++){e+=c.eq(b).val();if(b!=a-1){e+=","}}if(d==""){alert("请添写订阅邮件！")}else{if(!isEmail(d)){alert("请添写正确的邮件格式！")}else{if(e==""){alert("请选择订阅分类！")}else{$.ajax({type:"POST",async:false,url:"/customer/account/saveCatalogContent",data:{catalog_content:e,catalog_email:d},success:function(f){if($.trim(f)=="OK"){alert("订阅成功！")}else{alert("订阅失败！")}}})}}}}function homepage_subscribe_promotion_send(a){if(1==a){var e="mobile";var b=$.trim($("#mobile_num").val());var d=/^(13[0-9]|15[0|1|2|3|5|6|7|8|9]|18[2|6|7|8|9])\d{8}$/;if(!b){var c="请输入订阅的手机号！"}else{if(!d.test(b)){var c="请输入合法的手机号！"}}}else{if(2==a){var e="email";var b=$.trim($("#email_address").val());if(!b){var c="请添写订阅邮件！"}else{if(!isEmail(b)){var c="请添写正确的邮件格式！"}}}}if(c){alert(c);if(1==a){$("#mobile_num").val("请输入手机号")}else{if(2==a){$("#email_address").val("请输入E-mail地址")}}return false}else{$.ajax({type:"POST",async:false,url:"/customer/account/subscribeNewPromotionInfo",data:{subscribe_style:e,subscribe_connect:b},success:function(f){if($.trim(f)=="OK"){alert("订阅成功！")}else{alert("订阅失败！")}}})}}function homepage_footer_focusInputValue(b){var a=$(b).val();if(a=="请输入手机号"||a=="请输入E-mail地址"){$(b).val("")}}function homepage_footer_blurInputValue(c,a){var b=$(c).val();if(b==""){if(a==1){$(c).val("请输入手机号")}else{if(a==2){$(c).val("请输入E-mail地址")}}}}function all_cateogy_redirect_position(a){$(".first_cat").each(function(){var b=$(this).attr("id");if(b==a){$(this).addClass("navChoose")}else{$(this).removeClass("navChoose")}})}function guideTips(){var b=null;var a=0;if(document.getElementById("guide")){b=document.getElementById("guide").getElementsByTagName("a");a=b.length}for(var c=0;c<a;c++){b[c].onmouseover=function(){document.getElementById("guideNone").style.display="none"};b[c].onmouseout=function(){document.getElementById("guideNone").style.display=""}}}function stageLinkXY(a){document.getElementById("stageMay_lineRed").style.width=a+"px"}function hideDiv(a){document.getElementById(a).style.display="none"}function widget_change_class(d,a,c,b){$("."+d).each(function(){if($(this).attr("id")==a){$(this).children().eq(3).attr("style","display:inline;");if($(this).hasClass(b)){$(this).removeClass(b);$(this).addClass(c)}}else{$(this).children().eq(3).attr("style","display:none;");if($(this).hasClass(c)){$(this).removeClass(c);$(this).addClass(b)}}})}function widget_setTab(a,d){var c=document.getElementById("menu"+a).getElementsByTagName("li");var b=document.getElementById("main"+a).getElementsByTagName("ol");for(i=0;i<c.length;i++){c[i].className=i==d?"tabSelect":"";b[i].style.display=i==d?"block":"none"}}function widget_setTab_span(a,d){var c=document.getElementById("menu"+a).getElementsByTagName("span");var b=document.getElementById("main"+a).getElementsByTagName("ol");for(i=0;i<c.length;i++){c[i].className=i==d?"tab_on":"";b[i].style.display=i==d?"block":"none"}}function widget_setTab_li(a,d){var c=document.getElementById("menu"+a).getElementsByTagName("li");var b=document.getElementById("main"+a).getElementsByTagName("ol");for(i=0;i<c.length;i++){c[i].className=i==d?"tab_on":"";b[i].style.display=i==d?"block":"none"}}function show_date_time_show_0(c){var h=new Date(c);var k=new Date();var e=(h.getTime()-k.getTime());alert("timeold="+e);var m=e/1000;var l=Math.floor(m);var j=24*60*60*1000;var b=e/j;var g=Math.floor(b);var d=(b-g)*24;var a=Math.floor(d);var f=(d-a)*60;var o=Math.floor((d-a)*60);var n=Math.floor((f-o)*60);if(k>=h){return"剩余<b>0</b>小时<b>0</b>分<b>0</b>秒"}else{if(g>0){return"剩余<b>"+g+"</b>天<b>"+a+"</b>小时<b>"+o+"</b>分<b>"+n+"</b>秒 "}else{return"剩余<b>"+a+"</b>小时<b>"+o+"</b>分<b>"+n+"</b>秒 "}}}function show_date_time_show_1(h){var b=$("#clientInitTime").val();var f=new Date().getTime();var g=(f-b)/1000;var h=h-g;if(g>=0&&h>=0){h=Math.round(h);var c=Math.floor((h/3600)/24);var d=Math.floor((h-c*24*3600)/3600);var e=Math.floor((h-c*24*3600-d*3600)/60);var a=(h-d*3600)%60;html="剩 ";if(c!=0){html+="<span>"+c+"</span>天"}html+="<span><b>"+d+"</b></span>小时";html+="<span><b>"+e+"</b></span>分";html+="<span><b>"+a+"</b></span>秒";html+="结束";return html}else{return"已结束"}}function countdown(){$(".ClockTime").each(function(){var a=$(this).attr("endtime");alert(a);var b=show_date_time_show_0(a);$(this).html(b)})}function listcountdown(){window.setTimeout("listcountdown()",1000);$(".ClockTime").each(function(){var b=$(this).attr("endtime");var a=show_date_time_show_1(b);$(this).html(a)})}function countdown1(){$(".ClockTime").each(function(a,c){var b=function(){var g=(new Date().getTime()-$("#clientInitTime").val())/1000;var j=$(c).attr("balanceTime");var e=j-g;if(e>0){var k=99;var h=59;var f=59;if(e<99*60*60){var k=Math.floor(e/3600);var m=e%3600;var h=Math.floor(m/60);var n=m%60;var f=Math.floor(n);if(k<10){k="0"+k}if(h<10){h="0"+h}if(f<10){f="0"+f}}$(c).html("还剩 <span>"+k+"</span><span>"+h+"</span><span>"+f+"</span>结束")}else{var d=$(c).attr("productId");var l=$(c).attr("price");$("#specialPrice"+d).text("￥"+l);$(c).html("还剩 <span>00</span><span>00</span><span>00</span>已结束");window.clearInterval(c.timeout)}};c.timeout=window.setInterval(b,1000)})}var cur_dis_id;function sp_list(){}var widget_cur_rec_bnds="";function widget_show_recommend_brands(b,a){if(widget_cur_rec_bnds){$("#"+widget_cur_rec_bnds).css("display","none")}else{$("#all_rec_bnd_"+a).css("display","none")}$("#all_rec_bnd_"+b).css("display","");widget_cur_rec_bnds="rec_bnd_"+b;return false}function widget_hide_recommend_brands(b,a){$("#all_rec_bnd_"+b).css("display","none");$("#all_rec_bnd_"+a).css("display","");widget_cur_rec_bnds="all_rec_bnd_"+a;return false}function widget_channel_show_recommend_brands(b,a){$("#channel_rec_bnd_"+b).css("display","");$("#channel_rec_bnd_"+a).css("display","none")}function widget_channel_hide_recommend_brands(b,a){$("#channel_rec_bnd_"+b).css("display","none");$("#channel_rec_bnd_"+a).css("display","")}function widget_pic_slide(b){var a=$(".pcont").children(0).attr("id");if(a){var d=a.replace("List1_","rightArrow");var c=a.replace("List1_","leftArrow");$(".pcont").imgPlayer({distance:b,vertical:true,time:1,direction:"left",isAuto:false,btnGo:{left:"#"+d,right:"#"+c}})}}function widget_pic_slide_auto(b,e){var a=$(".pcont").children(0).attr("id");if(a){var d=a.replace("List1_","rightArrow");var c=a.replace("List1_","leftArrow");$(".pcont").imgPlayer({distance:b,vertical:true,time:e,direction:"left",isAuto:true,btnGo:{left:"#"+d,right:"#"+c}})}}var widget_mall_comment_cur_ele=0;function widget_comment_scroll_on_btn(c,b){var a=$(c).parent().children(".indexCommentsGoods").length;if("left"==b){var d=widget_mall_comment_cur_ele-1;d=d<0?(a-1):d}else{if("right"==b){var d=widget_mall_comment_cur_ele+1;d=d>=a?0:d}}$("#HP_commentInfo_D_"+widget_mall_comment_cur_ele).hide();$("#HP_commentInfo_D_"+d).show();$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).children("span").removeClass("slideChoose");$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).children("span").children(".slideGoodsName").hide();$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).children("span").children(".slideGoodsText").hide();$("#HP_commentInfo_C_"+d).children("span").addClass("slideChoose");$("#HP_commentInfo_C_"+d).children("span").children(".slideGoodsName").show();$("#HP_commentInfo_C_"+d).children("span").children(".slideGoodsText").show();widget_mall_comment_cur_ele=d}function widget_comment_scroll_on_pro(a){$("#HP_commentInfo_D_"+widget_mall_comment_cur_ele).hide();$("#HP_commentInfo_D_"+a).show();$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).children("span").removeClass("slideChoose");$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).children("span").children(".slideGoodsName").hide();$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).children("span").children(".slideGoodsText").hide();$("#HP_commentInfo_C_"+a).children("span").addClass("slideChoose");$("#HP_commentInfo_C_"+a).children("span").children(".slideGoodsName").show();$("#HP_commentInfo_C_"+a).children("span").children(".slideGoodsText").show();widget_mall_comment_cur_ele=a}var widget_mall_comment_cur_ele=0;function widget_comment_scroll_on_btn_august(c,b){var a=$(c).parent().children("ul").children("li").length;if("left"==b){var d=widget_mall_comment_cur_ele-1;d=d<0?(a-1):d}else{if("right"==b){var d=widget_mall_comment_cur_ele+1;d=d>=a?0:d}}$("#HP_commentInfo_D_"+widget_mall_comment_cur_ele).hide();$("#HP_commentInfo_D_"+d).show();$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).removeClass("choose");$("#HP_commentInfo_C_"+d).addClass("choose");widget_mall_comment_cur_ele=d}function widget_comment_scroll_on_pro_august(a){$("#HP_commentInfo_D_"+widget_mall_comment_cur_ele).hide();$("#HP_commentInfo_D_"+a).show();$("#HP_commentInfo_C_"+widget_mall_comment_cur_ele).removeClass("choose");$("#HP_commentInfo_C_"+a).addClass("choose");widget_mall_comment_cur_ele=a}function widget_luxury_brandListShow(a){$("#"+a).addClass("choose");(a).className="choose";$("#"+a+"DownList").show()}function widget_luxury_brandListHide(a){$("#"+a).removeClass("choose");$("#"+a+"DownList").hide()}var Speed_0=20;var Space_0=10;var PageWidth_0=140*5;var interval_0=50000000;var fill_0=0;var MoveLock_0=false;var MoveTimeObj_0;var MoveWay_0="right";var Comp_0=0;var AutoPlayObj_0=null;function GetObj(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval("document.all."+objName)}}function AutoPlay_0(){clearInterval(AutoPlayObj_0);AutoPlayObj_0=setInterval("ISL_GoDown_0();ISL_StopDown_0();",interval_0)}function ISL_GoUp_0(){if(MoveLock_0){return}clearInterval(AutoPlayObj_0);MoveLock_0=true;MoveWay_0="left";MoveTimeObj_0=setInterval("ISL_ScrUp_0();",Speed_0)}function ISL_StopUp_0(){if(MoveWay_0=="right"){return}clearInterval(MoveTimeObj_0);if((GetObj("ISL_Cont_0").scrollLeft-fill_0)%PageWidth_0!=0){Comp_0=fill_0-(GetObj("ISL_Cont_0").scrollLeft%PageWidth_0);CompScr_0()}else{MoveLock_0=false}AutoPlay_0()}function ISL_ScrUp_0(){if(GetObj("ISL_Cont_0").scrollLeft<=0){GetObj("ISL_Cont_0").scrollLeft=GetObj("ISL_Cont_0").scrollLeft+GetObj("List1_0").offsetWidth}GetObj("ISL_Cont_0").scrollLeft-=Space_0}function ISL_GoDown_0(){clearInterval(MoveTimeObj_0);if(MoveLock_0){return}clearInterval(AutoPlayObj_0);MoveLock_0=true;MoveWay_0="right";ISL_ScrDown_0();MoveTimeObj_0=setInterval("ISL_ScrDown_0()",Speed_0)}function ISL_StopDown_0(){if(MoveWay_0=="left"){return}clearInterval(MoveTimeObj_0);if(GetObj("ISL_Cont_0").scrollLeft%PageWidth_0-(fill_0>=0?fill_0:fill_0+1)!=0){Comp_0=PageWidth_0-GetObj("ISL_Cont_0").scrollLeft%PageWidth_0+fill_0;CompScr_0()}else{MoveLock_0=false}AutoPlay_0()}function ISL_ScrDown_0(){if(GetObj("ISL_Cont_0").scrollLeft>=GetObj("List1_0").scrollWidth){GetObj("ISL_Cont_0").scrollLeft=GetObj("ISL_Cont_0").scrollLeft-GetObj("List1_0").scrollWidth}GetObj("ISL_Cont_0").scrollLeft+=Space_0}function CompScr_0(){if(Comp_0==0){MoveLock_0=false;return}var a,c=Speed_0,b=Space_0;if(Math.abs(Comp_0)<PageWidth_0/2){b=Math.round(Math.abs(Comp_0/Space_0));if(b<1){b=1}}if(Comp_0<0){if(Comp_0<-b){Comp_0+=b;a=b}else{a=-Comp_0;Comp_0=0}GetObj("ISL_Cont_0").scrollLeft-=a;setTimeout("CompScr_0()",c)}else{if(Comp_0>b){Comp_0-=b;a=b}else{a=Comp_0;Comp_0=0}GetObj("ISL_Cont_0").scrollLeft+=a;setTimeout("CompScr_0()",c)}}function picrun_ini(){GetObj("List2_0").innerHTML=GetObj("List1_0").innerHTML;GetObj("ISL_Cont_0").scrollLeft=fill_0>=0?fill_0:GetObj("List1_0").scrollWidth-Math.abs(fill_0);GetObj("ISL_Cont_0").onmouseover=function(){clearInterval(AutoPlayObj_0)};GetObj("ISL_Cont_0").onmouseout=function(){AutoPlay_0()};AutoPlay_0()}function fShopCart_miniDelete(h){var d=h.id;var f=d.split("_");var c=f[0];var a=f[1];var e=f[2];var g=f[3];var b=f[4];$.getJSON("/sales/cart/delete",{alliance:a,type:e,activityId:g,productId:b,isMini:true},function(o){if(o){var l="<span></span>";if(o.finalAmount.toFixed(2)&&o.finalAmount.toFixed(2)!=o.amount.toFixed(2)){l='<span><b style="color:#333; font-size:12px; font-weight:100">折后金额：</b><font class="font_red">￥'+o.finalAmount.toFixed(2)+"</font></span><br>"}var j='<div class="total">共<span class="font_red">'+o.qty+'</span>件商品<br>金额总计：<span class="font_red">￥'+o.amount.toFixed(2)+"</span><br>"+l+"</div>";var k='<div class="total"><div class="totalLeft">共<span class="font_red">'+o.qty+'</span>件商品</div><div class="totalRight"><span>金额总计：<font>￥'+o.amount.toFixed(2)+'</font></span><br></div><div class="clear"></div></div>';if(c=="MiniDel"){var n=$(".shoppingInitRight");if(n.attr("class")){var m="Del_"+a+"_"+e+"_"+g+"_"+b;$("#"+m).parent().parent().parent().children(".total").replaceWith(j);$("#"+m).parent().parent().remove()}$(h).parent().parent().parent().children(".total").replaceWith(k)}else{$("#Mini"+d).parent().parent().parent().children(".total").replaceWith(k);$("#Mini"+d).parent().parent().remove();$(h).parent().parent().parent().children(".total").replaceWith(j)}$(h).parent().parent().remove();$(".globalHead_shoppingCart .subtotal").find("span").replaceWith("<span>"+o.qty+"</span>")}})}function homepage_dashboard(){var a=/^(mama\/101|yingyang\/102|yingyou\/103|wanju\/104|tongzhuang\/105|tushu\/106|huazhuang\/201|shipin\/202|baojian\/203|jiaju\/204|yundong\/205|jiadian\/206|shuma\/207)(\d{9}|\d{11})(-3(-\d+)?|-2(-\d+-\d+)?|-1(-\d+)?|-4(-\d+-\d+)?)?.html$/;var d=/^zhuanti\/(\d+).html$/;var c=/^week\/?(mama|yingyang|yingyou|wanju|tongzhuang|tushu|huazhuang|shipin|baojian|jiaju|yundong|jiadian|shuma)?\/?s?(\d)?p?(\d+)?$/;var b=/^(mama|yingyou|yingyang|wanju|tongzhuang|tushu|huazhuang|shipin|baojian|jiaju|yundong|jiadian|shuma)(\/(a\d{5}|a\d{5}b\d{7})?([c-z0-9]*))\/?$/;var e=/^brand\/(\d+)c?(\d+)?s?(\d)?p?(\d+)?.html$/;$("div.widgets_box").find("a").click(function(){var j=$(this).attr("href");var m=j.substring(j.indexOf("://")+3);var f=m.indexOf("/")+1;var h=$(this).parents();var l=$(h).find("div.widgets_box").attr("wid");j=m.substring(f);if(a.test(j)){var n=j.length-12;var g=j.substr(n,7);if(g!=""&&g!=null&&!isNaN(g)&&l!=null&&l!=""&&!isNaN(l)){var k=$.cookie("dashboardSID");$.getJSON("http://statis.redmall.com.cn/dashboardCount.php?sid="+k+"&widgetId="+l+"&pid="+g+"&jsoncallback=?",function(o){})}}else{if(d.test(j)){$.cookie("referer_url",encodeURI(j),{expires:1,path:"/"});$.cookie("referer_widget",l,{expires:1,path:"/"});$.cookie("referer_type",1,{expires:1,path:"/"})}else{if(c.test(j)){$.cookie("referer_url",encodeURI(j),{expires:1,path:"/"});$.cookie("referer_widget",l,{expires:1,path:"/"});$.cookie("referer_type",2,{expires:1,path:"/"})}else{if(b.test(j)){$.cookie("referer_url",encodeURI(j),{expires:1,path:"/"});$.cookie("referer_widget",l,{expires:1,path:"/"});$.cookie("referer_type",3,{expires:1,path:"/"})}else{if(e.test(j)){$.cookie("referer_url",encodeURI(j),{expires:1,path:"/"});$.cookie("referer_widget",l,{expires:1,path:"/"});$.cookie("referer_type",4,{expires:1,path:"/"})}}}}}})}function category_dashboard(){var c=$.cookie("referer_type");if(c==3){var q=location.href;var j=q.substring(q.indexOf("://")+3);var o=j.indexOf("/")+1;q=j.substring(o);var r=q.indexOf("/");var h=q.substring(0,r);var d=q.substring(r,q.lastIndexOf("/"));var a=d.indexOf("a");var f="";if(a!=-1){f=d.substring(a+1,a+6)}var g=d.indexOf("b");var e="";if(g!=-1){e=d.substring(g+1,g+8)}var s=decodeURI($.cookie("referer_url"));r=s.indexOf("/");var t=s.substring(0,r);var k=s.substring(r+1,s.lastIndexOf("/"));a=k.indexOf("a");var b="";if(a!=-1){b=k.substring(a+1,a+6)}g=k.indexOf("b");var l="";if(g!=-1){l=k.substring(g+1,g+8)}var n=$.cookie("referer_widget");if(h==t&&f==b&&e==l){var m=/^(mama\/101|yingyang\/102|yingyou\/103|wanju\/104|tongzhuang\/105|tushu\/106|huazhuang\/201|shipin\/202|baojian\/203|jiaju\/204|yundong\/205|jiadian\/206|shuma\/207)(\d{9}|\d{11})(-3(-\d+)?|-2(-\d+-\d+)?|-1(-\d+)?|-4(-\d+-\d+)?)?.html$/;$("div.rightProduct").find("a").click(function(){var w=$(this).attr("href");var y=w.substring(w.indexOf("://")+3);var u=y.indexOf("/")+1;w=y.substring(u);if(m.test(w)){var z=w.length-12;var v=w.substr(z,7);if(v!=""&&v!=null&&!isNaN(v)&&n!=null&&n!=""&&!isNaN(n)){var x=$.cookie("dashboardSID");$.getJSON("http://statis.redmall.com.cn/dashboardCount.php?sid="+x+"&widgetId="+n+"&pid="+v+"&jsoncallback=?",function(A){})}}})}}}function topicPage_dashboard(){var f=$.cookie("referer_type");if(f==1){var c=location.href;var e=c.substring(c.indexOf("://")+3);var b=e.indexOf("/")+1;c=e.substring(b);var g=decodeURI($.cookie("referer_url"));var d=$.cookie("referer_widget");if(c==g){var a=/^(mama\/101|yingyang\/102|yingyou\/103|wanju\/104|tongzhuang\/105|tushu\/106|huazhuang\/201|shipin\/202|baojian\/203|jiaju\/204|yundong\/205|jiadian\/206|shuma\/207)(\d{9}|\d{11})(-3(-\d+)?|-2(-\d+-\d+)?|-1(-\d+)?|-4(-\d+-\d+)?)?.html$/;$("div.widgets_box").find("a").click(function(){var k=$(this).attr("href");var m=k.substring(k.indexOf("://")+3);var h=m.indexOf("/")+1;k=m.substring(h);if(a.test(k)){var n=k.length-12;var j=k.substr(n,7);if(j!=""&&j!=null&&!isNaN(j)&&d!=null&&d!=""&&!isNaN(d)){var l=$.cookie("dashboardSID");$.getJSON("http://statis.redmall.com.cn/dashboardCount.php?sid="+l+"&widgetId="+d+"&pid="+j+"&jsoncallback=?",function(o){})}}});$("div.widgets_box").find("area").click(function(){var k=$(this).attr("href");var m=k.substring(k.indexOf("://")+3);var h=m.indexOf("/")+1;k=m.substring(h);if(a.test(k)){var n=k.length-12;var j=k.substr(n,7);if(j!=""&&j!=null&&!isNaN(j)&&d!=null&&d!=""&&!isNaN(d)){var l=$.cookie("dashboardSID");$.getJSON("http://statis.redmall.com.cn/dashboardCount.php?sid="+l+"&widgetId="+d+"&pid="+j+"&jsoncallback=?",function(o){})}}})}}}function brandPage_dashboard(){var f=$.cookie("referer_type");if(f==4){var c=location.href;var e=c.substring(c.indexOf("://")+3);var b=e.indexOf("/")+1;c=e.substring(b);var g=decodeURI($.cookie("referer_url"));var d=$.cookie("referer_widget");if(c==g){var a=/^(mama\/101|yingyang\/102|yingyou\/103|wanju\/104|tongzhuang\/105|tushu\/106|huazhuang\/201|shipin\/202|baojian\/203|jiaju\/204|yundong\/205|jiadian\/206|shuma\/207)(\d{9}|\d{11})(-3(-\d+)?|-2(-\d+-\d+)?|-1(-\d+)?|-4(-\d+-\d+)?)?.html$/;$("div.listMain").find("a").click(function(){var k=$(this).attr("href");var m=k.substring(k.indexOf("://")+3);var h=m.indexOf("/")+1;k=m.substring(h);if(a.test(k)){var n=k.length-12;var j=k.substr(n,7);if(j!=""&&j!=null&&!isNaN(j)&&d!=null&&d!=""&&!isNaN(d)){var l=$.cookie("dashboardSID");$.getJSON("http://statis.redmall.com.cn/dashboardCount.php?sid="+l+"&widgetId="+d+"&pid="+j+"&jsoncallback=?",function(o){})}}})}}}$(document).ready(function(){var d=new Date();var a="";var e=d.getHours();if(e<6){a="凌晨好，"}else{if(e>=6&&e<9){a="早上好，"}else{if(e>=9&&e<12){a="上午好，"}else{if(e>=12&&e<14){a="中午好，"}else{if(e>=14&&e<17){a="下午好，"}else{if(e>=17&&e<19){a="傍晚好，"}else{if(e>=19&&e<24){a="晚上好，"}}}}}}}var b=$.cookie("isgethead");if(b!=1){$.ajax({url:"/customer/account/getCustHead",async:true,dataType:"json",success:function(o){var n=o.register_url;var q="<a href='"+n+"'  id='registerlink' class='fontRed fontLast'>注册</a>";$("#redbaby_frontpage_head_aboutregister").html(q);var m=o.loginstatus;m=$.trim(m);if(m=="OK"){$("#redbaby_frontpage_head_haslogin").show();$("#redbaby_frontpage_head_aboutlogin").hide();if($("#redbaby_frontpage_head_aboutregister")!=""&&$("#redbaby_frontpage_head_aboutregister")!=null){$("#redbaby_frontpage_head_aboutregister").hide()}var r=o.email;r=$.trim(r);if(r==null||r==""){r=o.nickname}$("#redbaby_frontpage_head_customername").html(r);var l=o.ifziti;l=$.trim(l);if(l=="YES"){$("#zitilink").show()}}else{var k=$.cookie("sheQuLogoutflag");k=$.trim(k);if(k=="YES"){$("body").append('<img src="http://ucenter.redmama.com.cn/log.aspx?tp=1" width="1" height="1"/>');$.cookie("sheQuLogoutflag",null,{expires:7,path:"/",domain:"www.redbaby.com.cn",secure:false});$.cookie("sheQuLogoutflag",null,{expires:7,path:"/",domain:"www.binggo.com",secure:false})}$("#redbaby_frontpage_head_haslogin").hide();$("#redbaby_frontpage_head_aboutlogin").show();if($("#redbaby_frontpage_head_aboutregister")!=""&&$("#redbaby_frontpage_head_aboutregister")!=null){$("#redbaby_frontpage_head_aboutregister").show()}$("#redbaby_frontpage_head_customername").html($.cookie("rbwcustname"))}$("#redbaby_frontpage_head_time").html(a);$("#redbaby_frontpage_head_time").show();$("#redbaby_frontpage_head_customername").show()}})}else{var c=$.cookie("hdloginstatus");if(c=="OK"){$("#redbaby_frontpage_head_haslogin").show();$("#redbaby_frontpage_head_aboutlogin").hide();if($("#redbaby_frontpage_head_aboutregister")!=""&&$("#redbaby_frontpage_head_aboutregister")!=null){$("#redbaby_frontpage_head_aboutregister").hide()}var f=$.cookie("customerName");$("#redbaby_frontpage_head_customername").html(f);var g=$.cookie("hdifziti");if(g=="YES"){$("#zitilink").show()}}else{$("#redbaby_frontpage_head_haslogin").hide();$("#redbaby_frontpage_head_aboutlogin").show();if($("#redbaby_frontpage_head_aboutregister")!=""&&$("#redbaby_frontpage_head_aboutregister")!=null){$("#redbaby_frontpage_head_aboutregister").show()}$("#redbaby_frontpage_head_customername").html($.cookie("customerName"))}$("#redbaby_frontpage_head_time").html(a);$("#redbaby_frontpage_head_time").show();$("#redbaby_frontpage_head_customername").show()}if($(".globalHead_shoppingCart").length>0){$.getJSON("/sales/cart/getMiniCart",{},function(l){if(l){var k=$(".globalHead_shoppingCart").attr("class");if(k&&k!="undefined"){$(".globalHead_shoppingCart .subtotal").find("span").html(l.qty);$(".globalHead_shoppingCart .subtotal").before(l.html)}else{$(".headShoppingCart .subtotal").find("span").html(l.qty);$(".headShoppingCart .subtotal").before(l.html)}}})}var j=0;var h=0;$("#searchInput").keyup(function(m){m=m||window.event;var l=m.keyCode;if(l!=40&&l!=38){j=0}var k='<ul id="tie" class="hide">';if(l==13){$("#searchForm").submit()}else{if((l>=48&&l<=90)||l==8||l==32){$.ajax({type:"GET",async:true,url:"/prompt",data:"keyword="+$("#searchInput").val(),dataType:"text",success:function(n){var q=n.split("|");h=q.length;if(q.length>0&&q!=""){for(var t=0;t<q.length;t++){var u=q[t].split(",");if(u.length>0){k+="<li id='kw_"+t+"' onmouseout='out(this);' onmouseover='over(this);' onclick='selected(this);'><span>约"+u[1]+"条</span> <div>"+u[0]+"</div></li>"}}k+="<li class='close'><a onclick='hidePrompt();' herf='javascript:void(0)'>关闭</a></li></ul>";$("#tie").replaceWith(k);var v=0;var r=0;var s=$("#searchInput").offset();v=s.top+$("#searchInput").outerHeight();var w=$("#websiteHost_rb").val();var x=$("#websiteHost_current").val();var o=25;if(w==x){o=0.5}r=s.left-o;if(w==x){$("#tie").css({top:v,left:r})}else{$("#tie").css({"margin-top":30})}$("#tie").show();$("#tie").removeClass("hide")}else{$("#tie").hide();$("#tie").addClass("hide")}}})}else{if(l==40){$(".bg").removeClass("bg");$("#kw_"+j).addClass("bg");keyselected($("#kw_"+j));if(j<h-1){j++}else{j=0}}else{if(l==38){if(j==0){j=h-1}else{j--}$(".bg").removeClass("bg");$("#kw_"+j).addClass("bg");keyselected($("#kw_"+j))}}}}if($("#searchInput").val()==""){$("#tie").empty();$("#tie").addClass("hide");$("#tie").hide()}});$("#searchInput").click(function(){if($("#search").val()!=1&&$(this).hasClass("font_gary")){$(this).val("")}});$("#searchInput").focusout(function(){if($("#search").val()!=1&&($(this).hasClass("font_gary")||$(this).val()=="")){if($(this).hasClass("font_black")){$(this).removeClass("font_black");$(this).addClass("font_gary")}$(this).val($(this).attr("oirval"))}});$("#searchInput").keydown(function(){$(this).removeClass("font_gary");$(this).addClass("font_black")});$("body").click(function(){$("#tie").hide()});$("#searchForm").submit(function(){if($("#searchInput").val().length>70){alert("搜索词过长，请重新填写！");$("#searchInput").val("").focus();return false}});if($("#headTagRedbaby").length>0){$("#headTagRedbaby").parent().hover(function(){rbHeadTimer=setTimeout('headTagImgShow("headTagRedbaby")',1200)},function(){clearTimeout(rbHeadTimer)});$("#headTagRedbaby").hover(function(){$(this).show()},function(){$(this).hide()});$("#headTagBinggo").parent().hover(function(){rmHeadTimer=setTimeout('headTagImgShow("headTagBinggo")',1200)},function(){clearTimeout(rmHeadTimer)});$("#headTagBinggo").hover(function(){$(this).show()},function(){$(this).hide()})}});var urlre=document.referrer;var urlcur=unescape(document.location.search).toLowerCase();if(urlcur.indexOf("source")!="-1"){var date=new Date();$("body").append('<img height="1" border="0" width="1" src="http://www.binggo.com/union/login/unionCount?urlre='+urlre+"&rd="+date+'"> </img>');$("body").append('<img height="1" border="0" width="1" src="http://www.redbaby.com.cn/union/login/unionCount?urlre='+urlre+"&rd="+date+'"> </img>')};
