﻿/*公共调用 add by dxx 2011-05-05*/
jQuery.noConflict(); //取消$符号
var PvcID = "0"; //全局变量 留言省份
var jq = jQuery;
//页面加载事件
jq(function () {
    //加载头部选中样式
    var location; //当前位置
    if (jq(".location span a").length > 1) {
        location = jq(".location span a").eq(1).html();
    }
    else {
        location = jq(".location span a").eq(0).html();
    }
    jq(".menu a").each(function () {
        if (jq(this).html() == location) {
            jq(this).addClass("menuhot");
        }
    });
    //如果是预览，页面功能不可用
    if (typeof isView != "undefined" && isView == "1") {
        Boxy.bgopacity = 0;
        Boxy.alert(jq(""), '', { "showCloseBtn": [], "hideFrame": 1 });
    }
    //图片尺寸自适应    
    jq(".resizeImg").each(function (i) {
        new ResizePic(this);
    })
});
//显示公司联系人


function ShowCompanyContact(Cid) {
    jq("#viewcodeimg").attr('src','/NewShowStand/Image.aspx?type=viewcontact&v='+Math.random());
    jq("#view-contact").show();
    var href = window.location.href;
    var json = AjaxClass.InsertClickCompanyLink(Cid, href).value; 
    
}

function ClearFristInfo(clint, info, stype) {
            if (stype == 1) {
                if (document.getElementById(clint).value == info) {
                    document.getElementById(clint).value = '';
                }
            }
            else if (document.getElementById(clint).value == "")
                document.getElementById(clint).value = info;
        }

var _issendcontact=true;
//通用查看联系发送信息
function SendCompanyContactMessage(cid) {
	//$(".Wrong").hide();
	//var cid = $.trim($("#cid").val());
	jQuery(".view-btn button").text("提交中...");
    if(_issendcontact==false)
	{
		return;
	}
	_issendcontact=false;
	if (cid == null || cid == "" || cid == "0") {
		//Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
		    alertBoxShow("提示", "", "无此公司,ID错误！", function() {
			location.reload();
		});
		return;
	}  
    
	var _typename="";
    var _orderflag=jQuery('input:radio[name="consultType"]:checked').val();
    if(_orderflag=="1"){_typename="询价产品";}
    else if(_orderflag=="2"){_typename="售后服务";}
    var title =document.getElementById("viewtitle").value;
	//var detail = title + _typename;
	var detail = jQuery.trim(jQuery("#view-txtDetail").val()); 
	var linkMan = jQuery.trim(jQuery("#viewlinkname" ).val());
	var companyName = jQuery.trim(jQuery("#viewcompanyname" ).val());
	var tel = jQuery.trim(jQuery("#viewtel").val());
	var email =""; 
	var proID = jQuery.trim(jQuery("#viewpid").val());
	var valCode = jQuery.trim(jQuery("#viewcontactcode").val());
	var addr ="";
    var IsNoSend = jQuery('input:radio[name="isnosend4"]:checked').val(); 
    if (typeof (IsNoSend) == "undefined") {
	    IsNoSend = "0";//默认不转发
    } 
	var WXTel = "";
    var codename="viewcontact";
	 
   if (detail == "请简单描述您的需求，限200字") {
	 _issendcontact=true;
		jQuery(".view-btn button").text("提交信息");
        alert("请先描述您的需求"); 
		return;
	} else if (detail.length > 200) {
		_issendcontact=true;
		jQuery(".view-btn button").text("提交信息");
        alert("描述请控制在200字以内"); 
		return;
	}
	//包含  http 或https 或.com  .cn  .net  .php,.asp,.jsp 的  提示
	if (detail.length > 0) {
		var tempInqContent=detail.toLowerCase();
		if ( tempInqContent.indexOf("http")>-1 || tempInqContent.indexOf("https")>-1 || tempInqContent.indexOf(".com")>-1 || tempInqContent.indexOf(".cn")>-1|| tempInqContent.indexOf(".net")>-1|| tempInqContent.indexOf(".php")>-1|| tempInqContent.indexOf(".asp")>-1|| tempInqContent.indexOf(".jsp")>-1) {
			_issendcontact=true;
			jQuery(".view-btn button").text("提交信息");
			alert("留言信息中请勿包含网址，请修改后再次提交。");
            showInputWrong(jq("#view-txtDetail"),  "留言信息中请勿包含网址，请修改后再次提交。");
			return;
		}
	}
	if(location.href.indexOf("zyzhan")>-1 || location.href.indexOf("chem17")>-1)
	{
		if (companyName == "" || companyName == "您的单位...") {
			_issendcontact=true;
			jQuery(".view-btn button").text("提交信息");
			 alert("请填写您的单位");
			showInputWrong($("#viewcompanyname"), "请填写您的单位");
			return;
		}
	}
	

	if (linkMan == "" || linkMan == "您的姓名...") {
		_issendcontact=true;
		jQuery(".view-btn button").text("提交信息");
         alert("请填写您的姓名");
		showInputWrong($("#viewlinkname"), "请填写您的姓名");
		return;
	}
	if (tel == "" || tel == "固定电话或手机...") {
		_issendcontact=true;
		jQuery(".view-btn button").text("提交信息");
       alert("请填写联系电话");
	    showInputWrong($("#viewtel" ), "请填写联系电话");
	    return;
	} else {
        if (!IsTel(tel)) {
			_issendcontact=true;
		   jQuery(".view-btn button").text("提交信息");
            alert("联系电话输入错误");
            showInputWrong($("#viewtel"), "联系电话输入错误");
            return;
        }
    }
 
//    if (detail == "" || detail == "如对采购产品有详细要求，请在此输入....") {
//    detail = "";
//	} else if (detail.length > 200) {
//        alert("标题请控制在200字以内");
//		showInputWrong($("#viewtel" ), "补充说明请控制在200字以内");
//		return;
//	}
//	//包含  http 或https 或.com  .cn  .net  .php,.asp,.jsp 的  提示
//	if (detail.length > 0) {
//		var tempInqContent=detail.toLowerCase();
//		if ( tempInqContent.indexOf("http")>-1 || tempInqContent.indexOf("https")>-1 || tempInqContent.indexOf(".com")>-1 || tempInqContent.indexOf(".cn")>-1|| tempInqContent.indexOf(".net")>-1|| tempInqContent.indexOf(".php")>-1|| tempInqContent.indexOf(".asp")>-1|| tempInqContent.indexOf(".jsp")>-1) {
//			alert("留言信息中请勿包含网址，请修改后再次提交。");
//            showInputWrong(jq("#viewtitle"),  "留言信息中请勿包含网址，请修改后再次提交。");
//			return;
//		}
//	}
	 
	  var  PvcID = "0";
	 
	if (valCode == "") {
		_issendcontact=true;
		jQuery(".view-btn button").text("提交信息");
         alert("请填写验证码");
		showInputWrong($("#viewcontactcode"), "请填写验证码");
		return;
    } 
	if(title=="")
	{
		title=detail;
		if(detail.length>25)
		{
			title=detail.substring(0,25)+"......";
		} 
	}
	AjaxClass.AddOrder(cid, title, proID, linkMan, companyName, tel, email, detail, addr, valCode, PvcID, "", codename, IsNoSend, WXTel,"",_orderflag, SendCompanyContactMessageCallBack);
}



function SendCompanyContactMessageCallBack(obj) { 
    _issendcontact=true;
   jQuery(".view-btn button").text("提交信息");
    var jsonStr1 = obj.value;
    var jsonobj = eval("rrr=" + jsonStr1);
   // var ranNum = $.trim($("#ranNum").val());
    //var Detail = "detail_" + ranNum;
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功 
           jq("#view-contact").hide();
		   //jq("#view-contact-success").show();
		     jQuery("#viewcompanyname" ).val(''); 
             jQuery("#viewlinkname" ).val(''); 
	         jQuery("#viewtel").val('');
	         jQuery("#viewcontactcode").val('');
           AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function() { return false; });
		   var _proid=jQuery("#viewpid").val();
		   if(location.href.indexOf("sale")>-1 || (location.href.indexOf("gongying")>-1 && location.href.indexOf("xwboo")==-1))
					AjaxClass.ReCompanyMobileBySID(_proid,GetMobileCallBack);
			else
					AjaxClass.ReCompanyMobileByPID(_proid,GetMobileCallBack);
           // alertBoxShow("提示", 1, "您的留言已提交成功！我们将在第一时间回复您~", function() { location.reload(); });
           // document.getElementById(Detail).value = "";

        } else {
            switch (jsonobj.Detail[0].Success) {
            case -1:
                alert("验证码错误！请点击验证码进行刷新操作重新填写！");
                break;
            case -5:
                alert("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                break;
            case -10:
                alert("留言成功，邮件发送失败！");
                break;
            case -11:
                alert("留言信息中请勿包含网址，请修改后再次提交！");
                break;
            default:
                alert("数据写入失败!");
                break;
            }
        }
    } else {
        alert(jsonobj.Error);
    }
	jq("#viewcodeimg").attr('src','/NewShowStand/Image.aspx?type=viewcontact&v='+Math.random());
}
function GetMobileCallBack(obj) {   
     jq("#view-contact-success").show();
    var result = obj.value;
	if(result!=null && result!="")
		jq("#viewcontentmobile").html("联系方式："+result);

}

//显示名片
function showCard() {
    jq(".authBg").show();
    jq(".Card").show();
}
function contact(Cid,con) {
    var href = window.location.href;
    var json = AjaxClass.InsertClickCompanyLink(Cid, href).value;

    if (con == 1) {
        document.getElementById("contact").style.display = "none";
        document.getElementById("Mobil").style.display = "table-row";
        document.getElementById("Tel").style.display = "table-row";
        document.getElementById("Fax").style.display = "table-row";
        document.getElementById("AfterSaleTel").style.display = "table-row";
    }
    else if (con == 0) {
        document.getElementById("lx").style.display = "none";
        document.getElementById("Pho").style.display = "table-row";
        document.getElementById("fa").style.display = "table-row";
        document.getElementById("Mobile").style.display = "table-row";
        document.getElementById("After").style.display = "table-row";
    }
    else if (con == 2) {
        document.getElementById("lx1").style.display = "none";
        document.getElementById("Pho1").style.display = "table-row";
        document.getElementById("fa1").style.display = "table-row";
        document.getElementById("Mobile1").style.display = "table-row";
        document.getElementById("After1").style.display = "table-row";
    }
    else if (con == 3) {
        document.getElementById("A1").style.display = "none";
        document.getElementById("P1").style.display = "inline";
    }
    else if (con == 4) {
        document.getElementById("AfterSaleTel").style.display = "none";
        document.getElementById("After").style.display = "inline";
    }
   

  }
//点击弹出窗口
function showdownorder(proid, stype) {
    // if (stype != null && stype != "" && stype == "1")
    //     dialog.iframe33("../../SendOrder/Send2.aspx?stype=1&scid=" + cid + "&sproid=" + proid + "&sproname=" + proname, 625, 560);
    //  else
    if (window.location.href.indexOf("FromWebManage_") > -1) {
        var Prefix = window.location.href.replace("FromWebManage_", "").split("/i")[0];
        dialog.iframe33(Prefix+"/downmessage_" + proid + "_" + stype + ".html", 800, 670);
    }
    else {
        dialog.iframe33("downmessage_" + proid + "_" + stype + ".html", 800, 670);
    }
    
    //dialog.iframe33("$Common.GetStandUrl(${Company.ID}, '0')/downmessage_" + proid + ".html", 800, 530);
}
function showdownOpenTab(url) {
    window.open(url);
}

