// JavaScript Document
<!-- AJAX Start
var http_request = null;



<!-- AJAX End -->

// RS-485
var IP ="http://bwn.dyndns.tv/pt/ptctrl.cgi";
function move(d)
{
	var timestamp = new Date();
	var variables = "?cmd="+d;
	document.getElementById("hiddenframe").src = IP+variables+"&ts="+timestamp;
}


var pnameA = ["", "", "", "", "", "", "", "", ""];





var intervalID = null;
var FrameRate = "30";

var sizetimer = 2000; // milliseconds
var vsize; 
var sizeIndex; 
var netcamObj;


/* OCX Video init */
var vmode = "mpeg"; // mpeg, jpeg, mpeg
var ipadd = self.location.host; <!-- '172.31.2.195' / self.location.host -->
var lpp = ''; <!-- 'YWRtaW46YWRtaW4=' / -->
var brow;
var http_port = self.location.port;
var url = self.location.protocol;

if(ipadd.indexOf(":")>0)
{
 ipadd = ipadd.substring(0, ipadd.indexOf(":"));
}
if(http_port != "")
{
 ipadd = ipadd + ":" + http_port;
}

if(isIE()) { var brow = "IE"; }
if(isNS()) { var brow = "MZ"; }

function set_Video()
{
 var cf = document.forms[0];
 var vs = document.getElementById("v_play");

 if (vmode != "")
 {
 vs.style.display = "block";
 }
 else
 {
 vs.style.display = "none";
 }
}

var dw_jpeg = '<object classid="clsid:7B133798-FAA8-4A7e-950D-BEB35D3363AF" CODEBASE="LinksysViewer.cab#Version=2,0,0,16" id="WVC230_V_1" width="640" height="524">'+
 '<param name="Text" value="http://bwn.dyndns.tv'+
 ipadd+
 '/img/mjpeg.cgi'+
 ' '+
 lpp+
 ' 0 '+
 brow+
 '">' +
 '<param name="BackColor" value="12632256">'+
 '<param name="_Version" value="65536">'+
 '<param name="_ExtentX" value="11774">'+
 '<param name="_ExtentY" value="6562">'+
 '</object>';

var dw_mpeg = '<object classid="clsid:7B133798-FAA8-4A7e-950D-BEB35D3363AF" CODEBASE="LinksysViewer.cab#Version=2,0,0,16" id="WVC230_V_1" width="640" height="524">'+
 '<param name="Text" value="http://bwn.dyndns.tv'+
 ipadd+
 '/img/video.asf'+
 ' '+
 lpp+
 ' 0 '+
 brow+
 '">' +
 '<param name="BackColor" value="12632256">'+
 '<param name="_Version" value="65536">'+
 '<param name="_ExtentX" value="11774">'+
 '<param name="_ExtentY" value="6562">'+
 '</object>';

var dw_push = '<img border="0" alt="Video for other Platform/OS" src="http://bwn.dyndns.tv/img/video.mjpeg" onError="reloadOnErr(this)">';

function dw(message)
{ document.write(message); }

function doPlay()
{
 if(vmode != "")
 {
 if(url.indexOf('https') != -1)
 {
 if(isIE())
 { dw(dw_serror); }
 else
 { dw(dw_push); }
 }
 else
 {
 if(isWin())
 {
 if(isIE())
 {
 if( vmode == "jpeg" )
 { dw(dw_push); }
 else
 { dw(dw_push); }
 //setTimeout("window.viewerDIV.location='main.cgi?next_file=viewer.htm';", 1500);
 }
 else
 {
 dw(dw_push);
 //setTimeout("window.viewerDIV.location='main.cgi?next_file=viewer.htm';", 1500);
 }
 }
 else
 {
 dw(dw_push);
 //setTimeout("window.viewerDIV.location='main.cgi?next_file=viewer.htm';", 1500);
 }
 }
 }
 else return false;
}
/* OCX Video End */
