﻿function deleteSearchKey(Obj) {
    var strObj = document.getElementById(Obj).value;

    if (strObj == "请输入查询关键字") {
        document.getElementById(Obj).value = "";
    }
}

function AdvanceDisableAll(s, TypeValue) {
    var stypeObj = document.getElementById("SearchType");
    var stype = "";
    if (stypeObj != null && stypeObj != "null") {
        stype = stypeObj.value;
    }
    if (stype == "ID") {
        for (i = 0; i < s.split(',').length - 1; i++) {
            if (s.split(',')[i] != "") {
                var SsplitObj = document.getElementById(s.split(',')[i]);
                if (SsplitObj != null && SsplitObj != "null") {
                    document.getElementById(s.split(',')[i]).disabled = "disabled";
                }
            }
        }
        var SearchKey = document.getElementById("SearchKey").value;
        if (SearchKey == "请输入查询关键字") {
            SearchKey = "";
        }
        if (SearchKey != "" && !isDigit(SearchKey)) {
            alert("输入必须是数字!");
            document.getElementById("SearchKey").value = "";
            return true;
        }
    }
    else {
        for (i = 0; i < s.split(',').length - 1; i++) {
            if (s.split(',')[i] != "") {
                var SsplitObj = document.getElementById(s.split(',')[i]);
                if (SsplitObj != null && SsplitObj != "null") {
                    document.getElementById(s.split(',')[i]).disabled = false;
                }
            }
        }
    }
    return false;
}

function checkStartTime(fieldName) {
    var strStartTime = trim(document.getElementById(fieldName).value);
    if (strStartTime != "") {
        if (!isTime(strStartTime)) {
            alert("日期输入格式不对,请重新输入YYYY-MM-DD HH:MM:SS的时间格式!");
            document.getElementById(fieldName).value = "";
            return true;
        }
    }
    return false;
}

function checkEndTime(fieldName) {
    var strEndTime = trim(document.getElementById(fieldName).value);
    var iflg = 0;
    if (strEndTime != "") {
        if (!isTime(strEndTime)) {
            alert("日期输入格式不对,请重新输入YYYY-MM-DD HH:MM:SS的时间格式!");
            document.getElementById(fieldName).value = "";
            iflg += 1;
        }
        var strStartTime = trim(document.getElementById("StartTime").value);
        if (strStartTime != "") {
            if (isTime(strStartTime))
                if (StringToDate(strEndTime) <= StringToDate(strStartTime)) {
                alert("结束时间必须比开始时间晚!");
                document.getElementById(fieldName).value = "";
                iflg += 1;
            }
        }
    }

    if (iflg > 0)
        return true;

    return false;
}

function checkNumValue(fieldName) {
    var NumValue = trim(document.getElementById(fieldName).value);
    if (NumValue != "") {
        if (!isDigit(NumValue)) {
            alert("输入必须是数字!");
            document.getElementById(fieldName).value = "";
            return true;
        }
    }
    return false;
}



