<%@ Page Language="C#" AutoEventWireup="true" Inherits="InfoManage_SetArticle, QianboCMS" EnableEventValidation="false" %>
<%@ Import Namespace="Qianbo.BLL" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>文章添加页面</title>
    <link href="../Css/layout.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Js/jquery.js"></script>
    <script type="text/javascript" src="../../Js/lhgdialog/lhgdialog.min.js?self=true"></script>
    <script src="../../Js/Common.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../../Js/DatePicker/WdatePicker.js"></script>
    <script src="../../Js/XmlHttp.js" type="text/javascript"></script>
    <script language="javascript">
        function EWEBeditor_Create(s_ID, s_Style) {
            document.write('<input type="hidden" name="' + s_ID + '" value="">'
                + '<iframe id="' + s_ID + '__Iframe" src="../../Editor/eWebEditor/eWebEditor.htm?id=' + s_ID + '&style=' + s_Style + '" width="0" height="0" style="display: none;" frameborder="0" scrolling="no"></iframe>');
        }
        function EWEBeditor_ShowDialog(s_ID, s_Type, s_Mode, s_LinkID_SavePathFileName, s_LinkID_SaveFileName, s_LinkID_OriginalFileName) {
            var editor = document.getElementById(s_ID + '__Iframe').contentWindow;
            editor.openUploadDialog(s_Type, s_Mode, s_LinkID_SavePathFileName, s_LinkID_SaveFileName, s_LinkID_OriginalFileName)
        }
        EWEBeditor_Create("eWebEditor1", "standard650");
    </script>
    <script charset="utf-8" src="/Editor/KindEditor/kindeditor-all-min.js" type="text/javascript"></script>
    <script charset="utf-8" src="/Editor/KindEditor/lang/zh-CN.js" type="text/javascript"></script>
</head>

