function GetModelHtml(ChId, ColId, Id) {
    System_Info_SetInfo.GetModelHtmlValue(ChId, ColId, Id, CallBack);
}
function GetModelHtmlUser(ChId, ColId, Id) {
    User_Info_SetInfo.GetModelHtmlValue(ChId, ColId, Id, CallBack);
}
function GetModelHtmlUser_User(TypeId, UserId) {
    System_User_SetUser.GetModelHtmlValue(TypeId, UserId, CallBack);
}
function GetModelHtmlUser_User_1(TypeId, UserId) {
    User_SetUser.GetModelHtmlValue(TypeId, UserId, CallBack);
}
function GetGIPSModelHtml(ChId, Id) {
    system_gips_SetGips.GetModelHtmlValue(ChId, Id, CallBack);
}
function GetGIPSModelAdminHtml(ChId, Id) {
    admin_gips_SetGips.GetModelHtmlValue(ChId, Id, CallBack);
}
function GetCustomUpdateModel(CustomFormId, TableName, Id) {
    System_InfoModel_UpdateInfoCustomForm.GetModelHtmlValue(CustomFormId, TableName, Id, CallBack);
}
function GetCustomUpdateFormField(CustomFormId, TableName, Id) {
    System_InfoModel_UpdateFormField.GetModelHtmlValue(CustomFormId, TableName, Id, CallBack);
}
function GetCustomUserInfoShow(CustomFormId, TableName, Id) {
    User_Info_ShowInfoCustomForm.GetModelHtmlValue(CustomFormId, TableName, Id, CallBack);
}
function GetAdminModelHtml(ChId, ColId, Id) {
    admin_info_SetInfo.GetModelHtmlValue(ChId, ColId, Id, CallBack);
}
function CallBack(res) {
    for (var i = 0; i < res.value.Tables[0].Rows.length; i++) {
        var FieldName = res.value.Tables[0].Rows[i]["Name"];
        switch (res.value.Tables[0].Rows[i]["Type"]) {
          case "TextType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "ListBoxType":
            try {
                var FieldNameValueLength = res.value.Tables[1].Rows[0]["" + FieldName + ""].length;
                switch (res.value.Tables[0].Rows[i]["Content"].substring(5, 6)) {
                  case "1":
                    if (document.all["txt_" + FieldName + "_Id"].value != undefined) {
                        if (res.value.Tables[1].Rows[0]["" + FieldName + "_Id"].indexOf("," + document.all["txt_" + FieldName + "_Id"].value + ",") != "-1") {
                            document.all["txt_" + FieldName + "_Id"].checked = true;
                        }
                        $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""].substring(0, FieldNameValueLength - 1);
                    } else {
                        for (var p = 0; p < document.all["txt_" + FieldName + "_Id"].length; p++) {
                            if (res.value.Tables[1].Rows[0]["" + FieldName + "_Id"].indexOf("," + document.all["txt_" + FieldName + "_Id_" + p + ""].value + ",") != "-1") {
                                document.all["txt_" + FieldName + "_Id_" + p + ""].checked = true;
                            }
                        }
                    }
                    $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""].substring(0, FieldNameValueLength - 1);
                    break;
                  case "2":
                    for (var p = 0; p < document.all["txt_" + FieldName + "_Id"].length; p++) {
                        if (res.value.Tables[1].Rows[0]["" + FieldName + "_Id"].indexOf("," + document.all["txt_" + FieldName + "_Id"][p].value + ",") != "-1") {
                            document.all["txt_" + FieldName + "_Id"][p].selected = true;
                        }
                    }
                    $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    break;
                  case "3":
                    var fieldvalue = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    var fieldvalueid = res.value.Tables[1].Rows[0]["" + FieldName + "_Id"];
                    if (fieldvalue.startsWith(",") == true) {
                        fieldvalue = fieldvalue.substring(1, fieldvalue.length - 1);
                    }
                    if (fieldvalue.endsWith(",") == true) {
                        fieldvalue = fieldvalue.substring(0, fieldvalue.length - 1);
                    }
                    if (fieldvalueid.startsWith(",") == true) {
                        fieldvalueid = fieldvalueid.substring(1, fieldvalueid.length - 1);
                    }
                    if (fieldvalueid.endsWith(",") == true) {
                        fieldvalueid = fieldvalueid.substring(0, fieldvalueid.length - 1);
                    }
                    $("txt_" + FieldName + "").value = fieldvalue;
                    $("txt_" + FieldName + "_Id").value = fieldvalueid;
                    break;
                }
            } catch (e) {}
            break;
          case "DateType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "MultipleTextType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "MultipleHtmlType":
            try {
                if (FieldName.toLowerCase() != "content") {
                    $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    editor.html(res.value.Tables[1].Rows[0]["" + FieldName + ""]);
                } else {
                    var valueStr = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    var parten = "{Qianbo:Page}";
                    var reg = new RegExp(parten, "ig");
                    $("txt_" + FieldName + "").value = valueStr.replace(reg, '<span style="page-break-after: always;"><span style="display: none;">&nbsp;</span></span>');
                }
                window.frames["txt_" + FieldName + "___Frame"].location.reload();
            } catch (e) {}
            break;
          case "PicType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "RadioType":
            try {
                switch (res.value.Tables[0].Rows[i]["Content"].substring(5, 6)) {
                  case "1":
                  case "3":
                    $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    $("txt_" + FieldName + "_Id").value = res.value.Tables[1].Rows[0]["" + FieldName + "_Id"];
                    break;
                  case "2":
                    for (var p = 0; p < document.all["txt_" + FieldName + "_Id"].length; p++) {
                        if (document.all["txt_" + FieldName + "_Id_" + p + ""].value == "" + res.value.Tables[1].Rows[0]["" + FieldName + "_Id"] + "") {
                            document.all["txt_" + FieldName + "_Id_" + p + ""].checked = true;
                        }
                    }
                    $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    break;
                }
            } catch (e) {}
            break;
          case "FileType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "RadomType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "NumberType":
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
          case "ErLinkageType":
            try {
                if (res.value.Tables[1].Rows[0]["" + FieldName + ""] == null) {
                    GetLinkage("select_" + FieldName, "select_" + SelName, 0);
                } else {
                    $("select_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + "_Id"];
                    $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
                    var SelName = res.value.Tables[0].Rows[i]["Content"].split(",")[2].split("=")[1];
                    var SelValue = res.value.Tables[1].Rows[0]["" + SelName + ""];
                    $("txt_" + SelName + "").value = SelValue;
                    $("txt_" + SelName + "_Id").value = res.value.Tables[1].Rows[0]["" + SelName + "_Id"];
                    if (res.value.Tables[2] == null) {
                        GetLinkage("select_" + FieldName, "select_" + SelName, 1, "txt_" + FieldName + "_property");
                    } else {
                        GetUserLinkage("select_" + FieldName, "select_" + SelName, 1, "txt_" + FieldName + "_property");
                    }
                }
            } catch (e) {}
            break;
          default:
            try {
                $("txt_" + FieldName + "").value = res.value.Tables[1].Rows[0]["" + FieldName + ""];
            } catch (e) {}
            break;
        }
    }
}
function CallBack_SystemField(res) {
    switch (res.value.Tables[1].Rows[0]["ModelSort"]) {
      case 3:
        try {
            $("txtTitle").value = res.value.Tables[0].Rows[0]["Title"];
            $("txtIndexNum").value = res.value.Tables[0].Rows[0]["IndexNum"];
            var TagStr = res.value.Tables[0].Rows[0]["TagNameStr"];
            if (TagStr.startsWith("|") == true && TagStr.endsWith("|") == true) {
                TagStr = TagStr.substring(0, TagStr.length - 1);
                TagStr = TagStr.substring(1, TagStr.length);
            }
            var re = /|/g;
            TagStr = TagStr.replace(re, " ");
            $("txtTagNameStr").value = TagStr;
        } catch (e) {}
        break;
      default:
        break;
    }
}
function dateTrans(utcDate) {
    var normalDate = "";
    var month;
    var monthSet = "Jan01Feb02Mar03Apr04May05Ju06Jul07Aug08Sep09Oct10Nov11Dec12";
    var index;
    utcDate.toString;
    normalDate += utcDate.subStr(28, 4);
    month = utcDate.subStr(4, 3);
    index = monthSet.indexof(month);
    index += month.length;
    normalDate += "-" + monthSet.subStr(index, 2);
    normalDate += "-" + utcDate.charAt(8);
    return normalDate;
}