//顶部搜索
function search(p) {
    var web_site = document.getElementById("web_site").value;
    var keys = document.getElementById("keys").value;
    if (keys == '请输入产品名称...')
        keys = "";
    keys = keys.replace(/(^[^\S]+)|([^\S]+$)/g, "");
    keys = keys.replace(/\+/g, "%2b"); //替换'+'号，如果不处理‘+’号会被替换成空
    var getIndustryDomain = AjaxClass.GetIndustryDomain().value;
    var type = jq(".selectTop p").html();
    if (p == 1) //搜全站
    {
        var classidBykey = AjaxClass.GetClassIDByKey(keys).value;
        var searchUrl = "";
        if (type == "二手产品") {
            if (web_site == "jc35") {
                searchUrl = "https://used.jc35.com/chanpin-0.html";
            }
        }
        else {
            searchUrl = getIndustryDomain + "/product/t" + classidBykey + "/list_p0.html";
            if (web_site == "zyzhan" || web_site == "hbzhan" || web_site == "nongjx" || web_site == "foodjx" || web_site == "86pla" || web_site == "a-bm" || web_site == "fzfzjx" || web_site == "afzhan") {
                searchUrl = "/chanpin-0_p0.html";
            }
			else if (web_site == "gkzhan") {
               searchUrl = getIndustryDomain + "/chanpin/" + classidBykey + "_p0/";
            }
            else if (web_site == "ybzhan") {
                searchUrl = "https://www.ybzhan.cn/chanpin-" + classidBykey + "/list_p0.html";
            }
            else if (web_site == "jc35") {
                searchUrl = getIndustryDomain + "/chanpin-" + classidBykey + "_p0.html";
            }
            else if (web_site == "86175") {
                searchUrl = getIndustryDomain + "/product/list-" + classidBykey + ".html";
            }
            else if (web_site == "xwboo" || web_site == "tao31" || web_site == "supplier18" || web_site == "qqgongying" || web_site == "qqzzao" || web_site == "gc1288" || web_site == "qqmaoyi"
            || web_site == "cn-america" || web_site == "cn-africa" || web_site == "asia-eur" || web_site == "qqzyuan" || web_site == "yzzzao" || web_site == "equ1688") {
                searchUrl = getIndustryDomain + "/gongying/t0/";
            }
        }
        document.getElementById("searchForm").action = searchUrl;
    }
    else {
        //搜本商铺
        var action = "";
        if (type == "二手产品") {
            jq('#searchForm').attr('action', jq('#searchForm').attr('action').replace('product', 'used'));
        }
    }
    document.getElementById("searchForm").submit();
}
//底部搜索
function bottomsearch(p) {
    //获取web_site站点名
    var web_site = document.getElementById("web_site").value;
    //输入的值
    var keys = document.getElementById("BotKeys").value;
    //如果输入的值等于 请输入产品名称...
    if (keys == '请输入产品名称...')
    //把输入的值赋值为空
        keys = "";
        //正则表达式
    keys = keys.replace(/(^[^\S]+)|([^\S]+$)/g, "");
    keys = keys.replace(/\+/g, "%2b"); //替换'+'号，如果不处理‘+’号会被替换成空
    //拼接站点
    var getIndustryDomain = AjaxClass.GetIndustryDomain().value;
    //p等于1则是搜全站
    if (p == 1) //搜全站
    {
        //根据输入的值查询相的类别，并返回分类ID
        var classidBykey = AjaxClass.GetClassIDByKey(keys).value;
        //拼接地址
        var searchUrl = getIndustryDomain + "/product/t" + classidBykey + "/list_p0.html";
        //如果站点满足任何一个条件就执行里面语句
        if (web_site == "zyzhan" || web_site == "hbzhan" || web_site == "nongjx"  ) {
        //更换地址
            searchUrl = "/chanpin-0_p0.html";
        }
		else if (web_site == "gkzhan") {
               searchUrl = "/chanpin/0_p0/";
            }
        //如果站点等于ybzhan就重新赋值站点
        else if (web_site == "ybzhan") {
        //更换站点
            searchUrl = "http://www.ybzhan.cn/chanpin-0/list_p0.html";
        }
        //如果站点等于jc35就执行里边的语句
        else if (web_site == "jc35") {
            //站点中used的位置大于-1
            if (window.location.href.indexOf('used') > -1) {
                //更换站点https://www.jc35.com/st249164/product.html
                searchUrl = "http://used.jc35.com/chanpin-0.html";
            }
            else {
            //否则重新拼接站点
                searchUrl = getIndustryDomain + "/chanpin-" + classidBykey + "_p0.html";
            }
        }
        //站点等于86175
        else if (web_site == "86175") {
        //重新拼接站点
            searchUrl = getIndustryDomain + "/product/list-" + classidBykey + ".html";
        }
        //    把站点赋值给   选定from表单
       
        document.getElementById("botSearchForm").action = searchUrl;
    }
    else if (p == 2) {
        if (window.location.href.indexOf('used') > -1) {
            //更换站点https://www.jc35.com/st249164/product.html
            jq('#botSearchForm').attr('action', jq('#botSearchForm').attr('action').replace('product', 'used'));
        }
    }

    document.getElementById("BotKeys").submit = "Keys";
    //选定from表单调用submit方法 提交
    document.getElementById("botSearchForm").submit(); 
}


//左侧产品分类点击伸缩事件
function changeClassShow(obj) {
    if (obj.src.indexOf('jian.jpg') > -1) {
        obj.src = obj.src.replace('jian.jpg', 'jia.jpg');
        jq(obj).parent().parent().next().hide();
    }
    else {
        obj.src = obj.src.replace('jia.jpg', 'jian.jpg');
        jq(obj).parent().parent().next().show();
    }
}

//86175新版展台左侧产品分类点击伸缩事件
function NewchangeClassShow(obj, id) {
    if (obj.src.indexOf('jian.jpg') > -1) {
        obj.src = obj.src.replace('jian.jpg', 'jia.jpg');
        jq(obj).parent().parent().next().hide();
        var clientclass = ReadCookies("clientclass" + id)
        if (clientclass != null) {
            DelCookies("clientclass" + id);
        }
    }
    else {
        obj.src = obj.src.replace('jia.jpg', 'jian.jpg');
        jq(obj).parent().parent().next().show();
        WriteCookies("clientclass" + id, id, 365);
    }
}
//点击登陆弹出窗口
var weblogin;
function showLogin(type) {
    if (weblogin == null) {
        weblogin = jq(".weblogin").clone().show();
        jq(".weblogin").remove();
    }
    Boxy.alert(weblogin.clone(), '', { "showCloseBtn": [], "hideFrame": 1 });
    if (type == "online") {
        jq(".weblogin b").html('采购商登录')
    }
    else {
        jq(".weblogin b").html('会员登录')
    }
    var random = Math.random();
    setTimeout(function () {
        jq(".weblogin #newimgcode").attr("src", "/NewShowStand/Image.aspx?type=login&v=" + random + "");
    }, 0.001);
}

//以下第14套模板用到
//点击询价弹出窗口
var InQuiryHtml;
var InQuiryHtmlNew;
var InQuiryranNum;
function showInquiry() {
    InQuiryranNum = jq("#ranNum").val();
    if (jQuery('#title_' + InQuiryranNum).val() == "$MSG_Title") {
        jQuery('#title_' + InQuiryranNum).val("");
        jQuery('#Productid_' + InQuiryranNum).val("");
        jQuery('#proID_' + InQuiryranNum).val("");
    }
    Boxy.alert(jq(".inquiry").show(), '', { width: "710px", "showCloseBtn": [], "hideFrame": 1 });
    InQuiryHtml = "<div class=\"inquiry\" style=\"display:none\">" + jQuery(".inquiry").html() + "</div>";
    try {
        toSelect("#province", "#provinceList");
    }
    catch (err) {

    }
}

function showInputWrong(input,txt) {
    input.siblings('.Wrong').html(txt).show();
    input.siblings('.Wrong').css("background", "url(https://public.mtnets.com/Images/public/prompt.png) no-repeat 0 -125px");
    input.focus();
}
//结构不同;在线留言提示
function showInputWrongText(input,txt) {
    input.parent().parent().find('.Wrong').html(txt).show();
    input.focus();
}
function showInputSucc(input) {
    input.siblings('.Wrong').html('').show();
    input.siblings('.Wrong').css("background", "url(https://public.mtnets.com/Images/public/prompt.png) no-repeat 0 -60px");
}
function IsMobile(str){  
          var myreg=/^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;  
          if (!myreg.test(str)) {  
              return false;  
          } else {  
              return true;  
          }  
} 
 function ClearFristInfo(clint, info, stype) {
        if (stype == 1) {
            if (document.getElementById(clint).value == info) {
                document.getElementById(clint).value = '';
            }
        }
        else if (document.getElementById(clint).value == "")
            document.getElementById(clint).value = info;
    }
//模似select
	  function ToNewSelect(selectTop, selectBot) {
			jQuery(selectTop).parent().each(function(i) {
				jQuery(this).css('z-index', -(i) + 100);
			});

			jQuery(selectTop).click(function(event) {
				event.stopPropagation();
				jQuery(this).siblings(selectBot).slideToggle(300);
				jQuery(this).toggleClass("focus");
			});
			jQuery(selectBot).find("li").click(function(event) {
				event.stopPropagation();
				jQuery(this).parent(selectBot).siblings(selectTop).find("p").text(jQuery(this).text());
				jQuery(this).parent(selectBot).slideUp(300);
				jQuery(this).parent(selectBot).siblings(selectTop).removeClass("focus");

			});
			jQuery('html,body').click(function(event) {
				if (jQuery(event.target).closest(selectTop).length == 0) {
					jQuery(selectBot).slideUp(300);
					jQuery(selectTop).removeClass("focus");
				}
			});
     }
function WXPublicCopyMobile(){
InQuiryranNum = jQuery("#ranNum").val();
var _tel= jQuery('#tel_' + InQuiryranNum).val();
if(IsMobile(_tel))
{
jQuery('#WX_' + InQuiryranNum).val(_tel)
}
}
function WXCopyMobile(){
var _tel= jQuery('#InqTelphone').val();
if(IsMobile(_tel))
{
    jQuery('#InqWXTel').val(_tel)
}
} 

function openOrderBox() {
    if (jQuery("#KFCenterScreen").length > 0 && !jQuery("#KFCenterScreen").is(':hidden')) {
        jQuery("#KFCenterScreen .accept").click();
        jQuery("#KFCenterScreen .Open-Xwt").click();
    }
    else if (jQuery("#KFRightScreen a").length > 0) {
        ChatBoxClick();
    }
    else if (jQuery(".Xwt").length > 0 && jQuery(".OnlineBtn").length > 0) {
        ChatBoxClick();
    }
    else {
        showInquiry();
    }
    return false;
}
function showInquiryTab(objtitle, objid) {
    InQuiryHtml = "<div class=\"inquiry\" style=\"display:none\">" + jQuery(".inquiry").html() + "</div>";
    InQuiryranNum = jq("#ranNum").val();
    jQuery('#title_' + InQuiryranNum).val(objtitle);
    jQuery('#Productid_' + InQuiryranNum).val(objid);
    jQuery('#proID_' + InQuiryranNum).val(objid);
    Boxy.alert(jq(".inquiry").show(), '', { width: "710px", "showCloseBtn": [], "hideFrame": 1 });
    try {
        toSelect("#province", "#provinceList");
    }
    catch (err) {

    }

}


function showInquiry2022(type) {   
  //  是否要跳转到手机页面  
   if(typeof(intSkinID)!="undefined")
   {
       if(intSkinID==110 || intSkinID==111 || intSkinID==112)
       {
            var CompanyID = document.getElementById("cid").value;
            var u = navigator.userAgent;
            if (!!u.match(/AppleWebKit.*Mobile.*/)) {//判断是否为手机端
                window.location.href = "/st" + CompanyID + "/inquiry.html";
            }
       }
   }
//    jQuery('.hidtitle').show();
//    if(type=="1")
//    {
//        jQuery('.hidtitle').hide(); //非产品留言
//    }
    InQuiryHtmlNew = jQuery("#view-inquiry").html() ;
    InQuiryranNum = jQuery("#ranNum").val();
    if (jQuery('#title_' + InQuiryranNum).val() == "$MSG_Title") {
        jQuery('#title_' + InQuiryranNum).val("");
        jQuery('#Productid_' + InQuiryranNum).val("");
        jQuery('#proID_' + InQuiryranNum).val("");
    } 
    jQuery("#view-inquiry").show();
    try {  
        ToNewSelect(".view-select-top", ".view-select-bot");
        jQuery("#imgValCode").attr("src","/NewShowStand/Image.aspx?type=VnumNew&v="+Math.random());
    }
    catch (err) {

    }
}  
function showInquiryTab2022(objtitle,objid,type) {
    jQuery('.hidtitle').show();//非产品留言,切换回
    InQuiryHtmlNew = jQuery("#view-inquiry").html();
    InQuiryranNum = jQuery("#ranNum").val();
    jQuery('#title_' + InQuiryranNum).val(objtitle);
    jQuery('#Productid_' + InQuiryranNum).val(objid);
    jQuery('#proID_' + InQuiryranNum).val(objid); 
    jQuery("#view-inquiry").show(); 
    if(typeof(type)!="undefined")
    {
     if (type == "1"||type=="0") {
        jQuery("#orderType").val(type);
     }
    }
    try { 
        ToNewSelect(".view-select-top", ".view-select-bot");
         jQuery("#imgValCode").attr("src","/NewShowStand/Image.aspx?type=VnumNew&v="+Math.random()); 
    }
    catch (err) {

    }
}
 //在线留言通用方法20 22 23 101
