<%@ Page Language="C#" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Text" %>

<script runat="server">
    protected string _classid = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            _classid = WMread.GetBy("n", "info_class", "id", WM.RQ("classid"));
        }
    }
    string GetData()
    {
        StringBuilder sb = new StringBuilder();
        string strSQL = "select top 200 * from info where enable=" + WM.True + " and classid=" + WM.RQ("classid") + " and thumbnail<>'' order by time desc,id desc";
        IDataReader rdr = (IDataReader)WMshow.Show(strSQL);
        while (rdr.Read())
        {
            string url = rdr["url"].ToString();
            if (url.Length == 0) url = "/news/" + rdr["id"].ToString() + ".htm";
            string pic = rdr["thumbnail"].ToString();
            sb.Append("<li><a title=\"" + Server.HtmlEncode(rdr["title"].ToString()) + "\" rel=\"example_group\" href=\"" + pic + "\" target=\"_blank\"><img alt=\"" + Server.HtmlEncode(rdr["title"].ToString()) + "\" class=\"img1\" src=\"/skin/public/none.gif\" data-original=\"" + ZK.getProportionImage(pic, "", 208, "", 208) + "\" /></a><div class=\"con1\"><a href=\"" + url + "\" target=\"_blank\">" + WM.cut(rdr["title"].ToString(), 32, "..") + "</a></div><span><a href=\"" + url + "\" target=\"_blank\">(" + WMtime.FormatDateTime(rdr["time"].ToString(), "yyyy-MM-dd") + ")&nbsp;点击查看详情&raquo;</a></span></li>");
        }
        rdr.Close();
        rdr.Dispose();
        return sb.ToString();
    }
</script>

<%@ Register TagName="meta" TagPrefix="UC" Src="~/s/include/meta.ascx" %>
<%@ Register TagName="head" TagPrefix="UC" Src="~/s/include/head.ascx" %>
<%@ Register TagName="tip_bar" TagPrefix="UC" Src="~/s/include/tip_bar.ascx" %>
<%@ Register TagName="foot" TagPrefix="UC" Src="~/s/include/foot.ascx" %>
<!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">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title><%=_classid%></title>
    <UC:meta ID="meta1" runat="server" />
    <style type="text/css">
        .self_ulimg
        {
            padding-bottom: 9px;
            padding-left: 18px;
            overflow: hidden;
        }
        .self_ulimg li
        {
            float: left;
            width: 222px;
            margin-top: 11px;
            overflow: hidden;
            height: 256px;
            text-align: center;
            margin-right: 8px;
        }
        .self_ulimg li .img1
        {
            padding: 1px;
            height: 208px;
            width: 208px;
            border: 1px solid #eee;
            display: block;
            margin-right: auto;
            margin-left: auto;
            background: url(/s/skin/loading.gif) no-repeat center center;
        }
        .self_ulimg li .con1
        {
            overflow: hidden;
            height: 20px;
            cursor: pointer;
            padding-top: 4px;
        }
        .self_ulimg li span
        {
            overflow: hidden;
            height: 20px;
        }
        .self_ulimg li a
        {
            color: #06c;
        }
        .self_ulimg li span a
        {
            color: #666;
            font-family: Arial;
        }
        .self_ulimg li a:hover
        {
            color: #06c;
        }
        .self_ulimg li a:hover .img1
        {
            filter: Alpha(Opacity=80);
            -moz-opacity: 0.8;
            opacity: 0.8;
            border: 1px solid #ddd;
        }
    </style>

    <script type="text/javascript" src="/skin/public/jquery-1.8.3.min.js"></script>

    <script type="text/javascript">
        $(function(){
            $.getScript('/skin/public/jquery.lazyload.min.js',function(){   
                $.getScript('/skin/public/jquery.scrollstop.js',function(){   
                    $("img").lazyload({
                        effect: "fadeIn",
                        event: "scrollstop",
                        threshold : 10
                    });
                    $("html,body").animate({scrollTop:$("body").offset().top+1}, 100);
                    /*$("img").lazyload({
                        effect: "show",
                        event: "mouseover"                
                    });*/         
                });           
            });         
        });
    </script>

</head>
<body>
    <div class="wrap"><a name="pagetop" id="pagetop"></a>
        <UC:head ID="head1" runat="server" />
        <UC:tip_bar ID="tip_bar1" runat="server" />
        <div class="box">
            <div class="c1 mt5">
                <div class="b">
                    <div class="fl"></div>
                    <div class="con" style="width: 600px;"><%=_classid%></div>
                    <div class="fr"></div>
                    <div class="clear"></div>
                </div>
                <div class="v">
                    <div id="Panel_List" class="photo_list">

                        <script type="text/javascript" src="/space/fancybox/jquery.min.js"></script>

                        <script type="text/javascript" src="/space/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>

                        <script type="text/javascript" src="/space/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

                        <link rel="stylesheet" type="text/css" href="/space/fancybox/jquery.fancybox-1.3.4.css" media="screen" />

                        <script type="text/javascript">
		                    $(document).ready(function() {
			                    $("a[rel=example_group]").fancybox({
				                    'transitionIn'		: 'none',
				                    'transitionOut'		: 'none',
				                    'titlePosition' 	: 'over',
				                    'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					                    //return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				                        return '<span id="fancybox-title-over"><b class=\"s14\">' + (title.length ?  title : '&nbsp;') + '</b></span>';
				                        return '';	
				                    }
			                    });			
		                    });
                        </script>

                        <div class="self_ulimg">
                            <ul>
                                <%=GetData()%></ul>
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <UC:foot ID="foot1" runat="server" />
    </div>
</body>
</html>
