<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="GB2312">
    <title></title>
    <link href="css/style.css" title="style" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.6.3.min.js"></script>

</head>
<body style="background: #F3F3F3" onunload="OnClickStop201();">
<div class="append">
</div>
<script>
  var itype=3081;
<% db_Open("/NandFlash/dbCfg.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbSM where SID="+sid,0);%>;
<% db_Close(); %>
  var sip,sport,usercode,password;

  $(".back,.you_p").live("click",function(){window.history.go(-1);});
  $(function(){
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
  });
  list3(json);
  function list3(data){
    var q='';
    $.each(data.recs,function(i,n){
        var user=n.SerDef.split(":");
        sip=user[0]; sport=user[1];
		usercode=user[2];
		password=user[3];
        q+="<div class='type3080 empty' style='margin: 10px;'>";
        q+="<table width='100%' style='margin-bottom: 5px'>";
        q+="<tr><td style='border: none'> <h1>网络摄像机HNT</h1></td></tr>";
        q+="</table>";
        q+="<div  style='width: 100%;text-align: center'>";
        q+='<OBJECT style="TOP: 0px" id="ocx" codebase="ocx/JAVOleDe.CAB" classid=clsid:A90F043B-7FA7-44CD-99AE-F058629CF7AA width="100%" height="500"></OBJECT>';
        q+="<input style='width: 100px;height: 30px;margin: 0 30px' onclick='OnClickPlay201()' type='button' value='播放'>";
        q+="<input style='width: 100px;height: 30px;margin: 0 30px' onclick='OnClickStop201()'  type='button' value='停止'>";
        q+="</div>";
        q+="<a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>";
        q+="</div>";
    });
    $(".append").html(q);
    var obj = document.getElementById("ocx");
	var screenFormat='{"type":0,"count":4,"splitData":'
					+'[{"id":1, "x":1, "y":1, "wndCount":-1}, {"id":4, "x":2, "y":2, "wndCount":-1}, {"id":9, "x":3, "y":3, "wndCount":-1}, {"id":16, "x":4, "y":4, "wndCount":-1}]'
					+'}';
	obj.SetSplitDef(screenFormat);//定义分屏格式
	if(obj.Login(sip, 7554, 3321,  usercode, password)==0){
		alert("login == 0");
		return;
	}
	OnClickPlay201();
  }
  function OnClickPlay201() {
     var obj = document.getElementById("ocx");	  
     obj.StartStream(0, 0, 4);
  }
  function OnClickStop201() {
    var obj = document.getElementById("ocx");
    obj.StopStream(0, 4);
  }

</script>
</body>
</html>