<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function() { $("#tbl tr:nth-child(odd)").addClass("striped") });
    </script>
    <div class="contentDiv">
    <table border="0" cellpadding="0" cellspacing="0" >
        <tr id="Tr1">
            <td id="rightTableData" valign="top">
                <div id="linksPanel" style="margin-right:15px; margin-top : 10px;">
                    <table id="tblpanel" border="0" cellpadding="0" cellspacing="0" style="width:200px;">
                        <tr>
                            <td id="panelheadright" class="panelheadright">
                            </td>
                            <td id="panelheadrepeat" class="panelheadrepeat" align="center" style="width:160px;">
                                <asp:Label ID="lblpanelHead" runat="server" Text="منوی سایت" style="color:White; font-weight:bold; "></asp:Label>
                            </td>
                            <td id="panelheadleft" class="panelheadleft">
                            </td>
                        </tr>
                        <tr>
                            <td id="panelmarginright" class="panelmarginright">
                            </td>
                            <td valign="top" class="panelcontentback" style="background-image:none; background-color : White; "> <!-- ************ Content Place !-->
                                <div class="panelcontent" style="margin-top:17px;">
                                    <asp:Panel ID="panelMenues" runat="server">
                                    </asp:Panel>
                                </div>
                            </td>
                            <td id="panelmarginleft" class="panelmarginleft" align="left">
                            </td>
                        </tr>
                        <tr>
                            <td id="panelbottomright" class="panelbottomright" align="right">
                            </td>
                            <td id="panelbottomrepeat" class="panelbottomrepeat" style="width:160px;">
                            </td>
                            <td id="panelbottomleft" class="panelbottomleft" align="left">
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
            <td id="contentTableData" style="width:100%; padding-right : 10px;" align="right"; valign="top";>
                <div id="UserInfo" style="margin-left:10px; margin-top : 10px; margin-right:10px;">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td width="10px">
                                <asp:Image ID="Image1" runat="server" Width="10px" Height="150px" ImageUrl="~/images/kadrright.gif"/>
                            </td>
                            <td align="right" valign="middle" style="height:150px; background-image:url(images/kadrback.gif); background-repeat:repeat-x;">
                                <table border="0" cellpadding="0" cellspacing="5px">
                                    <tr>
                                        <td rowspan="3">
                                            <asp:Image ID="imgbtnUserImage" runat="server" Width="100px" Height="133px" ImageUrl=""/>
                                        </td>
                                        <td align="right">
                                            <asp:Label ID="lblFullName" runat="server" Text="" CssClass="userInfoLabels"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="lblUserName" runat="server" Text="" CssClass="userInfoLabels"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:LinkButton ID="btnMessages" runat="server" CssClass="userInfoLabels" 
                                                onclick="btnMessages_Click"></asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="10px">
                                <asp:Image ID="Image2" runat="server" Width="10px" Height="150px" ImageUrl="~/images/kadrleft.gif"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="frameContainer" style="padding:10px 10px 25px 10px; float:right; width:55%;">
                    <table id="Table2" border="0" cellpadding="0" cellspacing="0" style="width:100%;">
                        <tr>
                            <td id="Td92" class="panelheadright">
                            </td>
                            <td id="Td102" class="panelheadrepeat" align="center" >
                                <asp:Label ID="lblFrameTitle" runat="server" Text="جدیدترین اخبار" style="color:White; font-weight:bold;"></asp:Label>
                            </td>
                            <td id="Td112" class="panelheadleft">
                            </td>
                        </tr>
                        <tr>
                            <td id="Td122" class="panelmarginright">
                            </td>
                            <td valign="top" class="panelcontentback" > <!-- ************ Content Place !-->
                                <div id="divRoleType" class="panelcontent" style="text-align:center; " runat="server">
                                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>" 
                                        ProviderName="System.Data.SqlClient" 
                                        SelectCommand="SELECT Top 14 * FROM [t_News] Where showInList = 1 ORDER BY [newsId] DESC"></asp:SqlDataSource>
                                    <asp:GridView ID="GridView1" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="grid" 
                                        PageSize="14" PagerStyle-CssClass="gridPager" DataSourceID="SqlDataSource1"
                                        onrowcommand="GridView1_RowCommand">
                                        <Columns>
                                            <asp:BoundField DataField="newsId" HeaderText="کد خبر" 
                                                InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" 
                                                ItemStyle-CssClass="gridCell" >
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:TemplateField HeaderText="عنوان خبر" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="linkSubject" NavigateUrl='<%#GetNewsDetailsShowUrl(Eval("newsId")) %>' runat="server" style="text-decoration:none;" ><%#Eval("subject") %></asp:HyperLink>
                                                    <cc1:HoverMenuExtender ID="HoverMenuExtender1" runat="server" DynamicServicePath="" Enabled="True" PopupPosition="Left" 
                                                        TargetControlID="linkSubject" OffsetX="-5" OffsetY="-10" PopupControlID="panelContext">
                                                        <Animations>
                                                            <OnShow>
                                                                <Sequence>
                                                                    <HideAction Visible="True" />
                                                                    <Parallel Duration="0.3">
                                                                        <FadeIn Fps="24"/>
                                                                        <Move Horizontal="-25" Vertical="0" />
                                                                    </Parallel>
                                                                </Sequence>
                                                            </OnShow>
                                                            <OnHide>
                                                                <Sequence>
                                                                    <FadeOut Duration="0.2" Fps="24"/>
                                                                </Sequence>
                                                            </OnHide>
                                                        </Animations>
                                                    </cc1:HoverMenuExtender>
                                                    <asp:Panel ID="panelContext" runat="server" CssClass="popcontextpanel">
                                                        <div id="newsContext" runat="server">
                                                            <%#GetNewsContext(Eval("context").ToString())%>
                                                        </div>
                                                    </asp:Panel>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="newsDate" HeaderText="تاریخ خبر" 
                                                InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" 
                                                ItemStyle-CssClass="gridCell" >
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="numOfVisits" HeaderText="تعداد بازدیدها" 
                                                InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" 
                                                ItemStyle-CssClass="gridCell" >
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                            </td>
                            <td id="Td132" class="panelmarginleft" align="left">
                            </td>
                        </tr>
                        <tr>
                            <td id="Td142" class="panelbottomright" align="right" >
                            </td>
                            <td id="Td152" class="panelbottomrepeat" >
                            </td>
                            <td id="Td162" class="panelbottomleft" align="left";>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="Div1" style="padding:10px 10px 10px 10px; float : left; width:35%;">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td width="10px">
                                <asp:Image ID="Image3" runat="server" Width="10px" Height="400px" ImageUrl="~/images/newskadrright.gif"/>
                            </td>
                            <td align="center" valign="middle" style="height:400px; background-image:url(images/newskadrback.gif); background-repeat:repeat-x;">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <asp:SqlDataSource ID="SqlNews" runat="server" 
                                            ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>" 
                                            SelectCommand="SELECT TOP (10) newsId, newsDate, subject, context, numOfVisits, addedBy, newsPicUrl, lastEditDate, lastEditorUser, showInList FROM t_News  Where showInList = 1 ORDER BY [newsId] DESC"></asp:SqlDataSource>
                                        <asp:GridView ID="GridNews" runat="server" BorderStyle="None"
                                                AllowPaging="True" AutoGenerateColumns="False" 
                                                PageSize="1" DataKeyNames="newsId" DataSourceID="SqlNews" 
                                            ShowHeader="false" ShowFooter="false" onrowcommand="GridNews_RowCommand">
                                                <PagerSettings NextPageText="&gt;" PreviousPageText="&lt;" />
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <table border="0" cellpadding="0" cellspacing="0">
                                                                <tr style="padding-bottom:5px;">
                                                                    <td>
                                                                        <asp:ImageButton ID="imgbtnNews" runat="server" Width="200px" Height="200px" ImageUrl='<%#FindImageUrl(Eval("newsPicUrl")) %>' CommandName="ShowNews" CommandArgument='<%#Eval("newsId") %>'/>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-bottom:5px;">
                                                                    <td>
                                                                        <asp:LinkButton ID="btnSubject" runat="server" style="text-decoration:none;" CommandName="ShowNews" CommandArgument='<%#Eval("newsId") %>'><%#Eval("subject").ToString()%></asp:LinkButton>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-bottom:5px;">
                                                                    <td>
                                                                        <div class="newsshowcontext">
                                                                            <div style="padding:8px 8px 8px 8px;"><asp:Label ID="lblContext" runat="server" Text='<%#FindNewsContext(Eval("context")) %>'></asp:Label></div>
                                                                        </div>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerStyle CssClass="gridPager" BorderStyle="None" HorizontalAlign="Center" 
                                                    VerticalAlign="Middle" />
                                            </asp:GridView>
                                            <asp:Timer ID="Timer1" runat="server" Interval="2500" ontick="Timer1_Tick">
                                            </asp:Timer>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td width="10px">
                                <asp:Image ID="Image4" runat="server" Width="10px" Height="400px" ImageUrl="~/images/newskadrleft.gif"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
    </table>
</div>
</asp:Content>



