<%@ page language="C#" masterpagefile="~/SiteServer/MasterPage/PageTemplate.Master" autoeventwireup="true" inherits="SiteServer_Collect_Collect_StepThree, v5star.Web" title="Untitled Page" enableviewstate="false" validaterequest="false" theme="Default" %>

<%@ Register Src="CollectEditor.ascx" TagName="CollectEditor" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageBody" runat="Server">

    <script type="text/javascript">
    <!--
    function ChangeSet(obj)
    {
        var td2 = obj.parentNode.parentNode.lastChild;
        if(obj.checked)
        {
            td2.firstChild.style.display = 'none';
            td2.childNodes[1].style.display = '';
        }
        else
        {
            td2.firstChild.style.display = '';
            td2.childNodes[1].style.display = 'none';
        }
    }
    function ChangePage()
    {
        var flag;
        if(document.getElementById('ctl00_PageBody_RadPageNone').checked)
            flag = 0;
        else if(document.getElementById('ctl00_PageBody_RadPageOther').checked)
            flag = 1;
        else if(document.getElementById('ctl00_PageBody_RadPageCode').checked)
            flag = 2;
        var tr1 = document.getElementById("ctl00_PageBody_Tr_PageOther");
        var tr2 = document.getElementById("ctl00_PageBody_Tr_PageCode");

        switch(flag)
        {
            case 0:
                tr1.style.display = 'none';
                tr2.style.display = 'none';
                break;
            case 1:
                tr1.style.display = '';
                tr2.style.display = 'none';
                break;
            case 2:
                tr1.style.display = 'none';
                tr2.style.display = '';
                break;
        }
    }  
	function ChangeUrl(obj)
	{
	   var url = obj.options[obj.selectedIndex].value; 
	    var frm = document.getElementById("PreviewArea");
	    frm.src = url;
    }
    function ChangeUrls(obj)
	{
	    var url = "/viewcode.axd?url="+obj.options[obj.selectedIndex].value;
	    var frm = document.getElementById("ViewCode");
	    frm.src = url;
    }
	function StepBack()
	{
	    location.href = "Collect_StepTwo.aspx?ID=<%=cjid%>";
	}
	
	function LoadMe()
	{	  
        ChangeSet(document.getElementById('ctl00_PageBody_ChbAuthor'));
        ChangeSet(document.getElementById('ctl00_PageBody_ChbSource'));
        ChangeSet(document.getElementById('ctl00_PageBody_ChbTime'));
        ChangePage();
    }
  
    window.onload=LoadMe;
    //-->
    </script>

    <aspx:HeadMenuWebControls ID="HeadMenuWebControls1" runat="server" HeadTitleTxt="采集管理">
        <aspx:HeadMenuButtonItem ButtonIcon="back.gif" ButtonName="返回" ButtonPopedom="List"
            ButtonUrl="history.back()" ButtonUrlType="JavaScript" ButtonVisible="True" />
    </aspx:HeadMenuWebControls>
    <aspx:TabOptionWebControls ID="TabOptionWebControls1" runat="server">
        <aspx:TabOptionItem ID="TabOptionItem1" runat="server" Tab_Name="正文设置">
            <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="border">
                <tr>
                    <td class="table_body" style="width: 30%;" align="center">
                        标题:
                    </td>
                    <td class="table_none" style="width: 70%;">
                        <uc1:CollectEditor ID="EdtCaption" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="table_body" align="center">
                        内容:
                    </td>
                    <td class="table_none">
                        <uc1:CollectEditor ID="EdtContent" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="table_body" align="center">
                        作者:<asp:CheckBox runat="server" ID="ChbAuthor" onclick="ChangeSet(this)" Text="手动" />
                    </td>
                    <td class="table_none">
                        <div>
                            <uc1:CollectEditor ID="EdtAuthor" runat="server" />
                        </div>
                        <div>
                            <asp:TextBox runat="server" ID="TxtAuthor" Width="98%" MaxLength="100" /></div>
                    </td>
                </tr>
                <tr>
                    <td class="table_body" align="center">
                        来源:<asp:CheckBox runat="server" ID="ChbSource" onclick="ChangeSet(this)" Text="手动" /></td>
                    <td class="table_none">
                        <div>
                            <uc1:CollectEditor ID="EdtSource" runat="server" />
                        </div>
                        <div>
                            <asp:TextBox runat="server" ID="TxtSource" Width="98%" MaxLength="100" /></div>
                    </td>
                </tr>
                <tr>
                    <td class="table_body" align="center">
                        时间:<asp:CheckBox runat="server" ID="ChbTime" onclick="ChangeSet(this)" Text="手动" /></td>
                    <td class="table_none">
                        <div>
                            <uc1:CollectEditor ID="EdtTime" runat="server" />
                        </div>
                        <div>
                            <asp:TextBox runat="server" ID="TxtTime" Width="98%" MaxLength="25" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table_body" align="center">
                        分页方式</td>
                    <td class="table_none">
                        <asp:RadioButton runat="server" onclick="ChangePage()" Checked="true" ID="RadPageNone"
                            GroupName="RadGroupPage" Text="不设置新闻分页" />
                        <asp:RadioButton runat="server" onclick="ChangePage()" ID="RadPageOther" GroupName="RadGroupPage"
                            Text="递归分页设置" />
                        <asp:RadioButton runat="server" onclick="ChangePage()" ID="RadPageCode" GroupName="RadGroupPage"
                            Text="单页获取分页设置" />
                    </td>
                </tr>
                <tr runat="server" id="Tr_PageOther">
                    <td class="table_body" align="center">
                        递归分页设置
                    </td>
                    <td class="table_none">
                        <uc1:CollectEditor ID="EdtPageOther" runat="server" />
                        <br />
                        <span style="color: red;">例:&lt;a href="[分页新闻]"&gt;下一页 要求:下一页,必须为整个页面中唯一字符,只有第一个"[分页新闻]"有效。</span>
                    </td>
                </tr>
                <tr runat="server" id="Tr_PageCode">
                    <td class="table_body" align="center">
                        单页获取分页设置:
                    </td>
                    <td class="table_none">
                        <uc1:CollectEditor ID="EdtPageRule" runat="server" />
                        <br />
                        <span style="color: red;">例:&lt;a href="[分页新闻]"&gt;[变量]&lt;/a&gt; 要求 [分页新闻] 前字符串必须为整个页面中唯一代码</span>
                    </td>
                </tr>
                <tr id="Tr1" runat="server">
                    <td align="center" colspan="2">
                        &nbsp;<input type="button" value="上一步" class="button_bak" onclick="StepBack()" />
                        <asp:Button runat="server" ID="BtnNext" Text="完 成" CssClass="button_bak" OnClick="BtnNext_Click" />
                        <asp:Button runat="server" ID="BT_Test" Text="测 试" CssClass="button_bak" OnClick="BT_Test_Click" /></td>
                </tr>
            </table>
        </aspx:TabOptionItem>
        <aspx:TabOptionItem ID="TabOptionItem2" runat="server" Tab_Name="HTML代码">
            <table class="boder">
                <tr>
                    <td>
                        <asp:DropDownList ID="DropDownList1" runat="server" onchange="ChangeUrls(this)" Width="100%">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <iframe id="ViewCode" frameborder="1" marginheight="1" marginwidth="1" scrolling="no"
                            src="about:blank" style="height: 455px; width: 750px"></iframe>
                    </td>
                </tr>
            </table>
        </aspx:TabOptionItem>
        <aspx:TabOptionItem ID="TabOptionItem3" runat="server" Tab_Name="网页预览">
            <table class="boder">
                <tr>
                    <td>
                        <asp:DropDownList ID="DropDownList2" runat="server" onchange="ChangeUrl(this)" Width="100%">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <iframe frameborder="1" src="about:blank" id="PreviewArea" marginheight="1" marginwidth="1"
                            style="height: 450px; width: 750px" scrolling="auto"></iframe>
                    </td>
                </tr>
            </table>
        </aspx:TabOptionItem>
    </aspx:TabOptionWebControls>
</asp:Content>