function SubmitMessageForInquiry(type) {
    jq(".Wrong").hide();
    var cid = jq.trim(jq("#cid").val());
    if (cid == null || cid == "" || cid == "0") { 
         if(intSkinID=="101") 
               Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
         else
            alertBoxShow("提示", "", "无此公司,ID错误！", function () { location.reload(); });
        return;
    }
    var InqContent = jq.trim(jq("#InqContent").val());
    var InqName = jq.trim(jq("#InqName").val());
    var InqCompany = jq.trim(jq("#InqCompany").val());
    var InqTelphone = jq.trim(jq("#InqTelphone").val());
    var InqEmail = jq.trim(jq("#InqEmail").val());
    var InqProduct = jq.trim(jq("#InqProduct").val());
    //var proID = jq.trim(jq("#proID").val());
    var InqCode = jq.trim(jq("#InqCode").val());
    var InqAddress = jq.trim(jq("#InqAddress").val());
    var IsNoSend = jq('input:radio[name="isnosend1"]:checked').val();
    var WXTel = jq.trim(jq("#InqWXTel").val()); 
     var Post = jQuery('#job').text();
     var orderType = "0";
     if (typeof (Post) == "undefined") {
        Post = "";
    }
    if (typeof (IsNoSend) == "undefined") {
        IsNoSend = "0";
    }
    if(document.getElementById("agree")!=null)
     {
        if(document.getElementById("agree").checked==false)
        {
            IsNoSend = "0";
        }	
    } 
    if(Post=="请选择职务")
    {
        Post="";
    }
    if(WXTel=="微信号")
    {
        WXTel="";
    } 
    if ( InqProduct == "" || InqProduct == "请输入你感兴趣的产品" ) {
        showInputWrongText(jq("#InqProduct"), "请输入你感兴趣的产品");
        return;
    }
//     if (type != "1" && (InqProduct == "" || InqProduct == "请输入你感兴趣的产品")) {
//        showInputWrongText(jq("#InqProduct"), "请输入你感兴趣的产品");
//        return;
//    }
//    
    if (InqContent == "" ||InqContent == "请简单描述您的需求" || InqContent == "如对采购产品有详细要求，请在此输入....") {
        InqContent = "";
    }
    if(InqContent == "")
    {
        jq("#InqContent").parent().parent().parent().parent().find('.Wrong').html("请简单描述您的需求").show(); 
        jq("#InqContent").focus();  
        return;
    }
    else if (InqContent.length > 200) {
        //showInputWrong(jq("#InqContent"), "补充说明请控制在200字以内");
        jq("#InqContent").parent().parent().parent().parent().find('.Wrong').html("补充说明请控制在200字以内").show(); 
        jq("#InqContent").focus();
        return;
    }
	//包含  http 或https 或.com  .cn  .net  .php,.asp,.jsp 的  提示
	if (InqContent.length > 0) {
		var tempInqContent=InqContent.toLowerCase();
		if ( tempInqContent.indexOf("http")>-1 || tempInqContent.indexOf("https")>-1 || tempInqContent.indexOf(".com")>-1 || tempInqContent.indexOf(".cn")>-1|| tempInqContent.indexOf(".net")>-1|| tempInqContent.indexOf(".php")>-1|| tempInqContent.indexOf(".asp")>-1|| tempInqContent.indexOf(".jsp")>-1) {
			showInputWrong(jq("#InqContent"),   "留言信息中请勿包含网址，请修改后再次提交。");
			return;
		}
	}
    //同内容
    if(InqProduct=="")
    {
        InqProduct= InqContent;
    }
    if (InqCompany == "" || InqCompany == "请输入您的单位名称，个体经营者请填'个体经营'...") {
        InqCompany = "";
    }
    if (InqName == "" || InqName == "您的姓名...") {
        showInputWrongText(jq("#InqName"), "请填写您的姓名");
        return;
    }
    if (InqTelphone == "" || InqTelphone == "固定电话或手机...") {
        showInputWrongText(jq("#InqTelphone"), "请填写联系电话");
        return;
    } else {
        if (!IsTel(InqTelphone)) {
            showInputWrongText(jq("#InqTelphone"), "联系电话输入错误");
            return;
        }
    }
    //107模板的指定站点判断
    if(intSkinID=="107" && (location.href.indexOf("chem17")>-1 ||location.href.indexOf("a-bm")>-1))
    {
        if (InqCompany == ""  ) {
            showInputWrongText(jq("#InqCompany"), "请输入您的单位名称");
            return;
        }
        if (Post == "" ) {
            showInputWrongText(jq("#job"), "请选择职务");
            return;
        }
    }

    if (InqEmail == "" || InqEmail == "便于客户给您发邮件...") {
        InqEmail = "";
    }
    if (InqEmail != "" && InqEmail != "便于客户给您发邮件..." && !valid.isEMail(InqEmail)) {
        showInputWrongText(jq("#InqEmail"), "您填写的邮箱地址有误");
        return;
    }
	if(PvcID=="" ||PvcID=="0")
	{
	    PvcID = "0";
	}
    if(InqCode == "请输入计算结果")
    {
    InqCode = "";
    }
    if (InqCode == "") {
        showInputWrongText(jq("#InqCode"), "请填写验证码");
        return;
    }
//    try {
//        var _selpvc=jQuery("#selPvc .view-select-top p").text();
//        jQuery("#selPvc .view-select-bot li").each(function(){
//            if(_selpvc==jQuery(this).text())
//            {
//                PvcID=jQuery(this).attr("value");
//            } 
//        }) 
//    }
//    catch (error) { }
    AjaxClass.SendMsgOnlySaveNoSendMegAndReg(cid, InqProduct, "", InqName, InqCompany, InqTelphone, InqEmail, InqContent, InqAddress, InqCode, PvcID, orderType, "", 
    IsNoSend, WXTel, Post,InquiryOrderCallBack).value;

   // AjaxClass.SendMessage3(cid, InqProduct, "", InqName, InqCompany, InqTelphone, InqEmail, InqContent, InqAddress, InqCode, PvcID, IsNoSend, WXTel, SendMessageCallBack2);
}
 
function InquiryOrderCallBack(obj) { 
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功
            AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function () { return false; });
            document.getElementById('view-inquiry-success').style.display="block";
//            if(intSkinID=="101") 
//                Boxy.alert("发送成功！", function() { location.reload(); });
//            else
//                alertBoxShow("", "1", "发送成功！", function () { location.reload(); });
        } else {
            switch (jsonobj.Detail[0].Success) {
                case -1:
                    if(intSkinID=="101") 
                        Boxy.alert("验证码失效！请点击验证码进行刷新操作！");
                    else
                        alertBoxShow("", "2", "验证码失效！请点击验证码进行刷新操作！");
                    break;
                case -5:
                    if(intSkinID=="101") 
                        Boxy.alert("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                    else
                        alertBoxShow("", "2", "很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                    break;
                case -10:
                    if(intSkinID=="101") 
                        Boxy.alert("留言成功，邮件发送失败！");
                    else
                        alertBoxShow("", "2", "留言成功，邮件发送失败！");
                    break;
                case -2016001:
                    if(intSkinID=="101") 
                        Boxy.alert("失败！您发送信息太过频繁！");
                    else
                        alertBoxShow("", "2", "失败！您发送信息太过频繁！");
                    break;
                case -2016002:
                if(intSkinID=="101") 
                        Boxy.alert("失败！由于您曾频繁发送IP已经被封锁！");
                    else
                    alertBoxShow("", "2", "失败！由于您曾频繁发送IP已经被封锁！");
                    break;
                case 0:
                    if(intSkinID=="101") 
                        Boxy.alert("提交失败，请勿重复留言！");
                    else
                        alertBoxShow("", "2", "提交失败，请勿重复留言！");
                    break;
                default:
                    if(intSkinID=="101") 
                        Boxy.alert("数据写入失败！");
                    else
                        alertBoxShow("", "2", "数据写入失败！");
                    break;
            }
        }
    }
}

//==============



