<%@ page language="C#" autoeventwireup="true" inherits="vote_vote_result, 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">
        .VoteResult
        {
            padding: 6px 15px 14px 15px;
        }
        .VoteResult td
        {
            border-bottom: dotted 1px #ddd;
            padding: 10px 0;
        }
        .VoteResult .td1
        {
            width: 120px;
        }
        .VoteResult .td1 div
        {
            font-size: 14px;
            width: 120px;
            overflow: hidden;
            height: 20px;
            text-align:center;
        }
        .VoteResult .td1 div a
        {
            color: #069;
        }
        .VoteResult .td1 div a:hover
        {
            color: #f60;
        }
        
        .VoteResult .td2 div 
        {
        	padding-left:10px;
        }
        .VoteResult .td2 div img
        {
            -moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;
        }
        .VoteResult .td3
        {
            width: 70px;
        }
        
        .VoteResult .td3 div
        {
            font-size: 14px;
            width: 70px;
            overflow: hidden;
            height: 20px;
            color: #666;
            text-align:center;
        }
    </style>
</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>
            <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">
                    <asp:Repeater ID="Repeater1" runat="server">
                        <HeaderTemplate>
                            <div class="VoteResult">
                                <table border="0" cellpadding="0" cellspacing="0" width="100%" id="VoteResultTable">
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td class="td1">
                                    <div><a href="vote1_view.aspx?classid=<%#Eval("ClassID")%>&id=<%#Eval("ID")%>" target="_blank"><%#Eval("ItemName")%></a></div>
                                </td>
                                <td class="td2">
                                    <div><%#Eval("ItemCount")%></div>
                                </td>
                                <td class="td3">
                                    <div><%#Eval("ItemCount")%>
                                        票</div>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table></div>
                        </FooterTemplate>
                    </asp:Repeater>

                    <script type="text/javascript">
                    function ShowVoteResult()
                    {                                              
                        var TRS=document.getElementById("VoteResultTable").getElementsByTagName("tr"); 
                        
                        var TotalWidth="700";//总宽度
                        var TotalItems=TRS.length;//总数量
                        
                        var TDS=TRS[0].getElementsByTagName("td");
                        var MaxValue=parseInt(TDS[2].innerHTML.toLowerCase().replace("<div>","").replace("</div>","").replace("票","").replace(" ","").replace("　",""));//最大票数
                        
                        var proportion=MaxValue/TotalWidth;//比例                        
                        
                        for(var i=0;i<TRS.length;i++)
                        {
                            var TD_=TRS[i].getElementsByTagName("td")[1];
                            var Value_=TD_.innerHTML.toLowerCase().replace("<div>","").replace("</div>","").replace("票","").replace(" ","").replace("　","");
                            var NewValue_=Value_/proportion;
                            var pic="p3.jpg";
                            if(i==0)pic="p0.jpg";else if(i==1)pic="p1.jpg";else if(i==2)pic="p2.jpg";
                            TD_.innerHTML="<div><img alt=\"\" src=\""+pic+"\" width=\""+NewValue_+"\" height=\"28\" /></div>";
                        }
                    }
                    ShowVoteResult();
                    </script>

                </div>
            </div>
            <asp:Literal ID="Literal_VoteFoot" runat="server"></asp:Literal>
        </div>
        <UC:foot ID="foot1" runat="server" />
    </div>
</body>
</html>
