// (function() {
    // var bp = document.createElement('script');
    // var curProtocol = window.location.protocol.split(':')[0];
    // if (curProtocol === 'https') {
        // bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    // } else {
        // bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    // }
    // var s = document.getElementsByTagName("script")[0];
    // s.parentNode.insertBefore(bp, s);
// })();
let titleAlt = document.title
let pinpai = ""
 var _hmt = _hmt || [];
 (function() {
     var hm = document.createElement("script");
     hm.src = "https://hm.baidu.com/hm.js?583ee22dd97d57ccd5f3eeefe1b7eff4";
     var s = document.getElementsByTagName("script")[0];
     s.parentNode.insertBefore(hm, s);
 })();
 // var _hmt = _hmt || [];
 // (function() {
     // var hm = document.createElement("script");
     // hm.src = "https://hm.baidu.com/hm.js?a9e5192f706841629c92eec6d806af5b";
     // var s = document.getElementsByTagName("script")[0];
     // s.parentNode.insertBefore(hm, s);
 // })();
//详询需求
var staticprice;
var name;
var qq;
var fileName = window.location.href;
var obj = fileName.lastIndexOf("/");
var gpls = "2-" + fileName.substr(obj + 1).substring(0, 12) + ".do";
var aaaa=fileName.substr(obj + 1).substring(0, 12);
function returnqq(hydm, name) {
    if (hydm == '0001609' && name == '贾长铎') {
        return '357736667';
    }
    if (hydm == '0001609' && name == '朱晓林') {
        return '3529958968';
    }
    if (hydm == '0001609' && name == '李昀茜') {

        return '2285546320';
    }
    if (hydm == '0001609' && name == '郎艳') {
        return '1422551469';
    }
    if (hydm == '0001609' && name == '王卓') {
        return '1602301564';
    }
    if (hydm == '0001609' && name == '王秋月') {
        return '2443873679';
    }
    if (hydm == '0001609' && name == '李艳艳') {
        return '467729810';
    }
    if (hydm == '0001609' && name == '王兴华') {
        return '467452263';
    }
    if (hydm == '0001609' && name == '臧霞') {
        return '2714181403';
    }
    if (hydm == '0001609' && name == 'å§šç§‹æ± ') {
        return '1849437684';
    }
}
  var shopid 