///////////////////////////////////////////////////////////////////////////////////////////////////
//产品分类选择开始
///////////////////////////////////////////////////////////////////////////////////////////////////
function ChoiceProductCate(InputID, IframFlag) {
    var strHtml = "";
    strHtml += "<div style=\"border:solid 2px #CCCCCC;\">";

    strHtml += "    <div id=\"ChoiceCateTitle\" style=\"height:25px;padding:5px 0px 0px 10px;background-color:#DDDDDD;\">";
    strHtml += "        <div style=\"float:left;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/1055.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;\" />&nbsp;&nbsp;<b>选择产品分类</b></div>";
    strHtml += "        <div id=\"ShowChoiceMsgDiv\" style=\"float:left;padding-left:20px;\"></div>";
    strHtml += "        <div style=\"float:right;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/Close.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;cursor:pointer;\" alt=\"关闭\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" />&nbsp;&nbsp;</div>";
    strHtml += "    </div>";
    strHtml += "    <div id=\"ShowChoiceCateDiv\" style=\"background-color:#FFFFFF;padding:0px 10px 10px 10px;\"></div>";

    strHtml += "    <div id=\"SelectChoiceCateID\" style=\"display:none;\"></div>";

    strHtml += "    <div style=\"overflow:hidden;height:44px; width:100%;background-color:#EEEEEE;\">";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"取消\" style=\"width:80px;cursor:pointer;\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"确定\" style=\"width:80px;cursor:pointer;\" onclick=\"SetProductCate('" + InputID + "','" + IframFlag + "','ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "    </div>";

    strHtml += "</div>";

    var zIndexValue = parent.GetMaxzIndex();

    if (isNaN(parseInt(zIndexValue))) {
        zIndexValue = 0;
    }
    var ChoiceCateDivBGObj = document.getElementById("ChoiceCateDivBG");
    if (ChoiceCateDivBGObj != null && ChoiceCateDivBGObj.parentNode != null && ChoiceCateDivBGObj != "null") {
        ChoiceCateDivBGObj.parentNode.removeChild(ChoiceCateDivBGObj);
    }

    var ChoiceCateDivObj = document.getElementById("ChoiceCateDiv");
    if (ChoiceCateDivObj != null && ChoiceCateDivObj.parentNode != null && ChoiceCateDivObj != "null") {
        ChoiceCateDivObj.parentNode.removeChild(ChoiceCateDivObj);
    }

    var CreatForgetPassWordBgObj = document.createElement("div");
    CreatForgetPassWordBgObj.style.backgroundColor = "#000000";
    CreatForgetPassWordBgObj.style.zIndex = (parseInt(zIndexValue) + 10007);
    CreatForgetPassWordBgObj.style.position = "absolute";
    CreatForgetPassWordBgObj.id = "ChoiceCateDivBG";

    var CreatForgetPassWordMsgObj = document.createElement("div");
    CreatForgetPassWordMsgObj.style.zIndex = (parseInt(zIndexValue) + 10008);
    CreatForgetPassWordMsgObj.style.position = "absolute";
    CreatForgetPassWordMsgObj.id = "ChoiceCateDiv";
    CreatForgetPassWordMsgObj.innerHTML = strHtml;
    CreatForgetPassWordMsgObj.style.width = "620px";
    CreatForgetPassWordMsgObj.style.height = "auto";
    CreatForgetPassWordMsgObj.style.top = parseInt((window.screen.height) / 2 + document.documentElement.scrollTop - 350) + "px";
    CreatForgetPassWordMsgObj.style.left = (window.screen.width - 620) / 2 + "px";
    CreatForgetPassWordMsgObj.style.padding = "0px";
    CreatForgetPassWordMsgObj.style.margin = "0px";

    document.body.appendChild(CreatForgetPassWordBgObj);
    document.body.appendChild(CreatForgetPassWordMsgObj);

    fade("ChoiceCateDivBG", 60, "Auto");
    TheEle_initDrag("ChoiceCateTitle", "ChoiceCateDiv", "", "WebContent");

    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/ProductCateList.aspx?CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", "ShowChoiceMsgDiv", "ShowChoiceCateDiv");
}

function ShowChildProductCate(IDNode, ContentDivID, CateLeve, DivObj) {
    var ImgSrc = DivObj.src;
    var ArrImgSrc = ImgSrc.split("/");
    var DivImg = ArrImgSrc[ArrImgSrc.length - 1].replace(".gif", "");
    var ContentDivIDObj = document.getElementById(ContentDivID);

    switch (DivImg) {
        case "_plus1":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_minus1.gif";
                if (ContentDivIDObj.innerHTML == "") {
                    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/ProductCateList.aspx?IDNode=" + IDNode + "&CateLeveFlg=" + CateLeve + "&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", ContentDivID, ContentDivID);
                }
                else {
                    ContentDivIDObj.style.display = "";
                }
                break;
            }
        case "_plus2":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_minus2.gif";
                if (ContentDivIDObj.innerHTML == "") {
                    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/ProductCateList.aspx?IDNode=" + IDNode + "&CateLeveFlg=" + CateLeve + "&ContentDivID=ShowChoiceCateDiv&MsgDivID=ShowChoiceMsgDiv&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", ContentDivID, ContentDivID);
                }
                else {
                    ContentDivIDObj.style.display = "";
                }
                break;
            }
        case "_minus1":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_plus1.gif";
                ContentDivIDObj.style.display = "none";
                break;
            }
        case "_minus2":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_plus2.gif";
                ContentDivIDObj.style.display = "none";
                break;
            }
    }
}

