<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Dd_FerverTag.aspx.cs" Inherits="HteamDd.Web.Web.Dd_discover.Dd_FerverTag" %>

<!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 runat="server">
   <title>发现一热门|海客轻微博</title>
    <link rel="stylesheet" type="text/css" href="/css/public.css" />
    <link rel="stylesheet" type="text/css" href="/css/discover_public.css" />
    <script type="text/javascript" language="javascript" src="/jscript/jquery-1.4.2.js"></script>
    <script src="/jscript/Dd_image_deal.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        var jq = jQuery.noConflict();
        jq(document).ready(function () {
            var user = "";
            var cookie_info = ' <%=user_Mes%>';
            if (cookie_info != "") {
                user = cookie_info.split(',');
                blogname.innerHTML = user[1];
            }
            //退出时，进行session和cookie的清空
            jq("#uer_Exit").click(function () {
                jq.ajax({
                    type: "post",
                    url: '/ashx/Dd_userExit.ashx',
                    data: { type: "exit", time: new Date().getDate() },
                    success: function (data) {
                        if (data == "1") {
                            window.location.href = "/Dd_login.aspx";
                        }
                    },
                    error: function () {

                    }
                });
            });

            //img_user(user[1], "2"); //处理个人图片问题
            jq.ajax({ //网页天头上个人小图标的显示
                type: "get",
                url: '/ashx/Dd_image_deal.ashx',
                data: { user_ID: user[0], type: "user_image", time: new Date().getDate() },
                success: function (data) {
                    if (data != "") {
                        jq("#img_personal").attr("src", (data));
                    }
                },
                error: function () {
                    //jq("#img_personal").attr("src", "/UpLoadImage/HeadImg/Thumbnail_pics/avatar_64_64_jq1095.png");
                }
            });
        });
    </script>
   <script language="javascript" type="text/javascript">
       var pageID = 2;  //第一次加载时显示三行数据
       var first = true;  //判断是否是第一次加载
       var jsn = "";
       var timeid = "";
       var n = 0;
       jq(document).ready(function () {
           mytime();         
       });
       function startTime() {
          timeid= setTimeout("mytime()", 5000);
      }

       function mytime() {
           pageID += 1;
           n++;
           if (n <= 8) {
               jq.post('/ashx/Dd_FerverTag.ashx',
               { isfirst: first, TimeNum: pageID },
                function (result) {
                    success:
                    var judge = result.split('|');
                    if (judge[1] == "True") { pageID = 1; }
                    if (first == true) {
                        first = false;
                        showInfoFirst(judge[0]);
                        startTime();
                        return;
                    }
                    else if (first == false) { showInfo(judge[0]); }
                    startTime();
                });
           }
            else {
                clearTimeout(timeid);
           }
       }
       //第一次显示三行,每一行放两个数据块
       function showInfoFirst(data) {
           jsn = eval(data);
           var $nod = "";
           for (var i = 0; i < jsn.length; i++) {
               if (parseInt(i / 6) == 0) { $nod = jq("#Fever div:eq(2)"); }
               else if (parseInt(i / 6) == 1) { $nod = jq("#Fever div:eq(1)"); }
               else { $nod = jq("#Fever div:eq(0)"); }
               addInfo($nod, i, jsn);
           }
       }

       //再次加载时
       function showInfo(data) {
           jsn = eval(data);
           jq("#Fever").prepend('<div class="row clearfix"></div>');
           var $first = jq("#Fever div:eq(0)");
           for (var i = 0; i < jsn.length; i++) {
               addInfo($first, i, jsn);
           }
           $first.hide(); //隐藏刚加载的div
           //控制显示效果
           $first.slideDown(2000);  //显示刚加载的一行
           //$("#Fever div:eq(3)").slideUp("slow");  //隐藏最后一行
       }

       //将json中的数据添加到页面
       function addInfo(nd, i, jsn) {
           var $nod = nd;
           $nod.append(
               ' <div class="cell cell-photo" tag="" data-url="#">'
               + '<div class="content">'
               + '<img width="150" height="187" src="' + jsn[i].pic_Url + '"/>'
               + '</div>'
               + '<div class="misc">'
               + '<div class="tag-wrapper">'
               + '<span class="tag">'
               + '<a href="/Default.aspx?tag=' + jsn[i].pic_Tag
               + '"></a>' + jsn[i].pic_Tag + '</span>'
               + '</div></div></div>'
               );
       }
       function clearTime() {
           clearTimeout(timeid);
       }
   </script>
   <%--<script type="text/javascript">
       var MSG_UNLOAD = "离开页面时的提示信息!";

       var UnloadConfirm = {};

       UnloadConfirm.set = function (confirm_msg) {

           window.onbeforeunload = function (event) {

               event = event || window.event;

               event.returnValue = confirm_msg;

           }
           window.onunload = function () {
               alert("离开页面后执行的代码!");
           }
       }

       UnloadConfirm.set(MSG_UNLOAD);