function showHideLogin() {
    if (jQuery('#LinkInfo').is(":hidden")) {
        jQuery('#LinkInfo').show();
        jQuery('#LoginforInquiry').hide();
        jQuery('#isLoginA').html("[登录]");
    }
    else {
        jQuery('#LinkInfo').hide();
        jQuery('#LoginforInquiry').show();
        jQuery('#isLoginA').html("[取消登录]");
    }
    jQuery("#username2").val("");
    jQuery("#password2").val("");
}
var fristLogin = 0;
function InquiryCheckLogin() {
    jq("#ErrorLogin").html("");
    jq("#ErrorLogin").hide();
    var username = jq("#username2").val();
    var password = jq("#password2").val();
    if (username == "" || password == "") {
        jq("#ErrorLogin").show();
        jq("#ErrorLogin").html("请输入账号和密码！");
        return;
    }
    var result = AjaxClass.CheckLogin("-999999", username, password).value;
    var jsonOjbect = eval("data=" + result);
    if (jsonOjbect.Error) {
        if (jsonOjbect.Error == "-2") {
            jq("#ErrorLogin").show();
            jq("#ErrorLogin").html("该账号不存在！");
        }
        else if (jsonOjbect.Error == "-1") {
            jq("#ErrorLogin").show();
            jq("#ErrorLogin").html("密码不正确！");
        }
        else {
            jq("#ErrorLogin").show();
            jq("#ErrorLogin").html("登陆失败！");
        }
    }
    else {
        if (jsonOjbect.LoginCompany) {
            jq("#linkMan_" + InQuiryranNum).val(jsonOjbect.LoginCompany.LinkMan);
            jq("#companyName_" + InQuiryranNum).val(jsonOjbect.LoginCompany.CompanyName);
            jq("#tel_" + InQuiryranNum).val(jsonOjbect.LoginCompany.TelPhone);
            jq("#email_" + InQuiryranNum).val(jsonOjbect.LoginCompany.Email);
            jq("#addr_" + InQuiryranNum).val(jsonOjbect.LoginCompany.Address);
        }
        else {
            jq("#linkMan_" + InQuiryranNum).val(jsonOjbect.LoginUser.TrueName);
            jq("#tel_" + InQuiryranNum).val(jsonOjbect.LoginUser.TelPhone);
            jq("#email_" + InQuiryranNum).val(jsonOjbect.LoginUser.Email);
            jq("#addr_" + InQuiryranNum).val(jsonOjbect.LoginUser.Address);
        }
        jq("#topUserName").html(jsonOjbect.LoginUser.TrueName);
        jq("#msgBottom").html("您已成功登陆");
        jq("#notLogin").hide();
        jq("#loginYet").show();
        jq(".friendly").hide();
        jQuery('#LinkInfo').show();
        jQuery('#LoginforInquiry').hide();
        jQuery('#isLoginA').html("[已登录]");
        jQuery('#isLoginA').removeAttr("onclick");
        fristLogin = 1;
    }
}
//86175三种展台使用
function checknewLogin() {
    var username = jq("#username").val();
    var password = jq("#password").val();
    var validcode = jq("#validcode").val();
    jq("#username").parent().parent().find("font").html("");
    if (username == "") {
        jq("#username").parent().find("font").html(" 请输入您的账号");
        return;
    }
    if (password == "") {
        jq("#password").parent().find("font").html(" 请输入您的密码");
        return;
    }
    if (validcode == "") {
        jq("#validcode").parent().find("font").html(" 请输入验证码");
        return;
    }
    var result = AjaxClass.CheckLogin(validcode, username, password).value;
    if (result == "-1") {
        jq("#validcode").parent().find("font").html(" 验证码有误");
    }
    else {
        var jsonOjbect = eval("data=" + result);
        if (jsonOjbect.Error) {
            if (jsonOjbect.Error == "-2") {
                jq("#username").parent().find("font").html("请填写正确的用户名和密码");
            }
            else if (jsonOjbect.Error == "-1") {
                jq("#password").parent().find("font").html(" 密码不正确");
            }
            else {
                jq("#username").parent().find("font").html(" 登陆失败");
            }
        }
        else {
            //            location.reload();
            var ranNum = jq("#ranNum").val();
            if (jsonOjbect.LoginCompany) {
                jq("#linkMan_" + ranNum).val(jsonOjbect.LoginCompany.LinkMan);
                jq("#companyName_" + ranNum).val(jsonOjbect.LoginCompany.CompanyName);
                jq("#tel_" + ranNum).val(jsonOjbect.LoginCompany.TelPhone);
                jq("#email_" + ranNum).val(jsonOjbect.LoginCompany.Email);
                jq("#addr_" + ranNum).val(jsonOjbect.LoginCompany.Address);
            }
            else {
                jq("#linkMan_" + ranNum).val(jsonOjbect.LoginUser.TrueName);
                jq("#tel_" + ranNum).val(jsonOjbect.LoginUser.TelPhone);
                jq("#email_" + ranNum).val(jsonOjbect.LoginUser.Email);
                jq("#addr_" + ranNum).val(jsonOjbect.LoginUser.Address);
            }
            jq("#topUserName").html(jsonOjbect.LoginUser.TrueName);
            jq("#msgBottom").html("您已成功登陆");
            jq("#notLogin").hide();
            jq("#loginYet").show();
            jq(".tipbox").hide();
            Boxy.hide();
        }
    }
}
//提交留言
function InquirySubmitMessage(type) {
    var cid = jq.trim(jq("#cid").val());
    if (cid == null || cid == "" || cid == "0") {
        Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
        return;
    }
    var ranNum = jq.trim(jq("#ranNum").val());
    var detail = jq.trim(jq("#detail_" + ranNum).val());
    var linkMan = jq.trim(jq("#linkMan_" + ranNum).val());
    var companyName = jq.trim(jq("#companyName_" + ranNum).val());
    var tel = jq.trim(jq("#tel_" + ranNum).val());
    var email = jq.trim(jq("#email_" + ranNum).val());
    var title = jq.trim(jq("#title_" + ranNum).val());
    var proID = jq.trim(jq("#proID_" + ranNum).val());
    var valCode = jq.trim(jq("#valCode").val());
    var addr = jq.trim(jq("#addr_" + ranNum).val());
    var orderType = "0";

    if (jq("#orderType").length > 0) {
        orderType = jq("#orderType").val();
    }
    jq(".addFont").hide(); jq("#LinkError").hide(); jq("#LinkManError").html(""); jq("#TelPhoneError").html(""); jq("#EmailError").html("");
    if (type == "1" && (title == "" || title == "请输入你感兴趣的产品")) {
        jq("#title_" + ranNum).parent().append("<font color=\"red\" class=\"addFont\">" + " 请输入产品名称</font>");
        jq("#title_" + ranNum).focus();
        return;
    }
    if (linkMan == "" || linkMan == "您的姓名...") {
        jq("#LinkError").show(); jq("#LinkManError").html("请填写您的姓名");
        jq("#linkMan_" + ranNum).focus();
        return;
    }
    if (companyName == "" || companyName == "请输入您的单位名称，个体经营者请填'个体经营'...") {
        companyName = "";
    }
    if (tel == "" || tel == "固定电话或手机...") {
        jq("#LinkError").show(); jq("#TelPhoneError").html("请填写联系电话");
        jq("#tel_" + ranNum).focus();
        return;
    } else {
        if (!IsTel(tel)) {
            jq("#LinkError").show(); jq("#TelPhoneError").html("手机号只能输入纯数字");
            jq("#tel_" + ranNum).focus();
            return;
        }
    }
    if (email == "" || email == "便于客户给您发邮件...") {
        email = "";
    }
    if (email != "" && email != "便于客户给您发邮件..." && !valid.isEMail(email)) {
        jq("#LinkError").show(); jq("#EmailError").html("您填写的邮箱地址有误");
        jq("#email_" + ranNum).focus();
        return;
    }
    if (detail == "" || detail == "如对采购产品有详细要求，请在此输入....") {
        detail = "";
    }
    else if (detail.length > 200) {
        showError(jq("#detail_" + ranNum), "补充说明请控制在200字以内", type);
        return;
    }
	//包含  http 或https 或.com  .cn  .net 的  提示
	if (detail.length > 0) {
		var tempInqContent=detail.toLowerCase();
		if ( tempInqContent.indexOf("http")>-1 || tempInqContent.indexOf("https")>-1 || tempInqContent.indexOf(".com")>-1 || tempInqContent.indexOf(".cn")>-1|| tempInqContent.indexOf(".net")>-1|| tempInqContent.indexOf(".php")>-1|| tempInqContent.indexOf(".asp")>-1|| tempInqContent.indexOf(".jsp")>-1) {
			showError(jq("#detail_" + ranNum), "留言信息中请勿包含网址，请修改后再次提交。", type);
			return;
		}
	}
    if (PvcID == "" || PvcID == "0") {
        PvcID = "0";
    }

    if (valCode == "") {
        showError(jq("#valCode"), "请填写验证码", type);
        return;
    }
    jq('#AllDiv').css("height", jq(document).height());
    jq('#divIndicator2').css("left", jQuery('.inquiry').offset().left + 300);
    jq('#divIndicator2').css("top", jQuery('.inquiry').offset().top + 209);
    jq('#AllDiv').show();
    jq('#divIndicator2').show();
    jq("#SendError").hide();
    AjaxClass.NewSendMessage(cid, title, proID, linkMan, companyName, tel, email, detail, addr, valCode, PvcID, orderType, InquirySendMessageCallBack).value;
}

var oTimer;
var outTimeHides = 5
function InquirySendMessageCallBack(obj) {
    jq('#AllDiv').hide();
    jq('#divIndicator2').hide();
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功
            AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function () { return false; });
            Boxy.alert("<div class='successinquiry'><div class='successboxinquiry'><p>您的留言已提交成功！我们将在第一时间回复您~<br /><span id='outTimeHide' style='color:red'>" + outTimeHides + "</span> 秒钟后自动关闭，没关闭请<a href=\"javascript:void(0);\" onclick=\"jQuery('#inquiry').html(InQuiryHtml);Boxy.hide();\">点击这里</a></p></div><br class='clear' /></div>", '', { "showCloseBtn": [], "hideFrame": 1 });
            oTimer = setInterval("HideThisBox()", "800");

        } else {
            switch (NewOrderID) {
            case -1:
                jq("#SendError").show();
                jq("#SendError").html("验证码失效！请点击验证码进行刷新操作！");
                break;
            case -5:
                jq("#SendError").show();
                jq("#SendError").html("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                break;
            case -10:
                Boxy.alert("留言成功，邮件发送失败！");
                //                jq("#SendError").show();
                //                jq("#SendError").html("留言成功，邮件发送失败！");
                break;
            default:
                jq("#SendError").show();
                jq("#SendError").html("数据写入失败!");
                break;
            }
        }
    } else {
        jq("#SendError").show();
        jq("#SendError").html(jsonobj.Error);
    }
}

function HideThisBox() {
    outTimeHides--;
    jq('#outTimeHide').html(outTimeHides);
    if (outTimeHides < 0) {
        jQuery('#inquiry').html(InQuiryHtml);
        Boxy.hide();
        outTimeHides = 5;
        oTimer = window.clearInterval(oTimer);
        //        location.reload();
    }
}

//以上第14套模板用到

function checkLogin() {
    var username = jq("#username").val();
    var password = jq("#password").val();
    var validcode = jq("#validcode").val();
    jq("#username").parent().parent().find("font").html("");
    if (username == "") {
        jq("#username").parent().find("font").html(" 请输入您的账号");
        return;
    }
    if (password == "") {
        jq("#password").parent().find("font").html(" 请输入您的密码");
        return;
    }
    if (validcode == "") {
        jq("#validcode").parent().find("font").html(" 请输入验证码");
        return;
    }
    var isonline = "";
    if (jq(".weblogin b").html() == "采购商登录") {
        isonline = "1";
    }
    var result = AjaxClass.CheckLoginOnline(validcode, username, password, isonline).value;
    if (result == "-1") {
        jq("#validcode").parent().find("font").html(" 验证码有误");
    }
    else {
        var jsonOjbect = eval("data=" + result);
        if (jsonOjbect.Error) {
            if (jsonOjbect.Error == "-2") {
                jq("#username").parent().find("font").html(" 该账号不存在");
            }
            else if (jsonOjbect.Error == "-1") {
                jq("#password").parent().find("font").html(" 密码不正确");
            }
            else {
                jq("#username").parent().find("font").html(" 登陆失败");
            }
        }
        else {
            if (jsonOjbect.LoginUser.UserType != "6" && isonline == "1") {
                jq("#tips-box1").show();
            }
            var ranNum = jq("#ranNum").val();
            if (jsonOjbect.LoginCompany) {
                jq("#linkMan_" + ranNum).val(jsonOjbect.LoginCompany.LinkMan);
                jq("#companyName_" + ranNum).val(jsonOjbect.LoginCompany.CompanyName);
                jq("#tel_" + ranNum).val(jsonOjbect.LoginCompany.TelPhone);
                jq("#email_" + ranNum).val(jsonOjbect.LoginCompany.Email);
                jq("#addr_" + ranNum).val(jsonOjbect.LoginCompany.Address);
            }
            else {
                jq("#linkMan_" + ranNum).val(jsonOjbect.LoginUser.TrueName);
                jq("#tel_" + ranNum).val(jsonOjbect.LoginUser.TelPhone);
                jq("#email_" + ranNum).val(jsonOjbect.LoginUser.Email);
                jq("#addr_" + ranNum).val(jsonOjbect.LoginUser.Address);
            }
            jq("#topUserName").html(jsonOjbect.LoginUser.TrueName);
            jq("#msgBottom").html("您已成功登陆");
            jq("#notLogin").hide();
            jq("#loginYet").show();
            jq(".friendly").hide();
            Boxy.hide();
        }
    }
}

//退出登陆
function outLogin() {
    AjaxClass.OutLogin();
    location.reload();
}

//提交留言
function submitMessage(type) {
    var cid = jq.trim(jq("#cid").val());
    if (cid == null || cid == "" || cid == "0") {
        Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
        return;
    }
    var ranNum = jq.trim(jq("#ranNum").val());
    var detail = jq.trim(jq("#detail_" + ranNum).val());
    var linkMan = jq.trim(jq("#linkMan_" + ranNum).val());
    var companyName = jq.trim(jq("#companyName_" + ranNum).val());
    var tel = jq.trim(jq("#tel_" + ranNum).val());
    var email = jq.trim(jq("#email_" + ranNum).val());
    var title = jq.trim(jq("#title_" + ranNum).val());
    var proID = jq.trim(jq("#proID_" + ranNum).val());
    var valCode = jq.trim(jq("#valCode").val());
    var addr = jq.trim(jq("#addr_" + ranNum).val());
    var orderType = "0";
    if (window.location.href.indexOf('Flag1') > -1) {
        orderType = "1";
    }
    jq(".addFont").hide();
    if (type == "1" && (title == "" || title == "请输入你感兴趣的产品")) {
        showError(jq("#title_" + ranNum), "请输入产品名称", type);
        return;
    }
    if (linkMan == "") {
        showError(jq("#linkMan_" + ranNum), "请填写您的姓名", type);
        return;
    }
    if (companyName == "") {
        companyName = "";
    }
    if (tel == "") {
        showError(jq("#tel_" + ranNum), "请填写联系电话", type);
        return;
    } else {
        if (!IsTel(tel)) {
            showError(jq("#tel_" + ranNum), "手机号只能输入纯数字", type);
            return;
        }
    }
    if (email == "" || email == "便于客户给您发邮件...") {
        email = "";
    }
    if (email != "" && !valid.isEMail(email)) {
        showError(jq("#email_" + ranNum), "您填写的邮箱地址有误", type);
        return;
    }
    if (detail == "" || detail == "如对采购产品有详细要求，请在此输入....") {
        detail = "";
    }
    else if (detail.length > 200) {
        showError(jq("#detail_" + ranNum), "补充说明请控制在200字以内", type);
        return;
    }
    try {
        if (document.getElementById("selPvc") != null) {
            var selectOb = document.getElementById("selPvc");
            var index = selectOb.selectedIndex;
            if (selectOb.options[index].value != "0")
                PvcID = selectOb.options[index].value;

        }
    }
    catch (error) { }

    if (PvcID == "" || PvcID == "0") {
        PvcID = "0";
    }
    if (valCode == "") {
        showError(jq("#valCode"), "请填写验证码", type);
        return;
    }
    Boxy.showLoading({ "loginJudge": false });
    AjaxClass.NewSendMessage(cid, title, proID, linkMan, companyName, tel, email, detail, addr, valCode, PvcID, orderType, SendMessageCallBack).value;
}

function SendMessageCallBack(obj) {
    Boxy.hide();
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功
            AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function() { return false; });
            Boxy.alert("发送成功！", function () { location.reload(); });

        } else {
            switch (jsonobj.Detail[0].Success) {
            case -1:
                Boxy.alert("验证码失效！请点击验证码进行刷新操作！");
                break;
            case -5:
                Boxy.alert("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                break;
            case -10:
                Boxy.alert("留言成功，邮件发送失败！");
                break;
            case -2016001:
                Boxy.alert("失败！您发送信息太过频繁！");
                break;
            case -2016002:
                Boxy.alert("失败！由于您曾频繁发送IP已经被封锁！");
                break;
            default:
                Boxy.alert("数据写入失败！");
                break;
            }
        }
    }
}

