
var emnuvalue=1;

var connectwhileclick=false;
var need_readptztimer=false;
var LastRecvPtzString={};


RECVDATATIMEOUT=emnuvalue++;			//收取流时，如果10秒内都没有数据，则会发送此消息
FOCUSCHANGE=emnuvalue++;				//播放器焦点改变时发生
STARTPLAY=emnuvalue++;					//开始播放
ENTERWAITFORBUFFER=emnuvalue++;			//进入缓冲
SETUP_VIDEO_PARAM_OK=emnuvalue++;		//SetupDecoder返回成功
SETUP_AUDIO_PARAM_OK=emnuvalue++;		//SetupDecoder返回成功
SNAPSHORT_FINISH=emnuvalue++;			//抓图结束
BINDPORTERROR	=emnuvalue++;			//邦定端口失败
VSS_STOPPLAY=emnuvalue++;				//播放VSS文件结束
VSS_STARTPLAY=emnuvalue++;				//开始播放
VSS_PLAYNEXT=emnuvalue++;			//播放下一个文件
VSS_SETUPERROR		=emnuvalue++;		//调用setup返回失败
CREATE_THREAD_ERROR=emnuvalue++;		//创建线程失败
LOC_STOPPLAY		=emnuvalue++;		//停止本地文件播放
LOC_OPENFILEERROR	=emnuvalue++;		//本地文件播放时打开文件失败
LOC_PLAYERROR		=emnuvalue++;		//播放失败退出
LOC_PAUSEPLAY		=emnuvalue++;		//暂停播放
LOC_OPENFILE_ERROR	=emnuvalue++;		//打开本地文件失败


var selectPlayerId="player1";           //当前选择的播放器ID
var realplayplanel=null;                //实时播放视频窗口创建
var playbacksearchform =null;          //回放视频窗口
var loginForm =null;
var loginview=null;
var VssFileResultGrid =null;
var _playBackWind=null;
var helpPanel=null;
var searhfilePanel=null;
var treeViewPlan=null;
var showSearhPlan=null;
var realPlayPanel=null;
var loginObj=null;
var treeRealTime=null;
var loginUser="";
var loginPass="";
var LastCmdOkDevId="";
var playobjDevIdList={};//播放devid
var LastPlayVideoPort={};
var PlayVideoTypeList={};//保存播放的是d1还是cif
var LastPlayModeNeedShow={};
var LastDevStatus={};
var TimerHandleForUpdateStaus=null;
var LastSelectGroupNode=null;
var LastTackCameraId="";
var _playBackWind=null;//回放窗口
var __user_function_to_readcamera=false;



VS_ALARM_IN_NONE       =     0x00;
VS_ALARM_IN_FIRE       =     0x01;
VS_ALARM_IN_SMOKE      =     0x02;
VS_ALARM_IN_INFRARED   =     0x03;
VS_ALARM_IN_GAS        =     0x04;
VS_ALARM_IN_TEMPERATURE =    0x05;
VS_ALARM_IN_GATING     =     0x06;
VS_ALARM_IN_OTHER      =     0x07;









 

var alarmcode=0;

ALARM_TYPE_NONE = alarmcode++;
ALARM_TYPE_MOTIONDECTECT= alarmcode++;//, //移动侦测
ALARM_TYPE_FACEDECTECT= alarmcode++;//, //人脸检测
ALARM_TYPE_FACERECOGNIZED= alarmcode++;//, //人脸识别
ALARM_TYPE_VIDEO_LOST= alarmcode++;//, //视频丢失
ALARM_TYPE_VIDEO_COVERED= alarmcode++;//, //视频遮挡
ALARM_TYPE_IO_LOW2HIGH= alarmcode++;//, //IO由低变高
ALARM_TYPE_IO_HIGH2LOW= alarmcode++;//, //IO由高变低
ALARM_TYPE_STORAGE_FULL= alarmcode++;//, //存储空间不足
ALARM_TYPE_RECORD_FAILED= alarmcode++;//, //录像失败




 
alarmcode=0;
EVENT_TYPE_NONE= alarmcode++;//,
EVENT_TYPE_USB_PLUGIN= alarmcode++;//, //U盘插入
EVENT_TYPE_USB_UNPLUG= alarmcode++;//, //U盘拔出
EVENT_TYPE_SD1_PLUGIN= alarmcode++;//, //SD1插入
EVENT_TYPE_SD1_UNPLUG= alarmcode++;//, //SD1拔出
EVENT_TYPE_SD2_PLUGIN= alarmcode++;//, //SD2插入
EVENT_TYPE_SD2_UNPLUG= alarmcode++;//, //SD2拔出
EVENT_TYPE_RECORD_START= alarmcode++;//, //录像开始
EVENT_TYPE_RECORD_FINISHED= alarmcode++;//, //录像结束
EVENT_TYPE_RECORD_FILE_REMOVED= alarmcode++;//, //录像文件删除
EVENT_TYPE_RECORD_DIR_REMOVED= alarmcode++;//, //录像目录删除