</script>--%>
<%--<script type="text/javascript">

    window.onbeforeunload = function () { return 'Sure to leave?'; };

</script>--%>


</head>
<body>
<div id="wrap">
        <div id="header" class="clearfix">
        <div id="logo">
            <a href="/Default.aspx" onclick="clearTime()">海客网</a>
        </div>
        <ul id="nav">
            <li id="nav-index" class="active">
                <a class="nav-item"  href="/Default.aspx" onclick="clearTime()">首页</a>
                <a id="new-feed-count" class="header-pop-notice" style="display:none"></a>
            </li>
            <li>
                <a id="nav-explore" class="nav-item" style="float: left;"  href="Dd_FerverTag.aspx" onclick="clearTime()">发现</a>
            </li>
        </ul>
        <ul id="sub-nav">
            <li>
                <a  href="/Dd_login.aspx" id="uer_Exit" onclick="clearTime()" >退出</a>
            </li>
            <li>
                <a href="/web/Dd_setting.aspx" onclick="clearTime()" >设置</a>
            </li>
            <li>
                <a href="/Web/Dd_Intro_Master/Dd_aboutme.aspx" onclick="clearTime()">关于</a>
            </li>
           <%-- <li>
                <a href="#">手机</a>
            </li>
            <li>
                <a href="#">邀请</a>
            </li>--%>
        </ul>
        <ul id="nav-blog-list" class="clearfix">
            <li id="nav-blog-8500453" dd-event="blog-item">
                <a href="/Web/Dd_private_index.aspx" onclick="clearTime()">
                    <span class="nav-blog-avatar">
                        <img width="20" height="20" id="img_personal" src="/images/avatar_30_30.$1095.png"/>
                    </span>
                    <span class="nav-blog-name" id="blogname"></span>

                </a>
            </li>
        </ul>
    </div>
    <div id="content-holder">
        <div id="content">
            <div class="explore-nav-wrap clearfix">
                <div class="explore-search">
                    <div id="side-search-holder" class="sidebox">
                        <form id="side-search-form">
                            <div id="side-search-box">
                                <input id="side-search-input" class="input-tip" type="text" tip="{"class":"input-tip","text":"搜索标签"}" autocomplete="off" />
                            </div>
                            <button id="side-go-search" type="submit">搜索</button>
                        </form>
                    </div>
                </div>
            </div>
            <div class="recommend-wall-wrap">
                <div id="j_RecommendWall" class="recommend-wall">
                    <div id="Fever" class="wall-holder">
                      <div class="row clearfix"></div>
                      <div class="row clearfix"></div>
                      <div class="row clearfix"></div>
                    </div>
                 </div>
            </div>
            <div class="hot-tags-holder">
                <table class="hot-tags-table" cellpadding="0" cellspacing="0">
                    <thead>
                        <tr class="tag-hd-row">
                            <th class="tag-hd">热门标签</th>
                            <th class="hot-hd">热度</th>
                            <th class="active-hd">内容活跃度</th>
                            <th class="editor-hd">杰出博客</th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="RephotList" runat="server">
                        <ItemTemplate>
                        <tr class="tag-row odd new">
                            <td class="tag">
                                <a href="/Default.aspx?Fever=<%#Eval("lable") %>"><%#Eval("lable")%></a>
                            </td>
                            <td class="hot">
                            <%#GetHotNum(Convert.ToInt32(Eval("Fever")))%>
                            </td>
                            <td class="active">
                                <div class="active-bar-holder clearfix">
                               <%#GetHotHeight((Eval("lable").ToString())) %>
                               </div>
                            </td>
                            <td class="editor">
                                <a class="editor-info" href="#">
                                    <img alt="还没上传头像" src="<%#GetBlogName(Eval("lable").ToString(),"img") %>" width="25px" height="25px"/>
                                    <s class="editor-avartar" style="background-color:Blue"></s>
                                    <%#GetBlogName(Eval("lable").ToString(),"name") %>
                                </a>
                            </td>
                        </tr>
                        </ItemTemplate>
                        </asp:Repeater>
                        
                     </tbody>
                </table>
                <div class="editor-faq">
                    <a href="#">小编FAQ</a>
                </div>
            </div>
        </div>
  </div>
</div>
</body>
</html>
