//头部登录验证
function userCheckses(){
$.get(document.getElementById("webhttp").innerHTML+"tem/sesCheck.php",{},function(result){
 if(result=="0"){
 document.getElementById("notlogin").style.display="";
 document.getElementById("yeslogin").style.display="none";
 return false;
 }else{
 r=result.split(" ");
 document.getElementById("yeslogin").style.display="";
 document.getElementById("notlogin").style.display="none";
 document.getElementById("yesuid").innerHTML=r[0];
 
 if(document.getElementById("dontqd")){
  if(r[1]=="yes"){document.getElementById("dontqd").style.display="";document.getElementById("needqd").style.display="none";}
  else{document.getElementById("dontqd").style.display="none";document.getElementById("needqd").style.display="";}
 }
 
 if(document.getElementById("ze")){document.getElementById("ze").innerHTML=r[2];}
 if(document.getElementById("tx")){document.getElementById("tx").src=r[3];}
 if(document.getElementById("dj")){document.getElementById("dj").innerHTML=r[4];}
 if(document.getElementById("kt")){document.getElementById("kt").innerHTML=r[5];}
 if(document.getElementById("jf")){document.getElementById("jf").innerHTML=r[6];}
 if(document.getElementById("uid")){document.getElementById("uid").innerHTML=r[7];}
 if(document.getElementById("id")){document.getElementById("id").innerHTML=r[8];}
 return false;
 }
});
}
$(document).ready(function() {//xqyc
    $("#code_hot dl:first").addClass("dropList-hover");
    $("#code_hot dl").mouseover(function() {
        $("#code_hot dl.dropList-hover").removeClass("dropList-hover");
        $(this).addClass("dropList-hover")
    });
    $(".shop-evaluation-label label").on("click", function() {
        var a = $(this).attr("data").split("|");
        $(".shop-evaluation-score p").each(function(b) {
            $(this).html(a[b])
        })
    });

	//top
    $(".top_box li:not(.not)").live({
        mouseenter: function () {
            $(this).addClass("curr")
        },
        mouseleave: function () {
            $(this).removeClass("curr")
        }
    });
	//分页
 $(".sort_page a:not([data-ajax])").click(function() {
        var a = $("#page .ohave"),
            b = $(this).attr("id");
        a = ("l" == b ? a.prev() : a.next()).find("a");
        if (0 >= a.length) return layer.alert("亲，已经是" + ("l" == b ? "第一" : "最后一") + "页啦！", {
            icon: 5
        }), !1;
        location.href = a.attr("href")
    });
	//列表页更多选项
    $(".sort_select dl").hover(function() {
        var a = $(this).attr("data");
        a = $(this).find("a[data='" + a + "']");
        (0 >= a.length ? $(this).find("a:first") : a).addClass("curr");
        $(this).addClass("curr").siblings("dl").removeClass("curr");
        $(this).find("dd").show()
    }, function() {
        $(this).removeClass("curr").find("dd").hide()
    });
	//列表页右买卖家帮助
    $(".lrtop cite  a").click(function() {
        $(this).addClass("curr").siblings().removeClass("curr").closest("dl").next(".post").find("div:eq(" + $(this).index() + ")").removeClass("hide").siblings().addClass("hide")
    });
    //手动发货商品，付款后联系商家发货
	   $(".shou").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('手动发货商品，付款后联系商家发货', that, {
		        tips: [1, '#cc805b'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//该商品已经加入会员等级折扣体系，本站会员可以享受相应的折价优惠
		$(".zhe").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('该商品已经加入会员等级折扣体系，本站会员可以享受相应的折价优惠', that, {
		        tips: [1, '#40affe'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//商品有演示站,点击（演示）查看
		$(".yan").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('商品有演示站,点击（演示）查看', that, {
		        tips: [1, '#cc805b'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//商品已加入推广服务,在商品列表置顶显示
		$(".tuiguang").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('商品已加入推广服务,在商品列表置顶显示', that, {
		        tips: [1, '#ffc107'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//平台精选商品，用户好评超高！
		$(".jingxuan").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('平台精选商品，用户好评超高！', that, {
		        tips: [1, '#ff7e00'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//自动发货商品，拍下后，即可收到来自该商品的发货（下载）链接
		$(".zidong").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('自动发货商品，拍下后，即可收到来自该商品的发货（下载）链接', that, {
		        tips: [1, '#cc805b'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//商家信息
		$(".mysj").hover(function () {
		    var that = $(this);
		    var my = $(that).data("my");
		    nowtips = layer.tips('' + my + '', that, {
		        tips: [1, '#fff'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		//已加入消保，商家已缴纳保证金
		$(".bao-t").hover(function () {
		    var that = $(this);
		    var mn = $(that).data("mn");
		    nowtips = layer.tips('已加入消保，商家已缴纳保证金 <span class="mn-p">￥：' + mn + '元</span> ', that, {
		        tips: [1, '#0f9c0b'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
		
			//最后刷新时间
		$(".sx-sj").hover(function () {
		    var that = $(this);
		    nowtips = layer.tips('该时间为商品最后排序刷新时间，<br>不一定为出品或发布上架时间！', that, {
		        tips: [1, '#0f9c0b'],
		        time: 20000
		    });
		}, function () {
		    layer.close(nowtips);
		});
// pf	
$(".pingfen_btn").live("hover", function(a) {
    "mouseenter" == a.type ? $(this).addClass("active") : $(this).removeClass("active")
});	

function set_cur(a) {
    $(".c_r_menu em").hasClass("cur") && $(".c_r_menu em").removeClass("cur");
    $(".c_r_menu em" + a).addClass("cur")
}
		
$.fn.extend({//xq
   layer_top: function() {
        var a = $("#c_aa").offset().top,
            b = $("#c_bb").offset().top,
            c = $("#c_cc").offset().top;
			f = $(this);
        $(window).scroll(function() {
			$(window).scrollTop() > a ? f.addClass("fixed") : f.removeClass("fixed")
            var d = $(this).scrollTop() + 180;
            d >= c ? set_cur(".c_cc") : d >= b ? set_cur(".c_bb") : d >= a && set_cur(".c_aa")
			
        });
        $(".c_r_menu em:not([a])").click(function() {
            var a = $(this).attr("class").replace(/cur/, "");
          $("html,body").scrollTop($("#" + a).offset().top - 60);
           $(this).addClass("cur").siblings("em").removeClass("cur")
       })
    }
});
	//bz
 $(".fw_a").hover(function() {
        $(this).addClass("fw_on");
        $(this).siblings().removeClass("fw_on");
        var a = $(".fw_a").index($(this));
        $(".fw_txt cite").hide();
        $(".fw_txt cite").eq(a).show();
        $(this).hasClass("tpay") && $(this).find("i").html("&#xe659;")
    }, function() {
        if (!$(this).hasClass("tpay")) return !1;
        $(".fw_txt cite").hide();
        $(this).removeClass("fw_on");
        $(this).find("i").html("&#xe658;")
    });

//grt
	 $(".ubaf li").hover(function() {
        $(this).addClass("imzcur");
        $(this).children("div").show()
    }, function() {
        $this = $(this);
        $this.removeClass("imzcur");
        setTimeout(function() {
            $this.hasClass("imzcur") ||
                $this.children("div").hide()
        }, 1)
    });
	 $(".ubar li").hover(function() {
        $(this).addClass("imzcur");
        $(this).children("div").show()
    }, function() {
        $this = $(this);
        $this.removeClass("imzcur");
        setTimeout(function() {
            $this.hasClass("imzcur") ||
                $this.children("div").hide()
        }, 1)
    });
	//gr	
    $(".clist dt,.wlist .pic").mouseenter(function() {
        var a = $(this);
        enter = setTimeout(function() {
            a.find(".ly").show()
        }, 300)
    }).mouseleave(function() {
        clearTimeout(enter);
        $(this).find(".ly").hide()
    });
	
	
	 0 < $(".lazyload img[lay-src]").length && (layui.use("flow", function() {
        layui.flow.lazyimg({
            elem: ".lazyload img"
        })	
    }), layer_photos(".lazyload"));
    0 < $("#layer_top").length && $("#layer_top").layer_top();
    0 < $(".adsbygoogle").length && loadScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
    0 < $(".scroll-box").length && ($(".scroll-box").vTicker({
        showItems: $(".scroll-box").attr("items"),
        pause: $(".scroll-box").attr("times")
    }), $(".scroll-action").click(function() {
        $(".scroll-box").vTicker($(this).attr("action"), {
            animate: !0
        })
    }));
    $(".w_d_list .l2,.w_list .l2").hover(function() {
        var a = $(this);
        item1Timer = setTimeout(function() {
            $(a).children("span").show().animate({
                top: 0,
                height: "100%"
            }, 300)
        }, 100)
    }, function() {
        var a = $(this);
        clearTimeout(item1Timer);
        $(a).children("span").animate({
            top: "50%",
            height: 0
        }, 300, function() {
            $(a).children("span").hide()
        })
    })
});
layer_ly = function(a, b, c, d, e) {
    layer.open({
        type: 1,
        title: b,
        closeBtn: 1,
        shade: [.05, "#000"],
        area: [d || "auto", e || "auto"],
        shadeClose: c || !1,
        content: a
    });
    layer.closeAll("loading")
};
(function(d) {
    var g, c, f;
    g = {
        speed: 700,
        pause: 4E3,
        showItems: 1,
        mousePause: !0,
        height: 0,
        animate: !0,
        margin: 0,
        padding: 0,
        startPaused: !1,
        autoAppend: !0
    };
    c = {
        moveUp: function(a, b) {
            return c.showNextItem(a, b, "up")
        },
        moveDown: function(a, b) {
            return c.showNextItem(a, b, "down")
        },
        nextItemState: function(a, b) {
            var e, c;
            c = a.element.children("ul");
            e = a.itemHeight;
            0 < a.options.height && (e = c.children("li:first").height());
            e += a.options.margin + 2 * a.options.padding;
            return {
                height: e,
                options: a.options,
                el: a.element,
                obj: c,
                selector: "up" === b ? "li:first" : "li:last",
                dir: b
            }
        },
        showNextItem: function(a, b, e) {
            var d;
            d = c.nextItemState(a, e);
            d.el.trigger("vticker.beforeTick");
            e = d.obj.children(d.selector).clone(!0);
            "down" === d.dir && d.obj.css("top", "-" + d.height + "px").prepend(e);
            b && b.animate ? a.animating || c.animateNextItem(d, a) : c.nonAnimatedNextItem(d);
            "up" === d.dir && a.options.autoAppend && e.appendTo(d.obj);
            return d.el.trigger("vticker.afterTick")
        },
        animateNextItem: function(a, b) {
            b.animating = !0;
            return a.obj.animate("up" === a.dir ? {
                top: "-=" + a.height + "px"
            } : {
                top: 0
            }, b.options.speed, function() {
                d(a.obj).children(a.selector).remove();
                d(a.obj).css("top", "0px");
                return b.animating = !1
            })
        },
        nonAnimatedNextItem: function(a) {
            a.obj.children(a.selector).remove();
            return a.obj.css("top", "0px")
        },
        nextUsePause: function() {
            var a, b;
            b = d(this).data("state");
            a = b.options;
            if (!b.isPaused && !c.hasSingleItem(b)) return f.next.call(this, {
                animate: a.animate
            })
        },
        startInterval: function() {
            var a, b;
            b = d(this).data("state");
            a = b.options;
            return b.intervalId = setInterval(function(a) {
                return function() {
                    return c.nextUsePause.call(a)
                }
            }(this), a.pause)
        },
        stopInterval: function() {
            var a;
            if (a = d(this).data("state")) return a.intervalId && clearInterval(a.intervalId),
                a.intervalId = void 0
        },
        restartInterval: function() {
            c.stopInterval.call(this);
            return c.startInterval.call(this)
        },
        getState: function(a, b) {
            var c;
            if (!(c = d(b).data("state"))) throw Error("vTicker: No state available from " + a);
            return c
        },
        isAnimatingOrSingleItem: function(a) {
            return a.animating || this.hasSingleItem(a)
        },
        hasMultipleItems: function(a) {
            return 1 < a.itemCount
        },
        hasSingleItem: function(a) {
            return !c.hasMultipleItems(a)
        },
        bindMousePausing: function(a) {
            return function(a, e) {
                return a.bind("mouseenter", function() {
                    if (!e.isPaused) return e.pausedByCode = !0,
                        c.stopInterval.call(this),
                        f.pause.call(this, !0)
                }).bind("mouseleave", function() {
                    if (!e.isPaused || e.pausedByCode) return e.pausedByCode = !1,
                        f.pause.call(this, !1),
                        c.startInterval.call(this)
                })
            }
        }(this),
        setItemLayout: function(a, b, c) {
            var f;
            a.css({
                overflow: "hidden",
                position: "relative"
            }).children("ul").css({
                position: "absolute",
                margin: 0,
                padding: 0
            }).children("li").css({
                margin: c.margin,
                padding: c.padding
            });
            return isNaN(c.height) || 0 === c.height ? (a.children("ul").children("li").each(function() {
                if (d(this).height() > b.itemHeight) return b.itemHeight = d(this).height()
            }), a.children("ul").children("li").each(function() {
                return d(this).height(b.itemHeight)
            }), f = c.margin + 2 * c.padding, a.height((b.itemHeight + f) * c.showItems + c.margin)) : a.height(c.height)
        },
        defaultStateAttribs: function(a, b) {
            return {
                itemCount: a.children("ul").children("li").length,
                itemHeight: 0,
                itemMargin: 0,
                element: a,
                animating: !1,
                options: b,
                isPaused: b.startPaused,
                pausedByCode: !1
            }
        }
    };
    f = {
        init: function(a) {
            var b, e;
            d(this).data("state") && f.stop.call(this);
            b = jQuery.extend({}, g);
            a = d.extend(b, a);
            b = d(this);
            e = c.defaultStateAttribs(b, a);
            d(this).data("state", e);
            c.setItemLayout(b, e, a);
            a.startPaused || c.startInterval.call(this);
            if (a.mousePause) return c.bindMousePausing(b, e)
        },
        pause: function(a) {
            var b;
            b = c.getState("pause", this);
            if (!c.hasMultipleItems(b)) return !1;
            b.isPaused = a;
            b = b.element;
            if (a) return d(this).addClass("paused"),
                b.trigger("vticker.pause");
            d(this).removeClass("paused");
            return b.trigger("vticker.resume")
        },
        next: function(a) {
            var b;
            b = c.getState("next", this);
            if (c.isAnimatingOrSingleItem(b)) return !1;
            c.restartInterval.call(this);
            return c.moveUp(b, a)
        },
        prev: function(a) {
            var b;
            b = c.getState("prev", this);
            if (c.isAnimatingOrSingleItem(b)) return !1;
            c.restartInterval.call(this);
            return c.moveDown(b, a)
        },
        stop: function() {
            c.getState("stop", this);
            return c.stopInterval.call(this)
        },
        remove: function() {
            var a;
            a = c.getState("remove", this);
            c.stopInterval.call(this);
            a = a.element;
            a.unbind();
            return a.remove()
        }
    };
    return d.fn.vTicker = function(a) {
        return f[a] ? f[a].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" !== typeof a && a ? d.error("Method " + a + " does not exist on jQuery.vTicker") : f.init.apply(this, arguments)
    };
	
})(jQuery);