<!-- #include file="include/config_video.asp" -->
<!-- #include file="include/conn.asp" -->
<%
dim html,error,power,emoney,movieid,urlid,vtitle,vtype,vurl
n_sort="video"
movieid=request("id2")
urlid=request("id1")

tit="影视收看"
call web_head(0,0,4,0,0)

if movieid="" or urlid="" then
response.write error
response.end
end if

  sql="select power,emoney,type,title from video where id="&movieid
  set rs=conn.execute(sql)

if not rs.eof then
power=rs("power")
emoney=rs("emoney")
vtitle=rs("title")
vtype=rs("type")
else
rs.close:set rs=nothing
conn.close:set conn=nothing
response.write error
response.end
end if

call emoney_notes(power,emoney,n_sort,movieid,"js",1,1,"video_view.asp?id="&movieid&"",p_name)

  rs.close:set rs=nothing
  sql="update video set counter=counter+1 where id="&movieid
  conn.execute(sql)
dim rst
   set rst=server.createobject("adodb.recordset")
   sql="select url from videourl where id="&urlid
   rst.open sql,conn,1,1
   vurl=rst("url")
   rst.close:set rst=nothing

  call close_conn()

'   serverip=rs("serverip")
'   tdate=date()

response.cookies(""&urlid&"")="yes"
%>

<body bgcolor="#000000" scroll="no" marginwidth="0" leftmargin="0" topmargin="0" oncontextmenu="window.event.returnValue=false" ondragstart="window.event.returnValue=false" onselectstart="event.returnValue=false">

<script language="JAVASCRIPT">
<!-- Begin
var ap_name = navigator.appName;
var ap_vinfo = navigator.appVersion;
var ap_ver = parseFloat(ap_vinfo.substring(0,ap_vinfo.indexOf('(')));

var time_start = new Date();
var clock_start = time_start.getTime();
var dl_ok=false;

function init ()
{
if(ap_name=="Netscape" && ap_ver>=3.0)
dl_ok=true;
return true;
}

function show_secs () 
{
var i_total_secs = Math.round(get_time_spent());
var i_secs_spent = i_total_secs % 60;
var i_mins_spent = Math.round((i_total_secs-30)/60);
var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
var s_mins_spent = "" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);
document.fm0.time_spent.value = s_mins_spent + ":" + s_secs_spent;
window.setTimeout('show_secs()',1000);
}
init();
window.setTimeout('show_secs()',1);
 -->
</script>

<div align="center">
  <center>
  <table border="0" cellspacing="0" width="373" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<% if vtype="rm" then%>
    <tr>
      <td width="100%">
      <table border="0" cellspacing="0" style="border-collapse: collapse" width="373" id="AutoNumber1" background="images/video/menu_bg.gif" cellpadding="0">
        <tr>
          <td width="80%" height="20">&nbsp;影片名称：<font class=red_3><%=vtitle%></font>&nbsp;&nbsp;<%=action%></td>
          <td height="1" align="right">
          <input type="button" onclick="if (document.player.GetPlayState()==3) document.player.SetFullScreen()" name value="全屏播放" style="border-style: ridge; border-width: 1"></td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="100%">
      <script LANGUAGE="javaScript">              
var ERR_NonePlayer="播放器提示您:您的系统中没有安装Real Player播放器，请在主页上下载。\n\nMovie播放器将关闭。";
var ERR_FileNotFind="播放器提示您:对不起，未发现你要点播的文件。\n\n请更换其他影片！";
var ERR_NotLocateServer="播放器提示您:无法定位Movie服务器。请更换其他影片！";
var ERR_UnkownError="播放器提示您:在线用户过多，服务器限制，请抢线或稍后观看！";
      </script>
      <script LANGUAGE="VBScript">                                    