<body onload="OnloadParam();GetTitleType();SetHeader()">
    <iframe width="260" height="165" id="colorPalette" src="../../Common/SetColor.htm" style="visibility: hidden; position: absolute; border: 1px gray solid; left: 2px; top: 1px;" frameborder="0" scrolling="no"></iframe>
    <table cellspacing="1" cellpadding="0" class="wzdh" align="center">
        <tr>
            <td style="padding-left: 10px;">
                <img src="../Images/Skin/Default/you.gif" align="absmiddle" />
                您现在的位置：<a href="../SystemInfo.aspx">后台管理</a> &gt;&gt; <a href="ChannelList.aspx">频道管理</a> &gt;&gt;
                <asp:Literal runat="server" ID="litNav"></asp:Literal>
			</td>
        </tr>
    </table>
    <form id="form1" runat="server">
        <table cellspacing="0" cellpadding="0" border="0" class="cd" align="center">
            <tbody id="ShowDefault">
                <tr align="center">
                    <td id="TabTitle0" class="title6" onclick="ShowTabs(0)">内容设置</td>
                    <td id="TabTitle1" class="title5" onclick="ShowTabs(1)">所属专题</td>
                    <td id="TabTitle2" class="title5" onclick="ShowTabs(2)">高级选项</td>
                    <td id="TabTitle3" class="title5" onclick="ShowTabs(3)">收费选项</td>
                    <td>&nbsp;</td>
                </tr>
            </tbody>
        </table>
        <table cellpadding="0" cellspacing="1" class="editborder" align="center">
            <tr>
                <td class="bqleft"><%=ChannelModel.TypeName%>类型：</td>
                <td class="bqright">
                    <asp:RadioButton ID="rbComm" runat="server" Checked="True" GroupName="TitleType" Text="普通标题" onclick="SetTitleType(1)" />
                    <asp:RadioButton ID="rbImg" runat="server" GroupName="TitleType" Text="图片标题" onclick="SetTitleType(2)" />
                    <asp:CheckBox ID="rbOuter" onclick="SetIsOuter()" runat="server" Text="外部链接" />
				</td>
            </tr>
            <tr style="display: none;" id="ShowOurterUrl">
                <td class="bqleft">转向地址：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtOuterUrl" runat="server" Width="35%"></asp:TextBox>
                    <span class="red">*</span> <%=ChannelModel.TypeName %>转向Url
				</td>
            </tr>
            <tr id="ShowImgUrl" style="display: none;">
                <td class="bqleft">图片地址：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtTitleImgPath" name="txtTitleImgPath" runat="server" Width="35%" ReadOnly="True"></asp:TextBox>
                    <input id="btn" type="button" class="btn" value="上传图片" onclick="EWEBeditor_ShowDialog('eWebEditor1', 'image', '0', 'txtTitleImgPath', '', '')" />
                    <span class="red">*</span>
				</td>
            </tr>
            <tr>
                <td class="bqleft"><%=ChannelModel.TypeName %>标题：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtTitle" runat="server" Text='' Width="300px" MaxLength="200" CssClass=""></asp:TextBox>
                    <span class="red">*</span>
                    <asp:DropDownList ID="ddlTitleFontType" runat="server">
                        <asp:ListItem Value="0">常规</asp:ListItem>
                        <asp:ListItem Value="1">粗体</asp:ListItem>
                        <asp:ListItem Value="2">斜体</asp:ListItem>
                    </asp:DropDownList>
                    <span style="display: none;">
                        <asp:TextBox ID="txtTitleColor" runat="server" Width="45px"></asp:TextBox>
                    </span>
					<span>
                        <img src="../../Images/<%if (txtTitleColor.Text == ""){%>rectNoColor.gif<%}else{%>rect.gif<%} %>" width="18" height="17" border="0" align="absmiddle" id="TitleColorShow" style="cursor: pointer; background-color: #<%=txtTitleColor.Text %>;" title="选取颜色" onclick="GetColor($('TitleColorShow'),'txtTitleColor');" />
					</span>
                    <asp:CheckBox ID="IsShowCommentLink" runat="server" Text="标题旁评论" Visible="false" />
                    <input type="button" class="btn" value="<%=ChannelModel.TypeName %>标题重名检测" onclick="CheckTitle()" />
				</td>
            </tr>
            <tr>
                <td class="bqleft">副标题：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtLongTitle" runat="server" Text='' Width="300px" MaxLength="500"></asp:TextBox>
				</td>
            </tr>
            <tr>
                <td class="bqleft">所属栏目：</td>
                <td class="bqright">
                    <select name="ddlColId" onchange="SetParam()">
                        <%
                            DataTable dt = ColumnBll.GetFormatListItemByChannelId(ChannelId);
                            Response.Write("<option value=\"0\" selected>请选择栏目</option>");
                            foreach (DataRow dr in dt.Rows)
                            {
                                string colName = dr["ColName"].ToString();
                                int colId = Convert.ToInt32(dr["ColId"]);
                                bool flag = ColumnBll.ChkHasChildByColId(colId);
                                if ((flag && !ColumnBll.GetColumn(colId).IsAllowAddInfo) || !AdminGroupBll.Power_Column(colId, AdminUserModel.GroupId, 2))
                                {
                                    if (ColumnId == colId)
                                        Response.Write("<option value=\"" + colId + "\" style=\"background-color: red;\" selected>" + colName + "</option>");
                                    else
                                        Response.Write("<option value=\"" + colId + "\" style=\"background-color: red;\">" + colName + "</option>");
                                }
                                else
                                {
                                    if (ColumnId == colId)
                                        Response.Write("<option value=\"" + colId + "\" selected>" + colName + "</option>");
                                    else
                                        Response.Write("<option value=\"" + colId + "\" >" + colName + "</option>");
                                }
                            }
                        %>
                    </select>
				</td>
            </tr>
            <tr>
                <td class="bqleft">Tag关键字：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtTagNameStr" runat="server" Text='' Width="35%" MaxLength="100"></asp:TextBox>
                    <span class="tips">多个关键字请用空格分隔(每个关键字长度建议保持在20个字符以内)</span>
				</td>
            </tr>
            <tr>
                <td class="bqleft"><%=ChannelModel.TypeName %>作者：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtAuthor" runat="server" Text='' Width="35%" MaxLength="50"></asp:TextBox>
				</td>
            </tr>
            <tr>
                <td class="bqleft"><%=ChannelModel.TypeName %>来源：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtSource" runat="server" Text='' Width="35%" MaxLength="50"></asp:TextBox>
				</td>
            </tr>
            <tr>
                <td class="bqleft">属性设置：</td>
                <td class="bqright">
                    <asp:CheckBox ID="chkBoxIsRecommend" runat="server" Text="推荐" />
                    <asp:CheckBox ID="chkBoxIsFocus" runat="server" Text="焦点" />
                    <asp:CheckBox ID="chkBoxIsHeader" runat="server" Text="头条" onclick="SetHeader()" />
                    <asp:CheckBox ID="chkBoxIsSideShow" runat="server" Text="幻灯" />
                    <asp:CheckBox ID="chkBoxIsTop" runat="server" Text="置顶" />
                    <asp:CheckBox ID="chkBoxIsIrregular" runat="server" Text="不规则<%=ChannelModel.TypeName %>" />
                    <asp:CheckBox ID="chkBoxIsAllowComment" runat="server" Text="允许评论" />
                    <asp:CheckBox ID="chkBoxIsCreate" runat="server" Text="发布" Checked="True" />
				</td>
            </tr>
            <tbody style="display: none;" id="ShowHeaderProperty">
                <tr>
                    <td class="bqleft">头条属性设置：</td>
                    <td class="bqright">
						文字：<asp:TextBox ID="txtHeaderFont" runat="server" Width="270px" MaxLength="86"></asp:TextBox>
                        属性：<asp:DropDownList ID="ddlHeaderProPerty" runat="server">
                            <asp:ListItem Value="常规">常规</asp:ListItem>
                            <asp:ListItem Value="粗体">粗体</asp:ListItem>
                            <asp:ListItem Value="斜体">斜体</asp:ListItem>
                        </asp:DropDownList>
                        大小：<asp:DropDownList ID="ddlHeaderSize" runat="server"></asp:DropDownList>
                        颜色：<asp:TextBox ID="txtHeaderColor" runat="server" Width="45px" Style="display: none;"></asp:TextBox>
                        <span>
                            <img src="../../Images/<%if (txtHeaderColor.Text == ""){%>rectNoColor.gif<%}else{%>rect.gif<%} %>" width="18" height="17" border="0" align="absmiddle" id="HeaderColorShow" style="cursor: pointer; background-color: #<%=txtHeaderColor.Text %>;" title="选取颜色" onclick="GetColor($('HeaderColorShow'),'txtHeaderColor');" />
						</span>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">头条图片：</td>
                    <td class="bqright">
                        <input id="txtHeaderImgPath" runat="server" readonly="readOnly" style="width: 35%;" />
                        <input type="button" runat="server" class="btn" value="上传图片" onclick="EWEBeditor_ShowDialog('eWebEditor1', 'image', '0', 'txtHeaderImgPath', '', '')" />
                        <input type="button" class="btn" onclick="javascript: $('txtHeaderImgPath').value = '';" value="清除" />
					</td>
                </tr>
            </tbody>
            <tr>
                <td class="bqleft"><%=ChannelModel.TypeName %>导读：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtShortContent" runat="server" Rows="6" TextMode="MultiLine" Width="550px"></asp:TextBox>
				</td>
            </tr>
            <tbody id="Tabs0">
                <tr>
                    <td class="bqleft">详细内容：</td>
                    <td class="bqright">
                        <asp:TextBox ID="FilePicPath" runat="server" Text="" Style="display: none;"></asp:TextBox>
                        <asp:TextBox ID="txtContent" runat="server" Style="display: none;"></asp:TextBox>
						<script type="text/javascript">
							KindEditor.ready(function(K) {
								window.editor = K.create('#txtContent', {
								width:'99%',
								height:'500px'
								});
							});
						</script>
                        <!--<iframe id="eWebEditor1" src="../../Editor/eWebEditor/eWebEditor.htm?id=txtContent&style=standard650" frameborder="0" scrolling="no" width="650" height="350"></iframe>-->
                        <!--<asp:CheckBox ID="chkBoxRemoteSaveImage" runat="server" Text="开启远程存图功能" />-->
                    </td>
                </tr>
            </tbody>
            <tbody id="Tabs1" style="display: none;">
                <tr>
                    <td class="bqleft">所属专题：</td>
                    <td class="bqright">
                        <asp:ListBox ID="lBoxTopicIdStr" runat="server" SelectionMode="Multiple" Width="180px" Height="250px"></asp:ListBox>
                        <br />
                        <input type="button" id="btnSelAllTopicIdStr" name="btnSelAllTopicIdStr" value="选定所有专题" class="btn" onclick="btnSetToppicStr('ChooseAll')" />
                        <input type="button" id="btnCanCelTopicIdStr" name="btnCanCelTopicIdStr" value="取消选定专题" class="btn" onclick="btnSetToppicStr('Cancel')" />
					</td>
                </tr>
            </tbody>
            <tbody id="Tabs2" style="display: none;">
                <tr>
                    <td class="bqleft">点击数：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtHitCount" runat="server" Width="70px" MaxLength="10" onkeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;">0</asp:TextBox> 次
						<asp:TextBox ID="txtUpdateDateTime" runat="server" Style="display: none;"></asp:TextBox>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">评分等级：</td>
                    <td class="bqright">
                        <asp:DropDownList ID="ddlStarLevel" runat="server">
                            <asp:ListItem Value="★">★</asp:ListItem>
                            <asp:ListItem Value="★★">★★</asp:ListItem>
                            <asp:ListItem Value="★★★" Selected="True">★★★</asp:ListItem>
                            <asp:ListItem Value="★★★★">★★★★</asp:ListItem>
                            <asp:ListItem Value="★★★★★">★★★★★</asp:ListItem>
                        </asp:DropDownList>
					</td>
                </tr>
                <script type="text/javascript">
                    var jq = jQuery.noConflict();
                    jQuery(function () {
                        jQuery('#btnAddViewer').click(function () {
                            jQuery.dialog({
                                id: 'txtAddViewer',
                                lock: true,
                                title: '要求签收用户',
                                content: "url:../../Common/SelectViewer.aspx?ControlId=" + escape('txtViewer') + "&FilePath=news",
                                width: 800,
                                height: 'auto'
                            });
                        });
                        jQuery('#btnSelTemplate').click(function () {
                            jQuery.dialog({
                                id: 'txtSelTemplate',
                                lock: true,
                                title: '选择模板',
                                content: "url:../Common/SelectFile.aspx?ControlId=" + escape('txtTemplatePath') + "&StartPath=" + escape('/Template') + "",
                                width: 800,
                                height: 500
                            });
                        });
                    });
                </script>
                <tr>
                    <td class="bqleft">要求签收用户：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtViewer" runat="server" Width="35%" MaxLength="100"></asp:TextBox>
                        <input id="btnAddViewer" class="btn" type="button" value="添加" />
                        <input type="button" value="清空" class="btn" onclick="javascript: $('txtViewer').value = '';" />
					</td>
                </tr>
                <tr>
                    <td class="bqleft">添加时间：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtAddTime" runat="server" Width="15%"></asp:TextBox>
                        <span class="tips">默认为当前时间</span>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">签收结束时间：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtViewEndTime" runat="server" Width="15%" onClick="WdatePicker()"></asp:TextBox>
                        <span class="tips">当有签收用户时，此项为必填。</span>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">模板路径：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtTemplatePath" runat="server" Text="" Width="35%"></asp:TextBox>
                        <input type="button" value="选择模板" id="btnSelTemplate" class="btn" />
                        <span class="red">*</span>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">内容页扩展名：</td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="rdBtnPageType" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="1" Selected="True">.html</asp:ListItem>
                            <asp:ListItem Value="2">.htm</asp:ListItem>
                            <asp:ListItem Value="3">.shtml</asp:ListItem>
                            <asp:ListItem Value="4">.aspx</asp:ListItem>
                        </asp:RadioButtonList>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">归档时间：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtExpireTime" runat="server" Width="15%" onClick="WdatePicker()"></asp:TextBox>
                        <span class="red">*</span>
					</td>
                </tr>
            </tbody>
            <tbody id="Tabs3" style="display: none;">
                <tr>
                    <td class="bqleft">阅读收取金币数：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtPointCount" runat="server" Width="70px" MaxLength="10" onkeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;">0</asp:TextBox>
                        <span class="tips">阅读本文需要消耗多少<%=SiteModel.GUnitName%>金币</span>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">阅读权限：</td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="rdBtnIsOpened" runat="server">
                            <asp:ListItem Selected="True" Value="2">继承栏目权限（当所属栏目为认证栏目时，建议选择此项。）</asp:ListItem>
                            <asp:ListItem Value="1">开放（当所属栏目为开放栏目，想单独对某些文章进行阅读权限设置，可以选择此项。）</asp:ListItem>
                            <asp:ListItem Value="0">认证（当所属栏目为认证栏目，想单独对某些文章进行阅读权限设置，可以选择此项。）</asp:ListItem>
                        </asp:RadioButtonList>
                        <asp:CheckBoxList ID="chkBoxGroupIdStr" runat="server" RepeatDirection="Horizontal"></asp:CheckBoxList>
					</td>
                </tr>
                <tr>
                    <td class="bqleft">重复收费方式：</td>
                    <td class="bqright">
                        <asp:RadioButton ID="rdBtnChargeType1" runat="server" Checked="True" GroupName="ChargeType" />不重复收费<br />
                        <asp:RadioButton ID="rdBtnChargeType2" runat="server" GroupName="ChargeType" />距离上次收费时间
                        <asp:TextBox runat="server" ID="txtChargeHourCount" Text="24" MaxLength="10" Width="82px" onkeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;"></asp:TextBox>小时后重新收费<br />
                        <asp:RadioButton ID="rdBtnChargeType3" runat="server" GroupName="ChargeType" />会员重复阅读此文章
                        <asp:TextBox runat="server" ID="txtChargeViewCount" Text="10" MaxLength="10" Width="70px" onkeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;"></asp:TextBox>次后重新收费<br />
                        <asp:RadioButton ID="rdBtnChargeType4" runat="server" GroupName="ChargeType" />上述两者都满足时重新收费<br />
                        <asp:RadioButton ID="rdBtnChargeType5" runat="server" GroupName="ChargeType" />上述两者任一个满足时就重新收费<br />
                        <asp:RadioButton ID="rdBtnChargeType6" runat="server" GroupName="ChargeType" />每阅读一次就重复收费一次
					</td>
                </tr>
            </tbody>
            <tr>
                <td class="bqleft"></td>
                <td class="bqright">
                    <asp:Button ID="btnAddNewsSave" runat="server" Text="保存" OnClick="AddNewsBtn_Click" CssClass="btn" OnClientClick="return CheckValidate()" />
                    <input type="button" id="btnAddNewsCanCel" value="取消" class="btn" onclick='javascript: history.back();' />
                    <asp:Literal ID="litMsg" runat="server"></asp:Literal>
				</td>
            </tr>
        </table>
    </form>
    <br />