function SetProductCateValue(CateID, CateName, IDNode) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        SaveCateIDObj.innerHTML = CateID + "," + CateName + "," + IDNode;
    }
}

function SetProductCate(InputID, IframFlag, strDivID) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        if (SaveCateIDObj.innerHTML != "") {
            var SaveCateIDValue = SaveCateIDObj.innerHTML;
            var ArraySaveCateIDValue = SaveCateIDValue.split(",");
            var CateID = ArraySaveCateIDValue[0];
            var CateIDName = ArraySaveCateIDValue[1];
            var IDNode = ArraySaveCateIDValue[2];

            var ArrayIDNode = IDNode.split("|");
            var ParentCateIDName = "";
            for (var i = 0; i < ArrayIDNode.length; i++) {
                if (ArrayIDNode[i] != "0" && ArrayIDNode[i] != "") {
                    ParentCateIDName += document.getElementById("CateIDNameID" + ArrayIDNode[i]).innerHTML + ">";
                }
            }

            switch (IframFlag) {
                case "NoIfram":
                    {
                        document.getElementById(InputID).value = CateID;
                        document.getElementById(InputID + "Name").value = ParentCateIDName + CateIDName;
                        document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }
                case "Ifram":
                    {
                        var framesObj = top.document.getElementById('WorkModuleConfig').contentWindow;
                        framesObj.document.getElementById(InputID).value = CateID;
                        framesObj.document.getElementById(InputID + "Name").value = ParentCateIDName + CateIDName;
                        framesObj.document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }

            }

            ClearChoiceDiv(strDivID);

        }
        else {
            alert("必须选择一个分类!");
        }
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//品牌分类选择开始
///////////////////////////////////////////////////////////////////////////////////////////////////
function ChoiceBrandCate(InputID, IframFlag) {
    var strHtml = "";
    strHtml += "<div style=\"border:solid 2px #CCCCCC;\">";

    strHtml += "    <div id=\"ChoiceCateTitle\" style=\"height:25px;padding:5px 0px 0px 10px;background-color:#DDDDDD;\">";
    strHtml += "        <div style=\"float:left;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/1055.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;\" />&nbsp;&nbsp;<b>选择品牌分类</b></div>";
    strHtml += "        <div id=\"ShowChoiceMsgDiv\" style=\"float:left;padding-left:20px;\"></div>";
    strHtml += "        <div style=\"float:right;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/Close.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;cursor:pointer;\" alt=\"关闭\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" />&nbsp;&nbsp;</div>";
    strHtml += "    </div>";

    strHtml += "    <div style=\"background-color:#F6F6F6;padding:5px 10px 5px 10px;text-align:right;\">";
    strHtml += "        <input type=\"text\" id=\"strSearchKey\" name=\"strSearchKey\" style=\"width:150px;\" value=\"请输入查询关键字\" onclick=\"deleteSearchKey(this.id);\"/>";
    strHtml += "       <select id=\"SearchType\">";
    strHtml += "           <option value=\"CateName\" >品牌名称</option>";
    strHtml += "           <option value=\"ID\" >品牌ID编号</option>";
    strHtml += "       </select>";
    strHtml += "        <input type=\"button\" value=\"搜索\" style=\"cursor:pointer;\" onclick=\"BrandCateSearch();\"/>";
    strHtml += "    </div>";
    strHtml += "    <div style=\"background-color:#CCCCCC;text-align:right;height:1px;overflow:hidden;\"></div>";

    strHtml += "    <div id=\"ShowChoiceCateDiv\" style=\"background-color:#FFFFFF;\"></div>";

    strHtml += "    <div id=\"SelectChoiceCateID\" style=\"display:none;\"></div>";

    strHtml += "    <div style=\"overflow:hidden;height:44px; width:100%;background-color:#EEEEEE;\">";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"取消\" style=\"width:80px;cursor:pointer;\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"确定\" style=\"width:80px;cursor:pointer;\" onclick=\"SetBrandCate('" + InputID + "','" + IframFlag + "','ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "    </div>";

    strHtml += "</div>";

    var zIndexValue = parent.GetMaxzIndex();

    if (isNaN(parseInt(zIndexValue))) {
        zIndexValue = 0;
    }

    var ChoiceCateDivBGObj = document.getElementById("ChoiceCateDivBG");
    if (ChoiceCateDivBGObj != null && ChoiceCateDivBGObj.parentNode != null && ChoiceCateDivBGObj != "null") {
        ChoiceCateDivBGObj.parentNode.removeChild(ChoiceCateDivBGObj);
    }

    var ChoiceCateDivObj = document.getElementById("ChoiceCateDiv");
    if (ChoiceCateDivObj != null && ChoiceCateDivObj.parentNode != null && ChoiceCateDivObj != "null") {
        ChoiceCateDivObj.parentNode.removeChild(ChoiceCateDivObj);
    }

    var CreatForgetPassWordBgObj = document.createElement("div");
    CreatForgetPassWordBgObj.style.backgroundColor = "#000000";
    CreatForgetPassWordBgObj.style.zIndex = (parseInt(zIndexValue) + 10007);
    CreatForgetPassWordBgObj.style.position = "absolute";
    CreatForgetPassWordBgObj.id = "ChoiceCateDivBG";

    var CreatForgetPassWordMsgObj = document.createElement("div");
    CreatForgetPassWordMsgObj.style.zIndex = (parseInt(zIndexValue) + 10008);
    CreatForgetPassWordMsgObj.style.position = "absolute";
    CreatForgetPassWordMsgObj.id = "ChoiceCateDiv";
    CreatForgetPassWordMsgObj.innerHTML = strHtml;
    CreatForgetPassWordMsgObj.style.width = "620px";
    CreatForgetPassWordMsgObj.style.height = "auto";
    CreatForgetPassWordMsgObj.style.top = parseInt((window.screen.height) / 2 + document.documentElement.scrollTop - 350) + "px";
    CreatForgetPassWordMsgObj.style.left = (window.screen.width - 620) / 2 + "px";
    CreatForgetPassWordMsgObj.style.padding = "0px";
    CreatForgetPassWordMsgObj.style.margin = "0px";

    document.body.appendChild(CreatForgetPassWordBgObj);
    document.body.appendChild(CreatForgetPassWordMsgObj);

    fade("ChoiceCateDivBG", 60, "Auto");
    TheEle_initDrag("ChoiceCateTitle", "ChoiceCateDiv", "", "WebContent");

    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/BrandCateList.aspx?ShowMsgDiv=ShowChoiceMsgDiv&ContentDiv=ShowChoiceCateDiv&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", "ShowChoiceMsgDiv", "ShowChoiceCateDiv");
}

