<!--#include file = "Conn.asp"-->
<%
dim USERDEGNJI,enbaleuser,EnbaleWY,BFQpath,MovMod,LanDome,LanDomeUrl,movdown,isONE
DIM sqlEND,IZZY,MOVLZAI,SHOWNO,UserID
call getset
set rs=server.createobject("adodb.recordset")
'------------------------------------用户模式判断---------------------------------------------------------------------------------
UserID=0
if enbaleuser=1 then
  if Session("login")="" then 
      Response.Write "<script language='JScript'>alert('请登录');window.opener=null; window.close();</script>"
  else
      sql = "SELECT id,onlineIP,onlinetime,wbuser,EndDate,StartDate FROM movUser where Username='" & Session("login") & "'"
      rs.Open sql, conn, 1, 1
      if rs.eof or rs.bof then
            if Session("login")<>"everyone" then Response.Write "<script language='JScript'>alert('用户不存在，请联系管理员');window.opener=null; window.close();</script>":rs.close:set rs=nothing:Response.end
      else
            if USERDEGNJI<1 and enbaleuser=1 then Response.Write "<script language='JScript'>alert('您的帐号还在审核！');window.opener=null; window.close();</script>":rs.close:set rs=nothing:Response.end
            if rs("onlineip")<>ip and rs("wbuser")<>1 then Response.Write "<script language='JScript'>alert('您"&rs("onlinetime")&"在" & rs("onlineip") &  "登入了,请重新登入。如果密码泄露，请尽快更改密码!');window.opener=null; window.close();</script>":rs.close:set rs=nothing:Response.end
            if DateDiff("d", rs("StartDate"),Now)<0 then  Response.Write "<script language='JScript'>alert('您的帐号还未到点播日期');window.opener=null; window.close();</script>":rs.close:set rs=nothing:Response.end
            if DateDiff("d", Now,rs("EndDate"))<0 then  Response.Write "<script language='JScript'>alert('您的帐号已过期');window.opener=null; window.close();</script>":rs.close:set rs=nothing:Response.end
            UserID=rs("id")
      end if
      rs.close
  end if
end if
'---------------------------------------------------------------------------------------------------------------------
dim movid,video,exe,vgver,movno,down,ClientIP
movid=safeRequest("Classid")
video=saferequest("video")
exe=saferequest("exe")
vgver=saferequest("vgver")
down=saferequest("down")
movNo=saferequest("movNo")
session("exe")=exe
session("video")=video
if vgver="undefined" then'第1次加载页面
   isone=0
elseif vgver<10 then
  isone=vgver
end if

if (down=1 and movdown=0) then '检测下载
      Response.Write "<script language='JScript'>alert('服务器已经关闭下载功能');window.opener=null; window.close();</script>":set rs=nothing:Response.end
end if
if USERDEGNJI<3 and down=1 then
      Response.Write "<script language='JScript'>alert('《黄金用户》才有下载功能');window.opener=null; window.close();</script>":set rs=nothing:Response.end
end if
ClientIP=saferequest("ClientIP")
'---------------------------------------------------------------------------------------------------------------------
dim movFilePath,movtype,MovieName,mOVSERVER,MovFile,movNoFilename
sql = "SELECT movNo,MOVNAME,movServer,filename,movtype,filepath FROM movList where movid=" & MovID
rs.Open sql, conn, 1, 1
IF NOT RS.EOF or not rs.bof THEN
        if rs("movType")=6 or rs("movType")=8 then iszy=1
        movtype=rs("movtype")
        MovieName=rs("MOVNAME")
        mOVSERVER=RS("MOVSERVER")
        MovFile=lcase(rs("filepath"))
	movNo=rs("movNo")
ELSE
        Response.Write "<script language='JScript'>alert('此集片子可能已删除');window.opener=null; window.close();</script>":rs.close:set rs=nothing:Response.end
END IF
rs.close
'---------------------------------------------------------------------------------------------------------------------
sql = "SELECT MOVTVB FROM movList where movno=1 and MovName='" & MovieName & "'"
rs.Open sql, conn, 1, 1
IF RS("MOVTVB")=1 THEN SHOWNO=0
rs.close
sql = "SELECT filename,movno FROM movList where movid=" & MovID
rs.Open sql, conn, 1, 1
if showno=0 then
      movNoFilename=replace(rs("filename")," ","")
else
      movNoFilename=rs("movno")
end if
rs.close
movFilePath=movFile
if movtype=11=11 and (USERDEGNJI<1 or EnbaleWY=0 or StartWY=0) then
      Response.Write "<script language='JScript'>alert('非法A片');window.opener=null; window.close();</script>":set rs=nothing:Response.end
end if

dim UpdateUserClick
sql = "SELECT EnbaleWai,MovMod,bfqpath,LanDome,LanDomeUrl,UpdateUserClick FROM movSet"
rs.Open sql, conn, 1, 1
UpdateUserClick=rs("UpdateUserClick")
if rs("EnbaleWai")=1 then
	EnbaleWai=1
	If rs("LanDome") = 1 Then 
		LanDome=1
		LanDomeUrl=lcase(rs("LanDomeUrl"))
	else
		LanDome=0
	end if
else
	EnbaleWai=0