//详询需求 end
$(document).ready(function() {
    // var myprovince = returnCitySN['cname'];
    // var mys = myprovince.split("省");
    // var '' = '辽宁'
    shopid = getParameter("shopid").substring(0,7);
	if(shopid == null || shopid == "" ){
		
		$.ajax({
				type: "post",
				url: "http://www.mrobay.com/xianhuo/pick/show/1-" + aaaa + ".do?jsoncallback=?",
				async: true,
				dataType: "jsonp",
				data: { 'htmlflag': 'true' },
				success: function (ob) {
					shopid =ob[0].zyinfo.hydm
					indexxx(shopid)
				}
		});
		
	}
    $.ajax({
        type: "post",
        url: "http://www.mrobay.com/bsplatform/shop/" + shopid + "/" + gpls + "?jsoncallback=?",
        async: false,
        dataType: "jsonp",
        data: { 'htmlflag': 'true' },
        success: function(ob) {
			if(ob[0].shopBean.storename == '青岛恒信动力科技有限公司'){
				ob[0].shopBean.storename='高品智机床工具一站式解决方案供应链'
			}
            msfp(ob[0].user.hydm, '');
            $("#fzr").html(ob[0].shopBean.fuser);
            $("#fzrdh").html(ob[0].shopBean.ftel);
            $("#fzrqq").html(ob[0].shopBean.im1);
            $("#gsdh").html(ob[0].user.coptel);
			if(ob[0].user.coptel==""){
				 $("#gsdh").html("-");
			}
           // showmbscoreType("http://www.mrobay.com/scplatform", ob[0].user.hydm, "mbscore", "1", "1", ob[0].user.mbname);
            // $.ajax({
            // type: "post",
            // url: "http://47.105.148.55/spxiangqing?gpls=" + gpls + "&shopid=" + shopid + "&jsoncallback=?",
            // dataType: "jsonp",
            // success: function (ob4) {
            // console.log(ob4)
            // }
            // });
            //评价
		
            var source = ob[0].source;
			if(ob[0].user2 != null  && ob[0].user2.flag02 == 1){
					source.price00=source.price00*1.3
			}
            $("#szdq").html(ob[0].user.dq1name + ob[0].user.dqname);
            if (ob[0].shopBean.storename == '陌贝自营') {
                $("#mbname").html('陌贝自营');
                $("#mbname2").html('陌贝自营');
                $("#mbname2").attr("title", '陌贝自营');
                $("#spnm").html("陌贝自营").attr("title", "陌贝自营").attr("href", "http://www.mrobay.com/shangcheng/0001609/spxhd.html");
                $("#wl2").html(source.dq2 + "仓库  " + '');
                $("#szdq").html("辽宁省沈阳市");
                $(".sspan6").html("自营");
            } else {
                $("#mbname").html(ob[0].shopBean.storename);
                $("#mbname2").html(ob[0].shopBean.storename);
                $("#mbname2").attr("title", ob[0].shopBean.storename);
                $("#spnm").html(ob[0].shopBean.storename.substring(0, 9) + "...").attr("title",ob[0].shopBean.storename).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
                $("#wl2").html(source.dq1 + source.dqname + "  " + '');
            }


            $("#sjlb").html(ob[0].user.hytyp2Str);
            $("#sjlb2").html(ob[0].user.hytyp2Str);
            $("#main").html(source.cd + "(" + source.wzstr13 + ") " + source.dlname + "  " + source.pm);

            $("#in_shop").attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
            if (source.gqflag == 1) {
                $("#isgq").html("供应价格");
                $("#price").html("ï¿¥" + source.price00.toFixed(2) + "å…ƒ");
                if (0 == source.price00) {
                    staticprice = "详询";
                    $("#price").html("详询");
                    name = ob[0].source.opt1;
                    qq = returnqq(ob[0].shopBean.hydm, name);
                };
            } else {
                $("#isgq").html("求购价格");
                $("#price").html("ï¿¥" + source.price00.toFixed(2) + "å…ƒ");
            }
			if((ob[0].user2 == null || ob[0].user2 == "") || (ob[0].user2.menber.qxgid == 'M00000' || ob[0].user2.menber.qxgid == 'M00001')){
				$("#price").html( "认证会员可见" );
			}
            var l = "/";
            $("#cd").html(source.cd).attr("title", source.cd + "轴承");
            $("#pm").html(source.pm).attr("title", source.cd + source.pm);
            $(".cpgs_pic img").each(function(){
                $(this).attr('alt', source.cd +" "+ source.pm);
            });
            $("#jylc img").each(function(){
                $(this).attr('alt', source.cd +" "+ source.pm);
            });
            $("#date1Str").html(source.date1Str);
            $("#sl2").html("(库存" + source.sl2 + "套)");
            $("#qqjt2").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + source.cd + "')");
            $("#qqjt").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + source.cd + "')");
            $("#qqjt0").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + source.cd + "')");
            getContractInfo(ob[0].user.hydm, ob[0].shopBean.storename);
            $("#xh").html(source.pm);
            $("#pp").html(source.cd);
            $.ajax({
                type: "get",
                url: "http://www.mrobay.com/forbaidu.do?jsoncallback=?",
                cache: false,
                dataType: "jsonp",
                data: {
                    'wzpzSelect': 'gwc',
                    'pzname': source.pm,
                    'ref0': 0,
                    'flag07': 0,
                    'flag00': 0,
                    'flag01': 0,
				'new': 111,
                    'flag02': 0,
                    'mohu': "false"
                },
                success: function(ob22) {
                    console.log(ob22)
                      if (ob22[0].wzpzList != null) {
                        $("#dlname").html(ob22[0].wzpzList.fathername == '' ? '暂无数据' : ob22[0].wzpzList.fathername).attr("title", ob22[0].wzpzList.fathername);
						$("#wzstr01").html(ob22[0].wzpzList.ref0 == '' || ob22[0].wzpzList.ref0 == 0 ? '暂无数据' : ob22[0].wzpzList.ref0  + "mm");
						$("#wzstr02").html(ob22[0].wzpzList.ref1 == '' || ob22[0].wzpzList.ref1 == 0 ? '暂无数据' : ob22[0].wzpzList.ref1  + "mm");
						$("#wzstr03").html(ob22[0].wzpzList.ref2 == '' || ob22[0].wzpzList.ref2 == 0 ? '暂无数据' : ob22[0].wzpzList.ref2  + "mm");
						$("#wznum01").html(ob22[0].wzpzList.ref3 == '' || ob22[0].wzpzList.ref3 == 0 ? '暂无数据' : ob22[0].wzpzList.ref3  + "kg");
						
						
						
						if (source.blogoimg == "" && source.mlogoimg == "" && source.slogoimg == "" && source.logoimg1 == "" && source.logoimg2 == "" && ob22[0].wzpzList.fathername != '') {
								if(ob22[0].wzpzList.ref0.indexOf("深沟球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/0.jpg' width='382' height='349' alt="+titleAlt+" />");
								}else if(ob22[0].wzpzList.ref0.indexOf("调心球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/1.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("圆柱滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/2.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("调心滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/3.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("滚针轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/4.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("角接触球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/6.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("圆锥滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/7.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("推力球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/8.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("推力调心滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/9.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}
							}
					} else {
                        //$("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
                        if ($("#dlname").html() == '') {
                            $("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
                        }
                        $("#wzstr01").html(source.wzstr01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr01 + "mm");
                        $("#wzstr02").html(source.wzstr02 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr02 + "mm");
                        $("#wzstr03").html(source.wzstr03 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr03 + "mm");
                        $("#wznum01").html(source.wznum01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wznum01 + "kg");
                    }
                }
            });
           // $("#stockAccuracy").html(getKcjzd(source.price18))
                //面包屑
            $("#mbx_xh").html(source.cd + "_" + source.pm).attr("title", source.cd + source.pm);
            $("#mbx_gs").html(ob[0].shopBean.storename + " >").attr("title", ob[0].shopBean.storename).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
            if (ob[0].shopBean.storename == '陌贝自营') {
                $("#mbx_gs").html("陌贝自营" + " >").attr("title",ob[0].shopBean.storename).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
                $("#sjlb").html("陌贝自营");
                $("#sjlb2").html("陌贝自营");
            }
            if (source.longData != null && source.longData != "") {
                $("#beizhu").html("【" + source.longData + "】");
            } else if (source.opt1 == '嘉瑞') {
                $("#beizhu").html("【满500接单】");
            }
            if (source.isxg == '1') {
                //$("#ljgm").attr("style","display:none");
            }
            if (ob[0].user2 == null) {
                $("#ljgm").attr("onclick", "tologin()");
                $("#gwc").attr("onclick", "tologin()");
                $("#gwc2").attr("onclick", "tologin()");
            } else if (ob[0].user2.menber.qxgid == 'M00000' || ob[0].user2.menber.qxgid == 'M00001') {
                $("#ljgm").attr("onclick", "toRZ()");
                $("#gwc").attr("onclick", "toRZ()");
                $("#gwc2").attr("onclick", "toRZ()");
            } else {
                $("#gwc").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
                $("#gwc2").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
                $("#ljgm").attr("onclick", "gwc('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "','" + source.cd + "')");
            }

            if (source.blogoimg == "" && source.mlogoimg == "" && source.slogoimg == "" && source.logoimg1 == "" && source.logoimg2 == "") {
                
				if($("#dlname").html() != '' && $("#dlname").html() != '暂无数据'){
					if($("#dlname").html().indexOf("深沟球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/0.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("调心球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/1.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("圆柱滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/2.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("调心滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/3.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("滚针轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/4.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("角接触球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/6.jpg' width='382' height='349'  alt="+titleAlt+"/>");
					}else if($("#dlname").html().indexOf("圆锥滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/7.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("推力球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/8.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("推力调心滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/9.jpg' width='382' height='349' alt="+titleAlt+" />");
					}
						
				}else{
					$("#showbox").html("<img src='http://www.mrobay.com/webresource//images/mrobay/ScPic.jpg' width='382' height='349' alt="+titleAlt+" />");
				}
            } else {
                $("#showbox").html("");
                if (source.blogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.blogoimg + "' width='382' height='349' alt='" + titleAlt + "'/>");
                }
                if (source.mlogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.mlogoimg + "' width='382' height='349' alt='" + titleAlt+ "' />");
                }
                if (source.slogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.slogoimg + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
                if (source.logoimg1 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.logoimg1 + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
                if (source.logoimg2 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.logoimg2 + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
            }
            var showproduct = {
                "boxid": "showbox",
                "sumid": "showsum",
                "boxw": 382,
                "boxh": 349,
                "sumw": 50,
                "sumh": 50,
                "sumi": 5,
                "sums": 6,
                "sumsel": "sel",
                "sumborder": 1,
                "lastid": "showlast",
                "nextid": "shownext",
                "alt": source.cd + " " + source.pm
            };
            $.ljsGlasses.pcGlasses(showproduct);
            // document.title = "【" + ob[0].source.cd + " " + ob[0].source.pm + "】-" + ob[0].user.mbname + "-陌贝网";
            // var i = document.getElementsByTagName("meta");
            // i[1]["content"] = ob[0].user.mbname + "," + ob[0].source.cd + "轴承," + ob[0].source.pm + "轴承";//keywords
            // i[0]["content"] = ob[0].source.cd + "_" + ob[0].source.pm + ",剩余库存" + source.sl2 + "套,正品保障,陌贝网担保交易,正规发票。"//description
        }

    });

    //scrollIdx();
});


function indexxx(shopid){
	 $.ajax({
        type: "post",
        url: "http://www.mrobay.com/bsplatform/shop/" + shopid + "/" + gpls + "?jsoncallback=?",
        async: false,
        dataType: "jsonp",
        data: { 'htmlflag': 'true' },
        success: function(ob) {
			if(ob[0].shopBean.storename == '青岛恒信动力科技有限公司'){
				ob[0].shopBean.storename='高品智机床工具一站式解决方案供应链'
			}
            msfp(ob[0].user.hydm, '');
            $("#fzr").html(ob[0].shopBean.fuser);
            $("#fzrdh").html(ob[0].shopBean.ftel);
            $("#fzrqq").html(ob[0].shopBean.im1);
            $("#gsdh").html(ob[0].user.coptel);
            if(ob[0].user.coptel==""){
				 $("#gsdh").html("-");
			}
            //æ–°
            $("#mbscore2").html("累计访问量:" + ob[0].user.flag03)
            $("#qqjt4").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + ob[0].shopinfo.refstr01 + "')");
            $("#ljfwl").html(ob[0].user.flag03 + "次")
            $("#ljfwl2").html(ob[0].user.flag03 + "次")

            $("#fzr2").html(ob[0].shopBean.fuser)
            $("#fzrdh2").html(ob[0].shopBean.ftel)

            $("#kdsc").html(ob[0].spnf)

            if(ob[0].user.flag14 == 1){
                $("#cxsj").show()
                $("#cxsj2").show()
                $("#cxsj3").show()
                $("#cxsj4").css({"width":"500px","height":"260px"})
            }else{
                $("#cxsj").hide()
                $("#cxsj2").hide()
                $("#cxsj3").hide()
                $("#cxsj4").css({"width":"0px","height":"0px"})
            }
            
            //showmbscoreType("http://www.mrobay.com/scplatform", ob[0].user.hydm, "mbscore", "1", "1", ob[0].user.mbname);
            // $.ajax({
            // type: "post",
            // url: "http://47.105.148.55/spxiangqing?gpls=" + gpls + "&shopid=" + shopid + "&jsoncallback=?",
            // dataType: "jsonp",
            // success: function (ob4) {
            // console.log(ob4)
            // }
            // });
            //评价

            var source = ob[0].source;
			if(ob[0].user2 != null  && ob[0].user2.flag02 == 1){
					source.price00=source.price00*1.3
			}
            $("#szdq").html(ob[0].user.dq1name + ob[0].user.dqname);
            if (ob[0].shopBean.storename == '陌贝自营') {
                $("#mbname").html('陌贝自营');
                $("#mbname2").html('陌贝自营');
                $("#mbname2").attr("title", '陌贝自营');
                $("#spnm").html("陌贝自营").attr("title", "陌贝自营").attr("href", "http://www.mrobay.com/shangcheng/0001609/spxhd.html");
                $("#wl2").html(source.dq2 + "仓库&nbsp;&nbsp;" + '');
                $("#szdq").html("辽宁省沈阳市");
                $(".sspan6").html("自营");
            } else {
                $("#mbname").html(ob[0].shopBean.storename);
                $("#mbname2").html(ob[0].shopBean.storename);
                $("#mbname2").attr("title", ob[0].shopBean.storename);
                $("#spnm").html(ob[0].shopBean.storename.substring(0, 9) + "...").attr("title",ob[0].shopBean.storename).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
                $("#wl2").html(source.dq1 + source.dqname + "&nbsp;&nbsp;" + '');
            }
			if (ob[0].user.hytyp2Str == "生产厂家") {
							$("#newycj").css("display", "none")
							$("#newcjje").css("display", "none")
							$("#xxbs").css("display", "none")
							$("#cj_price").css("display", "none")
							$("#cjbs").css("display", "none")
			}
	
	
            $("#sjlb").html(ob[0].user.hytyp2Str);
            $("#sjlb2").html(ob[0].user.hytyp2Str);
            $("#main").html(source.cd + "(" + source.wzstr13 + ") " + source.dlname + "&nbsp;&nbsp;" + source.pm);

            $("#in_shop").attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
            if (source.gqflag == 1) {
                $("#isgq").html("供应价格");
                $("#price").html("ï¿¥" + source.price00.toFixed(2) + "å…ƒ");
                if (0 == source.price00) {
                    staticprice = "详询";
                    $("#price").html("详询");
                    name = ob[0].source.opt1;
                    qq = returnqq(ob[0].shopBean.hydm, name);
                };
            } else {
                $("#isgq").html("求购价格");
                $("#price").html("ï¿¥" + source.price00.toFixed(2) + "å…ƒ");
            }
			if((ob[0].user2 == null || ob[0].user2 == "") || (ob[0].user2.menber.qxgid == 'M00000' || ob[0].user2.menber.qxgid == 'M00001')){
				$("#price").html( "认证会员可见" );
			}
            var l = "/";
            $("#cd").html(source.cd).attr("title", source.cd + "轴承");
            $("#pm").html(source.pm).attr("title", source.cd + source.pm);
            $(".cpgs_pic img").each(function(){
                $(this).attr('alt', source.cd +" "+ source.pm);
            });
            $("#jylc img").each(function(){
                $(this).attr('alt', source.cd +" "+ source.pm);
            });
            $("#date1Str").html(source.date1Str);
            $("#sl2").html("(库存" + source.sl2 + "套)");
            $("#qqjt2").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + source.cd + "')");
            $("#qqjt").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + source.cd + "')");
            $("#qqjt0").attr("onclick", "qqTz('" + ob[0].user.hydm + "','" + source.cd + "')");
            getContractInfo(ob[0].user.hydm, ob[0].shopBean.storename);
            $("#xh").html(source.pm);
            $("#pp").html(source.cd);
            pinpai = source.cd + "轴承"
            $(".carousel5 img").each(function(){
                $(this).attr('alt', pinpai);
            });
            $(".carousel6 img").each(function(){
                $(this).attr('alt', pinpai);
            });
            $.ajax({
                type: "get",
                url: "http://www.mrobay.com/forbaidu.do?jsoncallback=?",
                cache: false,
                dataType: "jsonp",
                data: {
                    'wzpzSelect': 'gwc',
                    'pzname': source.pm,
                    'ref0': 0,
                    'flag07': 0,
                    'flag00': 0,
				'new': 111,
                    'flag01': 0,
                    'flag02': 0,
                    'mohu': "false"
                },
                success: function(ob22) {
                    console.log(ob22)
                   if (ob22[0].wzpzList != null) {
                        $("#dlname").html(ob22[0].wzpzList.fathername == '' ? '暂无数据' : ob22[0].wzpzList.fathername).attr("title", ob22[0].wzpzList.fathername);
						$("#wzstr01").html(ob22[0].wzpzList.ref0 == '' || ob22[0].wzpzList.ref0 == 0 ? '暂无数据' : ob22[0].wzpzList.ref0  + "mm");
						$("#wzstr02").html(ob22[0].wzpzList.ref1 == '' || ob22[0].wzpzList.ref1 == 0 ? '暂无数据' : ob22[0].wzpzList.ref1  + "mm");
						$("#wzstr03").html(ob22[0].wzpzList.ref2 == '' || ob22[0].wzpzList.ref2 == 0 ? '暂无数据' : ob22[0].wzpzList.ref2  + "mm");
						$("#wznum01").html(ob22[0].wzpzList.ref3 == '' || ob22[0].wzpzList.ref3 == 0 ? '暂无数据' : ob22[0].wzpzList.ref3  + "kg");
						
						if (source.blogoimg == "" && source.mlogoimg == "" && source.slogoimg == "" && source.logoimg1 == "" && source.logoimg2 == "" && ob22[0].wzpzList.fathername != '') {
								if(ob22[0].wzpzList.ref0.indexOf("深沟球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/0.jpg' width='382' height='349' alt="+titleAlt+" />");
								}else if(ob22[0].wzpzList.ref0.indexOf("调心球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/1.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("圆柱滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/2.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("调心滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/3.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("滚针轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/4.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("角接触球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/6.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("圆锥滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/7.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("推力球轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/8.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}else if(ob22[0].wzpzList.ref0.indexOf("推力调心滚子轴承") != -1){
									$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/9.jpg' width='382' height='349' alt="+titleAlt+"  />");
								}
							}
					} else {
                        //$("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
                        if ($("#dlname").html() == '') {
                            $("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
                        }
                        $("#wzstr01").html(source.wzstr01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr01 + "mm");
                        $("#wzstr02").html(source.wzstr02 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr02 + "mm");
                        $("#wzstr03").html(source.wzstr03 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr03 + "mm");
                        $("#wznum01").html(source.wznum01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wznum01 + "kg");
                    }
                }
            });
            //$("#stockAccuracy").html(getKcjzd(source.price18))
                //面包屑
            $("#mbx_xh").html(source.cd + "_" + source.pm).attr("title", source.cd + source.pm);
            $("#mbx_gs").html(ob[0].shopBean.storename + " >").attr("title", ob[0].shopBean.storename).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
            if (ob[0].shopBean.storename == '陌贝自营') {
                $("#mbx_gs").html("陌贝自营" + " >").attr("title", ob[0].shopBean.storename).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
                $("#sjlb").html("陌贝自营");
                $("#sjlb2").html("陌贝自营");
            }
            if (source.longData != null && source.longData != "") {
                $("#beizhu").html("【" + source.longData + "】");
            } else if (source.opt1 == '嘉瑞') {
                $("#beizhu").html("【满1200接单】");
            }
            if (source.isxg == '1') {
                //$("#ljgm").attr("style","display:none");
            }
            if (ob[0].user2 == null) {
                $("#ljgm").attr("onclick", "tologin()");
                $("#gwc").attr("onclick", "tologin()");
                $("#gwc2").attr("onclick", "tologin()");
            } else if (ob[0].user2.menber.qxgid == 'M00000' || ob[0].user2.menber.qxgid == 'M00001') {
                $("#ljgm").attr("onclick", "toRZ()");
                $("#gwc").attr("onclick", "toRZ()");
                $("#gwc2").attr("onclick", "toRZ()");
            } else {
                $("#gwc").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
                $("#gwc2").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
                $("#ljgm").attr("onclick", "gwc('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "','" + source.cd + "')");
            }
			if("0020361" == source.hydm){
				 $("#showbox").html("");
               // if (source.blogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020361/1.jpg' width='382' height='349' alt='" + titleAlt+ "'/>");
               // }
               // if (source.mlogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020361/2.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.slogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020361/3.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.logoimg1 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020361/4.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.logoimg2 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020361/5.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
			}else if("0017201" == source.hydm){
				
				 $("#showbox").html("");
               // if (source.blogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0017201/1.jpg' width='382' height='349' alt='" + titleAlt+ "'/>");
               // }
               // if (source.mlogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0017201/2.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.slogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0017201/3.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.logoimg1 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0017201/4.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.logoimg2 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0017201/5.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
			}else if("0020427" == source.hydm){
				
				 $("#showbox").html("");
				 
                 $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020427/1.jpg' width='382' height='349' alt='" + titleAlt+ "'/>");
         
			}else if("0020277" == source.hydm){
				 $("#showbox").html("");
               // if (source.blogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020277/1.jpg' width='382' height='349' alt='" + titleAlt+ "'/>");
               // }
               // if (source.mlogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020277/2.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }
               // if (source.slogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/img/0020277/3.jpg' width='382' height='349' alt='" + titleAlt + "' />");
               // }

			}else if (source.blogoimg == "" && source.mlogoimg == "" && source.slogoimg == "" && source.logoimg1 == "" && source.logoimg2 == "") {
                
				if($("#dlname").html() != '' && $("#dlname").html() != '暂无数据'){
					if($("#dlname").html().indexOf("深沟球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/0.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("调心球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/1.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("圆柱滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/2.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("调心滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/3.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("滚针轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/4.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("角接触球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/6.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("圆锥滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/7.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("推力球轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/8.jpg' width='382' height='349' alt="+titleAlt+" />");
					}else if($("#dlname").html().indexOf("推力调心滚子轴承") != -1){
						$("#showbox").html("<img src='http://www.mrobay.com/webresource//xiangqing/img/9.jpg' width='382' height='349' alt="+titleAlt+" />");
					}
						
				}else{
					$("#showbox").html("<img src='http://www.mrobay.com/webresource//images/mrobay/ScPic.jpg' width='382' height='349' />");
				}
            } else {
                $("#showbox").html("");
                if (source.blogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.blogoimg + "' width='382' height='349' alt='" + titleAlt+ "'/>");
                }
                if (source.mlogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.mlogoimg + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
                if (source.slogoimg != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.slogoimg + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
                if (source.logoimg1 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.logoimg1 + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
                if (source.logoimg2 != "") {
                    $("#showbox").html($("#showbox").html() + "<img src='http://www.mrobay.com/webresource/" + source.logoimg2 + "' width='382' height='349' alt='" + titleAlt + "' />");
                }
            }
            var showproduct = {
                "boxid": "showbox",
                "sumid": "showsum",
                "boxw": 382,
                "boxh": 349,
                "sumw": 50,
                "sumh": 50,
                "sumi": 5,
                "sums": 6,
                "sumsel": "sel",
                "sumborder": 1,
                "lastid": "showlast",
                "nextid": "shownext",
                "alt": source.cd + " " +source.pm
            };
            $.ljsGlasses.pcGlasses(showproduct);
            // document.title = "【" + ob[0].source.cd + " " + ob[0].source.pm + "】-" + ob[0].user.mbname + "-陌贝网";
            // var i = document.getElementsByTagName("meta");
            // i[1]["content"] = ob[0].user.mbname + "," + ob[0].source.cd + "轴承," + ob[0].source.pm + "轴承";//keywords
            // i[0]["content"] = ob[0].source.cd + "_" + ob[0].source.pm + ",剩余库存" + source.sl2 + "套,正品保障,陌贝网担保交易,正规发票。"//description
        }

    });
}



function qqjt(type, num) {
    if (type == '1') {
        window.open("tencent://message/?uin=" + num + "&Site=陌贝网&Menu=yes");
    }
    if (type == '2') {
        window.location.href = "http://www.mrobay.com/bsplatform/pages/htmlpage/app/login/market/login.html";
    }
}

function msfp(a, id) {
    // $.ajax({
    // type: "GET",
    // url: "http://www.mrobay.com/forbaidu",
    // data: { 'qthydm': a },
    // success: function (data) {
    // var JsonObjs = eval("(" + data + ")");
    // var ms = document.getElementById("ms" + id);
    // var fw = document.getElementById("fw" + id);
    // var wl = document.getElementById("wl" + id);
    // var fp = document.getElementById("fp" + id);

    // ms.innerText = JsonObjs[0]['ms'] + "分↑";
    // fw.innerText = JsonObjs[0]['fw'] + "分↑";
    // wl.innerText = JsonObjs[0]['wl'] + "分↑";
    // fp.innerText = JsonObjs[0]['fp'] + "分↑";
    // },
    // dateType: "json"
    // });
    var ms = document.getElementById("ms" + id);
    var fw = document.getElementById("fw" + id);
    var wl = document.getElementById("wl" + id);
    var fp = document.getElementById("fp" + id);

    ms.innerText = "5.0分↑";
    fw.innerText = "5.0分↑";
    wl.innerText = "5.0分↑";
    fp.innerText = "5.0分↑";
}

function showmbscoreType(scpath, mbcode, id, typ, flag, mbname) {
    if (mbname == '陌贝自营') {
        var html = "<img src='http://www.mrobay.com/webresource/images/integral/jf_b_3p.gif'>";
        $("#" + id).html(html);
        $("#" + id + "2").html(html);
    } else {
        var docpath = "http://www.mrobay.com/webresource/images/integral";

        var url = "";
        if (typ == null || typ == undefined || typ == "") {
            typ = "1";
        }
        if (typ == "1") {
            url = scpath + "/scp/score/mbscore.do?jsoncallback=?";
        } else if (typ == "2") {
            url = scpath + "/scm/score/mbscore.do?jsoncallback=?";
        }
        $.post(url, { "hydm": mbcode, "docpath": docpath, "flag": flag }, function(result) {
            try {
                var msg = result[0];
                $("#" + id).html(msg);
                $("#" + id + "2").html(msg);
            } catch (e) {

            }
        }, "json");
    }
}

function gwc(gpls, zdcgl, kc, sessionid, flag01, hydm, qq) {
    if (staticprice == "详询") {
        //alert("请与在线客服咨询商品信息,再进行采购!");
        var r = confirm("请与在线客服咨询商品信息,再进行采购!")
        if (r == true) {
            qqjt('1', $("#fzrqq").html());
        } else {
            return;
        }
        return;
    }

    var cando = sessionid == hydm ? '0' : '1';
    if (cando == "0") {
        gAlert("该商品为您本公司发布的商品,不能进行采购");
        return;
    }
    if (!checksl(zdcgl, kc)) {
        return false;
    }
    var jsons = new Array();
    var json = {};
    json.gpls = gpls;
    json.sl = jQuery("#cgs").val();
    json.flag01 = '2';
    jsons[jsons.length] = json;

    gConfirm1('该商品价格供参考,建议您先进行议价后再采购!', function doYes() {
        layer_close();
        validateLogin("http://www.mrobay.com/pages/htmlpage/app/hangsource/buy/picksource/pickInput.html?jsonstring=" + JSON.stringify(jsons), true);
    }, function doNo() {
        layer_close();
        qqTz(hydm, qq);
    });


}

function checksl(zdcgl, kc) {
    //购买数量
    var sl = jQuery("#cgs").val();
    if (zdcgl == null || zdcgl == "" || zdcgl == undefined) {
        gAlert("最少起订量为空!");
        return false;
    }
    if (kc == null || kc == "" || kc == undefined) {
        gAlert("库存为空!");
        return false;
    }

    var r = /^[0-9]*[1-9][0-9]*$/   //正整数    
    if (!r.test(sl)) {
        gAlert("采购数必须为正整数!");
        return false;
    } else {
        if (parseFloat(sl) < parseFloat(zdcgl)) {
            gAlert("采购数不能小于最低购买量!");
            return false;
        }
        if (parseFloat(sl) > parseFloat(kc)) {
            gAlert("采购数不能大于库存!");
            return false;
        }
        return true;
    }
}

function buy(gpls, flag01) {
    var jsons = new Array();
    var json = {};
    json.gpls = gpls;
    json.sl = jQuery("#cgs").val();
    json.flag01 = '2';
    jsons[jsons.length] = json;
    validateLogin("http://www.mrobay.com/pages/htmlpage/app/hangsource/buy/picksource/pickInput.html?jsonstring=" + JSON.stringify(jsons), true);
}

function tologin() {
    validateLogin("http://www.mrobay.com/bsplatform/pages/htmlpage/app/login/market/login.html", true);
}

function do_shopping(gpls, zdcgl, kc, sessionid, flag01, hydm) {
    //详询
    if (staticprice == "详询") {
        var r = confirm("请与在线客服咨询商品信息,再进行采购!")
        if (r == true) {
            qqjt('1', $("#fzrqq").html());
        } else {
            return;
        }
        return;
    }
    //详询 end
    var sl01 = $("#cgs").val();
    var cando = sessionid == hydm ? '0' : '1';
    if (cando == "0") {
        gAlert("该商品为您本公司发布的商品,不能加入购物车。");
        return;
    }
    if (!checksl(zdcgl, kc)) {
        return false;
    }
    currentAjax = $.ajax({
        type: "POST",
        url: "http://www.mrobay.com/exp/hangsource/buy/shopping/save.do",
        data: { "gpls": gpls, "flag01": flag01, "sl01": sl01, 'htmlflag': 'true' },
        dataType: "text",
        statusCode: {
            302: function() { gAlert("您无权限操作该功能模块!若要开通,请联系管理员。"); }
        },
        success: function(result2) {
            try {
                var msg2 = result2;
                if ("1" == msg2) {
                    gAlert("已加入购物车");
                    return false;
                } else if ("0" == msg2) {
                    gAlert("该商品已经被他人选购或卖方已经撤牌");
                    return false;
                } else {
                    gAlert("您无权限操作该功能模块!若要开通,请联系管理员。");
                    return false;
                }
            } catch (e1) {}
        },
        error: function(a, b, c) {
            gAlert("您无权限操作该功能模块!若要开通,请联系管理员。");
        }
    });

}

function getContractInfo(hydm, mbname) {
    if (hydm == '0001609') {

        var currentTime = Date.now();
        console.log(new Date().getDate());
        var targetTime = (new Date(2018, 9, 9, 0, 0, 0)).getTime();
        var offsetTime = targetTime - currentTime;
        offsetTime = Math.abs(offsetTime);
        var offsetDays = Math.floor(offsetTime / (3600 * 24 * 1e3));
        $("#cjbs").html(mrobayNum() + "套");
        //$("#cj_price").html((mrobayPrice()).toFixed(2) + "å…ƒ");
			$("#cj_price").html(( mrobayPrice()-1000000000).toFixed(2) + "å…ƒ");
    } else {
        $.post("http://www.mrobay.com/exp/contract/sell/manage/getContractInfo.do?jsoncallback=?", { "hzdm": hydm }, function(data) {
            try {
                var amt = parseFloat(data[0].htamt).toFixed(2);
                $("#cjbs").html(parseInt(data[0].spsl) + "套");
                $("#cj_price").html(amt + "å…ƒ");
                if (mbname == '陌贝自营') {
                    var currentTime = Date.now();
                    console.log(new Date().getDate());
                    var targetTime = (new Date(2018, 9, 9, 0, 0, 0)).getTime();
                    var offsetTime = targetTime - currentTime;
                    offsetTime = Math.abs(offsetTime);
                    var offsetDays = Math.floor(offsetTime / (3600 * 24 * 1e3));
                    $("#cjbs").html(parseInt(data[0].spsl) + mrobayNum() + "套");
                    $("#cj_price").html((parseFloat(amt) + mrobayPrice()).toFixed(2) + "å…ƒ");
                }
            } catch (e) {

            }


        }, "json");
    }
}
qqTz = function(hydm, flag) {
    $.ajax({
        type: "post",
        url: "http://www.mrobay.com/exp/hangsource/buy/picksource/getShopInfo.do?jsoncallback=?",
        cache: false,
        async: false,
        dataType: "jsonp",
        data: { "hydm": hydm, "brand": flag },
        success: function(result) {
            window.open("tencent://message/?uin=" + result.im1 + "&Site=陌贝网&Menu=yes");
        }
    });
}

function getParameter(param) {
    var query = window.location.search;
    var iLen = param.length;
    var iStart = query.indexOf(param);
    if (iStart == -1)
        return "";
    iStart += iLen + 1;
    var iEnd = query.indexOf("&", iStart);
    if (iEnd == -1)
        return query.substring(iStart);

    return query.substring(iStart, iEnd);
}

function sjFormat(data) {
    var hh = data['hours'];
    var mm = data['minutes'];
    var ss = data['seconds'];
    hh = buwei(hh);
    mm = buwei(mm);
    ss = buwei(ss);
    var day = data['date'];
    var month = data['month'] + 1;
    var year = data['year'] - 100 + 2000;
    return year + "-" + month + "-" + day + "  " + hh + ":" + mm + ":" + ss;
}

function buwei(value) {
    if (value < 10) {
        value = "0" + value;
    }
    return value;
}
//底部切换、评价切换
function scrollIdx() {
    var h1 = $(".tab_wrap .t_wrap:eq(0)").position().top - 40;
    var h2 = $("#foot").position().top;
    $(".spxxnav ul li").bind("click", function() {
        var idx = $(".spxxnav ul li").index($(this));
        $(this).addClass("li1").siblings().removeClass("li1");
        if (idx == 3) {
            //商铺商品详情评价
            $("html, body").animate({ scrollTop: $("#ljpj").position().top }, 120);
        } else {
            $("html, body").animate({ scrollTop: $(".tab_wrap .t_wrap:eq(" + idx + ")").position().top }, 120);
        }
    });

    $(".gongsidi a").bind("click", function() {
        var idx = $(".gongsidi a").index($(this));
        switch (idx) {
            case 1:
                $(".spxxnav ul li").eq(0).trigger("click");
                break;
            case 2:
                $(".spxxnav ul li").eq(1).trigger("click");
                break;
            case 3:
                $(".spxxnav ul li").eq(2).trigger("click");
                break;
        }
    });
    $(window).scroll(function() {
        var h = $(window).scrollTop();
        //console.log(h+" "h2);
        if (h > h1) {
            $(".gongsidi").fadeIn();
        } else {
            $(".gongsidi").hide();
        }
    });
    //评价切换
    $(".pjnr1 li").bind("click", function() {
        var idx = $(".pjnr1 li").index($(this));
        $(this).addClass("on").siblings().removeClass("on");
        //处理评价切换
    });
}

function toPickList() {
    window.location.href = "http://www.mrobay.com/pages/htmlpage/app/hangsource/buy/picksource/pickList.html?keyword=" + $("#yid").val();
}

function toPickList2() {
    validateLogin("http://www.mrobay.com/shop/spxhd.html?shopid=" + getParameter('shopid') + "&select=" + $('#yid').val(), false);
}

function carouselN(d, n, a) {
    var dom1 = '.' + d
    var num = $(dom1).children("li").length
    if (num > 1) {
        var i = 0

        setInterval(function showHide() {
            if (i < num - 1) {
                i++
            } else if (i = num - 1) {
                i = 0
            }
            console.log(i)
            $(dom1).children("li").eq(i).fadeIn(n)
            $(dom1).children("li").eq(i).siblings('li').fadeOut(n)
        }, 3000);
    }
}
carouselN('carousel5', 700, 0)
carouselN('carousel6', 700, 0)

$(function() {
    var obj = new commentMove('.tm-m-photos', '.tm-m-photo-viewer');
    obj.init()
})
var levelstar = GetQueryString('levelstar');

function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}

// 库存准确度
function getKcjzd(price18) {
	
    var listHtml = '';
    if (price18 == 5) {
        listHtml += '<div class="stockLevel" title="库存稳定可靠,可放心采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
    } else if (price18 == 4.5) {
        listHtml += '<div class="stockLevel" title="库存稳定可靠,可放心采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-half-o"></span>\n';
    } else if (price18 == 4) {
        listHtml += '<div class="stockLevel" title="库存较为可靠,建议咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    } else if (price18 == 3.5) {
        listHtml += '<div class="stockLevel" title="库存较为可靠,建议咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-half-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    } else if (price18 == 3) {
        listHtml += '<div class="stockLevel" title="库存较为可靠,建议咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    } else if (price18 == 2.5) {
        listHtml += '<div class="stockLevel" title="卖家库存不稳定,请咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-half-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    } else if (price18 == 2) {
        listHtml += '<div class="stockLevel" title="卖家库存不稳定,请咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    } else if (price18 == 1.5) {
        listHtml += '<div class="stockLevel" title="卖家库存不稳定,请咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-half-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    } else {
        listHtml += '<div class="stockLevel" title="库存较为可靠,建议咨询后采购">\n';
        listHtml += '库存准确度 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star"></span>\n';
        listHtml += '<span class="fa fa-star-o"></span>\n';
    }
    return listHtml;
}

$(".nsy").click(function() {
	if(shopid !=''){
		 location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/nindex.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
   
})
$("#ncp").click(function() {
   // location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/spxhd.html"
	if(shopid !=''){
		 location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/spxhd.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
})
$("#nzs").click(function() {
    
	if(shopid !=''){
		location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/ncertificate.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
})
$("#nxc").click(function() {
    
	if(shopid !=''){
		location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/nalbum.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
})
$("#nlx").click(function() {
    
	if(shopid !=''){
		 location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/ncontact.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
})
$("#njj").click(function() {
    
	if(shopid !=''){
		 location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/nintroduce.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
})
$("#lwxt").click(function() {
   
	if(shopid !=''){
		  location.href = "http://www.mrobay.com/shangcheng/" + shopid + "/nindex.html"
	}else{
		// location.href = "http://www.mrobay.com/xianhuo" 
        $.ajax({
            type: "post",
            url: "http://www.mrobay.com//wxxcx/ext/index/brandStoreList.do",
            cache: false,
            async: false,
            data: { "keyworld": $("#mbname").html(),"pageSize":"1"},
            dataType:"json",
            success: function(result) {
                if(result.result[0]!=""){
                    location.href = "http://www.mrobay.com/shangcheng/" + result.result.result[0].hydm + "/nindex.html"
                }else{
                    location.href = "http://www.mrobay.com/xianhuo" 
                }
                
            }
        });
	}
})
$("#top1").attr("href", "http://www.mrobay.com/shangcheng/0002476/spxhd.html")
$("#top2").attr("href", "http://www.mrobay.com/shangcheng/0016995/spxhd.html")
$("#bottom1").attr("href", "http://www.mrobay.com/shangcheng/0004615/spxhd.html")
$("#bottom2").attr("href", "http://www.mrobay.com/shangcheng/0017067/spxhd.html")

   var url = window.location.href
      $.ajax({
            url: 'http://115.28.32.40:8080/explatform/autoPush.do?url=' + url,
            type: 'GET',
            dataType: 'json',
            timeout: 3000,
            cache: false,
            success: function(){} //成功执行方法
        });