function BrandCateSearch() {
    var strSearchKey = document.getElementById("strSearchKey").value;

    var SearchType = document.getElementById("SearchType").value;
    var SearchFlg = true;
    if (SearchType == "ID") {
        if (!isDigit(strSearchKey)) {
            alert("必须输入数字!");
            SearchFlg = false;
            document.getElementById("strSearchKey").value = "";
        }
    }
    if (SearchFlg) {
        LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/BrandCateList.aspx?strSearchKey=" + strSearchKey + "&SearchType=" + SearchType + "&ShowMsgDiv=ShowChoiceMsgDiv&ContentDiv=ShowChoiceCateDiv&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", "ShowChoiceMsgDiv", "ShowChoiceCateDiv");
    }
}

function SetBrandCateValue(CateID, CateName) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        SaveCateIDObj.innerHTML = CateID + "," + CateName;
    }
}

function SetBrandCate(InputID, IframFlag, strDivID) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        if (SaveCateIDObj.innerHTML != "") {
            var SaveCateIDValue = SaveCateIDObj.innerHTML;
            var ArraySaveCateIDValue = SaveCateIDValue.split(",");
            var CateID = ArraySaveCateIDValue[0];
            var CateIDName = ArraySaveCateIDValue[1];

            switch (IframFlag) {
                case "NoIfram":
                    {
                        document.getElementById(InputID).value = CateID;
                        document.getElementById(InputID + "Name").value = CateIDName;
                        document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }
                case "Ifram":
                    {
                        var framesObj = top.document.getElementById('WorkModuleConfig').contentWindow;
                        framesObj.document.getElementById(InputID).value = CateID;
                        framesObj.document.getElementById(InputID + "Name").value = CateIDName;
                        framesObj.document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }

            }

            ClearChoiceDiv(strDivID);

        }
        else {
            alert("必须选择一个品牌!");
        }
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//供应商选择开始
///////////////////////////////////////////////////////////////////////////////////////////////////
function ChoiceSupplier(InputID, IframFlag) {
    var strHtml = "";
    strHtml += "<div style=\"border:solid 2px #CCCCCC;\">";

    strHtml += "    <div id=\"ChoiceCateTitle\" style=\"height:25px;padding:5px 0px 0px 10px;background-color:#DDDDDD;\">";
    strHtml += "        <div style=\"float:left;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/1055.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;\" />&nbsp;&nbsp;<b>选择供应商</b></div>";
    strHtml += "        <div id=\"ShowChoiceMsgDiv\" style=\"float:left;padding-left:20px;\"></div>";
    strHtml += "        <div style=\"float:right;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/Close.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;cursor:pointer;\" alt=\"关闭\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" />&nbsp;&nbsp;</div>";
    strHtml += "    </div>";

    strHtml += "    <div style=\"background-color:#F6F6F6;padding:5px 10px 5px 10px;text-align:right;\">";
    strHtml += "        <input type=\"text\" id=\"strSearchKey\" name=\"strSearchKey\" style=\"width:150px;\" value=\"请输入查询关键字\" onclick=\"deleteSearchKey(this.id);\" />";
    strHtml += "       <select id=\"SearchType\">";
    strHtml += "           <option value=\"Company\" >供应商公司名称</option>";
    strHtml += "           <option value=\"SupplierName\" >联系人</option>";
    strHtml += "           <option value=\"Tell\" >供应商电话</option>";
    strHtml += "           <option value=\"ID\" >ID编号</option>";
    strHtml += "       </select>";
    strHtml += "        <input type=\"button\" value=\"搜索\" style=\"cursor:pointer;\" onclick=\"SupplierSearch();\"/>";
    strHtml += "    </div>";
    strHtml += "    <div style=\"background-color:#CCCCCC;text-align:right;height:1px;overflow:hidden;\"></div>";

    strHtml += "    <div id=\"ShowChoiceCateDiv\" style=\"background-color:#FFFFFF;\"></div>";

    strHtml += "    <div id=\"SelectChoiceCateID\" style=\"display:none;\"></div>";

    strHtml += "    <div style=\"overflow:hidden;height:44px; width:100%;background-color:#EEEEEE;\">";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"取消\" style=\"width:80px;cursor:pointer;\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"确定\" style=\"width:80px;cursor:pointer;\" onclick=\"SetSupplier('" + InputID + "','" + IframFlag + "','ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "    </div>";

    strHtml += "</div>";

    var zIndexValue = parent.GetMaxzIndex();

    if (isNaN(parseInt(zIndexValue))) {
        zIndexValue = 0;
    }

    var ChoiceCateDivBGObj = document.getElementById("ChoiceCateDivBG");
    if (ChoiceCateDivBGObj != null && ChoiceCateDivBGObj.parentNode != null && ChoiceCateDivBGObj != "null") {
        ChoiceCateDivBGObj.parentNode.removeChild(ChoiceCateDivBGObj);
    }

    var ChoiceCateDivObj = document.getElementById("ChoiceCateDiv");
    if (ChoiceCateDivObj != null && ChoiceCateDivObj.parentNode != null && ChoiceCateDivObj != "null") {
        ChoiceCateDivObj.parentNode.removeChild(ChoiceCateDivObj);
    }

    var CreatForgetPassWordBgObj = document.createElement("div");
    CreatForgetPassWordBgObj.style.backgroundColor = "#000000";
    CreatForgetPassWordBgObj.style.zIndex = (parseInt(zIndexValue) + 10007);
    CreatForgetPassWordBgObj.style.position = "absolute";
    CreatForgetPassWordBgObj.id = "ChoiceCateDivBG";

    var CreatForgetPassWordMsgObj = document.createElement("div");
    CreatForgetPassWordMsgObj.style.zIndex = (parseInt(zIndexValue) + 10008);
    CreatForgetPassWordMsgObj.style.position = "absolute";
    CreatForgetPassWordMsgObj.id = "ChoiceCateDiv";
    CreatForgetPassWordMsgObj.innerHTML = strHtml;
    CreatForgetPassWordMsgObj.style.width = "620px";
    CreatForgetPassWordMsgObj.style.height = "auto";
    CreatForgetPassWordMsgObj.style.top = parseInt((window.screen.height) / 2 + document.documentElement.scrollTop - 350) + "px";
    CreatForgetPassWordMsgObj.style.left = (window.screen.width - 620) / 2 + "px";
    CreatForgetPassWordMsgObj.style.padding = "0px";
    CreatForgetPassWordMsgObj.style.margin = "0px";

    document.body.appendChild(CreatForgetPassWordBgObj);
    document.body.appendChild(CreatForgetPassWordMsgObj);

    fade("ChoiceCateDivBG", 60, "Auto");
    TheEle_initDrag("ChoiceCateTitle", "ChoiceCateDiv", "", "WebContent");

    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/SupplierList.aspx?ShowMsgDiv=ShowChoiceMsgDiv&ContentDiv=ShowChoiceCateDiv&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", "ShowChoiceMsgDiv", "ShowChoiceCateDiv");
}