end if
BFQpath=rs("bfqpath")
MovMod=rs("MovMod")
rs.close
if MovMod<>1 and MovMod<>2 and MovMod<>3 then Response.Write "<script language='JScript'>alert('服务器模式设置错误，请检查！');window.opener=null; window.close();</script>":set rs=nothing:Response.end
if down<>1 and MovMod=3 and exe<>1 and video=2 then Response.Write "<script language='JScript'>alert('宝丽通WEB播放器不支持共享模式播放');window.opener=null; window.close();</script>":set rs=nothing:Response.end
'------------------------------------------------------------------------------------------------------------------
sql = "Select * from online where userip='" & ip & "'"   '更新在线列表
rs.Open sql, conn, 1, 3
    if rs.eof or rs.bof then
          rs.addnew
    end if
    rs("zaixian")=1
    rs("movName")=moviename
    rs("movno")=movno
    rs("movID")=movid
    rs("movSer")=mOVSERVER
    rs("userip")=IP
    rs("username")=Session("login")
    rs("StartTime")=now
    rs("StartTimeInt")=int(timer)
    rs.update
rs.close

if UpdateUserClick=1 then
  sql = "Select * from UserClick"'更新播放记录
  rs.Open sql, conn, 1, 3
      rs.addnew
      rs("movID")=movid
      rs("movName")=moviename
      rs("movno")=movno
      rs("userID")=UserID
      rs("username")=Session("login")
      rs("UserIP")=ip
      rs("UserTime")=now
      rs.update
  rs.close
end if
'-------------------------------------------------------------------
Dim WuLiPath,XuNiName
Dim SerIP,SerPort,WebPort
Sub GetXuNiSet(SerId,FilePath)
	WuLiPath=""
	XuNiName=""
	Set Rsr = server.CreateObject("adodb.recordset")
	sql="select * from movPathSet WHERE movServerID=" & SerId
	Rsr.Open sql, conn, 1, 1
	FilePath=lcase(FilePath)
	do while not Rsr.EOF
	if instr(FilePath,lcase(Rsr("wulipath")))<>0 then
		XuNiName=Rsr("xuniname")
		WuLiPath=lcase(Rsr("wulipath"))
	end if
	Rsr.movenext
	loop
	if right(wulipath,1)="\" then wulipath=left(wulipath,len(wulipath)-1)
	Rsr.Close: Set Rsr = Nothing
End Sub
'-------------------------------------------------------------------
SUB GetMovSerSet(WAIMOD, SERID)
SET Rsr = server.CreateObject("adodb.recordset")
sql = "SELECT * FROM movSer where movserid=" & SERID
Rsr.Open sql, conn, 1, 1
IF NOT RSr.EOF THEN
        IF WAIMOD = 1 THEN
            SerIP = Rsr("movserip")
            IF LEFT(SerIP, 3) = LEFT(ClientIP, 3) THEN'如果前3位和内网服务器IP相同 ,那么取内网IP地址进行播放
                SerPort = Rsr("movserport")
                WebPort = Rsr("movwebport")
            ELSE
                IF LanDome = 1 AND LCase(ClientIP) = LanDomeUrl THEN '如果开启了内网域名模式
                        SerIP =   Rsr("movserip")
                        SerPort = Rsr("movserport")
                        WebPort = Rsr("movWebPort")
                ELSE
                        SerIP = ClientIP
                        SerPort = Rsr("movWaiport")
                        WebPort = Rsr("movWaiwebport")
                END IF
            END IF
        ELSE
           SerIP = Rsr("movserip")
           SerPort = Rsr("movserport")
           WebPort = Rsr("movwebport")
        END IF
ELSE
    SerIP = ""
    SerPort = ""
    WebPort = ""
END IF
Rsr.Close: SET Rsr = NOTHING
END SUB                                                 
'-------------------------------------------------------------------获取当前集数的播放路径
dim MovieNameClick,urla
MovieNameClick=MovieName
if video=2 then MovieName=replace(MovieName," ","%20")'如果是宝丽通播放器。取除空格
call GetMovSerSet(EnbaleWai,mOVSERVER)

if MovMod=1 then
    urla="http://"&SerIP&":"&SerPort&"/"&MovieName&"-第"&movNoFilename&"集?progid="&replace(movFilePath," ","%20")& Chr(13) & Chr(10)