</body>
</html>
<script type="text/javascript">
    var typeName ='<%=ChannelModel.TypeName %>'
    function CheckTitle() {
        var title = $("txtTitle").value.trim();
        if (title.length == 0) {
            alert("检测" + typeName + "标题不能为空！");
            return;
        }
        var flag = CheckHas("../Common/CheckHas.aspx", title, "Title", "Qianbo_Article")
        if (!flag) {
            alert("标题不存在！");
        }
        else {
            alert("标题已存在！");
        }
    }
    var elementCount = 0;
    function SepTagName() {
        $("txtTagNameStr").focus();
        if (document.selection) {
            var range = document.selection.createRange();
            range.text = "|";
        }
    }
    function SetIsOuter() {
        if ($('rbOuter').checked) {
            ShowOurterUrl.style.display = "";
            ShowDefault.style.display = "none";
            Tabs0.style.display = "none";
            Tabs1.style.display = "none";
            Tabs2.style.display = "none";
            Tabs3.style.display = "none";
        }
        else {
            ShowOurterUrl.style.display = "none";
            ShowDefault.style.display = "";
            Tabs0.style.display = "";
            ShowTabs(0);
        }
    }
    function SetTitleType(obj) {
        var temp = obj;
        if (temp == 1) {
            $('rbComm').checked = true;
            ShowImgUrl.style.display = "none";
            $('chkBoxIsSideShow').disabled = true;
        }
        else if (temp == 2) {
            $('rbImg').checked = true;
            ShowImgUrl.style.display = "";
            $('chkBoxIsSideShow').disabled = false;
        }
    }
    function CheckValidate() {
        var patt = /\d{4}-\d{1,2}-\d{1,2}$/;
        var title = $("txtTitle").value.trim();
        if (title.length == 0) {
            alert("" + typeName + "标题不能为空！");
            return false;
        }
        if ($('ddlColId').value == "0") {
            alert("请选择栏目！");
            return false;
        }
        if ($('ddlColId').options[$('ddlColId').selectedIndex].style.backgroundColor.trim().length != 0) {
            alert("所选栏目不能添加/修改" + typeName + "！");
            return false;
        }
        if ($("rbOuter").checked) {
            if ($("txtOuterUrl").value.trim().length == 0) {
                alert("" + typeName + "链接Url不能为空！");
                return false;
            }
        }
        if ($("rbImg").checked) {
            if ($("txtTitleImgPath").value.trim().length == 0) {
                alert("图片地址不能为空！");
                return false;
            }
        }
        if (!$("rbOuter").checked) {
            if ($("txtPointCount").value.trim().length == 0) {
                alert("阅读收取金币数不能为空！");
                return false;
            }
            if ($("txtHitCount").value.trim().length == 0) {
                alert("点击数不能为空！");
                return false;
            }
            if ($("txtExpireTime").value.trim().length == 0) {
                alert("归档时间不能为空！");
                return false;
            }
            if (!patt.test($("txtExpireTime").value.trim())) {
                alert("请输入正确的归档时间！");
                return false;
            }
            if (!patt.test($("txtViewEndTime").value.trim()) && $("txtViewEndTime").value.trim() != "") {
                alert("请输入正确的签收结束时间！");
                return false;
            }
            if ($("txtTemplatePath").value.trim().length == 0) {
                alert("模板路径不能为空！");
                return false;
            }
            if ($("rdBtnChargeType2").checked || $("rdBtnChargeType4").checked || $("rdBtnChargeType5").checked) {
                if ($("txtChargeHourCount").value.trim() == "") {
                    alert("请输入距离上次收费时间！");
                    return false;
                }
            }
            if ($("rdBtnChargeType3").checked || $("rdBtnChargeType4").checked || $("rdBtnChargeType5").checked) {
                if ($("txtChargeViewCount").value.trim() == "") {
                    alert("请输入会员重复阅读此" + typeName + "后重新收费次数！");
                    return false;
                }
            }
        }
        if ($('chkBoxIsHeader').checked) {
            if ($('txtHeaderFont').value.trim().length == 0) {
                alert("头条文字不能为空！");
                return false;
            }
            if ($('txtHeaderColor').value.trim().length == 0) {
                alert("头条文字颜色不能为空！");
                return false;
            }
        }
        return true;
    }
    function GetTitleType() {
        if ($("rbComm").checked) {
            ShowOurterUrl.style.display = "none";
            ShowDefault.style.display = "";
            ShowImgUrl.style.display = "none";
            $('chkBoxIsSideShow').disabled = true;
        }
        else if ($("rbImg").checked) {
            ShowImgUrl.style.display = "";
            ShowOurterUrl.style.display = "none";
            ShowDefault.style.display = "";
            $('chkBoxIsSideShow').disabled = false;
        }
        if ($("rbOuter").checked) {
            SetIsOuter()
        }
    }
    function btnSetToppicStr(val) {
        var lst1 = $("lBoxTopicIdStr");
        var length = lst1.options.length;
        var tt = "";
        if (val == "ChooseAll") {
            for (var i = 0; i < length; i++) {
                lst1.options[i].selected = true;
            }
        }
        else {
            for (var i = 0; i < length; i++) {
                lst1.options[i].selected = false;
            }
        }
    }
    function SetParam() {
        var data = XmlHttpPostMethodText("GetColumn.aspx", "ColId=" + $('ddlColId').value);
        if (data == "") {
            return;
        }
        else {
            var param = data.split('$');
            if (param.length == 7) {
                $('rdBtnPageType_' + (param[0] - 1)).checked = true;
                $('txtTemplatePath').value = param[1];
                $('rdBtnChargeType' + param[2]).checked = true;
                $('txtChargeHourCount').value = param[3];
                $('txtChargeViewCount').value = param[4];
                $('txtPointCount').value = param[5];
                if (param[6] == "True") {
                    $('chkBoxIsAllowComment').checked = true;
                }
            }
        }
    }
    function OnloadParam() {
        var articleId =<%=ArticleId %>;
        if (articleId == 0) {
            SetParam();
        }
    }
    function SetHeader() {
        if ($('chkBoxIsHeader').checked)
            ShowHeaderProperty.style.display = "";
        else
            ShowHeaderProperty.style.display = "none";
    }
</script>