//function ChktxtDetail() {
//       var ranNum = jq.trim(jq("#ranNum").val());
//       var detail = jq.trim(jq("#detail_" + ranNum).val());
//	 
//        if (detail.length != 0 && detail != '请简单描述您的需求') {
//            showInputSucc(jq("#detail_" + ranNum)); 
//        }
////        else {
////            showInputWrong(jq("#detail_" + ranNum), "请简单描述您的需求");
////        } 
//    }
//   function ChktxtLinkMan() {
//       var ranNum = jq.trim(jq("#ranNum").val());
//       var detail = jq.trim(jq("#linkMan_" + ranNum).val());
// 
//        if (detail.length != 0 && detail != '您的姓名') {
//            showInputSucc(jq("#linkMan_" + ranNum)); 
//        } 
//    }
//     function ChktxtTel() {
//       var ranNum = jq.trim(jq("#ranNum").val());
//       var detail = jq.trim(jq("#tel_" + ranNum).val());
// 
//        if (detail.length != 0 && detail != '固定电话或手机') {
//            showInputSucc(jq("#tel_" + ranNum)); 
//        }

////        else {
////            showInputWrong(jq("#tel_" + ranNum), "固定电话或手机");
////        } 
//    }
//提交留言

function submitMessage2022(type) {
    submitMessageVnumNew2022(type,"");
}

function submitMessageVnumNew2022(type,VnumNew) {
    var cid = jq.trim(jq("#cid").val());
    if (cid == null || cid == "" || cid == "0") {
        Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
        return;
    }
    var ranNum = jq.trim(jq("#ranNum").val());
    var detail = jq.trim(jq("#detail_" + ranNum).val());
    var linkMan = jq.trim(jq("#linkMan_" + ranNum).val());
    var companyName = jq.trim(jq("#companyName_" + ranNum).val());
    var tel = jq.trim(jq("#tel_" + ranNum).val());
    var email = jq.trim(jq("#email_" + ranNum).val());
    var title = jq.trim(jq("#title_" + ranNum).val());
    var proID = jq.trim(jq("#proID_" + ranNum).val());
    var valCode = jq.trim(jq("#valCode").val());
    var addr = jq.trim(jq("#addr_" + ranNum).val());
    var IsNoSend = jq('input:radio[name="isnosend"]:checked').val();
    var WXtel = jq.trim(jq("#WX_" + ranNum).val());
    var Post = jQuery('#selPost .view-select-top').text();
    if (typeof (Post) == "undefined") {
        Post = "";
     } 
     if (typeof (IsNoSend) == "undefined") {
        IsNoSend = "0";
     } 
     if(document.getElementById("agree")!=null)
     {
        if(document.getElementById("agree").checked==false)
        {
            IsNoSend = "0";
        }	
    } 
    if (typeof (proID) == "undefined") {
        proID = "0"; 
     }
     var orderType = "0"; 
     if(typeof(jQuery("#orderType").val())!="undefined")
     {
        orderType=jQuery("#orderType").val()
     }
     if (window.location.href.indexOf('Flag1') > -1) {
        orderType = "1";
    }
    if ( Post == "请选择职务") { 
         Post="";
    }
    if ( WXtel == "微信号") { 
         WXtel="";
    }
    if (companyName == "请输入您的单位名称") {
        companyName = "";
    }
    if (detail == "如对采购产品有详细要求，请在此输入...." || detail == "请简单描述您的需求" ) {
        detail = "";
    }
    if ( tel == "固定电话或手机") { 
         tel="";
    }  
    if ( linkMan == "您的姓名") { 
         linkMan="";
    }  
    if ( email == "便于客户给您发邮件") { 
         email="";
    }   
     if ( valCode == "请输入结果"|| valCode == "请输入计算结果") { 
         valCode="";
    }   
    if ( title == "" || title == "请输入你感兴趣的产品") {
        showInputWrong(jq("#title_" + ranNum), "请输入你感兴趣的产品");   
        return;
    } 
//    if (type!= "1" && (title == "" || title == "请输入你感兴趣的产品")) {
//        showInputWrong(jq("#title_" + ranNum), "请输入产品名称");  //type =1 是原来不需要标题的
//        return;
//    } 
    if (detail == ""  ) {
        showInputWrong(jq("#detail_" + ranNum), "请简单描述您的需求");
        return;
    }
    else if (detail.length > 200) {
        showInputWrong(jq("#detail_" + ranNum), "需求请控制在200字以内");
        return;
    }
    if (linkMan == "") {
        showInputWrong(jq("#linkMan_" + ranNum), "请填写您的姓名");
        return;
    }
    showInputSucc(jq("#linkMan_" + ranNum)); 

    if (tel == "" ) {
        showInputWrong(jq("#tel_" + ranNum), "请填写联系电话");
        return;
    } else {
        if (!IsTel(tel)) {
            showInputWrong(jq("#tel_" + ranNum), "手机号只能输入纯数字");
            return;
        }
    }
   showInputSucc(jq("#tel_" + ranNum));

     //107模板的指定站点判断
    if(intSkinID=="107" && (location.href.indexOf("chem17")>-1 ||location.href.indexOf("a-bm")>-1))
    {
        if (companyName == ""  ) {
            showInputWrong(jq("#companyName_" + ranNum), "请输入您的单位名称");
            return;
        }
         showInputSucc(jq("#companyName_"+ ranNum));
        if (Post == "" ) {
            showInputWrong(jq("#selPost .view-select-bot"), "请选择职务");
            return;
        }
         showInputSucc(jq("#selPost .view-select-bot"));
    }

    if (email != "" && !valid.isEMail(email)) {
        showInputWrong(jq("#email_" + ranNum), "您填写的邮箱地址有误");
        return;
    }
    if (detail == ""){
        showInputWrong(jq("#detail_" + ranNum), "请简单描述您的需求");
    }
    else if (detail.length > 200) {
        showInputWrong(jq("#detail_" + ranNum), "补充说明请控制在200字以内");
        return;
    }
    try {
        var _selpvc=jQuery("#selPvc .view-select-top p").text();
        jQuery("#selPvc .view-select-bot li").each(function(){
            if(_selpvc==jQuery(this).text())
            {
                PvcID=jQuery(this).attr("value");
            } 
        }) 
    }
    catch (error) { }

    
    
     
    if (valCode == "") {
        showInputWrong(jq("#valCode"), "请填写验证码", type);
        return;
    }
     showInputSucc(jq("#valCode"));  
    // if(title==""){title=detail;}//标题为空
    AjaxClass.SendMsgOnlySaveNoSendMegAndReg(cid, title, proID, linkMan, companyName, tel, email, detail, addr, valCode, PvcID, orderType, VnumNew, 
    IsNoSend, WXtel, Post,SendMsgOnlySaveNoSendMegAndRegCallBack).value;
}
function SendMsgOnlySaveNoSendMegAndRegCallBack(obj) {
   // Boxy.hide();
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功
            AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function() { return false; });
            document.getElementById('view-inquiry-success').style.display="block";
            //Boxy.alert("发送成功！", function() { location.reload(); });

        } else {
            switch (jsonobj.Detail[0].Success) {
            case -1:
                showInputWrong(jq("#valCode"), "验证码失效！请点击验证码进行刷新操作！");
                jQuery("#valCode").siblings('.Wrong').css("background", "url(https://public.mtnets.com/Images/public/prompt.png) no-repeat 0 -125px");
                break;
            case -5:
                jQuery("#valCode").siblings('.Wrong').html("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！").show();
                jQuery("#valCode").siblings('.Wrong').css("background", "url(https://public.mtnets.com/Images/public/prompt.png) no-repeat 0 -125px");
                break;
            case -10:
                alert("留言成功，邮件发送失败！");
//                jq("#valCode").siblings('.Wrong').html("留言成功，邮件发送失败！").show();
                break;
            case -11:
                alert("留言信息中请勿包含网址，请修改后再次提交！");
                break;
			case -2016001:
                    alert( "失败！您发送信息太过频繁！");
                    break;
             case -2016002:
                    alert( "失败！由于您曾频繁发送IP已经被封锁！");
                    break;
            case 0:
                document.getElementById('view-inquiry-fail').style.display="block";
                break;
            default:
                jQuery("#valCode").siblings('.Wrong').html("数据写入失败!").show();
                jQuery("#valCode").siblings('.Wrong').css("background", "url(https://public.mtnets.com/Images/public/prompt.png) no-repeat 0 -125px");
                break;
            }
        }
        if (intSkinID == 14 || intSkinID == 15 || intSkinID == 16)
        {
            jQuery('#inquiry').html(InQuiryHtml);
            jQuery('.boxy-modal-blackout').hide();
        }
    }
}

//提交留言
function submitMessage3(type) {
    var cid = jq.trim(jq("#cid").val());
    if (cid == null || cid == "" || cid == "0") {
        Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
        return;
    }
    var ranNum = jq.trim(jq("#ranNum").val());
    var detail = jq.trim(jq("#detail_" + ranNum).val());
    var linkMan = jq.trim(jq("#linkMan_" + ranNum).val());
    var companyName = jq.trim(jq("#companyName_" + ranNum).val());
    var tel = jq.trim(jq("#tel_" + ranNum).val());
    var email = jq.trim(jq("#email_" + ranNum).val());
    var title = jq.trim(jq("#title_" + ranNum).val());
    var proID = jq.trim(jq("#proID_" + ranNum).val());
    var valCode = jq.trim(jq("#valCode").val());
    var addr = jq.trim(jq("#addr_" + ranNum).val());
    var IsNoSend = jq('input:radio[name="isnosend"]:checked').val();
    var WXtel = jq.trim(jq("#WX_" + ranNum).val());
    if (typeof (IsNoSend) == "undefined") {
        IsNoSend = "0";//默认不转发
     }
    var orderType = "0";
    if (window.location.href.indexOf('Flag1') > -1) {
        orderType = "1";
    }
    jq(".addFont").hide();
    if (type == "1" && (title == "" || title == "请输入你感兴趣的产品")) {
        showError(jq("#title_" + ranNum), "请输入产品名称", type);
        return;
    }
    if (linkMan == "") {
        showError(jq("#linkMan_" + ranNum), "请填写您的姓名", type);
        return;
    }
    if (companyName == "") {
        companyName = "";
    }
    if (tel == "") {
        showError(jq("#tel_" + ranNum), "请填写联系电话", type);
        return;
    } else {
        if (!IsTel(tel)) {
            showError(jq("#tel_" + ranNum), "手机号只能输入纯数字", type);
            return;
        }
    }
    if (email == "" || email == "便于客户给您发邮件...") {
        email = "";
    }
    if (email != "" && !valid.isEMail(email)) {
        showError(jq("#email_" + ranNum), "您填写的邮箱地址有误", type);
        return;
    }
    if (detail == "" || detail == "如对采购产品有详细要求，请在此输入....") {
        detail = "";
    }
    else if (detail.length > 200) {
        showError(jq("#detail_" + ranNum), "补充说明请控制在200字以内", type);
        return;
    }
    try {
        if (document.getElementById("selPvc") != null) {
            var selectOb = document.getElementById("selPvc");
            var index = selectOb.selectedIndex;
            if (selectOb.options[index].value != "0")
                PvcID = selectOb.options[index].value;

        }
    }
    catch (error) { }

    if (PvcID == "" || PvcID == "0") {
        PvcID = "0";
    }
    if (valCode == "") {
        showError(jq("#valCode"), "请填写验证码", type);
        return;
    }
    Boxy.showLoading({ "loginJudge": false });
    AjaxClass.NewSendMessage4(cid, title, proID, linkMan, companyName, tel, email, detail, addr, valCode, PvcID, orderType, "", IsNoSend, WXtel, SendMessageCallBack4).value;
}

function SendMessageCallBack4(obj) {
    Boxy.hide();
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功
            AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function() { return false; });
            Boxy.alert("发送成功！", function() { location.reload(); });

        } else {
            switch (jsonobj.Detail[0].Success) {
            case -1:
                Boxy.alert("验证码失效！请点击验证码进行刷新操作！");
                break;
            case -5:
                Boxy.alert("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                break;
            case -10:
                Boxy.alert("留言成功，邮件发送失败！");
                break;
            case -2016001:
                Boxy.alert("失败！您发送信息太过频繁！");
                break;
            case -2016002:
                Boxy.alert("失败！由于您曾频繁发送IP已经被封锁！");
                break;
            default:
                Boxy.alert("数据写入失败！");
                break;
            }
        }
        if (intSkinID == 14 || intSkinID == 15 || intSkinID == 16)
        {
            jQuery('#inquiry').html(InQuiryHtml);
            jQuery('.boxy-modal-blackout').hide()
        }
    }
}


