<%@ page language="C#" autoeventwireup="true" inherits="ask_Detail, App_Web_k4nthjel" enableviewstate="false" enableEventValidation="false" %>
<%@ Register src="~/inc/PageHead.ascx" tagname="PageHead" tagprefix="uc1" %>
<%@ Register src="~/inc/PageSearchBox.ascx" tagname="PageSearchBox" tagprefix="uc2" %>
<%@ Register src="~/inc/PageFooter.ascx" tagname="PageFooter" tagprefix="uc3" %>
<%@ Register src="~/inc/NewsRight.ascx" tagname="NewsRight" tagprefix="uc4" %>
<%@ Register src="~/inc/ParamPageNavigator.ascx" tagname="ParamPageNavigator" tagprefix="uc5" %>
<%@ Register src="~/inc/NewsTopAds.ascx" tagname="NewsTopAds" tagprefix="uc6" %>
<%@ Register src="Searchbox.ascx" tagname="Searchbox" tagprefix="uc7" %>
<%@ Register src="LeftCategorys.ascx" tagname="LeftCategorys" tagprefix="uc8" %>
<%@ Register src="../inc/PageSmallHead.ascx" tagname="PageSmallHead" tagprefix="uc9" %>
<%@ Register src="AskPostItem.ascx" tagname="AskPostItem" tagprefix="uc10" %>

