<%@ Page Language="C#" AutoEventWireup="true" Codebehind="movie.aspx.cs" Inherits="JuSNS.Web.home.Movie.Movie" %>
<!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>
<title id="ptitle" runat="server">电影</title>
<script language="javascript" type="text/javascript" src="<%=rooDir %>/js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="<%=rooDir %>/js/public.js"></script>
<link href="<%=rooDir %>/template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css"   id="skinpath" type="text/css" rel="stylesheet" />
    <script language="javascript" type="text/javascript">
    function loadStar()
    {
        var mystar=document.getElementById("span_star");
        var XY=getXY(mystar);
        var orgClassName=mystar.className;
        var orgInnerTxt=mystar.innerText;
        
        mystar.onmousemove=function()
        {
            var event=getEvent();
            var obj=event.srcElement||event.target;
            var x=event.clientX;
            var offsetX=x-XY.X;
            
            var starNumber=(Math.floor((offsetX-3)/16)+1);
            mystar.innerText=starNumber;
            mystar.className="rate-star rate-star"+starNumber; 
        }
        mystar.onmouseout=function()
        {
            mystar.className=orgClassName;
            mystar.innerText=orgInnerTxt;
        }
        mystar.onmousedown=function()
        {
            var starNum=mystar.innerText;
            var pobj=mystar.parentNode;
        }
        mystar.onmouseup=function()
        {
            var starNumber=mystar.innerText;
            orgClassName="rate-star rate-star"+starNumber;
            orgInnerTxt=starNumber;
            mystar.className="rate-star rate-star"+starNumber;
        }
        mystar.onclick=function()
        {
           var starNumber=mystar.innerText;
           op("SaveScore",starNumber);
        }
    }
    
    if (window.attachEvent)
    {
        window.attachEvent("onload",loadStar); 
    }
    if (window.addEventListener)
    {
        window.addEventListener("load",loadStar,false);
    } 
    </script>