//提交下载留言
function submitDownMessage(type) {
    var cid = jq.trim(jq("#cid").val());
    if (cid == null || cid == "" || cid == "0") {
        Boxy.alert("无此公司,ID错误！", function () { location.href = "/"; });
        return;
    }
    var ranNum = jq.trim(jq("#ranNum").val());
    // var detail=jq.trim(jq("#detail_"+ranNum).val());
    // var title=jq.trim(jq("#title_"+ranNum).val());
    var detail = "";
    var title = "";
    var linkMan = jq.trim(jq("#linkMan_" + ranNum).val());
    var companyName = jq.trim(jq("#companyName_" + ranNum).val());
    var tel = jq.trim(jq("#tel_" + ranNum).val());
    var email = jq.trim(jq("#email_" + ranNum).val());

    var proID = jq.trim(jq("#proID_" + ranNum).val());
    var valCode = jq.trim(jq("#valCode").val());
    var addr = jq.trim(jq("#addr_" + ranNum).val());
    jq(".addFont").hide();
    /*  if(type=="1"&&(title==""||title=="请输入你感兴趣的产品"))
    {
    showError(jq("#title_"+ranNum),"请输入留言主题",type);
    return;
    }*/
    if (linkMan == "") {
        showError(jq("#linkMan_" + ranNum), "请填写您的姓名", 1);
        return;
    }
    if (tel == "") {
        showError(jq("#tel_" + ranNum), "请填写联系电话", type);
        return;
    }
    else {
        var tel = document.getElementById('tel_' + ranNum).value;
        if (!/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(tel)) {
             showError(jq("#tel_" + ranNum),"固定电话有误，请重填", type);
            return false;
        }
    }
    if (companyName == "") {
        showError(jq("#companyName_" + ranNum), "请填写您的单位名称", type);
        return;
    }
    if (email == "") {
        showError(jq("#email_" + ranNum), "请填写您的常用邮箱", type);
        return;
    }
    if (email != "" && !valid.isEMail(email)) {
        showError(jq("#email_" + ranNum), "您填写的邮箱地址有误", type);
        return;
    }

    /*if(detail==""||detail=="您好,如果你对本公司产品感兴趣,请在此留言,谢谢!(限100字内)")
    {
    showError(jq("#detail_"+ranNum),"请填写留言内容",type);
    return;
    }
    else if(detail.length>200)
    {
    showError(jq("#detail_"+ranNum),"留言内容请控制在200字以内",type);
    return;
    }*/

    var _issendbuy = "";
    var radio = document.getElementsByName("issendbuy");
    for (var i = 0; i < radio.length; i++) {
        if (radio[i].checked) {
            _issendbuy = radio[i].value;
        }
    }
	if(document.getElementById("title_" + ranNum)!=undefined && document.getElementById("title_" + ranNum)!=null)
	{
		title=document.getElementById("title_" + ranNum).value;
		if(title==""){
			showError(jq("#title_" + ranNum), "请填写感兴趣的产品", type);
			return;
		}
			
		//if(title=="" && document.getElementById("PageDetailTitle")!=undefined && document.getElementById("PageDetailTitle")!=null && document.getElementById("PageDetailTitle").value!="")
		//{
			//title=document.getElementById("PageDetailTitle").value;
		//}
	}
    if (_issendbuy == "") {
        showError(jq("#showissendbuy"), "请选择采购计划", type);
        return;
    }
	var _SelRevHelp="";
	var PHck = document.getElementsByName("ProvidesHelp");
	for (var i = 0; i < PHck.length; i++) {
        if (PHck[i].checked) {
            _SelRevHelp=_SelRevHelp+","+PHck[i].value;
        }
    }
	if(_SelRevHelp==""){
		 //showError(jq("#showProvidesHelp"), "请选择", type);
		 alert("请选择需要提供哪些帮助？");
         return;		 
	}
 	
    if (valCode == "") {
        showError(jq("#valCode"), "请填写验证码", type);
        return;
    }
	
	var thisURL=window.parent.window.location.href;
    Boxy.showLoading({ "loginJudge": false });
    AjaxClass.SendDownMessage(cid, title, proID, linkMan, companyName, tel, email, detail, addr, _issendbuy, valCode,_SelRevHelp,thisURL,SendDownMessageCallBack).value;
}


function SendDownMessageCallBack(obj) {
    var _site = window.location.host;
    var ranNum = jq.trim(jq("#ranNum").val());
    var cid = jq.trim(jq("#cid").val());
    var filetype = jq.trim(jq("#filetype").val());
    var proID = jq.trim(jq("#proID_" + ranNum).val());
    if (cid == null || cid == "" || cid == "0" || proID == null || proID == "" || proID == "0") {
        Boxy.alert("无此公司,ID错误！", function () { location.href = location.href; });
        return;
    }
    var getStandDomain = AjaxClass.GetStandDomain(cid).value;
    Boxy.hide();
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        switch (jsonobj.Detail[0].Success) {
            case "-1":
                Boxy.alert("验证码失效！请点击验证码进行刷新操作！");
                break;
            case "-5":
                Boxy.alert("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                break;
            case "-10":
                Boxy.alert("留言成功，邮件发送失败！",function(){
					 if (filetype == "") { filetype = 'F' }; //F文件  I图片，具体见商铺DownLoadFile文件
						if (_site.indexOf("86175") > -1 || _site.indexOf("xwboo") > -1) {
						parent.location.href = getStandDomain + '/DownLoadFile_' + proID + '_' + filetype + '.html';
						}
						else {
							parent.location.href = getStandDomain + '/DownLoadFile_' + proID + '_' + filetype + '.html';
						}
						parent.dialog.reset33();
					 });
                break;
            case "10":
                Boxy.alert("留言成功！信息已经发送至对方邮箱！", function () { location.reload(); });
                break;
            case "1":
                if (filetype == "") { filetype = 'F' }; //F文件  I图片，具体见商铺DownLoadFile文件
                if (_site.indexOf("86175") > -1 || _site.indexOf("xwboo") > -1) {
                    parent.location.href = getStandDomain + '/DownLoadFile_' + proID + '_' + filetype + '.html';
                }
                else {
                    parent.location.href = getStandDomain + '/DownLoadFile_' + proID + '_' + filetype + '.html';
                }
                parent.dialog.reset33();
                break;
            case "-2016001":
                Boxy.alert("失败！您发送信息太过频繁！");
                break;
            case "-2016002":
                Boxy.alert("失败！由于您曾频繁发送IP已经被封锁！");
                break;
            default:
                Boxy.alert("数据写入失败！");
                break;
        }
    }
}


function showError(jqObj, text, type) {
    if (type == "1")//页面红字提示
    {
        jqObj.parent().find("em").hide();
        var errorObj = jqObj.parent().find("font");
        if (errorObj.length > 0) {
            errorObj.html(" " + text).show();
        }
        else {
            jqObj.parent().append("<font color=\"red\" class=\"addFont\">" + " " + text + "</font>");
        }
        jqObj.focus()
    }
    else//弹出提示
    {
        Boxy.alert(text + "！", function () { jqObj.focus() });
    }
}

function fillSecondBrandClass(p, sonCtrlID, v) {
    jq("#" + sonCtrlID + " option").not(":first").remove();
    if (p != "" && p != "0") {
        var result = AjaxClass.ReBrandDirectorys('BrandsInfo', p, v).value;
        if (result != null) {
            var csobj = eval("result=" + result);
            for (var i = 0; i < csobj.Detail.length; i++) {
                jq("#" + sonCtrlID).append("<option value=\"" + csobj.Detail[i].ID + "\"" + (v != undefined && v == csobj.Detail[i].ID ? " selected=\"selected\"" : "") + ">" + csobj.Detail[i].Name + "</option>");
            }
        }
    }
}
function ReadCookies(name) {
    var cookieValue = "";
    var search = name + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length;
            }
            cookieValue = unescape(document.cookie.substring(offset, end))
        }
    }
    return cookieValue;
}

//添加cook
function WriteCookies(c_name, value, expiredays) {
    expiredays = expiredays || 1;
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    // 使设置的有效时间正确。增加toGMTString()
    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/";
}

//删除cookie
function DelCookies(name) {
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval = ReadCookies(name);
    if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ";path=/";
}

function msgWindowClick(obj) {
    if (jq(obj).attr("class") == "feedbig") {
        jq(obj).removeClass("feedbig").addClass("feedsmall");
        jq('.feedback-box').slideDown('normal');
        WriteCookies("ShowMsgWindow", 1);
    }
    else {
        jq(obj).removeClass("feedsmall").addClass("feedbig");
        jq('.feedback-box').slideUp('normal');
        WriteCookies("ShowMsgWindow", 0);
    }
}
//本网特供，打开在线留言对话框
function msgWindowOpen() {
    jq('.feedbig').removeClass("feedbig").addClass("feedsmall");
    jq('.feedback-box').slideDown('normal');
    WriteCookies("ShowMsgWindow", 1);
}

/*
功能:图片自适应高宽，支持原图片已限高宽的情况，支持显示图片加载中效果
作者:dxx
参数说明:pic:图片对象
maxW:限制的最大宽度
maxH:限制的最大高度，若不传，则与maxW相同
errorImg:图片加载错误时加载的图片
*/
function ResizePic(pic, maxW, maxH, errorImg) {
    this.pic = pic;
    this.maxW = maxW || jQuery(this.pic).attr("maxW") || 111;
    this.maxH = maxH || jQuery(this.pic).attr("maxH") || this.maxW;
    this.errorImg = errorImg || jQuery(this.pic).attr("errorImg") || "/NewShowStand/images/smallno.jpg";
    this.trueSrc = jQuery(pic).attr("trueSrc");
    if (this.trueSrc == null || this.trueSrc == "" || this.trueSrc == jQuery(pic).attr("src"))
        return;
    if (this.trueSrc == "/NewShowStand/images/smallno.jpg" || this.trueSrc == "/NewShowStand/images/bigno.jpg") {
        jQuery(this.pic).attr("src", this.trueSrc);
        return;
    }
    var thisObj = this;
    this.tmpJqPic = jQuery("<img style=\"visibility:hidden;position:absolute;left:0;top:0;\" src='" + this.trueSrc
        + "'/>");
    this.tmpJqPic.bind("load", function () { thisObj.Resize(); }).bind("error", function () { thisObj.Error(); });
    jQuery(document.body).append(this.tmpJqPic);
}

ResizePic.prototype = {
    Resize: function () {
        var thisObj = this;
        var targetPic = this.pic;
        var sourcePic = this.tmpJqPic.get(0);
        imgWidth = sourcePic.width;
        imgHeight = sourcePic.height;
        setTimeout(function () { thisObj.tmpJqPic.remove(); }, 1);
        targetPic.removeAttribute('src');
        if (imgWidth > this.maxW || imgHeight > this.maxH) {
            if (imgWidth / imgHeight > this.maxW / this.maxH) {
                targetPic.style.width = this.maxW + "px";
                targetPic.style.height = this.maxW * (imgHeight / imgWidth) + "px";
            }
            else {
                targetPic.style.height = this.maxH + "px";
                targetPic.style.width = this.maxH * (imgWidth / imgHeight) + "px";
            }
        }
        else {
            targetPic.style.width = imgWidth + "px";
            targetPic.style.height = imgHeight + "px";
        }
        jQuery(this.pic).attr("src", jQuery(targetPic).attr("trueSrc"));
    },
    Error: function () {
        var thisObj = this;
        var targetPic = this.pic;
        var sourcePic = this.tmpJqPic.get(0);
        setTimeout(function () { thisObj.tmpJqPic.remove(); }, 1);
        jQuery(this.pic).attr("src", this.errorImg);
    }
};
function DrawImage(ImgD, FitWidth, FitHeight) {
    var image = new Image();
    image.src = ImgD.src;
    var nwidth = 0;
    var nheight = 0;
    image.src = ImgD.src;
    image.onload = function () {
        if (image.width > 0 && image.height > 0) {
            if (image.width / image.height >= FitWidth / FitHeight) {
                if (image.width > FitWidth) {
                    nwidth = FitWidth;
                    nheight = (image.height * FitWidth) / image.width;
                } else {
                    nwidth = image.width;
                    nheight = image.height;
                }
            } else {
                if (image.height > FitHeight) {
                    nheight = FitHeight;
                    nwidth = (image.width * FitHeight) / image.height;
                } else {
                    nwidth = image.width;
                    nheight = image.height;
                }
            }
            ImgD.width = nwidth;
            ImgD.height = nheight;
        }
        ImgD.style.width = nwidth + "px";
        ImgD.style.height = nheight + "px";
    }
}


