<%@ page language="C#" autoeventwireup="true" inherits="vote_vote2, ZKCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register TagName="meta" TagPrefix="UC" Src="~/s/include/meta.ascx" %>
<%@ Register TagName="head" TagPrefix="UC" Src="~/s/include/head.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" />
    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
    <UC:meta ID="meta1" runat="server" />
    <style type="text/css">
        .VoteBox
        {
            padding: 0 0 8px 15px;
        }
        .VoteBox li
        {
            margin-top: 10px;
            width: 175px;
            float: left;
            text-align: center;
            padding-top: 9px;
            margin-right: 8px;
            border: solid 1px #ddd;
            background:#F5F5F5;
            -moz-border-radius: 10px;-webkit-border-radius: 10px;border-radius: 10px;
        }
        .VoteBox li .con1
        {
        }
        .VoteBox li .con1 img
        {
            width: 140px;
            height: 170px;
            padding: 1px;
            border: solid 1px #ccc;
            display: block;
            margin: 0 auto;
            background:#fff;
            -moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;
        }
        .VoteBox li .con1 a:hover img
        {
            filter: Alpha(Opacity=80);
            -moz-opacity: 0.8;
            opacity: 0.8;
        }
        .VoteBox li .con2
        {
            padding-top: 5px;
            height: 20px;
            overflow: hidden;
            font-size: 14px;
            font-weight: bold;
        }
        .VoteBox li .con2 a
        {
            color: #333;
        }
        .VoteBox li .con2 a:hover
        {
            color: #f60;
        }
        .VoteBox li .con3
        {
            padding: 5px 14px 8px 14px;
        }
        .VoteBox li .con3 td
        {
            text-align: left;
        }
    </style>

    <script type="text/javascript">
    var VoteStat=0;
    function DoVote(id)
    {
        function recovery()
        {
            VoteStat=0;
        }
        if(VoteStat==1)
        {
            alert("投票太快！");
            setTimeout(recovery,3000);
        }
        else
        {
            document.getElementById("votehref"+id).href="javascript:void(0)";
            function SubFun(result)
            {
                document.getElementById("votehref"+id).href="javascript:DoVote('"+id+"')";
                VoteStat=0;   
                
                if( parseInt(result)>0)
                {                
                    document.getElementById("vote"+id).innerHTML=result;
                    document.getElementById("votehref"+id).href="javascript:DoVoted()";  
                    //alert("投票成功！");
                    TINY.box.show("<div class=\"msgon str\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">&nbsp;恭喜您，投票成功！</div>",0,200,23,0,3);
                }
                else if(result=="-1")
                {                    
                    document.getElementById("votehref"+id).href="javascript:DoVoted()";  
                    //alert("请不要重复投票！");
                    TINY.box.show("<div class=\"msgon str\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">&nbsp;请不要重复投票！</div>",0,200,23,0,2);
                }
                else if(result=="-2")
                {
                    alert("非法投票！");
                }
                else if(result=="-3")
                {
                    alert("投票还未开始！");
                }
                else if(result=="-4")
                {
                    alert("投票活动已结束！");
                }
                else if(result=="-5")
                {
                    alert("请先登录后再投票！");
                }
                else
                {
                    alert("投票失败！");                    
                }                                 
            }
            VoteStat=1; 
            ajax("post","vote1.aspx?act=vote","id="+base64en(id),function OnHandler(){if(xmlHttp.readyState == 4){SubFun(xmlHttp.responseText);}});
        }
    }
    function DoVoted()
    {
        //alert("您已经投过票了！");
        TINY.box.show("<div class=\"msgon str\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">&nbsp;您已经投过票了！</div>",0,200,23,0,2);
    }
    </script>

</head>
<body>
    <div class="wrap"><a name="pagetop" id="pagetop"></a>
        <UC:head ID="head1" runat="server" />
        <div class="box pt5">
            <asp:Literal ID="Literal_VoteHead" runat="server"></asp:Literal>
            <asp:Panel ID="Panel1" runat="server">
                <div class="c1 mt5">
                    <div class="b">
                        <div class="fl"></div>
                        <div class="con">投票说明</div>
                        <div class="fr"></div>
                        <div class="clear"></div>
                    </div>
                    <div class="v">
                        <div style="padding: 6px 10px;">
                            <asp:Literal ID="Literal2" runat="server"></asp:Literal>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <div class="c1 mt5">
                <div class="b">
                    <div class="fl"></div>
                    <div class="con">在线投票</div>
                    <div class="fr"><a href="vote_result.aspx?classid=<%=WM.RQ("classid")%>" target="_blank">查看结果</a></div>
                    <div class="clear"></div>
                </div>
                <div class="v">
                    <asp:Repeater ID="Repeater1" runat="server">
                        <HeaderTemplate>
                            <div class="VoteBox">
                                <ul>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <li>
                                <div class="con1"><a href="vote1_view.aspx?classid=<%#Eval("ClassID")%>&id=<%#Eval("ID")%>" target="_blank"><img alt="<%#Eval("ItemName")%>" src="<%#WMcompare.IsEqual(Eval("thumbnail").ToString(),"","/skin/public/none.gif")%>" /></a></div>
                                <div class="con2"><a title="查看详细介绍" href="vote1_view.aspx?classid=<%#Eval("ClassID")%>&id=<%#Eval("ID")%>" target="_blank"><%#Eval("ItemName")%></a></div>
                                <div class="con3">
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td>
                                                <span id="vote<%#Eval("ID")%>" style="padding-right: 4px"><%#Eval("ItemCount")%></span>票
                                            </td>
                                            <td>
                                                <div class="ar"><a id="votehref<%#Eval("ID")%>" href="javascript:DoVote('<%#Eval("ID") %>')"><img alt="" src="vote_btn1.gif" /></a></div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </li>
                        </ItemTemplate>
                        <FooterTemplate>
                            </ul><div class="clear"></div>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
            </div>
            <asp:Literal ID="Literal_VoteFoot" runat="server"></asp:Literal>
        </div>
        <UC:foot ID="foot1" runat="server" />
    </div>
</body>
</html>