function SupplierSearch() {
    var strSearchKey = document.getElementById("strSearchKey").value;

    var SearchType = document.getElementById("SearchType").value;
    var SearchFlg = true;
    if (SearchType == "ID") {
        if (!isDigit(strSearchKey)) {
            alert("必须输入数字!");
            SearchFlg = false;
            document.getElementById("strSearchKey").value = "";
        }
    }
    if (SearchFlg) {
        LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/SupplierList.aspx?strSearchKey=" + strSearchKey + "&SearchType=" + SearchType + "&ShowMsgDiv=ShowChoiceMsgDiv&ContentDiv=ShowChoiceCateDiv&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", "ShowChoiceMsgDiv", "ShowChoiceCateDiv");
    }
}

function SetSupplierValue(CateID, CateName) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        SaveCateIDObj.innerHTML = CateID + "," + CateName;
    }
}

function SetSupplier(InputID, IframFlag, strDivID) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        if (SaveCateIDObj.innerHTML != "") {
            var SaveCateIDValue = SaveCateIDObj.innerHTML;
            var ArraySaveCateIDValue = SaveCateIDValue.split(",");
            var CateID = ArraySaveCateIDValue[0];
            var CateIDName = ArraySaveCateIDValue[1];

            switch (IframFlag) {
                case "NoIfram":
                    {
                        document.getElementById(InputID).value = CateID;
                        document.getElementById(InputID + "Name").value = CateIDName;
                        document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }
                case "Ifram":
                    {
                        var framesObj = top.document.getElementById('WorkModuleConfig').contentWindow;
                        framesObj.document.getElementById(InputID).value = CateID;
                        framesObj.document.getElementById(InputID + "Name").value = CateIDName;
                        framesObj.document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }

            }

            ClearChoiceDiv(strDivID);

        }
        else {
            alert("必须选择一个供应商!");
        }
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//商机类别选择开始
///////////////////////////////////////////////////////////////////////////////////////////////////
function ChoiceBusinessType(InputID, IframFlag) {
    var strHtml = "";
    strHtml += "<div style=\"border:solid 2px #CCCCCC;\">";

    strHtml += "    <div id=\"ChoiceCateTitle\" style=\"height:25px;padding:5px 0px 0px 10px;background-color:#DDDDDD;\">";
    strHtml += "        <div style=\"float:left;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/1055.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;\" />&nbsp;&nbsp;<b>选择商机类别</b></div>";
    strHtml += "        <div id=\"ShowChoiceMsgDiv\" style=\"float:left;padding-left:20px;\"></div>";
    strHtml += "        <div style=\"float:right;\"><img src=\"/Style/zzs_admin/Image/WebCss/WebSite/gif/Close.gif\" alt=\"\" width=\"16px\" height=\"16px\" style=\"vertical-align:middle;cursor:pointer;\" alt=\"关闭\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" />&nbsp;&nbsp;</div>";
    strHtml += "    </div>";
    strHtml += "    <div id=\"ShowChoiceCateDiv\" style=\"background-color:#FFFFFF;padding:0px 10px 10px 10px;\"></div>";

    strHtml += "    <div id=\"SelectChoiceCateID\" style=\"display:none;\"></div>";

    strHtml += "    <div style=\"overflow:hidden;height:44px; width:100%;background-color:#EEEEEE;\">";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"取消\" style=\"width:80px;cursor:pointer;\" onclick=\"ClearChoiceDiv('ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "         <div style=\"text-align:right;padding:10px;float:right;\"><input type=\"button\" value=\"确定\" style=\"width:80px;cursor:pointer;\" onclick=\"SetBusinessType('" + InputID + "','" + IframFlag + "','ChoiceCateDiv,ChoiceCateDivBG');\" /></div>";
    strHtml += "    </div>";

    strHtml += "</div>";

    var zIndexValue = parent.GetMaxzIndex();

    if (isNaN(parseInt(zIndexValue))) {
        zIndexValue = 0;
    }

    var ChoiceCateDivBGObj = document.getElementById("ChoiceCateDivBG");
    if (ChoiceCateDivBGObj != null && ChoiceCateDivBGObj.parentNode != null && ChoiceCateDivBGObj != "null") {
        ChoiceCateDivBGObj.parentNode.removeChild(ChoiceCateDivBGObj);
    }

    var ChoiceCateDivObj = document.getElementById("ChoiceCateDiv");
    if (ChoiceCateDivObj != null && ChoiceCateDivObj.parentNode != null && ChoiceCateDivObj != "null") {
        ChoiceCateDivObj.parentNode.removeChild(ChoiceCateDivObj);
    }

    var CreatForgetPassWordBgObj = document.createElement("div");
    CreatForgetPassWordBgObj.style.backgroundColor = "#000000";
    CreatForgetPassWordBgObj.style.zIndex = (parseInt(zIndexValue) + 10007);
    CreatForgetPassWordBgObj.style.position = "absolute";
    CreatForgetPassWordBgObj.id = "ChoiceCateDivBG";

    var CreatForgetPassWordMsgObj = document.createElement("div");
    CreatForgetPassWordMsgObj.style.zIndex = (parseInt(zIndexValue) + 10008);
    CreatForgetPassWordMsgObj.style.position = "absolute";
    CreatForgetPassWordMsgObj.id = "ChoiceCateDiv";
    CreatForgetPassWordMsgObj.innerHTML = strHtml;
    CreatForgetPassWordMsgObj.style.width = "620px";
    CreatForgetPassWordMsgObj.style.height = "auto";
    CreatForgetPassWordMsgObj.style.top = parseInt((window.screen.height) / 2 + document.documentElement.scrollTop - 350) + "px";
    CreatForgetPassWordMsgObj.style.left = (window.screen.width - 620) / 2 + "px";
    CreatForgetPassWordMsgObj.style.padding = "0px";
    CreatForgetPassWordMsgObj.style.margin = "0px";

    document.body.appendChild(CreatForgetPassWordBgObj);
    document.body.appendChild(CreatForgetPassWordMsgObj);

    fade("ChoiceCateDivBG", 60, "Auto");
    TheEle_initDrag("ChoiceCateTitle", "ChoiceCateDiv", "", "WebContent");

    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/BusinessTypeList.aspx?CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", "ShowChoiceMsgDiv", "ShowChoiceCateDiv");
}