</head>
<body>
   <!--头部-->
   <%=this.GetHtmlShort()%> 
    <div id="divhead">
        <%=this.GetHtmlHead()%>
    </div>
    <div id="divbody">
        <div id="body_first">
            <div class="body_menu">
                <%=this.GetHtmlLeft()%>
            </div>
        </div>
        <div id="body_sec">
           <form id="form1" runat="server"> 
                <div id="body_mid">
                    <div class="body_frame">
                        <!--主题内容中-->
                        <div class="body_frame_otherinfo">
                            <div class="title">
                                <div class="l">
                                    <img src="<%=rooDir %>/template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/movie.gif" align="absmiddle" />
                                    <span class="bold shenlan font14 ocolor" id="em_Name" runat="server">电影，视频</span></div>
                                <div class="r">
                            
                                     <input type="text" id="moviename" class="f-text" runat="server" />
                                     <input type="button" class="f-button" value="搜索电影，视频" onclick="javascript:self.location='<%=rooDir %>/home/movie/index.aspx?r=all&key='+escape(document.form1.moviename.value);" />
                                   
                                </div>
                                <div class="c">
                                </div>
                            </div>
                            <div class="nav-menu">
                                <ul>
                                    <li><a href="<%=rooDir %>/home/movie">好友的电影</a></li>
                                    <li><a href="<%=rooDir %>/home/movie/?r=my">我的电影</a></li>
                                    <li><a href="<%=rooDir %>/home/movie/?r=all">所有电影</a></li>
                                    <li><a href="<%=rooDir %>/home/movie/top.aspx">排行榜</a></li>
                                   <li class="current"><a href="<%=rooDir %>/movie/m<%=Request.QueryString["Id"] %>.aspx">电影概况</a></li>
                                </ul>
                            </div>
                        </div>
                        
                        
                        <div class="body_sec_left">
                                <div class="content">
                                        <div class="pstr">
                                            <span id="span_Name" runat="server" class="font16 bold"></span>
                                        </div>
                                </div>
                                
                                <div class="content">
                                <div id="movie-show" class="nl">
                                    <div class="nl image w150 center">
                                        <img width="140" height="180" id="Img_Movie" runat="server" /><a id="A_Upload" runat="server">电影海报</a>
                                    </div>
                                    
                                    <div class="nr w370 padding10">
                                        <div id="movie-show-evaluation">
                                            <div class="font14 bold">
                                                评价：
                                            </div>
                                            <div id="p_result" runat="server" class="pstr"></div>
                                            <div class="spline"></div>
                                        </div>
                                        
                                        <div id="movie-show-evaluate">
                                            <div class="font14 bold">我的评价</div>
                                            <div class="movie-costar pstr">
                                                <span class="movie-rating">
                                                    <span class="rate-star rate-star0" id="span_star" runat="server"></span>
                                                </span> 
                                                <a href="javascript:void(0);" id="a_Think" class="movie-wannasee nope" onclick="javascript:op('Think',0);" onmouseout="this.className='movie-wannasee nope'" onmouseover="this.className='movie-wannasee'" runat="server">想看</a> <a href="javascript:void(0);"  id="a_NoThink" class="movie-notinterested nope" onmouseout="this.className='movie-notinterested nope'"  onmouseover="this.className='movie-notinterested'" onclick="javascript:op('NoThink',0);" runat="server">不想看</a>
                                            </div>
                                            <div id="Common" runat="server"></div>
                                            <asp:HiddenField ID="HidMovieID" runat="server" />
                                        </div>
                                       <div class="spline"></div>
                                    </div>
                                </div>
                                <div class="hdtitle s97 bold">剧情</div>
                                <div runat="server" id="span_Gut" class="pstr indent" style="line-height:22px;"></div>
                                <div class="spline"></div>
                                <div class="hdtitle s97 bold">播放地址(系统) &nbsp; <span class="normal"><a href="javascript:;" onclick="AddMovieUrl('<%=Request.QueryString["Id"] %>');">为此电影视频添加播放地址</a></span></div>
                                <div id="MovieListURL" class="pstr" runat="server" />
                                <div class="spline" id="comment"></div>
                                <div id="GetUserUserList" runat="server"></div>
                                <div id="mv-friendsreview" class="content c">
                                    <div class="hdtitle bold">
                                        好友的评价 &nbsp; <span class="normal"><span id="span_Cnt" runat="server"></span>个好友评价了这部电影。</span>
                                    </div>
                                    <div class="content nl">
                                        <ul>
                                            <asp:Repeater ID="Rpt_Comm" runat="server">
                                                <ItemTemplate>
                                                    <li class="nl pstr">
                                                        <div class="body-m-left nl image center">
                                                            <a href="<%=rooDir %>/user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>">
                                                                <img src="<%# JuSNS.Common.Public.GetSmallHeadPic(DataBinder.Eval(Container.DataItem, "FilePath"),1)%>" alt="<%# DataBinder.Eval(Container.DataItem, "UserName")%>" style="width:48px;" /><div><%# DataBinder.Eval(Container.DataItem, "UserName")%></div></a>
                                                         </div>
                                                        
                                                        <div class="body-m-right nr ">
                                                            <div class="<%# getCSS(DataBinder.Eval(Container.DataItem, "Score")) %>" style="margin:5px;"></div>
                                                            <div class="pstr">
                                                                <%# getContent(DataBinder.Eval(Container.DataItem, "Comment"))%>
                                                            </div>
                                                        </div>
                                                        <div class="spline"></div>
                                                    </li>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                                
                        </div>
                        <!--中间分隔-->
                        <div class="line_mid">
                          <div class="line_01"></div>
                          <div class="line_02" id="midline"></div>
                          <div class="line_03"></div>
                        </div>
                        <!--中间分隔结束-->                    
                        <div class="body_sec_right">
                                <div class="adscss">
                                    <script type="text/javascript" src="<%=rooDir %>/js/ads/body_top.js"></script>
                                </div>
                                <div id="movie-subinfo">
                                    <dl>
                                        <dt class="bold">导演：</dt>
                                        <dd>
                                            <span id="span_Director" runat="server"></span>
                                        </dd>
                                        <dt class="bold">演员：</dt>
                                        <dd>
                                            <span id="span_Billing" runat="server"></span>
                                        </dd>
                                        <dt class="bold">年份：</dt>
                                        <dd>
                                            <a id="a_Year" runat="server"></a>
                                        </dd>
                                        <dt class="bold">类型：</dt>
                                        <dd>
                                            <span id="sapn_Sort" runat="server"></span>
                                        </dd>

                                    </dl>
                                </div>
                                <div class="line1"></div>
                                <div class="ctitle c">您看过这些电影吗...</div>
                                <div class="movie-list-top" id="TopLooked" runat="server"></div>
                                <div class="line1"></div>
                                <div class="ctitle c">点击最多的电影...</div>
                                <div class="movie-list-top" id="Tophits" runat="server"></div>
                                <div class="line1"></div>
                                <div class="ctitle c">热门电影...</div>
                                <div class="movie-list-top" id="Topcomment" runat="server"></div>                                
                                                                
                                <div class="adscss">
                                    <script type="text/javascript" src="<%=rooDir %>/js/ads/body.js"></script>
                                </div>                                 
                            
                        </div>
                        
                        </div>
                    <!--底部-->
                    <div class="divbottom">
                        <%=this.GetHtmlFoot()%>
                    </div>                    
                        </div>
            </form>
       </div>