Elseif MovMod=2 then
	Call GetXuNiSet(mOVSERVER,MovFile)
	urla="http://"&SerIP&":"&WebPort&"/"&replace((replace(replace(MovFile,wulipath,xuniname),"\","/"))," ","%20")& Chr(13) & Chr(10)
Elseif MovMod=3 then 
	Call GetXuNiSet(mOVSERVER,MovFile)
	urla="\\"&SerIP&"\"&replace(MovFile,WuLiPath,XuNiName)& Chr(13) & Chr(10)
END IF
'-------------------------------------------------------------------'获得文件的排列方式
dim movieno,movienoA,movienoB,url,URL1,ygplayno
movienoA=movNoFilename
if iszy=1 then
  if ShowNo=0 then
    if MOVLZ=1 then
      sqlEND="' order by filename desc"
    else
      sqlEND="' order by filename"
    end if
  else
    if MOVLZ=1 then
      sqlEND="' order by movno desc"
    else
      sqlEND="' order by movno"
    end if
  end if
else
  if ShowNo=0 then
    sqlEND="' order by filename"
  else
    sqlEND="' order by movno"
  end if
end if
'-------------------------------------------------------------------'非午夜影片远古或宝丽通连播放。
IF movtype<>11 and down=0 and ((video=1 and vgver="2009" and exe=1) or (video=2)) then
	sql = "SELECT movid,movno,FILENAME,filepath,movserver FROM movList where movname='" & replace(MovieName,"%20"," ") & sqlEND
	rs.Open sql, conn, 1, 1
	do while not rs.eof
        mOVSERVER=rs("movserver")
        if showno=0 then movNoFilename=replace(rs("filename")," ","") else movNoFilename=rs("movno")'看是否按文件名显示
        if movNoFilename=movienoA then ygplayno=1'判断到前集数的前后集
        if MovMod=1 then'默认播放模式
                  IF YGPLAYNO=1 THEN
                    url1=url1 & "http://"&SerIP&":"&SerPort&"/"&MovieName&"-第"&movNoFilename&"集?progid="&replace(rs("filepath")," ","%20")& Chr(13) & Chr(10)
                  else
                    url=url & "http://"&SerIP&":"&SerPort&"/"&MovieName&"-第"&movNoFilename&"集?progid="&replace(rs("filepath")," ","%20")& Chr(13) & Chr(10)
                  end if
        elseif MovMod=2 then'IIS虚拟目录模式
                  Call GetXuNiSet(mOVSERVER,rs("filepath"))
                  IF YGPLAYNO=1 THEN

                    url1=url1 & "http://"&SerIP&":"&WebPort&"/"&replace(replace(replace(replace(rs("filepath"),":\Movie",""),wulipath,xuniname),"\","/")," ","%20")& Chr(13) & Chr(10)
                  ELSE
                    URL=URL & "http://"&SerIP&":"&WebPort&"/"&replace(replace(replace(replace(rs("filepath"),":\movie",""),wulipath,xuniname),"\","/")," ","%20")& Chr(13) & Chr(10)	
                  END IF	
        Elseif MovMod=3 then'共享模式
                  Call GetXuNiSet(mOVSERVER,rs("filepath"))
                  IF YGPLAYNO=1 THEN
                    url1=url1 &"\\"&SerIP&"\"&replace(right(rs("filepath"),len(rs("filepath"))-3),WuLiPath,XuNiName)& Chr(13) & Chr(10)
                  else
                    url=url &"\\"&SerIP&"\"&replace(right(rs("filepath"),len(rs("filepath"))-3),WuLiPath,XuNiName)& Chr(13) & Chr(10)
                  end if
        end if
        
        if ygplayno=1 then
          movienoB=movienoB & movNoFilename & "|"
        else
          movieno=movieno & movNoFilename & "|"
        end if
        rs.movenext
	loop
	rs.close
	URL=URL1 & URL
	movieno=movienoB & movieno
End if

'------------------------------------------------------------------- 更新点击次数
sql = "update movlist set click=click+1 where movno=1 and movname='" & MovieNameClick & "'"
conn.execute sql
'if video<>1 and video<>2 then'如果不是远古或宝丽通播放器
    'urla=replace(urla,"集?","集")
'end if


IF VIDEO=1 AND (MOVMOD=3 or movmod=1) THEN '如果是远古播放器在默认模式或共享模式下
    URL=REPLACE(URL,"\","\\")
    URLA=REPLACE(URLA,"\","\\")
end if
'-----------------------------------------------------------------------------------------
%>


<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<% if down=1 then'如果是下载%>
            <STYLE type=text/css>A{text-transform: none;}
            a{color: #FF359A;       text-decoration: none;
            }
            a:hover{color: #FF8000}

            </STYLE> 
            <BODY style="TEXT-ALIGN: left" leftMargin=0 background=../images/bg_3.jpg 
            topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
            <title><%=movIEname%>-<%=movNoFilename%>-下载</title>
            <BR/>
            <%
            response.write "&nbsp;<a href=" & urla & "><B>右键目标另存为 </B></a>"
            response.write "<script>"
            response.write "window.resizeTo(200,100);"
            response.write "window.moveTo((screen.width-200)/2, (screen.height-100)/2);"
            response.write "</script>"
            %>
            </br>
            <SCRIPT LANGUAGE=javascript>

            function click1() {
            if (event.button==1) {alert('请用右键目标另存为');}}
            document.onmousedown=click1;

            </SCRIPT>

                </tbody>
            </table> 

            </html>
            <%
            set rs=nothing
            set conn=nothing
            response.flush
            response.end
else
           response.write "<title>"&movIEname&"-"&movNoFilename&"-在线观看</title>"
end if
%>



</head>
<%

if (exe=1 and vgver<>"2009") or video=3 then
        set rs=nothing
        set conn=nothing
%>'如果选了EXE播放且不是远古播放器 或者是 暴风播放器 起用自定义播放器方式
        <BODY> 
        <OBJECT ID="GetClient" WIDTH=100 HEIGHT=100  CLASSID="CLSID:54DE4BCA-09BA-4012-83D6-84E27215AC13"> 
        <PARAM NAME="TypeVideo" VALUE="<%=video%>"> 
        <PARAM NAME="url" VALUE="<%if video=2 then response.write url else response.write replace(urla,Chr(13) & Chr(10),"")%>">
        <PARAM NAME="path" VALUE="<%=bfqpath%>"> 
        </OBJECT> 
        </BODY> 
        <script language="javascript"> 
        function clock(){ 
        window.opener=null; 
        window.close();
        } 
        clock(); 
        </script>
<%
      response.end
end if
%>
<%
'-----------------------------------------------------------------------------------------'如果是远古2009
if vgver="2009" then
      set rs=nothing
      set conn=nothing
      IF URL="" THEN 
          URL=URLA
          movieno=movienoA
      END IF
      if movmod<>3 then URL=REPLACE(URL,"\","\\")
%>
    <BODY onLoad="javascript:play('<%=replace(url,chr(13)&chr(10),"|")%>','<%=movieno%>');">
    <OBJECT id= "VGPDemo" classid="clsid:8F114728-7F1F-4EC7-97BD-8AB664F0F6B3" width ="0" height ="0" left="0"></OBJECT>
    <script language="JScript">
    function play(progid,movNo)
    {      
            datastr=progid;
            datamov=movNo;      
        var str= new Array();
      var mNO= new Array();
      var vStart = VGPDemo.StartPlayer();    
        if (vStart !="0") {alert("运行播放器失败，请检查客户端！");}
        str=datastr.split("|");  
            mNO=datamov.split("|");
          for (i=0;i<str.length;i++ )    
          {    
        if (i==0){
          //alert(str[i]+"  第"+mNO[i]+"集");
          VGPDemo.PlayURL(str[i],"第"+mNO[i]+"集");
        }else{
          VGPDemo.ADDURL(str[i],"第"+mNO[i]+"集");
        }
          //document.write(str.length);    
          }       
        window.opener=null; 
        window.close();
    }
    </script>
<%
    response.flush
    response.end
end if
'-----------------------------------------------------------------------------------------

if video=1 and vgver="2008" then
                  set rs=nothing
                  set conn=nothing
%>
                  <script type="text/javascript">
                  function resizeFunc()
                  {
                    WebPlayer7.width=document.body.clientWidth
                    WebPlayer7.height=document.body.clientHeight


                  }
                    </script>
                  <body onContextMenu="window.event.returnValue=false;" bgcolor="#000000" topMargin="0" leftMargin="0" style="border-color:#000000;">
                      <script type="text/javascript">
                          window.attachEvent("onresize",resizeFunc); //方法一
                          //window.onresize = resizeFunc;    //方法二，支持ff
                      </script>
                  </body>
                  <table align="center" cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tr>
                      <td align="center" valign="middle">
                  <object id="WebPlayer7" classid="CLSID:38A9965A-5B6B-42DA-834A-EE655790F453" VIEWASTEXT> </object>

                        </object>
                      </td>
                    </tr>
                  </table>

                  <script language="JScript">
                    x = CheckPlayer();
                    WebPlayer7.URL		="<%=replace(urla,Chr(13) & Chr(10),"")%>";
                    resizeFunc()
                  function CheckPlayer()
                  {
                    try
                    {
                      var oTest = new ActiveXObject("VGPlayer.WebPlayer7p2p");
                    }
                    catch(e)
                    {
                      if(window.opener == undefined)
                      {
                        window.alert("首次点播将安装远古播放器插件...");
                        window.open("http://www.slys99.com/download.html");
                        history.back(-1);
                      }
                      else
                      {
                        window.opener.alert("首次点播将安装远古播放器插件...");
                        window.opener.open("http://www.slys99.com/download.html");
                        self.close();
                      }
                      return false;
                    }
                    delete oTest;

                    resizeFunc();
                    return true;
                  }
                  </script>
                  </body>



<%elseif video=2 then '宝丽通
                dim movnoNext,movidNext,QUJI
                sql = "SELECT movid,movno,filename FROM movList where movname='" & replace(MovieName,"%20"," ") & sqlEND
                rs.Open sql, conn, 1, 1
                DO WHILE not rs.eof
                  IF QUJI=1 THEN
                        movidNext=rs("movid")
                        movnoNext=rs("movno")
                        EXIT DO
                  ELSE
                        movidNext="nothing"
                        movnoNext="nothing"
                  END IF
                  if showno=0 then movNoFilename=replace(rs("filename")," ","") else movNoFilename=rs("movno")
                  if movNoFilename=movienoA THEN QUJI=1
                  RS.MOVENEXT
                LOOP
                rs.close
                set rs=nothing
                set conn=nothing
                response.flush
								
				url=replace(url,"\","/")
				dim urlaa
				urlaa=right(replace(urla,Chr(13) & Chr(10),""),3)
				if urlaa="mp4" or urlaa="flv" or urlaa="f4v" then
                dim urlnew,zs
				zs=0
				urlnew=split(url,Chr(13) & Chr(10))
				for i=0 to ubound(urlnew)
				   if right(urlnew(i),3)="mp4" or right(urlnew(i),3)="flv" or right(urlnew(i),3)="f4v" then zs=zs+1
				  next
				     if zs=ubound(urlnew)  then
					 
%>
       
<body style="margin:0px;overflow-x:hidden;overflow-y:hidden;background:#000">

<script type="text/javascript">
window.moveTo((screen.width-800)/2, (screen.height-450)/2);
</script>
 

<div id="video" ><div id="a1"></div></div>
<script src="../ckplayer/ckplayer.js"></script>
<script type="text/javascript">
       function playerstop() {
            setTimeend();
        }
       function setTimeend() {//获取下一部视频的播放ID
            nowD++;
            if (nowD >= videoarr.length ) {
                nowD = 0;
            }
            playvideo(nowD);
        }
       
        var nowD = 0;//目前播放的视频的编号(在数组里的编号)
        var frontTime = false;//前置广告倒计时是否在运行中
        var frontHtime = false;//后置广告是否在进行中
        var videoarr = new Array();//新建一个数组来存flash端视频地址，添加方法就像下面一样
		<%
	     for i=0 to ubound(urlnew)-1
		 if movmod=2 then response.write "videoarr.push('"&replace(urlnew(i),":/Movie","")&"');"
	     if movmod=1 then response.write "videoarr.push('"&urlnew(i)&"');"
	     next
	    %>
		
        function playvideo(n) {
            nowD = n;
        var flashvars = {
        f: videoarr[n],
        c: 0,
        p: 1,
        e: 0,
        my_url: encodeURIComponent(window.location.href)
     };
    strs=(videoarr[n]).split("/");
document.title=strs[strs.length-1];
      
      CKobject.embed('../ckplayer/ckplayer.swf', 'a1', 'ckplayer_a1', '100%', '100%', false, flashvars);
    }
    playvideo(0);
	
	function resize()
	{
	document.getElementById("video").style.width=document.body.clientWidth;
	document.getElementById("video").style.height=document.body.clientHeight;
      }
 window.onresize=resize;//在窗口改变时触发
</script>
	
</script>
 
  <iframe name="shuaxin" id="shuaxin" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no" width="0" height="0" src="time.asp"></iframe>

</body>
</html>

	   
<%
             response.end
             end if 
             end if			 
		
%>
                  <BODY onLoad="javascript:GetPlayerVersion();" bgcolor="#000000" topMargin="0" leftMargin="0" style="border-color:#000000;"">
                <table align="center" cellspacing="0" cellpadding="0" width="100%" height="100%" border="0">
                  <tr>

                    <td align="center" valign="middle">
                    <OBJECT ID="ActiveX"  name="player" CLASSID="CLSID:C3D8F2C7-A508-4724-BC3A-C247058D17EB" width="100%" height="100%"  VIEWASTEXT>
                <PARAM NAME="uimode" VALUE="1"> <!--0:无控制台；1:显示控制台-->
                <PARAM NAME="playmode" VALUE="1"> <!--播放模式，0:宝丽通VOD协议；1:HTTP协议-->
                <PARAM NAME="autostart" VALUE="1"> <!--0:不自动启动播放；1:自动开始播放-->
                <PARAM NAME="url" VALUE="<%=replace(urla,Chr(13) & Chr(10),"")%>">
                <PARAM NAME="keephistory" VALUE="0"> <!--0:不保留；1:保留-->
                <PARAM NAME="playinplayer" VALUE="0"> <!--0:禁用在播放器中播放；1:允许播放器中播放-->
                <param name="adlinks" value="<%=MovieName%>-<%=movienoA%>#http://www.slys99.com"> <!--文字#链接,多项使用|隔开-->
               <!-- <param name="skinurl" value="http://<%=serip&":"&webport%>/bltskin.zip">皮肤路径,请在此修改为你的皮肤路径，HTTP格式-->	
                    


</OBJECT>
                  </td>
                   </tr>		
                </table>
				
				
                <script language="javascript">
						
                <!--
                ///
                function GetPlayerVersion()
				 			
                {
                    try{
                      var Player;
                      var ret;
                      Player = new ActiveXObject("VodHelper.NetPlayer");
                      ret = Player.GetCurrentVersion();
                      if(ret < 3.75)
                      {
                        alert("宝丽通播放器版本已过期，需要重新安装宝丽通播放器");
                        document.location.href = "download/blt4.0.8.75.exe";
                        return false;			
                      }	
                      delete Player;
                    }
                    catch(e)
                    {
                      alert("首次点播需要安装宝丽通播放器!");
                      document.location.href = "download/blt4.0.8.75.exe";
                      return false;
                    }	
                  return true;
                }

                //-->
                </script>
                <%
                if isONE=0 then 
                isONE=isONE+1
                %>
                        <SCRIPT LANGUAGE=javascript >
                            window.moveTo((screen.width-800)/2, (screen.height-450)/2);
							
				
                        </SCRIPT>
                <%end if%>
                <Script Language=javascript> 
                function Click(){ 
                alert('版权所有(C) <%=titleA%>'); 
                window.event.returnValue=false; 
                }
                document.oncontextmenu=Click; 
                </Script>
                <% if movnoNext<>"nothing" and movidNext<>"nothing" then%>
                            <SCRIPT LANGUAGE=javascript FOR=ActiveX EVENT=PlayStateChange(newState)>
                            <!--
                             switch (newState)
                             {
                             case 8:
                                  var Player;
                                  var ret;
                                  Player = new ActiveXObject("VodHelper.NetPlayer");
                                  player.stop();
                                  delete Player;
                                 document.location.href ='PlayMov.asp?ClassId=<%=movIDNext%>&video=2&exe=0&down=0&movNo=<%=movNoNext%>&vgver=<%=isone%>&ClientIP=<%=ClientIP%>';
                                 return ;
                               break; 
                             }//-->
                            </SCRIPT>
                <%end if%>



<%elseif video=4 then
                '影音先锋
				dim movnoNexty,movidNexty,QUJIy
                sql = "SELECT movid,movno,filename FROM movList where movname='" & replace(MovieName,"%20"," ") & sqlEND
                rs.Open sql, conn, 1, 1
                DO WHILE not rs.eof
                  IF QUJIy=1 THEN
                        movidNexty=rs("movid")
                        movnoNexty=rs("movno")
                        EXIT DO
                  ELSE
                        movidNexty="nothing"
                        movnoNexty="nothing"
                  END IF
                  if showno=0 then movNoFilename=replace(rs("filename")," ","") else movNoFilename=rs("movno")
                  if movNoFilename=movienoA THEN QUJIy=1
                  RS.MOVENEXT
                LOOP
                rs.close
                set rs=nothing
                set conn=nothing
                response.flush
				urla=replace(urla,"\","/")
%>
 



<BODY style="margin:0px;overflow-x:hidden;overflow-y:hidden">
 <script type="text/javascript">
 window.moveTo((screen.width-800)/2, (screen.height-450)/2);
 function resize()
	{
	Xfplay.style.width=document.body.clientWidth;
	Xfplay.style.height=document.body.clientHeight;
      }
 window.onresize=resize;//在窗口改变时触发
</script>
<script type="text/javascript">
function Xf_Complete()
{
   <% if movnoNexty<>"nothing" and movidNexty<>"nothing" then%>
     
     document.location.href ='PlayMov.asp?ClassId=<%=movIDNexty%>&video=4&exe=0&down=0&movNo=<%=movNoNexty%>&vgver=<%=isone%>&ClientIP=<%=ClientIP%>';                 
    
  <%end if%>
}
</script>
<div align=center>
<td id=tdxfplay>

<IFRAME id=xframe_mz name=xframe_mz style="MARGIN: 0px; WIDTH: 100%; DISPLAY: none; HEIGHT: 100%" src="http://error.xfplay.com/error.htm" frameBorder=0 scrolling=no></IFRAME>

<!--先锋播放器-->
<OBJECT id=Xfplay name=Xfplay  onerror="document.getElementById('Xfplay').style.display='none';document.getElementById('xframe_mz').style.display='';document.getElementById('xframe_mz').src='http://error.xfplay.com/error.htm';" 
              CLASSID="CLSID:E38F2429-07FE-464A-9DF6-C14EF88117DD"  width="800" height="450">

<!--IE 浏览器-->
<PARAM NAME="URL" VALUE="<%=replace(urla,Chr(13) & Chr(10),"")%>">

  <!--火狐，谷歌 等浏览器-->                                                                  
<embed type="application/xfplay-plugin" id="Xfplay2" name="Xfplay2" PARAM_URL="<%=replace(urla,Chr(13) & Chr(10),"")%>"  Event_Xf_Complete="Xf_Complete" width="800" height="450" ></embed>
     
</OBJECT>
</td>
</div>


<SCRIPT language=JavaScript src="http://error.xfplay.com/Player.js"></SCRIPT>

<!--  IE 浏览器 播放完成后调用 -->
<script for="Xfplay" language="JavaScript" event="Xf_Complete()"> 
{
      Xf_Complete();
}   
</script>


 
  
 


<%elseif video=5 then'讯雷看看播放器'mediaPlay
                
                sql = "SELECT movid,movno,filename FROM movList where movname='" & replace(MovieName,"%20"," ") & sqlEND
                rs.Open sql, conn, 1, 1
                DO WHILE not rs.eof
                  IF QUJI=1 THEN
                        movidNext=rs("movid")
                        movnoNext=rs("movno")
                        EXIT DO
                  ELSE
                        movidNext="nothing"
                        movnoNext="nothing"
                  END If
                  
				  
                  if showno=0 then movNoFilename=replace(rs("filename")," ","") else movNoFilename=rs("movno")
                  if movNoFilename=movienoA THEN QUJI=1
                  RS.MOVENEXT
                LOOP
                rs.close
                set rs=nothing
                set conn=nothing
                response.flush
                dim XLFullScreen
                XLFullScreen=saferequest("FullScreen")
				urla=replace(urla,"\","/")
				
%>
               
<HTML>
	<HEAD>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
		<title><%=MovieName%>-<%=movienoA%></title>
		<script type="text/javascript"> 
		function fsn(){
		if (document.body.clientWidth<1024){
		this.moveTo(0,0);
		this.resizeTo(screen.width,screen.height);
		}
		else{
		this.resizeTo(800,550);
		this.moveTo((screen.width-800)/2,(screen.height-550)/2);
		}
		}
		</script>
		
	</HEAD>

 <body scroll=no oncontextmenu="self.event.returnValue=false"  bgcolor="#000000" topMargin="0" leftMargin="0" style="border-color:#000000;">
   <table  align="center" cellspacing="0" cellpadding="0" width="100%" height="100%" border="0">
                  <tr>

                    <td align="center" valign="middle">


		<table  cellspacing="0" cellpadding="0" border="0">
		
		  <tr><td> <p id="objAPlayer"></p></td></tr>
		  <tr><td id="tiao" onclick="javascript:mouseMove();" style="cursor:hand;background-color:#5B5B5B;height:3px"><div id="tc1" style="text-align:right;width:0%;background-color:#8E8E8E;font-size=4px"></div></td></tr>
		  
		 <tr><td>
           <input id="btnPlay" type="image" style="width:32px;height:32px; " src="play.png" title="播放" onclick="play()"/>
            <input id="btnPause" type="image" style="width:32px;height:32px;" src="pause.png" title="暂停" onclick="pause()"/>
			<input id="btnStop" type="image" style="width:32px;height:32px;" src="stop.png" title="下一集" onclick="stop()"/>
			<input id="btnFsn" type="image" style="width:32px;height:32px;" src="full.png" title="全屏" onclick="fsn()"/>
			<div style="position:relative;left:160px;bottom:26px "><font id="txtTime" size="2" color="white" ></font></div>
            <div id="ftc1" style="position:relative;left:50%;bottom:42px "><font color="white" size="2"><%=right(MovieName,12)%>(第<%=right(movienoA,8)%>集)</font></div>
			<div id="tc2" onclick="javascript:mouseMove1();" style="cursor:hand;position:relative;left:85%;bottom:52px;width:100px;background-color:#5B5B5B;font-size=4px;"><div id="tc3"  style="width:50px;background-color:#9D9D9D;"></div></div>
			
			<div id="vol" style="position:relative;left:82%;bottom:65px; width:22px;height:22px;background-image:url(volume.png)"></div>
			
			</td>
					
			
			
			</tr>
			
			
			</table>
	
 
	</td>
                   </tr>		
                </table>
	<script type="text/javascript"> 
document.getElementById("vol").style.left=(document.body.clientWidth)-145;
document.getElementById("tc2").style.left=(document.body.clientWidth)-120;
 </script>
<script type="text/javascript"> 
 
    var startTips = "请点击播放按钮开始播放。"
 
    if (navigator.mimeTypes["application/x-thunder-aplayer"] != null) {
        objAPlayer.innerHTML = '<embed id="APlayer" type="application/x-thunder-aplayer" width="800" height="450" clsid="{A9332148-C691-4B9D-91FC-B9C461DBE9DD}" Event_OnSeekCompleted="OnSeekCompleted" Event_OnMessage="OnMessage" Event_OnStateChanged="OnStateChanged" Event_OnOpenSucceeded="OnOpenSucceeded" Event_OnDownloadCodec="OnDownloadCodec"</embed>';
	txtTime.innerHTML = startTips;
    }
    else {
        try {
            var thePlayer = new ActiveXObject("APlayer3.Player");
            delete thePlayer;
            objAPlayer.innerHTML = '<object id="APlayer"   width="800" height="450" classid="CLSID:A9332148-C691-4B9D-91FC-B9C461DBE9DD" VIEWASTEXT></object>';
	    txtTime.innerHTML = startTips;
        }
        catch (e1) {
            objAPlayer.innerHTML = "<font color=white>无法播放, APlayer3媒体播放引擎和完整解码器 未安装，若已安装，请使用浏览器兼容模式播放! </br>请下载 <a href='http://pan.baidu.com/s/1eQCFETk' target='_blank'>APlayer3媒体播放引擎和完整解码器</a> 解压后安装。</font></br></br></br>";
            btnPlay.style.display = "none";
            btnStop.style.display = "none";
			 btnPause.style.display = "none";
			  btnFsn.style.display = "none";
			  vol.style.display ="none";
			  tc2.style.display ="none";
			  tc3.style.display ="none";
			  tc1.style.display ="none";
			  ftc1.style.display ="none";
			  tiao.style.display ="none";
        }
    }
 
 
    var EventUtil =
	{
	    addHandler: function (element, type, handler) {
	        if (element.addEventListener) {
	            element.addEventListener(type, handler, false);
	        }
	        else {
	            element.attachEvent("on" + type, handler);
	        }
	    },
 
	    removeHandler: function (element, type, handler) {
	        if (element.removeEventListener) {
	            element.removeEventListener(type, handler, false);
	        }
	        else {
	            element.detachEvent("on" + type, handler);
	        }
	    }
	};
 
 
    var player = null;
    var position = null;
    var duration = null;
	var nDuration = null;

    var loadhandler = function () {
	window.moveTo((screen.width-800)/2, (screen.height-450)/2);
	 player = document.getElementById("APlayer");
	 player.style.width=document.body.clientWidth;
	player.style.height=document.body.clientHeight-34;
	
	autoplay();
    }
 
    var unloadhandler = function () {
        if (player != null) {
            player.Close();
        }
    }
 
    EventUtil.addHandler(window, "load", loadhandler);
    EventUtil.addHandler(window, "unload", unloadhandler);
	window.attachEvent("onresize",resize);
	function resize()
	{
	player.style.width=document.body.clientWidth;
	player.style.height=document.body.clientHeight-34;
	document.getElementById("vol").style.left=(document.body.clientWidth)-145;
document.getElementById("tc2").style.left=(document.body.clientWidth)-120;
	}
  function autoplay() {
	
 
        if (player != null) 
	{  
            if (player.GetState() == 0) {
 
		player.setConfig(201, "3");
 
                txtTime.innerHTML = "[不显示进度和时间请使用IE兼容模式]"
                player.open("<%=replace(urla,Chr(13) & Chr(10),"")%>");
            }
        }
    }
	function kuaijin30() {
	 if (player != null) {
	 if (player.GetState() == 5) {
	    
                
	 var pos1=player.GetPosition()+30000;
	     if(pos1>=nDuration){
		  player.setPosition(nDuration);
		}
		 else
		{
		  player.setPosition(pos1);
		 }
		  }
	 	 }
		}
		function houtui30() {
	 if (player != null) {
	 if (player.GetState() == 5) {
	    
                
	 var pos1=player.GetPosition()-30000;
	     if(pos1>=nDuration){
		  player.setPosition(nDuration);
		}
		 else
		{
		  player.setPosition(pos1);
		 }
		  }
	 	 }
		}
    function play() {
	
 
        if (player != null) 
	{
            if (player.GetState() == 0) {
 
		player.setConfig(201, "3");
 
                player.open("<%=replace(urla,Chr(13) & Chr(10),"")%>");
            }
			else
			{
			
			if (player.GetState() == 3) {
          
		  player.play();
      
				}
            }
			
        }
    }
 
    function stop() {
        if (player != null) {
            if (player.GetState() != 0) {
                player.Close();
            }
        }
    }
 function pause() {
        if (player != null) {
            if (player.GetState() ==5) {
                player.Pause();
            }
			else
			{
			player.play();
			}
        }
    }
    function MillisecondToText(ms) {
        var s = ms / 1000;
        ms = ms % 1000;
        var h = s / 3600;
        s = s % 3600;
        var m = s / 60;
        s = s % 60;
 
        h = Math.floor(h);
        m = Math.floor(m);
        s = Math.floor(s);
 
        var text = "";
        if (h > 0 && h < 10)
            text = "0" + h + ":";
 
        if (m >= 0 && m < 10)
            text = text + "0" + m + ":";
        else
            text = text + m + ":";
 
        if (s >= 0 && s < 10)
            text = text + "0" + s;
        else
            text = text + s;
        return text;
    }
 
    function OnStateChanged(oldState, newState) {
	var nothing="nothing";
	 if (oldState == 5 && newState==6){
	 
          if("<%=XLFullScreen%>" != "1"){
		   if (<%=movnoNext%> != "nothing" && <%=movidNext%> != "nothing"){
            document.location.href ='PlayMov.asp?ClassId=<%=movIDNext%>&video=5&exe=0&down=0&movNo=<%=movNoNext%>&vgver=<%=isone%>&ClientIP=<%=ClientIP%>';
          }
		  else
		  {
		  player.Close();
		  window.opener=null;
       window.open('', '_self'); 
       window.close(); 
		  }
		  }
          else{
		  if (<%=movnoNext%> != "nothing" && <%=movidNext%> != "nothing"){
            document.location.href ='PlayMov.asp?ClassId=<%=movIDNext%>&video=5&exe=0&down=0&movNo=<%=movNoNext%>&vgver=<%=isone%>&ClientIP=<%=ClientIP%>&FullScreen=1';
         }
		 else
		  {
		  player.Close();
		 window.opener=null;
       window.open('', '_self'); 
       window.close(); 
		  }
		 }        	
			}
    }
 
    function OnOpenSucceeded() {
         nDuration = player.GetDuration();
        duration = MillisecondToText(nDuration);
    }
 
    function OnDownloadCodec(strCodecPath) {
	alert("缺少解码器:" + strCodecPath + ", 请重新安装播放器");
        player.SetConfig(19, "1");
    }
	
	
	 self.setInterval("clock7()", 15000)
       function clock7(){
           player.style.height=document.body.clientHeight;
       }

	
	
	
	
	
    function OnMessage(nMessage, wParam,lParam){
	  if (nMessage==0x0202)
	  {	  
	  //fsn();  
	  player.style.height=document.body.clientHeight-34;
	  }
	  else{
	  if (nMessage==0x0204){
	  if(player.GetState()==5){
	  player.Pause();
	  }
	  else
	  {
	  if(player.GetState()==3){
	  player.play();
	  } } }
	  }
	  
	  if (nMessage==0x0101)
	  {
	  if (wParam==32){
	  pause();
	  }
	 if (wParam==39){
	 kuaijin30();
	 }	
     if (wParam==37){
	 houtui30();
	 }
    if (wParam==38){
	 var vo=player.getvolume();
	 if (vo+100<=1000){
	 player.setVolume(vo+100);
	 }
	 }	
  if (wParam==40){
	 var vo1=player.getvolume();
	 if (vo1-100>=10){
	 player.setVolume(vo1-100);
	 }
	 }		 
	  }
	  
	}
	
 
    function UpdateTime()
    {
        if (player != null)
       {
            if (player.GetState() != 0)
            {
                position = player.GetPosition();
				if (nDuration != null && position != null && position !=0){
				var bfb1 = (position/nDuration*100).toFixed(2)+"%";
				document.getElementById("tc1").style.width=bfb1;
                //document.getElementById("tc1").innerHTML=bfb1;
				}
				position = MillisecondToText(position);
                var p = player.GetBufferProgress();
 
                if (p == -1)
                    txtTime.innerHTML = position + "/" + duration;
                else
                    txtTime.innerHTML = position + "/" + duration + " 正在缓冲(" + p + "%)";
					
            }
            else
            {
               var nResult = player.GetConfig(7);
               if(nResult != 0 && nResult != 1)
	           txtTime.innerHTML = "播放失败, 错误码 = " + nResult;
               else
                   txtTime.innerHTML = "";
            }
        }
        setTimeout(function () { UpdateTime(); }, 1000);
    }
 
    UpdateTime();
</script>
 <script type="text/javascript">
function mousePosition(ev){ 
if(ev.pageX || ev.pageY){ 
return {x:ev.pageX, y:ev.pageY}; 
} 
return { 
x:ev.clientX  - document.body.clientLeft, 

y:document.body.clientWidth
}; 
} 
 
  
  
  
function mouseMove(ev){ 
ev = ev || window.event; 
var mousePos = mousePosition(ev); 
var bfb=mousePos.x/mousePos.y;
 
if (player != null) {
	 if (player.GetState() == 5) {
	 var nDuration = player.GetDuration();
	 if  (nDuration != null){
	 var pos1=Math.round(bfb*nDuration);
	     player.setPosition(pos1);

var bfc = (bfb*100).toFixed(2) + "%"
document.getElementById("tc1").style.width=bfc;
//document.getElementById("tc1").innerHTML=bfc;


}
}
}
}

function mouseMove1(ev){ 
ev = ev || window.event; 
var mousePos = mousePosition(ev); 
var startpostion=(document.body.clientWidth)-120;

if (startpostion<=mousePos.x && mousePos.x<=startpostion+100){

document.getElementById("tc3").style.width=mousePos.x-startpostion;
var st=mousePos.x-startpostion;
if (player != null) {
	 if (player.GetState() == 5) {
if (st<=50){
player.SetVolume(st*2);
}
else{

if (st>50 && st<=60) {player.SetVolume(200);}
if (st>60 && st<=70) {player.SetVolume(400);}
if (st>70 && st<=80) {player.SetVolume(600);}
if (st>80 && st<=90) {player.SetVolume(800);}
if (st>90 && st<=100) {player.SetVolume(1000);}

}
}
}
}
}
</script>

<script type="text/javascript" for="APlayer" event="OnStateChanged(nOldState, nNewState)"> 
	OnStateChanged(nOldState, nNewState);
</script>
 <script type="text/javascript" for="APlayer" event="OnMessage(nMessage, wParam,lParam)"> 
	OnMessage(nMessage, wParam,lParam);
</script>
<script type="text/javascript" for="APlayer" event="OnOpenSucceeded()"> 
	OnOpenSucceeded();
</script>
 
<script type="text/javascript" for="APlayer" event="OnDownloadCodec(strCodecPath)"> 
        OnDownloadCodec(strCodecPath);
</script>
 <script type="text/javascript" language="JavaScript">
document.onkeydown=function(event){
var e = event || window.event || arguments.callee.caller.arguments[0];
if(e && e.keyCode==39){  
kuaijin30();
}
else
{
if(e && e.keyCode==32){  
pause();
}
else
{
if(e && e.keyCode==37){  
houtui30();
}
else{
 if (e && e.keyCode==38){
	 var vo11=player.getvolume();
	 if (vo11+100<=1000){
	 player.setVolume(vo11+100);
	 }
	 }
	 else{
	 if (e && e.keyCode==40){
	 var vo12=player.getvolume();
	 if (vo12-100>=10){
	 player.setVolume(vo12-100);
	 }
	 }
	 
	 }
}
}
}
}
</script>

	</BODY>

</HTML>
<%end if%>
<iframe name="shuaxin" id="shuaxin" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no" width="0" height="0" src="time.asp"></iframe>
</body>
</html>