function ShowChildBusinessType(IDNode, ContentDivID, CateLeve, DivObj) {
    var ImgSrc = DivObj.src;
    var ArrImgSrc = ImgSrc.split("/");
    var DivImg = ArrImgSrc[ArrImgSrc.length - 1].replace(".gif", "");
    var ContentDivIDObj = document.getElementById(ContentDivID);

    switch (DivImg) {
        case "_plus1":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_minus1.gif";
                if (ContentDivIDObj.innerHTML == "") {
                    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/BusinessTypeList.aspx?IDNode=" + IDNode + "&CateLeveFlg=" + CateLeve + "&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", ContentDivID, ContentDivID);
                }
                else {
                    ContentDivIDObj.style.display = "";
                }
                break;
            }
        case "_plus2":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_minus2.gif";
                if (ContentDivIDObj.innerHTML == "") {
                    LoadPageData("GET", "/WorkModule/ContentModule/02.产品列表/code/BusinessTypeList.aspx?IDNode=" + IDNode + "&CateLeveFlg=" + CateLeve + "&ContentDivID=ShowChoiceCateDiv&MsgDivID=ShowChoiceMsgDiv&CurrentDomain=" + WebSiteGroupFun.CurrentDomain, "", "", ContentDivID, ContentDivID);
                }
                else {
                    ContentDivIDObj.style.display = "";
                }
                break;
            }
        case "_minus1":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_plus1.gif";
                ContentDivIDObj.style.display = "none";
                break;
            }
        case "_minus2":
            {
                DivObj.src = "/WorkModule/ContentModule/02.产品列表/code/images/_plus2.gif";
                ContentDivIDObj.style.display = "none";
                break;
            }
    }
}

