function CheckValidate() {
    if (DianCMS_$("txtModelName").value == "") {
        $.dialog.alert('请输入模型名称', function() {
            DianCMS_$("txtModelName").focus();
        });
        return false;
    }
    if (DianCMS_$("txtModelEnName").value == "") {
        $.dialog.alert('请输入模型英文名称', function() {
            DianCMS_$("txtModelEnName").focus();
        });
        return false;
    }
    if (DianCMS_$("txtModelUnit").value == "") {
        $.dialog.alert('请输入模型单位', function() {
            DianCMS_$("txtModelUnit").focus();
        });
        return false;
    }
    if (DianCMS_$("txtTableName").value == "") {
        $.dialog.alert('请输入模型表名', function() {
            DianCMS_$("txtTableName").focus();
        });
        return false;
    }
    if (DianCMS_$("txtUploadPath").value == "") {
        $.dialog.alert('上传文件存放目录不能够为空', function() {
            DianCMS_$("txtUploadPath").focus();
        });
        return false;
    }
    if (DianCMS_$("txtUploadSize").value == "") {
        $.dialog.alert('请输入文件上传大小', function() {
            DianCMS_$("txtUploadSize").focus();
        });
        return false;
    }
    if (DianCMS_$("txtHomeTemplate").value == "") {
        $.dialog.alert('请选择模型首页模板', function() {
            DianCMS_$("txtHomeTemplate").focus();
        });
        return false;
    }
    if (DianCMS_$("txtInfoTemplate").value == "") {
        $.dialog.alert('请选择内容页模板', function() {
            DianCMS_$("txtInfoTemplate").focus();
        });
        return false;
    }
    //            if ($("txtCommentTemplate").value == "") {
    //                Alert("请选择评论页模板");
    //                return false;
    //            }

    return true;
}
function PinYin() {
    var chs = DianCMS_$("txtModelName").value;
    D.BLL.B_CHS2PinYin.GetPinYin(chs, CallBack);
}

function CallBack(res) {
    DianCMS_$("txtModelEnName").value = res.value;
}

function AddInfoType() {
    var TypeCount = document.getElementsByName("RadAddInfo");
    var s;
    if (navigator.appName == "Microsoft Internet Explorer") {
        s = TypeCount[1].checked;
    }
    else {
        s = TypeCount[0].checked;
    }
    if (s) {
        DianCMS_$("SelectColumn").style.display = "none";
    }
    else {
        DianCMS_$("SelectColumn").style.display = "";
    }
}

function SelectModel() {
    var TypeCount = document.getElementsByName("RadModelType");
    var p = 0;
    if (navigator.appName == "Microsoft Internet Explorer") {
        p = 1;
    }

    for (var i = p; i < TypeCount.length; i++) {
        if (TypeCount[i].checked) {
            switch (TypeCount[i].value) {
                case "1":
                    DianCMS_$("Info_Model").style.display = "";
                    DianCMS_$("Music_Model").style.display = "none";
                    DianCMS_$("Shop_Model").style.display = "none";
                    DianCMS_$("Movie_Model").style.display = "none";
                    DianCMS_$("txtTabelName_1").value = "D_U_";
                    DianCMS_$("MovieTemplate").style.display = "none";
                    break;
                case "2":
                    DianCMS_$("Info_Model").style.display = "none";
                    DianCMS_$("Music_Model").style.display = "";
                    DianCMS_$("Shop_Model").style.display = "none";
                    DianCMS_$("Movie_Model").style.display = "none";
                    DianCMS_$("txtTabelName_1").value = "D_Music_";
                    DianCMS_$("MovieTemplate").style.display = "none";
                    break;
                case "3":
                    DianCMS_$("Info_Model").style.display = "none";
                    DianCMS_$("Music_Model").style.display = "none";
                    DianCMS_$("Shop_Model").style.display = "";
                    DianCMS_$("Movie_Model").style.display = "none";
                    DianCMS_$("txtTabelName_1").value = "D_Shop_";
                    DianCMS_$("MovieTemplate").style.display = "none";
                    break;
                case "4":
                    DianCMS_$("Info_Model").style.display = "none";
                    DianCMS_$("Music_Model").style.display = "none";
                    DianCMS_$("Shop_Model").style.display = "none";
                    DianCMS_$("Flow_Model").style.display = "";
                    DianCMS_$("txtTabelName_1").value = "D_Flow_";
                    break;
                case "5":
                    DianCMS_$("Info_Model").style.display = "none";
                    DianCMS_$("Music_Model").style.display = "none";
                    DianCMS_$("Shop_Model").style.display = "none";
                    DianCMS_$("Movie_Model").style.display = "";
                    DianCMS_$("txtTabelName_1").value = "D_Movie_";
                    DianCMS_$("MovieTemplate").style.display = "";
                    break;
            }
        }
    }
}