<!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">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title><%= Utils.GetShortTextNotEx(td.subject,80) %>_福建婚嫁问答_<%= ConfigurationManager.AppSettings["site_title"]%></title>
    <meta name="description" content="<%= Utils.GetShortTextNotEx(Utils.FilterHtml(td.topicdescr + td.askdescr),200).Replace("\t","").Replace(" ","").Replace("\r","").Replace("\n","") %>" />
    <meta name="keywords" content="<%= td.keywords %> <%= Utils.GetArrText(Utils.arrAskCategorys,td.subcateid,4) %> <%= Utils.GetArrText(Utils.arrAskCategorys,td.cateid,2) %> <%= Utils.GetArrText(Utils.arrAskCategorys,td.subcateid,2) %>" />
    
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/css/front.css" rel="stylesheet" type="text/css" />
    <link href="/fsk/style.css" rel="stylesheet" type="text/css" />
    <style type="text/css"></style>
    <script type="text/javascript" src="/Js/jquery.js"></script>
    <script type="text/javascript" src="/Js/utils.js"></script>
    <script type="text/javascript" src="/Js/_effect.js"></script>
    <script type="text/javascript" src="/js/ajax.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="wrapper askbody askdetail">
            <uc9:PageSmallHead ID="PageSmallHead1" runat="server" Title="问答" />
            <uc7:Searchbox ID="Searchbox1" runat="server" />
            <div style="text-align:center;">
                <%= Utils.GetADHtml("ASK-TOP-1", "/adimages/askad2.png", "", true)%>
                
            </div>
            
            <div class="topnavs">
                <div class="left"><a href="/fsk/">婚嫁问答</a> > <%= Utils.GetAskCateLinkHTML(td.cateid)%> > <%= Utils.GetAskCateLinkHTML(td.subcateid)%></div>
                <div class="right"><%= Utils.GetADHtml("ASK-D-TXT1-1", "婚嫁网广告位火爆招商中", "", false)%></div>
            </div>
            <div class="clear"></div>
            
            <div class="llist">
                <div class="questions <%= td.isdone ? "acceptedques" : "" %>">
                    <div class="tit">
                        <span class="left"><strong>问题</strong> <%= !td.isdone ? "(离问题结束还有:" + (td.questiondate.AddDays(14) - DateTime.Now).Days + "天" + (td.questiondate.AddDays(14) - DateTime.Now).Hours + "小时)" : "(已完成)"%> <%= td.store > 0 ? " <img src='/fsk/images/moneys.gif' align='absmiddle' /> 高悬赏" + td.store + "分" : ""%></span>
                        <span class="right"><a href="javascript:changetsize('.bg .content',18);">大</a> <a href="javascript:changetsize('.bg .content',14);">中</a> <a href="javascript:changetsize('.bg .content',12);">小</a> | <a href="javascript:fav();">添加收藏夹</a></span>
                        <div class="clear"></div>
                    </div>
                    <div class="bg">
                        <h1 class="subject"><%= td.subject%></h1>
                        <div class="content">
                            <%= content %>
                            <div class="appendcontent" style="display:<%= td.appendcontentfile == "" ? "none" : "" %>">
                            <%= Utils.HtmlEncode(Utils.GetFileData(td.appendcontentfile)) %>
                            </div>
                            <div class="opts">
                                <div class="left"><% if (!td.isdone && !IsMyQuestion)
                                                     { %><a href="#askinputs">我来回答</a><%} %></div>
                                <div class="right">提问者：<a href="#"><%= td.poster%></a>  <%= td.isdone ? "已完成" : "未完成"%> - <%= td.questiondate%> 
                                <%if (!td.isdone && IsMyQuestion && td.appendcontentfile == "")
                                  { %><a href="javascript:void(0);" class="app" id="appendques">补充提问</a><%} %>
                                
                                    <div id="appendquespnl">
                                        <textarea id="txtappendques"></textarea><br />
                                        <input type="button" value="补充提问" id="doappendques" />
                                    </div>
                                </div>
                            </div>
                        <div class="clear"></div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div id="asklist">
                    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
                    <ItemTemplate>
                        <uc10:AskPostItem ID="AskPostItem1" runat="server" PostItemId='<%# DataBinder.Eval(Container.DataItem, "postid")%>'
                            content='<%# DataBinder.Eval(Container.DataItem, "content")%>'
                            asker='<%# DataBinder.Eval(Container.DataItem, "asker")%>'
                            isaccept='<%# DataBinder.Eval(Container.DataItem, "isaccept")%>'
                            Recommands='<%# DataBinder.Eval(Container.DataItem, "Recommands")%>'
                            isdone='<%# DataBinder.Eval(Container.DataItem, "isdone")%>'
                            isSysget='<%# DataBinder.Eval(Container.DataItem, "issysget")%>'
                            topicUid='<%# DataBinder.Eval(Container.DataItem, "topicuid")%>'/>
                    </ItemTemplate>
                    </asp:Repeater>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:dnt3ConnectionString %>" 
                        SelectCommand="SELECT t2.uid as topicuid,t1.postid,t1.content,t1.asker,t1.isaccept,t1.Recommands,t2.issysget,t2.isdone from mry_askposts as t1 left join mry_asktopics as t2 on t1.topcid = t2.topcid where t1.topcid = @topcid order by isaccept desc, postid">
                        <SelectParameters>
                            <asp:QueryStringParameter DefaultValue="3" Name="topcid" 
                                QueryStringField="id" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </div>
                <%if (!td.isdone && !IsMyQuestion)
                  { %>
                <div class="askinputs" id="askinputs">
                    <div class="bg">
                        <div class="left">我来回答：<B><%= Utils.IsLogined ? Utils.GetLoginedUserDescr().uname : "匿名" %></B>&nbsp;&nbsp;&nbsp;</div>
                        <div class="right">
                            <textarea id="txtContent"></textarea>
                            <div class="l">
                            <input type="button" value="提交回答" id="submitask" />
                            请输入验证码：<input id="txtValidateCode" type="text" style="width:60px" /> &nbsp;
                            <span id="validateimg"><img src="/inc/aspx/ValidateCode.aspx?" style="cursor:pointer;" /></span>
                            </div>
                            <div class="r">
                            <%= Utils.GetADHtml("ASK-D-IMG1-1", "/adimages/1212.gif", "width:247px;height:40px;", true)%></div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                <%} %>
                <div class="hots">
                    <div class="tit">网友最关注的<%= Utils.GetAskCateLinkHTML(td.subcateid)%>问题</div>
                    <div class="bg">
                    <asp:Repeater ID="Repeater8" runat="server" DataSourceID="SqlDataSource8">
                        <HeaderTemplate><ul></HeaderTemplate>
                        <ItemTemplate><li><a href="<%# Utils.GetAskItemLinkUrl(DataBinder.Eval(Container.DataItem, "subcateid"),DataBinder.Eval(Container.DataItem, "topcid")) %>" title="<%# DataBinder.Eval(Container.DataItem, "subject") %>"><%# Utils.GetShortText(DataBinder.Eval(Container.DataItem, "subject"),40)%></a></li></ItemTemplate>
                        <FooterTemplate></ul></FooterTemplate>
                        </asp:Repeater>
                        <asp:SqlDataSource ID="SqlDataSource8" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:dnt3ConnectionString %>" 
                            SelectCommand="SELECT TOP 20 subcateid, topcid,subject FROM mry_asktopics where subcateid = @subcateid order by lastaskdate desc,asks desc,hots desc">
                        </asp:SqlDataSource>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
            
            <div class="rlist">
                <div class="topic">
                    <div class="bg">
                        <div class="ad" style=" text-align:center;">
                        <!-- zanox AdServer code start-->