function SetBusinessTypeValue(CateID, CateName, IDNode) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        SaveCateIDObj.innerHTML = CateID + "," + CateName + "," + IDNode;
    }
}

function SetBusinessType(InputID, IframFlag, strDivID) {
    var SaveCateIDObj = document.getElementById("SelectChoiceCateID");
    if (SaveCateIDObj != null && SaveCateIDObj != "null") {
        if (SaveCateIDObj.innerHTML != "") {
            var SaveCateIDValue = SaveCateIDObj.innerHTML;
            var ArraySaveCateIDValue = SaveCateIDValue.split(",");
            var CateID = ArraySaveCateIDValue[0];
            var CateIDName = ArraySaveCateIDValue[1];
            var IDNode = ArraySaveCateIDValue[2];

            var ArrayIDNode = IDNode.split("|");
            var ParentCateIDName = "";
            for (var i = 0; i < ArrayIDNode.length; i++) {
                if (ArrayIDNode[i] != "0" && ArrayIDNode[i] != "") {
                    ParentCateIDName += document.getElementById("CateIDNameID" + ArrayIDNode[i]).innerHTML + ">";
                }
            }

            switch (IframFlag) {
                case "NoIfram":
                    {
                        document.getElementById(InputID).value = CateID;
                        document.getElementById(InputID + "Name").value = ParentCateIDName + CateIDName;
                        document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }
                case "Ifram":
                    {
                        var framesObj = top.document.getElementById('WorkModuleConfig').contentWindow;
                        framesObj.document.getElementById(InputID).value = CateID;
                        framesObj.document.getElementById(InputID + "Name").value = ParentCateIDName + CateIDName;
                        framesObj.document.getElementById(InputID + "Button").value = "重选";
                        SaveCateIDObj.innerHTML = "";
                        break;
                    }

            }

            ClearChoiceDiv(strDivID);

        }
        else {
            alert("必须选择一个商机类别!");
        }
    }
}
////////////////////////////////////////

function ClearChoiceDiv(strDivID) {
    var arrayStrDivID = strDivID.split(",");
    for (var i = 0; i < arrayStrDivID.length; i++) {
        var Obj = document.getElementById(arrayStrDivID[i]);
        if (Obj != null && Obj != "null") {
            Obj.innerHTML = "";
            if (Obj != null && Obj.parentNode != null) {
                Obj.parentNode.removeChild(Obj);
            }
        }
    }
}