//IO告警输入
VS_ALARM_TYPE_NONE = VS_ALARM_IN_NONE;// ,
VS_ALARM_TYPE_FIRE = VS_ALARM_IN_FIRE;// , 
VS_ALARM_TYPE_SMOKE = VS_ALARM_IN_SMOKE ;//, 
VS_ALARM_TYPE_INFRARED = VS_ALARM_IN_INFRARED ;//, 
VS_ALARM_TYPE_GAS = VS_ALARM_IN_GAS;// ,
VS_ALARM_TYPE_TEMPERATURE = VS_ALARM_IN_TEMPERATURE ;//, 
VS_ALARM_TYPE_GATING = VS_ALARM_IN_GATING;// ,  
VS_ALARM_TYPE_MANUAL = VS_ALARM_IN_OTHER ;//,   



 
  
VS_EVENT_TYPE_NONE = EVENT_TYPE_NONE,
VS_EVENT_TYPE_USB_PLUGIN = EVENT_TYPE_USB_PLUGIN;//, //U盘插入
VS_EVENT_TYPE_USB_UNPLUG = EVENT_TYPE_USB_UNPLUG;//, //U盘拔出
VS_EVENT_TYPE_SD1_PLUGIN = EVENT_TYPE_SD1_PLUGIN;//, //SD1插入
VS_EVENT_TYPE_SD1_UNPLUG = EVENT_TYPE_SD1_UNPLUG;//, //SD1拔出
VS_EVENT_TYPE_SD2_PLUGIN = EVENT_TYPE_SD2_PLUGIN;//, //SD2插入
VS_EVENT_TYPE_SD2_UNPLUG = EVENT_TYPE_SD2_UNPLUG;//, //SD2拔出
VS_EVENT_TYPE_RECORD_START = EVENT_TYPE_RECORD_START;//, //录像开始
VS_EVENT_TYPE_RECORD_FINISHED = EVENT_TYPE_RECORD_FINISHED;//, //录像结束
VS_EVENT_TYPE_RECORD_FILE_REMOVED = EVENT_TYPE_RECORD_FILE_REMOVED;//, //录像文件删除
VS_EVENT_TYPE_RECORD_DIR_REMOVED = EVENT_TYPE_RECORD_DIR_REMOVED;//, //录像目录删除
 



 






//IO报警输入
VS_ALARM_TYPE_NONE			= VS_ALARM_IN_NONE;
VS_ALARM_TYPE_FIRE			= VS_ALARM_IN_FIRE;
VS_ALARM_TYPE_SMOKE			= VS_ALARM_IN_SMOKE;
VS_ALARM_TYPE_INFRARED		= VS_ALARM_IN_INFRARED;
VS_ALARM_TYPE_GAS				= VS_ALARM_IN_GAS;
VS_ALARM_TYPE_TEMPERATURE	= VS_ALARM_IN_TEMPERATURE;
VS_ALARM_TYPE_GATING			= VS_ALARM_IN_GATING;
VS_ALARM_TYPE_MANUAL			= VS_ALARM_IN_OTHER	;



emnuvalue=0x101;
//摄像头报警
VS_ALARM_TYPE_MOTIONDECTECT = emnuvalue++;	//移动侦测
VS_ALARM_TYPE_FACEDECTECT= emnuvalue++;		//人脸检测
VS_ALARM_TYPE_FACERECOGNIZED= emnuvalue++;	//人脸识别
VS_ALARM_TYPE_VIDEO_LOST= emnuvalue++;		//视频丢失
VS_ALARM_TYPE_VIDEO_COVERED= emnuvalue++;	//视频遮挡
VS_ALARM_TYPE_STORAGE_FULL= emnuvalue++;	//存储空间不足
VS_ALARM_TYPE_RECORD_FAILED= emnuvalue++;	//录像失败

//以下2个，如果配置了报警输入设备，则根据通道号查找相应的报警输入类型
VS_ALARM_TYPE_IO_LOW2HIGH= emnuvalue++;		//IO由低变高
VS_ALARM_TYPE_IO_HIGH2LOW= emnuvalue++;		//IO由高变低

VS_ALARM_TYPE_UNKNOWN= emnuvalue++;









//IO告警输入
VS_ALARM_TYPE_NONE			= VS_ALARM_IN_NONE;
VS_ALARM_TYPE_FIRE			= VS_ALARM_IN_FIRE;
VS_ALARM_TYPE_SMOKE			= VS_ALARM_IN_SMOKE;
VS_ALARM_TYPE_INFRARED		= VS_ALARM_IN_INFRARED;
VS_ALARM_TYPE_GAS				= VS_ALARM_IN_GAS;
VS_ALARM_TYPE_TEMPERATURE	= VS_ALARM_IN_TEMPERATURE;
VS_ALARM_TYPE_GATING			= VS_ALARM_IN_GATING;
VS_ALARM_TYPE_MANUAL			= VS_ALARM_IN_OTHER	;