<script type="text/javascript" src="http://zbox.zanox.com/scripts/adbox_content.js">
</script>
<script type="text/javascript">
CallAdBoxTracking(379547, 507246441, 0, 200, 200, 'B0E0E6', 'FFFFFF', '000000', '336699', '333333', '0', '', true);
</script>
<!-- zanox AdServer code end -->

         
                        </div> 
                        <div class="bestact">
                            <asp:Repeater ID="Repeater16" runat="server" DataSourceID="SqlDataSource16">
                            <ItemTemplate>
                            <div class="bestact" style="clear:both;display:table;height:380px;">
                                <a target="_blank" href="/vip/<%# DataBinder.Eval(Container.DataItem, "buid") %>/act_<%# DataBinder.Eval(Container.DataItem, "activityid") %>.html"><img src="/uploadfiles/<%# DataBinder.Eval(Container.DataItem, "picurl")%>_small.jpg" alt="<%# DataBinder.Eval(Container.DataItem, "companyname") %> <%# DataBinder.Eval(Container.DataItem, "activityname") %>" /></a>
                                <a target="_blank" title="<%# DataBinder.Eval(Container.DataItem, "activityname") %>" href="/vip/<%# DataBinder.Eval(Container.DataItem, "buid") %>/act_<%# DataBinder.Eval(Container.DataItem, "activityid") %>.html"><%# Utils.FormatNumberString(Utils.GetShortText(DataBinder.Eval(Container.DataItem, "activityname"), 66))%></a>
                            </div>
                            </ItemTemplate>
                            </asp:Repeater>
                            <asp:SqlDataSource ID="SqlDataSource16" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:DLConnectionString %>" 
                                SelectCommand="select top 1 activityid,buid,activityname,picurl,companyname,startdate,enddate,outofdate from v_BusinessActivityUname where enddate > getdate() order by newid()">
                            </asp:SqlDataSource>
                        </div>
                        <div style="display:none;">
                            <ul>
                                <li><%= Utils.GetADHtml("ASK-D-TXT2-1", "广告位招商", "", false)%></li>
                                <li><%= Utils.GetADHtml("ASK-D-TXT2-2", "广告位招商", "", false)%></li>
                            </ul>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="askbuttons">
                    <a href="/fsk/BeforeQuestion.aspx"><img src="/fsk/images/doask.gif" alt="我要提问" /></a>
                </div>
                <div class="recomm">
                    <div class="tit">精华知识</div>
                    <div class="bg">
                    <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource1">
                        <HeaderTemplate><ul></HeaderTemplate>
                        <ItemTemplate><li><a target="_blank"href="<%# Utils.GetAskItemLinkUrl(DataBinder.Eval(Container.DataItem, "subcateid"),DataBinder.Eval(Container.DataItem, "topcid")) %>" title="<%# DataBinder.Eval(Container.DataItem, "subject") %>"><%# Utils.GetShortText(DataBinder.Eval(Container.DataItem, "subject"),40)%></a></li></ItemTemplate>
                        <FooterTemplate></ul></FooterTemplate>
                        </asp:Repeater>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:dnt3ConnectionString %>" 
                            SelectCommand="SELECT TOP 10 subcateid, topcid,subject FROM mry_asktopics order by topcid desc">
                        </asp:SqlDataSource>
                    </div>
                </div>
                <div class="keywords">
                    <div class="tit">热门搜索</div>
                    <div class="bg">
                        <ul>
                        <%
                            foreach (string key in ConfigurationManager.AppSettings["hot_ask_keywords"].Split(','))
                            {
                                %>
                            <li><a href="/fsk/AskList.aspx?isfind=true&keyword=<%= Server.UrlEncode(key) %>" class="<%= Utils.rnd.Next(1,3)==1 ? "b" : "" %>"><%= key %></a></li>
                                <%
                            }
                         %>
                        </ul>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
            
            <!-- 主要内容结束 -->
            <uc3:PageFooter ID="PageFooter1" runat="server" />
        </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#submitask").bind("click", function() {
                SubmitAsk(<%=td.topcid %>, 
                    <%= Utils.IsLogined ? Utils.GetLoginedUserDescr().bbsUid : 0 %>, 
                    '<%= Utils.IsLogined ? Utils.GetLoginedUserDescr().uname : "匿名" %>', 
                        $("#txtContent").attr("value"),
                        $("#txtValidateCode").attr("value"),
                        '<%= !Utils.IsLogined %>');
            });

            $("#validateimg").bind("click", function() {
                $("#validateimg img").attr("src", "/inc/aspx/ValidateCode.aspx?t=" + new Date().getTime());
            });
            
            $("#appendques").click(function(){
                $("#appendquespnl").show();
                $("#appendques").hide();
            });
            
            $("#doappendques").click(function(){
                AppendQuestion(<%=td.topcid %>,$("#txtappendques").attr("value"),<%= Utils.IsLogined ? Utils.GetLoginedUserDescr().bbsUid : 0 %>);
            });
        });
    </script>
</body>
</html>