//产品列表点击最新和热门按照不同排序规则读取产品信息
function showProSortTab(cid, pageindex, categoryID, erCategoryID, brandID, keyword, sType) {
    if (cid == 0)
        return;
    var getIndustryDomain = AjaxClass.GetIndustryDomain().value;
    var getStandDomain = AjaxClass.GetStandDomain(cid).value;
    var retUrl = "";
    if (getStandDomain.indexOf("www") > -1) { //非二级域名
        if (sType == 0) {
            if (keyword != "")
                retUrl = "/st" + cid + "/product_w" + keyword + "_p" + pageindex + ".html";
            else if (categoryID > 0)
                retUrl = "/st" + cid + "/list_" + categoryID + "_p" + pageindex + ".html";
            else if (erCategoryID > 0)
                retUrl = "/st" + cid + "/erlist_" + erCategoryID + "_p" + pageindex + ".html";
            else if (brandID > 0)
                retUrl = "/st" + cid + "/bplist_" + brandID + "_p" + pageindex + ".html";
            else
                retUrl = "/st" + cid + "/product_p" + pageindex + ".html";
        } else if (sType == 1) {
            if (keyword != "")
                retUrl = "/st" + cid + "/hotproduct_w" + keyword + "_p" + pageindex + ".html";
            else if (categoryID > 0)
                retUrl = "/st" + cid + "/hotlist_" + categoryID + "_p" + pageindex + ".html";
            else if (erCategoryID > 0)
                retUrl = "/st" + cid + "/hoterlist_" + erCategoryID + "_p" + pageindex + ".html";
            else if (brandID > 0)
                retUrl = "/st" + cid + "/hotbplist_" + brandID + "_p" + pageindex + ".html";
            else
                retUrl = "/st" + cid + "/hotproduct_p" + pageindex + ".html";
        }
    }
    else {
        if (sType == 0) {
            if (keyword != "")
                retUrl = getStandDomain + "/product_w" + keyword + "_p" + pageindex + ".html";
            else if (categoryID > 0)
                retUrl = getIndustryDomain + "/company/prolist-com" + cid + "-t" + categoryID + "_p" + pageindex + ".html";
            else if (erCategoryID > 0)
                retUrl = getIndustryDomain + "/company/prolist-com" + cid + "-t" + erCategoryID + "_p" + pageindex + ".html";
            else if (brandID > 0)
                retUrl = getIndustryDomain + "/company/prolist-com" + cid + "-bt" + brandID + "_p" + pageindex + ".html";
            else
                retUrl = getIndustryDomain + "/company/prolist-com" + cid + "-t0_p" + pageindex + ".html";
        } else if (sType == 1) {
            if (keyword != "")
                retUrl = getStandDomain + "/hotproduct_w" + keyword + "_p" + pageindex + ".html";
            else if (categoryID > 0)
                retUrl = getStandDomain + "/hotlist_" + categoryID + "_p" + pageindex + ".html";
            else if (erCategoryID > 0)
                retUrl = getStandDomain + "/hoterlist_" + erCategoryID + "_p" + pageindex + ".html";
            else if (brandID > 0)
                retUrl = getStandDomain + "/hotbplist_" + brandID + "_p" + pageindex + ".html";
            else
                retUrl = getStandDomain + "/hotproduct_p" + pageindex + ".html";
        }

    }
    if (retUrl != "")
        location.href = retUrl;
    return false;
}

function toSelect(selectTop, selectBot) {
    jQuery(selectTop).click(function (event) {
        event.stopPropagation();
        if (jQuery(selectBot).hide()) {
            jQuery(selectBot).show();
        }
    });
    jQuery(selectBot).children().click(function (event) {
        event.stopPropagation();
        jQuery(selectTop).text(jQuery(this).html());
        jQuery(selectBot).hide();
    });

    jQuery(document).click(function (event) {
        //jQuery(selectBot).hide(); 
        try {
            if (event.target.id == "") {
                jQuery(selectBot).hide();
                return;
            }
            else if (event.target.id == selectTop.substring(1, selectTop.length)) {
                winHelp(selectBot);
            }
            else if (event.target.id == selectBot.substring(1, selectBot.length)) {
            }
            //		else if(event.target.id.substring(0,12)==selectBot.substring(1,selectBot.length)){
            //			jQuery(selectTop).text(event.target.innerText);
            //			jQuery(selectBot).hide();
            //		}
            else {
                jQuery(selectBot).hide();
            }
        }
        catch (er) {
            jQuery(selectBot).hide();
        }

    });

}

function winHelp(selectBot) {
    if (jQuery(selectBot).hide()) {
        jQuery(selectBot).show();
    }
}

function SelPvc(pvcid) {
    PvcID = pvcid;
}
function SelPvc1(pvcid, name) {
    PvcID = pvcid;
    jQuery("#province").html(name);
}

//百度流量日志
var _IsPlayed = false;
function PlayVideo(mda) {
    if (_IsPlayed == false) {
        _IsPlayed = true;
        AjaxClass.AddVideoUsageLog(mda, backinfo);
    }
}
function backinfo() {
    return;
}

//-----------------------------------------新留言框2019

//window.onload=function(){
//	setTimeout(ShowNewBox(),3000);
//}
jq(document).ready(function () {
    setTimeout(ShowNewBox(), 3000);
});

function inStartCol() {

}

var xmlhttp;
function loadXMLDoc(url) {
    xmlhttp = null;
    if (window.XMLHttpRequest) {// code for IE7, Firefox, Opera, etc.
        xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {// code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (xmlhttp != null) {
        xmlhttp.onreadystatechange = state_Change;
        xmlhttp.open("GET", url, false);
        xmlhttp.send(null);

    }
    else {
        alert("Your browser does not support XMLHTTP.");
    }
}


function state_Change() {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {

            var mycode = AjaxClass.EncryptVerCode().value;
            if (mycode != null && mycode != "") {
                //var rst= AjaxClass.CkVCode(mycode).value;
                //alert(rst);
                var detail = document.getElementById("new_detail").value;
                var linkMan = document.getElementById("new_linkname").value;
                var companyName = document.getElementById("new_companyname").value;
                var tel = document.getElementById("new_telphone").value;
                var email = document.getElementById("new_email").value;
                var title = document.getElementById("new_title").value;
                var addr = document.getElementById("new_Address").value;
                var cid = document.getElementById("cid").value;
                var pid = document.getElementById("Pid").value;
                var IsNoSend = jQuery('input:radio[name="isnosend3"]:checked').val();
                var wxtel = document.getElementById("new_wxtel").value;
				if (typeof (IsNoSend) == "undefined") {
					IsNoSend = "0";//默认不转发
	            }
	            var wxtel = document.getElementById("new_wxtel").value;
	            AjaxClass.SendMessage3(cid, title, pid, linkMan, companyName, tel, email, detail, addr, mycode, "0", IsNoSend, wxtel, InquirySendMessageCallBack2).value; 
            }
            else {
                alert("发生错误，刷新重试");
                document.getElementById("btnsubmit").innerHTML = "提交留言";
                document.getElementById("btnsubmit").setAttribute("onclick", "NewOderMessage()");
                document.getElementById("btnsubmit").onclick = function () { NewOderMessage(); };
            }
        }
        else {
            alert("Problem retrieving XML data");
            document.getElementById("btnsubmit").innerHTML = "提交留言";
            document.getElementById("btnsubmit").setAttribute("onclick", "NewOderMessage()");
            document.getElementById("btnsubmit").onclick = function () { NewOderMessage(); };
        }
    }
}


function NewOderMessage() {
    var detail = document.getElementById("new_detail").value;
    if (detail == "" || detail == "详细需求：") { alert("请填写详细！"); return; }
    var linkMan = document.getElementById("new_linkname").value;
    if (linkMan == "" || linkMan == "联系人") { alert("请填写联系人！"); return; }
    var companyName = document.getElementById("new_companyname").value;
    if (companyName == "" || companyName == "公司") { document.getElementById("new_companyname").value = ""; }
    var tel = document.getElementById("new_telphone").value;
    if (tel == "" || tel == "手机") { alert("请填写联系电话！"); return; } else {
        if (!IsTel(tel)) {
            alert("手机号只能输入纯数字")
            return;
        }
    }
    if (checkPhone(tel) == false && checkTel(tel) == false) { alert("请填写正确的联系方式"); return; }
    var email = document.getElementById("new_email").value;
    if (email == "" || email == "邮箱") { document.getElementById("new_email").value = ""; }
    try { if (email != "" && email != "邮箱" && !valid.isEMail(email)) { alert("填写的邮箱有误."); return; } } catch (err) { }
    var title = document.getElementById("new_title").value;
    var addr = document.getElementById("new_Address").value;
    var cid = document.getElementById("cid").value;
    var pid = document.getElementById("Pid").value;
    document.getElementById("btnsubmit").innerHTML = "提交中...";
    document.getElementById("btnsubmit").setAttribute("onclick", "");
    document.getElementById("btnsubmit").onclick = function () { };
    loadXMLDoc('/NewShowStand/Image.aspx?' + Math.random());

}


function InquirySendMessageCallBack2(obj) {
    jsonStr = obj.value;
    var jsonobj = eval("rrr=" + jsonStr);
    if (jsonobj.Detail) {
        var NewOrderID = jsonobj.Detail[0].Success;
        if (NewOrderID > 0) { //留言成功
            AjaxClass.NewSendMsgOnlySaveNoSendMeg_CallBackToSend(NewOrderID, function() { return false; });
            alert("您的留言已提交成功！我们将在第一时间回复您~");
            ClearUpNewBox();

        } else {
            switch (jsonobj.Detail[0].Success) {
            case -1:
                alert("验证失效！请重试！");
                break;
            case -5:

                alert("很抱歉，您的信息包含了非法字符(" + jsonobj.Detail[0].DirtyWords + ")，请修改！");
                break;
            case -10:
                alert("留言成功，邮件发送失败！");
                ClearUpNewBox();
                break;
            default:
                alert("数据写入失败,请重试!");
                break;
            }
        }
    } else {

        alert("失败：" + jsonobj.Error);
    }
    document.getElementById("btnsubmit").innerHTML = "提交留言";
    document.getElementById("btnsubmit").setAttribute("onclick", "NewOderMessage()");
    document.getElementById("btnsubmit").onclick = function () { NewOderMessage(); };
}

function ClearUpNewBox() {
    if (document.getElementById("popCol") != null) {
        document.getElementById("new_detail").value = "";
        document.getElementById("new_linkname").value = "";
        document.getElementById("new_companyname").value = "";
        document.getElementById("new_telphone").value = "";
        document.getElementById("new_email").value = "";
        //document.getElementById("popCol").style.display="none";
    }
}
//var ShowNewBoxSite = ["www.gkzhan.com", "www.a-bm.cn", "www.jc35.com"];
var ShowNewBoxSite = [""];  //20200507gkzhan直接又不要这个留言了 --202208171611 胡杨提直接不要了
function ShowNewBox() {
    if (IsShowSite(ShowNewBoxSite) && window.location.href.indexOf("product") > -1) {
        if (document.getElementById("Pid") != null) {
            if (document.getElementById("Pid").value == "") {
                return;
            }
        }
        else {
            return;
        }

        if (document.getElementById("popCol") != null) {
            document.getElementById("popCol").style.display = "block";
        }
        if (window.location.hostname == "www.gkzhan.com") //2020-04-26 提需求gkzhan显示新样式 但是又不展开了
        {
            jQuery("#popCol").css({ right: '-360px' }); //消失；
            setTimeout(function () { document.getElementById("PopHelp").style.display = "block" }, 500);
            return;
        }

        setTimeout(function () {
            try {
                var kfr = document.getElementById("KFRightScreen");
                if (kfr != null) {
                    var tmepClassName = kfr.className;
                    if (tmepClassName.charAt(tmepClassName.length - 1) != "2") {
                        kfr.setAttribute("class", kfr.className + "2");
                    }
                }
                else {
                    console.log("KFRightScreen notfind");
                }

            } catch (Err) { console.log("error"); }
        }, 500);

    }
}
function zxjl_Help() {
    if (IsShowSite(ShowNewBoxSite) && window.location.href.indexOf("product") > -1) {
        if (document.getElementById("Pid") != null) {
            if (document.getElementById("Pid").value == "") {
                return;
            }
        }
        else {
            return;
        }
    }
    else {
        return;
    }
    if (window.location.hostname == "www.gkzhan.com") //2020-04-26 提需求gkzhan显示新样式 但是又不展开了
    {
        return;
    }
    setTimeout(function () {
        try {
            var kfr = document.getElementById("KFRightScreen");
            if (kfr != null) {
                var tmepClassName = kfr.className;
                if (tmepClassName.charAt(tmepClassName.length - 1) != "2") {
                    kfr.setAttribute("class", kfr.className + "2");
                }
            }
            else {
                console.log("KFRightScreen notfind");
            }

        } catch (Err) { console.log("error"); }
    }, 500);
}