emnuvalue=0x101;
//摄像头告警
VS_ALARM_TYPE_MOTIONDECTECT = emnuvalue++;	//移动侦测
VS_ALARM_TYPE_FACEDECTECT= emnuvalue++;		//人脸检测
VS_ALARM_TYPE_FACERECOGNIZED= emnuvalue++;	//人脸识别
VS_ALARM_TYPE_VIDEO_LOST= emnuvalue++;		//视频丢失
VS_ALARM_TYPE_VIDEO_COVERED= emnuvalue++;	//视频遮挡
VS_ALARM_TYPE_STORAGE_FULL= emnuvalue++;	//存储空间不足
VS_ALARM_TYPE_RECORD_FAILED= emnuvalue++;	//录像失败

//以下2个，如果配置了告警输入设备，则根据通道号查找相应的告警输入类型
VS_ALARM_TYPE_IO_LOW2HIGH= emnuvalue++;		//IO由低变高
VS_ALARM_TYPE_IO_HIGH2LOW= emnuvalue++;		//IO由高变低

VS_ALARM_TYPE_UNKNOWN= emnuvalue++;

languageValue="ch";
downloadfiledir="c:\\";

var modifyPassPanel=null;//修改密码窗口
var passmodifyplan=null;






var main_but_stop=null;
var main_but_d1=null;
var main_but_stopsound=null;
var main_but_record=null;
var main_text_showpage=null;
var main_but_startaudio=null;//对讲版本
var main_but_capture=null;

var main_loginuser_field=null;
var main_loginpass_field=null;
var main_loginip_field=null;
var main_loginport_field=null;
var main_needsavepass_field=null;






var have_AdvPTZRight=0;//云台
var have_PTZRight=0;//云台
var have_DevMNGRight=0;//设备管理
var have_SURVEILRight=0;//视频监控
var have_USRMNGRight=0;//用户管理
var have_VideoReplayRight=0;//回放
var have_AudioControlRight=0;//对讲
var have_BCControlRight=0;//广播
var have_TVWallRight=0;//电视
var have_AlarmMngRight=0;//告警管理
var have_ContentDeleteRight=0;//录像管理




var lastSearchDeviceId="";//最后一次搜索的ID
var lastSearchRecordTypeId="";//最后一次搜索的ID
var lastSearchPageNumber=0;//最后一次搜索的页号



var lastRealPlayIdx=0;//回放的播放窗口

var timer_forShowAlarm=0;//用于更新告警信息的定时器
var haveRecvAlarmData=false;//标记有没有收到新的告警信息，如果有，则每秒定时器会自动更新
var __timer_forchekplay=0;//用于检查播放列表定时器


var userConfigStr="";//用户播放列表

var nLastRecvAlarmTime=0;//最后接收告警的时间
var ptzAndAlarmForm=null;
var _AlarmFormPanel=null;
var _PtzFormPanel=null;
var nowallowShowAlarm=false;
var LastCmdStatusMsg="";

//0833FA59-A823-4fe1-AF0D-D1F0060D2F99
var __playbackclassid="0833FA59-A823-4fe1-AF0D-D1F0060D2F99";
var __playerbackclasspath="activex/TPPlayer.cab#version=1,0,1,0";


var __playclassid="0833FA59-A823-4fe1-AF0D-D1F0060D2FCC";
var __playerclasspath="activex/TPPlayer.cab#version=1,0,5,5";


__loginobjclassid="12F1D13E-5AF7-477E-9383-EFBEDD398F18";
__loginobjclasspath="activex/TPPlayer.cab#version=1,0,8,1";


var LastPubDllVersion="075DD6BA-FB75-498D-B50E-16081B6C839B";
var LastPublicVersionValue=20111200;



var main_autologin_field=null;// 是否自动登录 
var __LastTimeisAutoLogin=false;
var main_changeauto_login_but=null;
var Max_play_Count=4;


var __now_Play_ShowCount=1;
var main_but_changeplaycount=null;
var __playAudioDevId="";

var configserverip=GetIpFromUrl();
configserverip=configserverip.replace(/[^0-9a-zA-Z.]+/g,"");
var __configfilefullpath="c:\\"+configserverip+"web.ini";
var __configfilefullpath2="c:\\"+configserverip+"web.ini";


var itemsplitobj="AA@#~!@==!@AA";
var __exitPanel=null;





//  此三个变量只是解决手动登录时不正确的情况   
IsAutoLoginMode=false;
AutoLoginServer="";
AutoLoginServerPort=20001;
AutoReadIpFromIeURL=true;
//   结束,以上三个变量不用配置   





var __versionstring="WebC_1.4.4";
var __copyrightstring=" WEB Client Copyright 2010-2012 All Rights Reserved";

var __userFCom=false;
var __lastRecvDevListStatus={};

var __fullfillplnel=null;