</div>
</body>
</html>

<script language="javascript" type="text/javascript">
function op(type,Score)
{
    var uid='<%=GetUserID() %>';
    if(uid=="0")
    {
        alert("需要登录后才能发表日志！");return false;
    }
    var url = "";
    var obj = document.getElementById('p_result');
    var objstar =document.getElementById('span_star');
    var objthink =document.getElementById('a_Think');
    var objnothink =document.getElementById('a_NoThink');
    var tourl=''+RootDir+'/Inc/Ajax/movie/MovieAjax.aspx';
    var movieid = document.form1.HidMovieID.value;
    switch(type)
    {
        case "Think":
            url ="Action=Think&movieid="+ movieid;
            break;
        case "NoThink":
            url ="Action=NoThink&movieid="+ movieid;
            break;
        case "SaveScore":
            url ="Action=SaveScore&Score="+Score+"&movieid="+ movieid;
            break;
    }
    var  options={
        method:'get',
        parameters:url,
        onComplete:
            function(transport)
	        {
				var returnvalue=transport.responseText;
				if (returnvalue.indexOf("??")>-1)
				    obj.innerHTML="操作失败";
				else
				{
				    arr_returnvalue = returnvalue.split('|');
                    obj.innerHTML=arr_returnvalue[0];
                    var tf = arr_returnvalue[1];
                    switch(type)
                    {
                        case "Think":
                           objstar.className="rate-star rate-star0";
                           if(tf=="True")
                            {
                                objthink.className="movie-wannasee";
                                objthink.onmouseout="";
                                objthink.onmouseover="";
                                if(objnothink.className=="movie-notinterested")
                                {
                                    objnothink.className="movie-notinterested nope";
                                    objnothink.onmouseout=function(){objnothink.className='movie-notinterested nope';};
                                    objnothink.onmouseover=function(){objnothink.className='movie-notinterested';};
                                }
                            }
                            else
                            {
                                objthink.className="movie-wannasee nope";
                                objthink.onmouseout=function(){objthink.className='movie-wannasee nope';};
                                objthink.onmouseover=function(){objthink.className='movie-wannasee';};
                            }
                            break;
                        case "NoThink":
                           objstar.className="rate-star rate-star0";
                           if(tf=="True")
                            {
                                objnothink.className="movie-notinterested";
                                objnothink.onmouseout="";
                                objnothink.onmouseover="";
                                if(objthink.className=="movie-wannasee")
                                {
                                    objthink.className="movie-wannasee nope";
                                    objthink.onmouseout=function(){objthink.className='movie-wannasee nope';};
                                    objthink.onmouseover=function(){objthink.className='movie-wannasee';};
                                }
                           }
                            else
                            {
                                objnothink.className="movie-notinterested nope";
                                objnothink.onmouseout=function(){objnothink.className='movie-notinterested nope';};
                                objnothink.onmouseover=function(){objnothink.className='movie-notinterested';};
                            }
                            break;
                        case "SaveScore":
                            objstar.className="rate-star rate-star"+Score;
                            objthink.className="movie-wannasee nope";
                            objnothink.className="movie-notinterested nope";
                            objthink.onmouseout=function(){objthink.className='movie-wannasee nope';};
                            objthink.onmouseover=function(){objthink.className='movie-wannasee';};
                            objnothink.onmouseout=function(){objnothink.className='movie-notinterested nope';};
                            objnothink.onmouseover=function(){objnothink.className='movie-notinterested';};
                           break;
                    }                    
                    obj1.innerHTML=arr_returnvalue[1];
                }
	        } 
	}
	new  Ajax.Request(tourl,options);
}

function MoreGut(id,type)
{
    var obj = document.getElementById("span_Gut");
    var  options={
        method:'get',
        parameters:"Action="+ type +"&movieid="+ id,
        onComplete:
            function(transport)
	        {
				var returnvalue=transport.responseText;
				if (returnvalue.indexOf("??")>-1)
				    obj.innerHTML="操作失败";
				else
					obj.innerHTML=returnvalue;
	        } 
	}
	new  Ajax.Request(RootDir+'/Inc/Ajax/movie/MovieAjax.aspx',options);
}
</script>