function IsShowSite(SiteName) {
    var tempsitename = window.location.hostname;
    for (var i = 0; i < SiteName.length; i++) {
        if (tempsitename == SiteName[i]) {
            return true;
        }
    }
    return false;
}

function CloseNewBox() {
    //if(document.getElementById("popCol")!=null)
    //document.getElementById("popCol").style.display="none";
    if (document.getElementById("popCol") != null) {
        //document.getElementById("box_close").style.display="none";
        //document.getElementById("popBody").style.display="none";
        //document.getElementById("box_open").style.display="block";
        jQuery("#popCol").animate({ right: '-360px' }); //动画消失；
        setTimeout(function () { document.getElementById("PopHelp").style.display = "block" }, 500);
        try {
            var kfr = document.getElementById("KFRightScreen");
            if (kfr != null) {
                var tmepClassName = kfr.className;
                if (tmepClassName.charAt(tmepClassName.length - 1) == "2") {
                    kfr.setAttribute("class", tmepClassName.substring(0, tmepClassName.length - 1));
                }
            }
            else {
                console.log("KFRightScreen notfind");
            }

        } catch (Err) { console.log("error2"); }


        if (ChatCompanyID != null && ChatCompanyID != "undefined") {
            try {
                //setCookie("KFRightScreenLeft_"+ChatCompanyID,"",-1);
                document.getElementById("KFRightScreen").style.left = "";
                document.getElementById("KFRightScreen").style.top = PaddingTopLoad + "px";
                document.getElementById("KFRightScreen").style.right = "2px";
            }
            catch (errr) {

            }
        }

    }

}
function OpenNewBox() {
    if (document.getElementById("popCol") != null) {
        //document.getElementById("box_open").style.display="none";
        //document.getElementById("popBody").style.display="block";
        //document.getElementById("box_close").style.display="block";	
        document.getElementById("PopHelp").style.display = "none";
        jQuery("#popCol").animate({ right: '0px' }); //动画出现
        try {
            var kfr = document.getElementById("KFRightScreen");
            if (kfr != null) {
                var tmepClassName = kfr.className;
                if (tmepClassName.charAt(tmepClassName.length - 1) != "2") {
                    kfr.setAttribute("class", tmepClassName + "2");
                }
            }
            else {
                console.log("KFRightScreen notfind");
            }

        } catch (Err) { console.log("error3"); }

        if (ChatCompanyID != null && ChatCompanyID != "undefined") {
            try {
                //setCookie("KFRightScreenLeft_"+ChatCompanyID,"",-1);
                document.getElementById("KFRightScreen").style.left = "";
                document.getElementById("KFRightScreen").style.top = PaddingTopLoad + "px";
                document.getElementById("KFRightScreen").style.right = "2px";
            }
            catch (errr) {

            }
        }
    }
}
function checkPhone(str) {
    var phone = str;
    if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(phone))) {
        return false;
    }
    else {
        return true;
    }
}
function checkTel(str) {
    var tel = str;
    if (!/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(tel)) {
        return false;
    }
    else {
        return true;
    }

}

function select(selectTop, selectBot) {
    jQuery(selectTop).parent().each(function (i) {
        jQuery(this).css('z-index', -(i) + 100);
    });

    jQuery(selectTop).click(function (event) {
        event.stopPropagation();
        jQuery(this).siblings(selectBot).slideToggle(300);
        jQuery(this).toggleClass("focus");
    });
    jQuery(selectBot).find("li").click(function (event) {
        event.stopPropagation();
        jQuery(this).parent(selectBot).siblings(selectTop).find("p").text(jQuery(this).text());
        jQuery(this).parent(selectBot).slideUp(300);
        jQuery(this).parent(selectBot).siblings(selectTop).removeClass("focus");

    });
    jQuery('html,body').click(function (event) {
        if (jQuery(event.target).closest(selectTop).length == 0) {
            jQuery(selectBot).slideUp(300);
            jQuery(selectTop).removeClass("focus");
        }
    });
}

var ButClickNum = 1;
function GetPrivacyNumber(cid) {
    if (ButClickNum > 1) {
        return; //防止多余请求
    }
    ButClickNum++;
    console.log("getnumber");
    var mmsgbox = document.getElementById("TelMsgBox");
    var callrst = AjaxClass.GetPrivacyNumber(cid).value;
    try {
        var jsonObj = eval("Data=" + callrst);
        if (jsonObj.Success) {
            if (jsonObj.ByCookie) {
                if (mmsgbox != null) {
                    document.getElementById("TelNo").innerHTML = jsonObj.Success;
                    document.getElementById("TelMsgContent").innerHTML = "隐私号码，15分钟内有效，请尽快拨打！通话录音，敬请谅解";
                    document.getElementById("TelMsgBox").style.display = "block";
                }
                else {
                    alert("成功！该号码为隐私号,将在15分钟后过期 ：" + jsonObj.Success);
                }
            }
            else {
                if (mmsgbox != null) {
                    document.getElementById("TelNo").innerHTML = jsonObj.Success;
                    document.getElementById("TelMsgContent").innerHTML = "隐私号码将失效，请尽快拨打！通话录音，敬请谅解";
                    document.getElementById("TelMsgBox").style.display = "block";
                }
                else {
                    alert("隐私号码将失效，请尽快拨打！通话录音，敬请谅解 ：" + jsonObj.Success);

                }
            }

        }
        else {

            var alertMsg = "";
            if (jsonObj.Error == "号码池资源不足") {
                alertMsg = "热线繁忙中，请15分钟后再查看";
            }
            else if (jsonObj.Error == "格式异常" || jsonObj.Error == "手机号格式错误;" || jsonObj.Error == "手机号格式错误；" || jsonObj.Error == "手机号格式错误") {
                alertMsg = "该供应商未提供正确电话联系方式！";
            }
            else if (jsonObj.Error == "LimFq") {
                alertMsg = "系统提示：您的操作过于频繁";
            }
            else {
                alertMsg = jsonObj.Error;
            }


            if (mmsgbox != null) {
                document.getElementById("TelNo").innerHTML = "";
                document.getElementById("TelMsgContent").innerHTML = alertMsg;
                document.getElementById("TelMsgBox").style.display = "block";
            }
            else {
                alert("错误（若号码池已空 请15分钟后重试） ：" + alertMsg);
            }

        }
    }
    catch (ex) {
        if (mmsgbox != null) {
            document.getElementById("TelNo").innerHTML = "";
            document.getElementById("TelMsgContent").innerHTML = callrst;
            document.getElementById("TelMsgBox").style.display = "block";
        }
        else {
            alert(callrst);
        }
    }
    ButClickNum = 1;

}
//直接显示
function GetPrivacyNumberForContact(cid) {
    if (ButClickNum > 1) {
        return; //防止多余请求
    }
    ButClickNum++;
    console.log("getnumber");
    var alertMsg = "";
    var callrst = AjaxClass.GetPrivacyNumber(cid).value;
    try {
        var jsonObj = eval("Data=" + callrst);
        if (jsonObj.Success) {
            alertMsg = jsonObj.Success; 
        }
        else {
            alertMsg = "号码异常无法查看";  
        }
    }
    catch (ex) {
        alertMsg = "号码异常无法查看";
    }
    ButClickNum = 1;
    document.writeln(alertMsg);

}
function PrivacyNumberCallBack() {

}

function CloseTelMsgBox() {
    var mmsgbox = document.getElementById("TelMsgBox");
    if (mmsgbox != null) {
        document.getElementById("TelMsgBox").style.display = "none";
    }
}


function setPrivacyCookie(cname, cvalue, exMin) {
    var d = new Date();
    d.setTime(d.getTime() + (exMin * 60 * 1000));
    var expires = "expires=" + d.toGMTString();
    document.cookie = cname + "=" + cvalue + "; " + expires;

}


function getPrivacyCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i].trim();
        if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
    }
    return "";
}

//判断输入是否为整形数字
function inputIsNum(e) {
    e = window.event || e;
    var code = e.keyCode || e.which;
    if (code >= 48 && code <= 57)
        return code;
    else
        return false;
}
//判断输入是否为浮点数字
function inputIsFloatNum(e) {
    e = window.event || e;
    var code = e.keyCode || e.which;
    if ((code >= 48 && code <= 57) || code == 46)
        return code;
    else
        return false;
}
function chkIsLogin() {
    var result = AjaxClass.IsLogin().value;
    if (result == "-1") {
        if (intSkinID == "14" || intSkinID == "15" || intSkinID == "16" || intSkinID == "101") {
            showLogin('online');
        }
        else if (intSkinID == "102" || intSkinID == "103" || intSkinID == "17" || intSkinID == "18" || intSkinID == "19" || intSkinID == "107" || intSkinID == "110" || intSkinID == "111") {
            jQuery(".outside").show();
        }
        else {
            showLogin2('online');
        }
        return false;
    }
    if (result == "1") {
        jQuery("#tips-box1").show();
        return false;
    }
    return true;
}

function checkLogin3() {
    var username = jQuery("#username1").val();
    var password = jQuery("#password1").val();
    var validcode = jQuery("#validcode1").val();
    if (username == "") {
        alert("请输入您的账号");
        return;
    }
    if (password == "") {
        alert("请输入您的密码");
        return;
    }
    if (validcode == "") {
        alert("请输入验证码");
        return;
    }
    var result = AjaxClass.CheckLoginOnline(validcode, username, password, "1").value;
    if (result == "-1") {
        alert("验证码有误");
        return;
    }
    else {
        var jsonOjbect = eval("data=" + result);
        if (jsonOjbect.Error) {
            if (jsonOjbect.Error == "-2") {
                alert("该账号不存在");
                return;
            }
            else if (jsonOjbect.Error == "-1") {
                alert("密码不正确");
                return;
            }
            else {
                alert("登陆失败");
                return;
            }
        }
        else {
            if (jsonOjbect.LoginUser.UserType != "6") {
                jQuery('.outside').hide();
                jQuery("#tips-box1").show();
                return;
            }
        }
        if (jQuery("#remember").attr('class') == "checked") {
            setCookie("pm_username", username);
        }
        else {
            setCookie("pm_username", "");
        }
        window.location.reload();
    }
}
function setCookie(name, value) {
    document.cookie = name + "=" + escape(value) + "; path=/";
}

//获取cookie
function getCookie(name) {
    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

    if (arr = document.cookie.match(reg))

        return unescape(arr[2]);
    else
        return null;
}
function SetClickNumber(Cid, Position) {
    var href = window.location.href;
    var json = AjaxClass.InsertClickCompanyLink(Cid, href).value;
    var jsonObj = eval("Data=" + json);
    if (jsonObj.Detail && jsonObj.Detail[0].Success == "1") {
        if (Position=="0") {
            document.getElementById("ClickPhone").style.display = "none";
            document.getElementById("StandTopPhone").style.display = "block";
        }
        else if(Position=="1"){
            document.getElementById("BotClick").style.display = "none";
            document.getElementById("StandBotPhone").style.display = "inline";
        }
        else if (Position == "2") {
            document.getElementById("BotMobilePhone").style.display = "none";
            document.getElementById("StandBotMobile").style.display = "inline";
        }
        else if (Position == "3") {
            document.getElementById("IntroPhone").style.display = "none";
            document.getElementById("StandIntro").style.display = "inline";
        }
        else if (Position == "4") {
            document.getElementById("IntroMobilePhone").style.display = "none";
            document.getElementById("StandIntroMobile").style.display = "inline";
        }
    }

}
//检测手机号
function IsTel(s) {
    var patrn = /^[/0-9-/u9fa5]*$/; ///^(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}$/;
    if (!patrn.exec(s))
        return false
    else
        return true
}

function postIndexInfo(strurl) {
    jQuery(document).ready(function() {
        var iframe = document.createElement('iframe');
        iframe.style.display = "none";
        iframe.src = strurl;
        document.body.appendChild(iframe);
    });
    
}