on error resume next
RealPlayerG2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n'); 
RealPlayer5 = (NOT IsNull(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")))
RealPlayer4 = (NOT IsNull(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)")))
if not RealPlayerG2 and RealPlayer5 and RealPlayer4 then
		if MsgBox("您的浏览器无法自动下载最新的浏览器插件，是否要下载播放器来播放？", vbYesNo) = vbYes then
			window.location = "http://51cd.com/2.exe"
		end if
end if

Sub player_OnBuffering(lFlags,lPercentage)
	if (lPercentage=100) then
		StartPlay=false
		if (FirstPlay) then
			FirstPlay=false
		end if	
		exit sub
	end if
End Sub
Sub player_OnErrorMessage(uSeverity, uRMACode, uUserCode, pUserString, pMoreInfoURL, pErrorString)
select case player.GetLastErrorRMACode()
		case -2147221496
			window.alert(ERR_FileNotFind)
		case -2147221433,-2147221428,-2147221417,-2147217468
			window.alert(ERR_NotLocateServer)
		case else
			window.alert(ERR_UnkownError)
	end select
End Sub
      </script>
      <p align="center">
      <object id="player" name="player" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="373" height="290">
        <param name="_ExtentX" value="9869">
        <param name="_ExtentY" value="7726">
        <param name="AUTOSTART" value="-1">
        <param name="SHUFFLE" value="0">
        <param name="PREFETCH" value="0">
        <param name="NOLABELS" value="-1">
        <param name="SRC" value="<%=vurl%>">
        <param name="CONTROLS" value="Imagewindow">
        <param name="CONSOLE" value="clip1">
        <param name="LOOP" value="0">
        <param name="NUMLOOP" value="0">
        <param name="CENTER" value="0">
        <param name="MAINTAINASPECT" value="0">
        <param name="BACKGROUNDCOLOR" value="#000000">
      </object>
      <br>
      <object ID="RP2" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="373" HEIGHT="50">
        <param name="_ExtentX" value="9869">
        <param name="_ExtentY" value="741">
        <param name="AUTOSTART" value="-1">
        <param name="SHUFFLE" value="0">
        <param name="PREFETCH" value="0">
        <param name="NOLABELS" value="-1">
        <param name="SRC" value="<%=vurl%>">
        <param name="CONTROLS" value="ControlPanel,StatusBar">
        <param name="CONSOLE" value="clip1">
        <param name="LOOP" value="0">
        <param name="NUMLOOP" value="0">
        <param name="CENTER" value="0">
        <param name="MAINTAINASPECT" value="0">
        <param name="BACKGROUNDCOLOR" value="#000000">
      </object>
      <script language="javascript"> 
player.SetEnableContextMenu(false);
player.SetWantErrors(true);
      </script>
</td>
    </tr>
    <%elseif vtype="md" then %>
    <tr>
      <td width="100%">
      <table border="0" cellspacing="0" style="border-collapse: collapse" width="373" id="AutoNumber1" background="images/video/menu_bg.gif" cellpadding="0">
        <tr>
          <td width="80%" height="20">&nbsp;影片名称：<font class=red_3><%=vtitle%></font>&nbsp;&nbsp;<%=action%></td>
          <script language="JavaScript">
    <!--

    var Real;
    Real='MediaPlayer1.';
    var Mute=false;
    var CanSetPos=true;
    var SetPosStart=false;
    var SetVolStart=false;
    var loop, timer, initialised;
    var speed=50;
    var oldwidth=566,oldheight=502;


    function DoFull()
    {
        eval(Real+'DisplaySize=3');
    }


NetShowServer = "" ;

var mPath = NetShowServer + "";


function LoadVideo(c1,c2) {
 if (c1=="") return;
 video_filename = c1;

 MusicPlayer.Cancel()
 timer=window.setTimeout("video_play()",2000)
}
function video_play(fn) {
 var mName = mPath + video_filename;
 MusicPlayer.Open(mName)
}
    -->
          </script>
          <td height="1" align="right">
          <input type="button" onMouseDown="DoFull()" value="全屏显示" style="border-style: ridge; border-width: 1"></td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="100%">
      <p align="center">
      <script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
-->
      </script>
      <script language="JavaScript">
<!--
function fullscreen() {       
	msplayer.FullScreen=true;
}
function fullscreen64() {       
	msplayer.DisplaySize=3;
}
-->
      </script>
      <script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--

var st=0;
var st2=0;

function MediaPlayer1_EndOfStream() {
	reg.button1.disabled=false;
reg.fullscreen.disabled=true;	
}

function MediaPlayer1_Error() {
	reg.aderror.value="on";
	alert('已超过本站最大负载能力，请稍后尝试观看当前影片！');
	reg.button1.disabled=false;
reg.fullscreen.disabled=false;
}

function reg_onsubmit() {
	reg.button1.disabled=true;
	reg.fullscreen.disabled=false;
	return true;
}


function MediaPlayer1_OpenStateChange() {
	st=MediaPlayer1.OpenState;
	if (st==0) {adstatus.innerText ="播放结束";}
	if (st==3) {adstatus.innerText="正在连接服务器......";}
	if (st==4) {adstatus.innerText="已连接服务器";}
	if (st==5) {adstatus.innerText="正在打开文件......";}
	if (st==6) {adstatus.innerText="文件已打开";}
}

function MediaPlayer1_PlayStateChange() {
	st2=MediaPlayer1.PlayState;
	if (st2==0) {adstatus.innerText = "播放已停止";}
	if (st2==1) {adstatus.innerText="播放暂停";}
	if (st2==2) {adstatus.innerText="正在播放";}

}

-->
      </script>
      <script LANGUAGE="javascript" FOR="MediaPlayer1" EVENT="EndOfStream">
<!--
 MediaPlayer1_EndOfStream()
	reg.button1.disabled=false;

-->
      </script>
      <script LANGUAGE="javascript" FOR="MediaPlayer1" EVENT="Error">
<!--
 MediaPlayer1_Error()
-->
      </script>
      <script LANGUAGE="javascript" FOR="MediaPlayer1" EVENT="OpenStateChange">
<!--
 MediaPlayer1_OpenStateChange()
-->
      </script>
      <script LANGUAGE="javascript" FOR="MediaPlayer1" EVENT="PlayStateChange">
<!--
 MediaPlayer1_PlayStateChange()
-->
      </script>
      <object id="MediaPlayer1" style="left: 0px; top: 0px" type="application/x-oleobject" height="340" standby="Loading Media Player components..." width="373" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebasr="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ? name="msplayer">
        <param name="AudioStream" value="-1">
        <param name="AutoSize" value="0">
        <param name="AutoStart" value="-1">
        <param name="AnimationAtStart" value="-1">
        <param name="AllowScan" value="-1">
        <param name="AllowChangeDisplaySize" value="-1">
        <param name="AutoRewind" value="0">
        <param name="Balance" value="0">
        <param name="BaseURL" value>
        <param name="BufferingTime" value="5">
        <param name="CaptioningID" value>
        <param name="ClickToPlay" value="0">
        <param name="CursorType" value="0">
        <param name="CurrentPosition" value="-1">
        <param name="CurrentMarker" value="0">
        <param name="DefaultFrame" value>
        <param name="DisplayBackColor" value="0">
        <param name="DisplayForeColor" value="16777215">
        <param name="DisplayMode" value="0">
        <param name="DisplaySize" value="4">
        <param name="Enabled" value="-1">
        <param name="EnableContextMenu" value="0">
        <param name="EnablePositionControls" value="-1">
        <param name="EnableFullScreenControls" value="0">
        <param name="EnableTracker" value="-1">
        <param name="Filename" value="<%=vurl%>">
        <param name="InvokeURLs" value="-1">
        <param name="Language" value="-1">
        <param name="Mute" value="0">
        <param name="PlayCount" value="1">
        <param name="PreviewMode" value="0">
        <param name="Rate" value="1">
        <param name="SAMILang" value>
        <param name="SAMIStyle" value>
        <param name="SAMIFileName" value>
        <param name="SelectionStart" value="-1">
        <param name="SelectionEnd" value="-1">
        <param name="SendOpenStateChangeEvents" value="-1">
        <param name="SendWarningEvents" value="-1">
        <param name="SendErrorEvents" value="-1">
        <param name="SendKeyboardEvents" value="0">
        <param name="SendMouseClickEvents" value="0">
        <param name="SendMouseMoveEvents" value="0">
        <param name="SendPlayStateChangeEvents" value="-1">
        <param name="ShowCaptioning" value="0">
        <param name="ShowControls" value="-1">
        <param name="ShowAudioControls" value="-1">
        <param name="ShowDisplay" value="0">
        <param name="ShowGotoBar" value="0">
        <param name="ShowPositionControls" value="-1">
        <param name="ShowStatusBar" value="-1">
        <param name="ShowTracker" value="-1">
        <param name="TransparentAtStart" value="0">
        <param name="VideoBorderWidth" value="0">
        <param name="VideoBorderColor" value="0">
        <param name="VideoBorder3D" value="0">
        <param name="Volume" value="-600">
        <param name="WindowlessVideo" value="0">
      </object>
      </p>
      <form method="post" action="mpath.asp?id=52&count=2&serv=2" name="reg" target="keepframe" LANGUAGE="javascript" onsubmit="return reg_onsubmit()">
        <input type="hidden" name="aderror" id="aderror">
        <p>
        <input id="hidden" name="button1" type="hidden" LANGUAGE="javascript">
        <input type="hidden" id="fullscreen" onClick="fullscreen64();return false;" disabled>
        <input type="hidden" name="hid" value="472393097"></p>
        <p></p>
      </form>
      <p><br>
      </td>
    </tr>
<% elseif vtype="mov" then %>
    <tr>
      <td width="100%">
      <p align="center">
      <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="373" height="341" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
        <param name="src" value="<%=vurl%>">
        <param name="controller" value="false">
        <param name="target" value="myself">
        <param name="href" value="<%=vurl%>">
        <param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">
        <embed width="372" height="316" controller="false" target="myself" href="<%=vurl%>" src="<%=vurl%>" bgcolor="FFFFFF" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html">
      </object>
      </td>
    </tr>
    <%end if%>
  </table>
  </center>
</div>

</body>

</html>

