//Release var bDEBUG = false; var bFlexTest = false; //test(1-4 channel replace 5-16 channel) var bButtonFlexTest = false; //test 1-6button replace 7-16的button var bButtonFlexSizeTest = true; //test button minsize var bDiskmapDataTest = false; var bDebugMsgFlag=true; //Debug open var bBasicFlagTest=false; //true:none basic,false:xml var g_DebugMessageFlag=true; // debug // Normal User right var g_NormalUserFunctionEnable=new Array(0,0,0,0); // 0:play 1:search 2:export 3:alarm //var bFlowChartTest = true; //Release : bDEBUG = false var g_sMac = ""; var MAX_CHANNELS=16; var MKF_PRODUCT=0; //0:4Mosa , 6:Bahu , 3:2mosa , 5:600RT var g_webVersion="v0.0.5"; var page = new Array(); var g_LiveCamera = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var DiskmapCamera = new Array("","","","","","","","","","","","","","","",""); var g_SeqCamera = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var g_QuadSeqCamera = new Array(0, 0, 0, 0, 0, 0); var CovertCamera = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var EnableCamera = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var VLossCamera = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); var VLossPlaybackCamera = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); // Playback's VLoss var arySmartGrid = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); var aryGrid = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); var arySysInfo = new Array(0,0,0,0); var aryNewSysInfo = new Array(0,0,0,0); var g_LiveModeIdx = 0; //MenuView 0: 1x1, 1: 2X2, 4:3x3, 5:4x4 var g_OldLiveModeIdx = 0; // 0: 1x1, 1: 2X2, 4:3x3, 5:4x4 var g_SeqDoubleClickIdx = 0; // 0: 1x1, 1: 2X2, 4:3x3, 5:4x4 var g_OldHightLightCam = 0; // click MOSAView 的 Camera Index var g_OldSeqLightCam=0; var g_flagOutCamera = false; // MOSA View Dobule Click var g_NxNIndex=0; //var LiveCameraIndex = 0; var g_VedioSystem = 0; //#define DVR_BASIC 0 //#define DVR_PREFESSIONAL 1 var g_SystemModel = 0; var g_nScrWidth; var g_bLoginOK = false; var g_bGetDT = false; var g_bPTZactive = false; var g_nPTZNumber = 0; var g_UserLevel = 2; var g_userName=""; var g_bLive = 0; var g_MenuIndex = 0; //menu, 0:Live, 1:Search, 2:Config, 3:Export var g_menuSearchIndex = 0; // Time/Event/Smart Search Index var g_menuConfigIndex = 0; var g_ConfigCameraIndex = 0; var g_ConfigScheduleIndex = 0; var g_ConfigDisplayIndex = 0; var g_ConfigEventIndex = 0; var g_ConfigNetworkIndex = 0; var g_ConfigSystemIndex = 0; var g_bMenuCameraShow = true; var g_bMenuScheduleShow = true; var g_bMenuDisplayShow = true; var g_bMenuEventShow = true; var g_bMenuNetworkShow = true; var g_bMenuSystemShow = true; //Search var g_EventSearchIndex = 1; var g_EventSearchCameraSelect=new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); var g_SmartSearchIndex = 1; var g_SmartSearchCameraSelect=new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); var g_playspeed = 0; var g_ClientCount = 0; var g_bGetSysDT = false; var g_bIsSeqMode = false; //Seq mode var g_SeqIndex = 0; //Seq run 0..n-1 var g_QuadIndex = 1; var g_SeqNextIndex = 0; var g_tmpSeqSec = 0; //var g_bViewMenu = false; //1x1,2x2....4x4,Seq,Full,true:show,false:Disable var g_CovertValue = 0; var g_AudioCovertValue = 0; var g_PBCovertCameraMask=0; //========================================================= var g_bLiveMode = false; var g_bSearchMode = false; var g_bConfigMode = false; var g_nPlaydst = 2; var g_nLanguage = 0; //========================================================= var g_host = top.location.host; var g_ip = g_host.split(":")[0]; var g_port = g_host.split(":")[1]?g_host.split(":")[1]:80; var ajax = new AjaxClass(); var hx = new HandleXml(); var ocx; var cgi; var reconnectFlag = 0; var g_mAudioCam = 0; var g_nLoginMsg = 0; // alarm email var g_alarmMode=false; var g_alarmTime; var g_alarmChannel; // Quick Export var g_exportMode=false; var g_export_start=0; var g_export_end=0; var g_export_ch=0; // Quick Config var g_configMode=false; var g_config_start=0; var g_userPassword; var g_userLanguage; var g_liveMask=0;//1:mask var g_factoryFlag=false; var g_ptzSpeed=0; //========================================================= //diskmap var bmpDiskmap = new Array("diskmap_no.bmp","diskmap_continuous.bmp","diskmap_input.bmp","diskmap_no.bmp", "diskmap_motion.bmp","diskmap_no.bmp","diskmap_no.bmp","diskmap_no.bmp", "diskmap_no_daylight.bmp","diskmap_continuous_daylight.bmp","diskmap_input_daylight.bmp","diskmap_no.bmp", "diskmap_motion_daylight.bmp","diskmap_no.bmp","diskmap_no.bmp","diskmap_no.bmp","diskmap_no.bmp"); var g_TableMenuButton = new Array(0,1,4,5,2,3); //button to bmp file, 1x1 2x2,3x3,4x4,seq,full //========================================================= function Initialize() { //Get MAX_CHANNELS InitProductInfo(); if(bDebugMsgFlag==true) ErrMsgRegister(); SetMainFrameLogoProductName(); // DVR 400,/600 Series SetMargin(); layer_init(); hideConfigMenu(); initPrepositions(); //set language Language_init(); var sLanguage = GetCookie("MosaLanguage"); if(sLanguage=="") sLanguage=0; setIdValue("sel_Language",sLanguage); LanguageChange(sLanguage); InitCameraMenuTable(tbl_CameraMenu1,"td_CameraMenu","img_CameraMenu","CameraMenuover","CameraMenuSelect","CameraMenuOut"); cgi = new cgi(); ocx = new ocx("MOSAViewer"); DisplayCH(); // ?alarm_time=123428434&channel_index=1 // check alarm mode g_alarmTime=parseHttp(window.location,"alarm_time"); g_alarmChannel=parseHttp(window.location,"channel_index")-1; var max=parseInt(MAX_CHANNELS,10); if((g_alarmTime!=null) && (g_alarmChannel!=null)){ if((g_alarmTime>0) && (g_alarmChannel>=0) && (g_alarmChannel 0) && (g_export_end > 0)) g_exportMode=true; // alarm mode = true } // ex: http://192.168.13.159/login.html?username=QURNSU5JU1RSQVRPUg==&password=MDAwMDAw&export_start=1295977735&export_end=1295977855 if(g_exportMode==true){ GetTimeFMT(); ExportMosaShow(0); return; } //Config Start g_config_start = parseHttp(window.location,"config_start"); if(g_config_start!=null){ if(g_config_start > 0) g_configMode=true; } // ex: http://192.168.13.159/login.html?username=QURNSU5JU1RSQVRPUg==&password=MDAwMDAw&config_start=1 if(g_configMode==true){ GetTimeFMT(); ConfigMosaShow(0); return; } //初始設定,4,8,16 ch的按鈕狀態 if(MAX_CHANNELS==4) g_LiveModeIdx=1; // 2x2 else if(MAX_CHANNELS==8) g_LiveModeIdx=4; // 3x3 else if(MAX_CHANNELS==16) g_LiveModeIdx=5; // 4x4 else g_LiveModeIdx=0; } // Export need get time format first function GetTimeFMT() { var myhx=new HandleXml(); myhx.setUrl("System.xml"); g_Time1224 = myhx.getNodeValue("TIME_1224"); } //取得Login_info.xml資訊 function InitProductInfo() { var myhx=new HandleXml(); myhx.setUrl("Login_info.xml"); MKF_PRODUCT=myhx.getNodeValue("MKF_PRODUCT"); if(myhx.getNodeValue("MKF_CHANNEL")) { MAX_CHANNELS=myhx.getNodeValue("MKF_CHANNEL"); // 設定MAX_CHANNELS } else { MAX_CHANNELS=4; } } // Search Tabel的CameraMenu function InitCameraMenuTable(tableIDElement,cameraID,imgID,menuOver,menuSelect,menuOut) { var trID; var tdID; var idx; if(tableIDElement.rows[0]!=null) return; trID=tableIDElement.insertRow(); for(var i=1; i<=MAX_CHANNELS; i++) { // tdID=trID.insertCell(); tdID.id=cameraID+(i); eval("tdID.onMouseover=function(e){"+menuOver+"("+i+");};"); // mouse over event: CameraMenuover(i) eval("tdID.onMouseout=function(e){e=e||window.event; "+menuOut+"();};"); // mouse out event: CameraMenuOut(i) eval("tdID.onclick=function(e){"+menuSelect+"("+i+");};"); // mouse select: CameraMenuSelect(i) idx=getPrefixCH("Button_",i)+".bmp"; if(bButtonFlexSizeTest && (MAX_CHANNELS>4)) tdID.innerHTML=""; else tdID.innerHTML=""; if(i%8==0 && i!=MAX_CHANNELS) //每8個換行 trID=tableIDElement.insertRow(); } } function DisplayCH() { if(MAX_CHANNELS==16) //16CH { setIdHeight("tbl_CameraFrame1",73); setIdHeight("tbl_Camera",73); setIdStyleHeight("CameraMenu",73); setIdStyleTop("PtzFrame",130); setIdStyleTop("PtzMenu",133); setIdStyleTop("EventLogFrame",433); setIdStyleTop("EventLogMenu",439); setIdStyleHeight("ifrm_Event_List",160); setIdHeight("tbl_EventLog",178); } else if(MAX_CHANNELS<=8) //8CH { setIdHeight("tbl_CameraFrame1",55); setIdHeight("tbl_Camera",55); setIdStyleHeight("CameraMenu",55); setIdStyleTop("PtzFrame",112); setIdStyleTop("PtzMenu",115); setIdStyleTop("EventLogFrame",417); setIdStyleTop("EventLogMenu",421); setIdStyleHeight("ifrm_Event_List",178); setIdStyleHeight("EventLogFrame",206); setIdHeight("tbl_EventLogFrame",206); setIdHeight("tbl_EventLog",205); if(MAX_CHANNELS==8) getIdStyle("img_menuView_5").display="none"; else{ //==4 getIdStyle("img_menuView_4").display="none"; getIdStyle("img_menuView_5").display="none"; } } } function InitSearchDT() { initDateYear(); initDateMonth(); initDateDay(); initDateHour(); initDateMin(); initDateSec(); } function InitObject() { //Release document.write('\n'); document.write('\n'); //Go to export.js , search.js } function exitLoginHtml() { g_bIsSeqMode=false; closeOcx(); } function closeOcx() { cgi.PBpause(); cgi.PBcancel(); if(typeof(MOSAViewer.Logout)=="unknown") MOSAViewer.Logout(); } function layer_init() { if(document.layers) { page[0] = eval(document.layers["loginFrame"]); page[1] = eval(document.layers["viewFrame"]); page[2] = eval(document.layers["MainFrame"]); page[3] = eval(document.layers["MainFrameBack"]); page[4] = eval(document.layers["LogoFrame"]); page[5] = eval(document.layers["MenuFrame"]); page[6] = eval(document.layers["SetupFrame"]); page[7] = eval(document.layers["SetupIFrame"]); page[8] = eval(document.layers["CameraFrame"]); page[9] = eval(document.layers["CameraMenu"]); page[10] = eval(document.layers["PtzFrame"]); page[11] = eval(document.layers["PtzMenu"]); page[12] = eval(document.layers["EventLogFrame"]); page[13] = eval(document.layers["EventLogMenu"]); page[14] = eval(document.layers["SearchFrame"]); page[15] = eval(document.layers["SearchSubFrame"]); page[16] = eval(document.layers["SearchMenu"]); page[17] = eval(document.layers["ConfigFrame"]); page[18] = eval(document.layers["ConfigMenu"]); page[19] = eval(document.layers["SearchTimeFrame"]); page[20] = eval(document.layers["SearchEventFrame"]); page[21] = eval(document.layers["SearchSmartFrame"]); page[22] = eval(document.layers["MenuFrameDisabled"]); page[23] = eval(document.layers["CameraMenuDisabled"]); page[24] = eval(document.layers["PtzMenuDisabled"]); page[25] = eval(document.layers["EventLogMenuDisabled"]); page[26] = eval(document.layers["GridSaveFrame"]); page[27] = eval(document.layers["OutputMenuDisabled"]); page[28] = eval(document.layers["SetupIFrameBack"]); page[29] = eval(document.layers["SearchCancalBtn"]); page[30] = eval(document.layers["DaylightSavingBtn"]); page[31] = eval(document.layers["PtzMenu2"]); page[32] = eval(document.layers["SystemInfoFrame"]); page[33] = eval(document.layers["SetupIFrameBack2"]); } else { page[0] = eval(document.all["loginFrame"].style); page[1] = eval(document.all["viewFrame"].style); page[2] = eval(document.all["MainFrame"].style); page[3] = eval(document.all["MainFrameBack"].style); page[4] = eval(document.all["LogoFrame"].style); page[5] = eval(document.all["MenuFrame"].style); page[6] = eval(document.all["SetupFrame"].style); page[7] = eval(document.all["SetupIFrame"].style); page[8] = eval(document.all["CameraFrame"].style); page[9] = eval(document.all["CameraMenu"].style); page[10] = eval(document.all["PtzFrame"].style); page[11] = eval(document.all["PtzMenu"].style); page[12] = eval(document.all["EventLogFrame"].style); page[13] = eval(document.all["EventLogMenu"].style); page[14] = eval(document.all["SearchFrame"].style); page[15] = eval(document.all["SearchSubFrame"].style); page[16] = eval(document.all["SearchMenu"].style); page[17] = eval(document.all["ConfigFrame"].style); page[18] = eval(document.all["ConfigMenu"].style); page[19] = eval(document.all["SearchTimeFrame"].style); page[20] = eval(document.all["SearchEventFrame"].style); page[21] = eval(document.all["SearchSmartFrame"].style); page[22] = eval(document.all["MenuFrameDisabled"].style); page[23] = eval(document.all["CameraMenuDisabled"].style); page[24] = eval(document.all["PtzMenuDisabled"].style); page[25] = eval(document.all["EventLogMenuDisabled"].style); page[26] = eval(document.all["GridSaveFrame"].style); page[27] = eval(document.all["OutputMenuDisabled"].style); page[28] = eval(document.all["SetupIFrameBack"].style); page[29] = eval(document.all["SearchCancalBtn"].style); page[30] = eval(document.all["DaylightSavingBtn"].style); page[31] = eval(document.all["PtzMenu2"].style); page[32] = eval(document.all["SystemInfoFrame"].style); page[33] = eval(document.all["SetupIFrameBack2"].style); } page[0].visibility = (document.layers) ? "hide" : "hidden"; page[1].visibility = (document.layers) ? "hide" : "hidden"; page[2].visibility = (document.layers) ? "hide" : "hidden"; page[3].visibility = (document.layers) ? "hide" : "hidden"; page[4].visibility = (document.layers) ? "hide" : "hidden"; page[5].visibility = (document.layers) ? "hide" : "hidden"; page[6].visibility = (document.layers) ? "hide" : "hidden"; page[7].visibility = (document.layers) ? "hide" : "hidden"; page[8].visibility = (document.layers) ? "hide" : "hidden"; page[9].visibility = (document.layers) ? "hide" : "hidden"; page[10].visibility = (document.layers) ? "hide" : "hidden"; page[11].visibility = (document.layers) ? "hide" : "hidden"; page[12].visibility = (document.layers) ? "hide" : "hidden"; page[13].visibility = (document.layers) ? "hide" : "hidden"; page[14].visibility = (document.layers) ? "hide" : "hidden"; page[15].visibility = (document.layers) ? "hide" : "hidden"; page[16].visibility = (document.layers) ? "hide" : "hidden"; page[17].visibility = (document.layers) ? "hide" : "hidden"; page[18].visibility = (document.layers) ? "hide" : "hidden"; page[19].visibility = (document.layers) ? "hide" : "hidden"; page[20].visibility = (document.layers) ? "hide" : "hidden"; page[21].visibility = (document.layers) ? "hide" : "hidden"; page[22].visibility = (document.layers) ? "hide" : "hidden"; page[23].visibility = (document.layers) ? "hide" : "hidden"; page[24].visibility = (document.layers) ? "hide" : "hidden"; page[25].visibility = (document.layers) ? "hide" : "hidden"; page[26].visibility = (document.layers) ? "hide" : "hidden"; page[27].visibility = (document.layers) ? "hide" : "hidden"; page[28].visibility = (document.layers) ? "hide" : "hidden"; page[29].visibility = (document.layers) ? "hide" : "hidden"; page[30].visibility = (document.layers) ? "hide" : "hidden"; page[31].visibility = (document.layers) ? "hide" : "hidden"; page[32].visibility = (document.layers) ? "hide" : "hidden"; page[33].visibility = (document.layers) ? "hide" : "hidden"; initshow(); } function initshow() { page[0].visibility = (document.layers) ? "show" : "visible"; page[2].visibility = (document.layers) ? "show" : "visible"; page[4].visibility = (document.layers) ? "show" : "visible"; page[5].visibility = (document.layers) ? "show" : "visible"; page[6].visibility = (document.layers) ? "show" : "visible"; page[8].visibility = (document.layers) ? "show" : "visible"; page[9].visibility = (document.layers) ? "show" : "visible"; page[10].visibility = (document.layers) ? "show" : "visible"; page[11].visibility = (document.layers) ? "show" : "visible"; page[12].visibility = (document.layers) ? "show" : "visible"; page[13].visibility = (document.layers) ? "show" : "visible"; page[31].visibility = (document.layers) ? "show" : "visible"; page[32].visibility = (document.layers) ? "show" : "visible"; viewFrameLive(); MenuFrame_Disabled(true); CameraMenu_Disabled(true); PtzMenu_Disabled(true); OutputMenu_Disabled(true); EventLogMenu_Disabled(true); page[1].visibility = (document.layers) ? "hide" : "hidden"; } function setAudioChannel1() { if(g_bConfigMode) { cgi.setLiveAudio(0); return; } var tmpCam = ocx.GetMouseDownCamera(); var bAudio=false; var nCam=0; for(var i = 0;i < MAX_CHANNELS;i++) { if((tmpCam & 0x01<=4) { alert(IDS_USER_FULL); } else { cgi.login(g_LoginID, connect); }*/ var sLanguage = getIdValue("sel_Language"); SetCookie("MosaLanguage", sLanguage, 1000); cgi.login(g_LoginID, connect); } else { page[1].visibility = (document.layers) ? "hide" : "hidden"; if(g_nLoginMsg==0) alert(IDS_WM0231); else alert(IDS_USER_FULL); } } } function connect() { if(cgi.ajax.status == 1 && cgi.ajax.data) { cgi.sid = cgi.ajax.data; ocx.sid = cgi.sid; SetSeriesModel(); SetCovertSetting(); SetDateTimeFormat(); var enableLive=Math.pow(2,MAX_CHANNELS)-1; ocx.LiveStream(g_ip,g_port,enableLive.toInt()); setTimeout("delayconnect();",1000); //var nCheck = "0"; var nCheck = cgi.checkstream(); //0:OK -1:fail if(nCheck == "0") { if(reconnectFlag == 0) { //取得使用者XML GetUserXML(); getNormalUserFunctionEnable(); g_curUserId=GetCurUserID(); MosaOKShow(); } else { //ifrm_View.initFrame(); } reconnectFlag = 1; //var enableLive=Math.pow(2,MAX_CHANNELS)-1; //ocx.LiveStream(g_ip,g_port,enableLive.toInt()); // //close cgi.ao_login(ao_connect); g_bGetDT = true; page[0].visibility = (document.layers) ? "hide" : "hidden"; // Alarm MosaOkShow if(g_alarmMode==true) { if(g_UserLevel>0) //Admin除外 0:admin SetLevelSettingPB(); MainFrame.style.zIndex=101; //5 LogoFrame.style.zIndex=102; //5 SetupIFrame.style.zIndex=103; //36 SetupIFrame.style.left=111; //211 //hide yy mm dd hh rr sel_Search_Time_YY.style.display="none"; sel_Search_Time_MM.style.display="none"; sel_Search_Time_DD.style.display="none"; sel_Search_Time_H.style.display="none"; sel_Search_Time_M.style.display="none"; sel_Search_Time_S.style.display="none"; sel_Search_Time_AP.style.display="none"; setTimeout("viewFrameNone();",1000); cgi.setLiveStream(0); MenuSelect(1); if(g_normalUserPlayEnable==false) { SetCookieHours("Dvr_400_600_UserName","",1); SetCookieHours("Dvr_400_600_Password","",1); alert(IDS_WM0231); Logout_MOSA(); } } if(g_exportMode==true) { MainFrame.style.zIndex=101; //5 LogoFrame.style.zIndex=102; //5 SetupIFrame.style.zIndex=103; //36 SetupIFrame.style.left=111; //211 //hide yy mm dd hh rr sel_Search_Time_YY.style.display="none"; sel_Search_Time_MM.style.display="none"; sel_Search_Time_DD.style.display="none"; sel_Search_Time_H.style.display="none"; sel_Search_Time_M.style.display="none"; sel_Search_Time_S.style.display="none"; sel_Search_Time_AP.style.display="none"; setTimeout("viewFrameNone();",1000); cgi.setLiveStream(0); MenuSelect(3); } if(g_configMode==true) { page[5].visibility = (document.layers) ? "hide" : "hidden"; setTimeout("viewFrameNone();",1000); cgi.setLiveStream(0); MenuSelect(2); } //factory if(g_factoryFlag==true){ MOSAViewer.Logout(); MenuSelect(3); } } else { page[0].visibility = (document.layers) ? "show" : "visible"; alert(IDS_WEB_MSG_LOGIN_FAIL4); } } else { cgi.login(g_LoginID, connect); } } function delayconnect() { // } function ao_connect() { if(cgi.ajax.status == 1 && cgi.ajax.data) { cgi.aoid = cgi.ajax.data; ocx.aoid = cgi.aoid; //2 way audio ocx.AudioStream(g_ip,g_port); ocx.SetAudioBroadcast(1,0x20); } else { cgi.ao_login(ao_connect); } } function GetLoginOK(LoginMode) { var sUsername; var sPassword; if(LoginMode==0) { var sTempUsername = getIdValue("username"); var sTempPassword = getIdValue("password"); sUsername = encode64(sTempUsername); sPassword = encode64(sTempPassword); } else if(LoginMode==1)//AlarmLogin { sUsername = g_userName; sPassword = g_userPassword; } else if(LoginMode==2)//ExportLogin { sUsername = g_userName; sPassword = g_userPassword; } else if(LoginMode==3)//ConfigLogin { sUsername = g_userName; sPassword = g_userPassword; } var sTempUsernameX = decode64(sUsername); var userHx = new HandleXml(); var userData = cgi.getlogin(sUsername,sPassword); userHx.setXml(userData); if(userHx.getNodeValue("result") == "1") { g_userName = sUsername; g_curUserName = sTempUsernameX; g_UserLevel = userHx.getNodeValue("LEVEL"); g_VedioSystem = userHx.getNodeValue("VIDEO_SYSTEM"); if(bBasicFlagTest==true) g_SystemModel=1; else g_SystemModel = userHx.getNodeValue("DVR_SYS_MODEL"); g_covert = parseInt(userHx.getNodeValue("COVERT"),10); GetCovertCameraAry(); if(g_SystemModel==0) //Basic { setIdVisibility("img_Outputs2", 0); setIdVisibility("img_Outputs3", 0); setIdVisibility("img_Outputs4", 0); } g_bLoginOK = true; //factory if( sTempUsername=="a" && sTempPassword=="1111" ) g_factoryFlag=true; } else { if(userHx.getNodeValue("result") == "0") g_nLoginMsg = 0; if(userHx.getNodeValue("result") == "2") g_nLoginMsg = 1; g_bLoginOK = false; } } //Not Use function GetChannelNumInfo() { var num=0; var tmpHx = new HandleXml(); var tmpData = cgi.getSystemInfo(); tmpHx.setXml(tmpData); if(tmpHx.getNodeValue("result") == "1") { num = tmpHx.getNodeValue("MAX_CHANNEL"); } return num; } //Not Use function GetMacInfo() { var tmpHx = new HandleXml(); var tmpData = cgi.getSystemInfo(); tmpHx.setXml(tmpData); if(tmpHx.getNodeValue("result") == "1") { var sMac = tmpHx.getNodeValue("MAC"); var nMacLen = sMac.length-1; for(var i=nMacLen; i>0; i--) { var sTemp = sMac.substr(i,1); if(sTemp!="-") g_sMac = g_sMac+sTemp; } } } function GetCovertCameraAry() { for(var i=0 ; i0) //Admin除外 0:admin SetLevelSetting(); } function getNormalUserFunctionEnable() { var flag; //set 4 funciton checkbox var hxlogin = new HandleXml(); hxlogin.setUrl("Login_info.xml"); flag=hxlogin.getNodeValue("PLAYBACK"); g_NormalUserFunctionEnable[0]=flag; flag=hxlogin.getNodeValue("SEARCH"); g_NormalUserFunctionEnable[1]=flag; flag=hxlogin.getNodeValue("EXPORT"); g_NormalUserFunctionEnable[2]=flag; flag=hxlogin.getNodeValue("ACK"); g_NormalUserFunctionEnable[3]=flag; } function GetCurUserID() { for(var i=0;i0) { for(var j = 0;j < MAX_CHANNELS;j++) { if((CamShow & 0x01<0) { for(var j = 0;j < MAX_CHANNELS;j++) { if((CamShow & 0x01<0) { for(var i = 0;i < MAX_CHANNELS;i++) { if(cgiflag==true) flag=true; else // false or null flag=(parent.VLossPlaybackCamera[i]==0?true:false); if(CovertCamera[i] == 0) //相反 0:show { //if(parent.VLossPlaybackCamera[i]==0 && (bitWise(customMask,j)==0)) // VLossPlaybackCamera if(flag && (bitWise(customMask,j)==0) ) { if((CamShow & 0x01<0) { Disabledstr = "_disabled"; page[27].visibility = (document.layers) ? "show" : "visible"; } else //Admin { if(bDisabled) { Disabledstr = "_disabled"; page[27].visibility = (document.layers) ? "show" : "visible"; } else { page[27].visibility = (document.layers) ? "hide" : "hidden"; } } for(i=1; i<=4; i++) setIdSrc('img_Outputs'+i,'img/Relay_0'+i+'_inactive'+Disabledstr+'.bmp'); } function EventLogMenu_Disabled(bDisabled) { if(bDisabled) page[25].visibility = (document.layers) ? "show" : "visible"; else page[25].visibility = (document.layers) ? "hide" : "hidden"; } //1x1,2x2,3x3,4x4,Seq,Funn,選單控制 function DisableNxNMenuView(bDisabled) { if(bDisabled) { setIdSrc("img_menuView_0","img/menuView_0_d.gif"); setIdSrc("img_menuView_1","img/menuView_11_d.gif"); setIdSrc("img_menuView_2","img/menuView_2_d.gif"); setIdSrc("img_menuView_3","img/menuView_3_d.gif"); setIdSrc("img_menuView_4","img/menuView_41_d.gif"); setIdSrc("img_menuView_5","img/menuView_5_d.gif"); } else { setIdSrc("img_menuView_0","img/menuView_0_n.gif"); setIdSrc("img_menuView_1","img/menuView_11_n.gif"); setIdSrc("img_menuView_2","img/menuView_2_n.gif"); setIdSrc("img_menuView_3","img/menuView_3_n.gif"); setIdSrc("img_menuView_4","img/menuView_41_n.gif"); setIdSrc("img_menuView_5","img/menuView_5_n.gif"); } setIdDisabled("img_menuView_0",bDisabled); setIdDisabled("img_menuView_1",bDisabled); setIdDisabled("img_menuView_2",bDisabled); setIdDisabled("img_menuView_3",bDisabled); setIdDisabled("img_menuView_4",bDisabled); setIdDisabled("img_menuView_5",bDisabled); // g_bViewMenu = bDisabled; } function DisableNxNMenuView_seq(bDisabled) { if(bDisabled) { setIdSrc("img_menuView_0","img/menuView_0_d.gif"); setIdSrc("img_menuView_1","img/menuView_11_d.gif"); setIdSrc("img_menuView_4","img/menuView_41_d.gif"); setIdSrc("img_menuView_5","img/menuView_5_d.gif"); } else { setIdSrc("img_menuView_0","img/menuView_0_n.gif"); setIdSrc("img_menuView_1","img/menuView_11_n.gif"); setIdSrc("img_menuView_4","img/menuView_41_n.gif"); setIdSrc("img_menuView_5","img/menuView_5_n.gif"); } setIdDisabled("img_menuView_0",bDisabled); setIdDisabled("img_menuView_1",bDisabled); setIdDisabled("img_menuView_4",bDisabled); setIdDisabled("img_menuView_5",bDisabled); // g_bViewMenu = bDisabled; } function DisableNxNMenuView_DTsearch(bDisabled) { if(bDisabled) //幻燈片 Menu Item { setIdSrc("img_menuView_2","img/menuView_2_d.gif"); } else { setIdSrc("img_menuView_2","img/menuView_2_n.gif"); } setIdDisabled("img_menuView_2",bDisabled); // g_bViewMenu = bDisabled; } function CheckCharKeyin(Textobj,bChar,Value1,Value2) //bChar 1:0-9 a-z ' ','.','-','_','@' 0:0-9, value1~value2 { var sText=Textobj.value; var l=sText.length; var bText=0; for (var i=l-1;i>=0;i--) { var ch=sText.charCodeAt(i); if ((ch>=48)&&(ch<=57)) //0-9 { // } else if ((ch>=65)&&(ch<=90)) //A-Z { if(bChar==0) bText=1; } else if ((ch>=97)&&(ch<=122)) //A-Z { if(bChar==0) bText=1; } else if ((ch==32)||(ch==46)||(ch==47)||(ch==58)||(ch==45)||(ch==95)||(ch==64)) //32" ", 46".", 47"/", 58":', 45"-", 64"@", 95"_" { if(bChar==0) bText=1; } else { bText=1; } } if (bText==1) { if(bChar==0) alert(IDS_WEB_MSG_CHK_KEYIN_NUM); else alert(IDS_WEB_MSG_CHK_KEYIN_CHAR); Textobj.focus(); Textobj.select(); } else { if(Value1!=Value2) { if((sTextValue2)||(sText=="")) { alert(IDS_WEB_MSG_CHK_KEYIN_MIN + Value1 + ", " + IDS_WEB_MSG_CHK_KEYIN_MAX + Value2); Textobj.focus(); Textobj.select(); } } } } function CheckCamTitleCharKeyin(Textobj,bChar,Value1,Value2) //bChar 1:0-9 a-z ' ','.','/',':','-' 0:0-9, value1~value2 { var sText=Textobj.value; var l=sText.length; var bText=0; for (var i=l-1;i>=0;i--) { var ch=sText.charCodeAt(i); if ((ch>=48)&&(ch<=57)) //0-9 { // } else if ((ch>=65)&&(ch<=90)) //A-Z { if(bChar==0) bText=1; } else if ((ch>=97)&&(ch<=122)) //A-Z { if(bChar==0) bText=1; } else if ((ch==32)||(ch==46)||(ch==47)||(ch==58)||(ch==45)) //32" ", 46".", 47"/", 58":', 45"-" { if(bChar==0) bText=1; } else if ((ch==64)||(ch==95)) //64"@", 95"_" { if(MKF_PRODUCT == 0) { bText=1; } else { if(bChar==0) bText=1; } } else { bText=1; } } if (bText==1) { if(bChar==0) alert(IDS_WEB_MSG_CHK_KEYIN_NUM); else alert(IDS_WEB_MSG_CHK_KEYIN_CHAR); Textobj.focus(); Textobj.select(); } else { if(Value1!=Value2) { if((sTextValue2)||(sText=="")) { alert(IDS_WEB_MSG_CHK_KEYIN_MIN + Value1 + ", " + IDS_WEB_MSG_CHK_KEYIN_MAX + Value2); Textobj.focus(); Textobj.select(); } } } } /* */ function initDateYear() { var hs1 = new HandleSelect("sel_Search_Time_YY",0); var hs2 = new HandleSelect("sel_Search_Event_Start_YY",0); var hs3 = new HandleSelect("sel_Search_Event_End_YY",0); var hs4 = new HandleSelect("sel_Search_Smart_Start_YY",0); var hs5 = new HandleSelect("sel_Search_Smart_End_YY",0); for(i=0; i<32; i++) { hs1.addOpt(i,i+2006,i+2006); hs2.addOpt(i,i+2006,i+2006); hs3.addOpt(i,i+2006,i+2006); hs4.addOpt(i,i+2006,i+2006); hs5.addOpt(i,i+2006,i+2006); } } function initDateMonth() { var hs1 = new HandleSelect("sel_Search_Time_MM",0); var hs2 = new HandleSelect("sel_Search_Event_Start_MM",0); var hs3 = new HandleSelect("sel_Search_Event_End_MM",0); var hs4 = new HandleSelect("sel_Search_Smart_Start_MM",0); var hs5 = new HandleSelect("sel_Search_Smart_End_MM",0); for(i=0; i<12; i++) { if(i<9) { hs1.addOpt(i,"0"+(i+1),i+1); hs2.addOpt(i,"0"+(i+1),i+1); hs3.addOpt(i,"0"+(i+1),i+1); hs4.addOpt(i,"0"+(i+1),i+1); hs5.addOpt(i,"0"+(i+1),i+1); } else { hs1.addOpt(i,i+1,i+1); hs2.addOpt(i,i+1,i+1); hs3.addOpt(i,i+1,i+1); hs4.addOpt(i,i+1,i+1); hs5.addOpt(i,i+1,i+1); } } } function initDateDay() { var hs1 = new HandleSelect("sel_Search_Time_DD",0); var hs2 = new HandleSelect("sel_Search_Event_Start_DD",0); var hs3 = new HandleSelect("sel_Search_Event_End_DD",0); var hs4 = new HandleSelect("sel_Search_Smart_Start_DD",0); var hs5 = new HandleSelect("sel_Search_Smart_End_DD",0); for(i=0; i<31; i++) { if(i<9) { hs1.addOpt(i,"0"+(i+1),i+1); hs2.addOpt(i,"0"+(i+1),i+1); hs3.addOpt(i,"0"+(i+1),i+1); hs4.addOpt(i,"0"+(i+1),i+1); hs5.addOpt(i,"0"+(i+1),i+1); } else { hs1.addOpt(i,i+1,i+1); hs2.addOpt(i,i+1,i+1); hs3.addOpt(i,i+1,i+1); hs4.addOpt(i,i+1,i+1); hs5.addOpt(i,i+1,i+1); } } } function initDateHour() { var hs1 = new HandleSelect("sel_Search_Time_H",0); var hs2 = new HandleSelect("sel_Search_Event_Start_H",0); var hs3 = new HandleSelect("sel_Search_Event_End_H",0); var hs4 = new HandleSelect("sel_Search_Smart_Start_H",0); var hs5 = new HandleSelect("sel_Search_Smart_End_H",0); if(g_Time1224==0) //12H { hs1.addOpt(0,"12",0); hs2.addOpt(0,"12",0); hs3.addOpt(0,"12",0); hs4.addOpt(0,"12",0); hs5.addOpt(0,"12",0); for(i=1; i<12; i++) { if(i<=9) { hs1.addOpt(i,"0"+i,i); hs2.addOpt(i,"0"+i,i); hs3.addOpt(i,"0"+i,i); hs4.addOpt(i,"0"+i,i); hs5.addOpt(i,"0"+i,i); } else { hs1.addOpt(i,i,i); hs2.addOpt(i,i,i); hs3.addOpt(i,i,i); hs4.addOpt(i,i,i); hs5.addOpt(i,i,i); } } setIdDisplay("sel_Search_Time_AP" ,"inline"); setIdDisplay("sel_Search_Event_Start_AP" ,"inline"); setIdDisplay("sel_Search_Event_End_AP" ,"inline"); setIdDisplay("sel_Search_Smart_Start_AP","inline"); setIdDisplay("sel_Search_Smart_End_AP" ,"inline"); } else { for(i=0; i<24; i++) { if(i<=9) { hs1.addOpt(i,"0"+i,i); hs2.addOpt(i,"0"+i,i); hs3.addOpt(i,"0"+i,i); hs4.addOpt(i,"0"+i,i); hs5.addOpt(i,"0"+i,i); } else { hs1.addOpt(i,i,i); hs2.addOpt(i,i,i); hs3.addOpt(i,i,i); hs4.addOpt(i,i,i); hs5.addOpt(i,i,i); } } setIdDisplay("sel_Search_Time_AP" ,"none"); setIdDisplay("sel_Search_Event_Start_AP" ,"none"); setIdDisplay("sel_Search_Event_End_AP" ,"none"); setIdDisplay("sel_Search_Smart_Start_AP","none"); setIdDisplay("sel_Search_Smart_End_AP" ,"none"); } } function initDateMin() { var hs1 = new HandleSelect("sel_Search_Time_M",0); var hs2 = new HandleSelect("sel_Search_Event_Start_M",0); var hs3 = new HandleSelect("sel_Search_Event_End_M",0); var hs4 = new HandleSelect("sel_Search_Smart_Start_M",0); var hs5 = new HandleSelect("sel_Search_Smart_End_M",0); for(i=0; i<60; i++) { if(i<=9) { hs1.addOpt(i,"0"+i,i); hs2.addOpt(i,"0"+i,i); hs3.addOpt(i,"0"+i,i); hs4.addOpt(i,"0"+i,i); hs5.addOpt(i,"0"+i,i); } else { hs1.addOpt(i,i,i); hs2.addOpt(i,i,i); hs3.addOpt(i,i,i); hs4.addOpt(i,i,i); hs5.addOpt(i,i,i); } } var hs; hs = new HandleSelect("sel_Search_Time_AP",0); hs.addOpt(0,"am","0") .addOpt(1,"pm","1"); hs = new HandleSelect("sel_Search_Event_Start_AP",0); hs.addOpt(0,"am","0") .addOpt(1,"pm","1"); hs = new HandleSelect("sel_Search_Event_End_AP",0); hs.addOpt(0,"am","0") .addOpt(1,"pm","1"); hs = new HandleSelect("sel_Search_Smart_Start_AP",0); hs.addOpt(0,"am","0") .addOpt(1,"pm","1"); hs = new HandleSelect("sel_Search_Smart_End_AP",0); hs.addOpt(0,"am","0") .addOpt(1,"pm","1"); } function initDateSec() { if(typeof($id("sel_Search_Time_S"))!="object"){ return; } var hs1 = new HandleSelect("sel_Search_Time_S",0); for(i=0; i<60; i++) { if(i<=9) { hs1.addOpt(i,"0"+i,i); } else { hs1.addOpt(i,i,i); } } } /* */ function Language_init() { LanguageChange(g_nLanguage); lang_init(); var hs = new HandleSelect("sel_Language",0); hs.addOpt(0,IDS_L4_English,"0") .addOpt(1,IDS_L4_German,"1") .addOpt(2,IDS_L4_French,"2") .addOpt(3,IDS_L4_Dutch,"3") .addOpt(4,IDS_L4_Italian,"4") .addOpt(5,IDS_L4_Spanish,"5") .addOpt(6,IDS_L4_Portuguese,"6") .addOpt(7,IDS_L4_Swedish,"7") .addOpt(8,IDS_L4_Norwegian,"8") .addOpt(9,IDS_L4_Finish,"9") .addOpt(10,IDS_L4_Danish,"10") .addOpt(11,IDS_L4_Russian,"11") .addOpt(12,IDS_L4_Turkish,"12") .addOpt(13,IDS_L4_Polish,"13") .addOpt(14,IDS_L4_Czech,"14") .addOpt(15,IDS_L4_Hungarian,"15") .addOpt(16,IDS_L4_Greek,"16") .addOpt(17,IDS_L4_Simplified_Chinese,"17") .addOpt(18,IDS_L4_Traditional_Chinese,"18"); } function LanguageChange(nLang) { switch(parseInt(nLang,10)) { case 0: lang_en(); //English, EN break; case 1: lang_de(); //German, DE break; case 2: lang_fr(); //French, FR break; case 3: lang_nl(); //Dutch, NL break; case 4: lang_it(); //Italian, IT break; case 5: lang_es(); //Spanish, ES break; case 6: lang_pt(); //Portuguese, PT break; case 7: lang_sv(); //Swedish, SV break; case 8: lang_no(); //Norwegian, NO break; case 9: lang_fi(); //Finish, FI break; case 10: lang_da(); //Danish, DA break; case 11: lang_ru(); //Russian, RU break; case 12: lang_tr(); //Turkish, TR break; case 13: lang_pl(); //Polish, PL break; case 14: lang_cs(); //Czech, CS break; case 15: lang_hu(); //Hungarian, HU break; case 16: lang_el(); //Greek, EL break; case 17: lang_ch(); //Simplified_Chinese, CH break; case 18: lang_zh(); //Traditional_Chinese, ZH break; } g_nLanguage = nLang; //Login setIdInnerHTML("td_Login_Title" ,IDS_WEB_LOGIN); setIdInnerHTML("td_Language" ,IDS_L1_Language); setIdInnerHTML("td_User_ID" ,IDS_WEB_USER_ID); setIdInnerHTML("td_Password" ,IDS_L3_Password); setIdValue("btn_login_ok" ,IDS_WEB_LOGIN); //Live setIdTitle(document ,IDS_WEB_TITLE); setIdInnerHTML("td_Camera_selection" ,IDS_WEB_CAM_SELECTION); setIdInnerHTML("td_Camera_controls" ,IDS_WEB_CAM_CONTROLS); setIdInnerHTML("td_Pre_positions" ,IDS_WEB_PRE_POSITIONS); setIdValue("btn_ptz_shot" ,IDS_L4_Move); setIdValue("btn_ptz_set" ,IDS_L4_Set); setIdValue("btn_ptz_Aux_on" ,IDS_WEB_AUX_ON); setIdValue("btn_ptz_Aux_off" ,IDS_WEB_AUX_OFF); setIdInnerHTML("td_Outputs" ,IDS_L4_Relay_output); setIdInnerHTML("td_Event_Log" ,IDS_WEB_EVENT_LOG); //Button if(g_nLanguage==17) //CH { setIdClass("btn_login_ok" ,"buttoncolorCH"); setIdClass("btn_ptz_shot" ,"buttoncolorCH"); setIdClass("btn_ptz_set" ,"buttoncolorCH"); setIdClass("btn_ptz_Aux_on" ,"buttoncolorCH"); setIdClass("btn_ptz_Aux_off" ,"buttoncolorCH"); } else { setIdClass("btn_login_ok" ,"buttoncolor"); setIdClass("btn_ptz_shot" ,"buttoncolor"); setIdClass("btn_ptz_set" ,"buttoncolor"); setIdClass("btn_ptz_Aux_on" ,"buttoncolor"); setIdClass("btn_ptz_Aux_off" ,"buttoncolor"); } //ifrm_Event_List.setIdInnerHTML("td_EventList_DateTime" ,IDS_L2_Date_Time); } /* */ function initPrepositions() { var hs_Shot = new HandleSelect('sel_Shot_num',0); var hs_Aux = new HandleSelect('sel_Aux_num',0); for(var i=0; i<=999; i++) { var si=i; if(i<100) { si = "0"+i; } if(i<10) { si = "00"+i; } hs_Shot.addOpt(i,si,i); hs_Aux.addOpt(i,si,i); } } /* Live Mode OCX顯示區域控制*/ function viewFrameLive() { page[1].visibility = (document.layers) ? "hide" : "hidden"; $("viewFrame").width(555) .height(417) .left(208) .top(56);//.top(56+65); $("MOSAViewer").width(555) .height(417); page[1].visibility = (document.layers) ? "show" : "visible"; } function viewFrameNone() { page[1].visibility = (document.layers) ? "hide" : "hidden"; $("viewFrame").width(1) .height(1) .left(1) .top(1);//.top(56+65); $("MOSAViewer").width(1) .height(1); page[1].visibility = (document.layers) ? "show" : "visible"; } function viewFrameSearchhide() { page[1].visibility = (document.layers) ? "hide" : "hidden"; } function viewFrameSearch() { page[1].visibility = (document.layers) ? "hide" : "hidden"; $("viewFrame").width(555) .height(417) .left(208) .top(56); $("MOSAViewer").width(555) .height(417); page[1].visibility = (document.layers) ? "show" : "visible"; } function viewFrameVideoadj() { page[1].visibility = (document.layers) ? "hide" : "hidden"; $("viewFrame").width(380) .height(285) .left(295) .top(265); $("MOSAViewer").width(380) .height(285); page[1].visibility = (document.layers) ? "show" : "visible"; } function viewFrameMotion() { page[1].visibility = (document.layers) ? "hide" : "hidden"; $("viewFrame").width(380) .height(285) .left(295) .top(205); $("MOSAViewer").width(380) .height(285); page[1].visibility = (document.layers) ? "show" : "visible"; } function viewFramePTZ() { page[1].visibility = (document.layers) ? "hide" : "hidden"; $("viewFrame").width(320) .height(224) .left(265) .top(285); $("MOSAViewer").width(320) .height(240); page[1].visibility = (document.layers) ? "show" : "visible"; } function Logout_MOSA() { g_bGetDT = false; location.reload(); } //將 selected cam array -->1,1,1,1,0,0,0,0 轉換成 15這個數值 //arr: array , val為1 or 0 //num: number of array function selectedArray2MapVal(arr,num) { var val=0; for(var i=0;i0) SetLevelSetting(); switch(idx) { case 0: menu_live(); break; case 1: meun_search(0); break; case 2: meun_config(0,0); break; case 3: menu_export(); break; case 4: // break; case 5: // break; } } function SetLiveStream(mask) { if(mask==null || mask==undefined) mask=-1; if(mask==-1){ switch(MAX_CHANNELS.toInt()){ case 4: mask=0xf; break; case 8: mask=0xff; break; case 16: mask=0xffff; break; } } cgi.setLiveStream(mask.toInt()); } /* Live */ function menu_live() { if(g_bLiveMode) return; hideAllSubMenu(); page[7].visibility = (document.layers) ? "hide" : "hidden"; page[8].visibility = (document.layers) ? "show" : "visible"; page[9].visibility = (document.layers) ? "show" : "visible"; page[10].visibility = (document.layers) ? "show" : "visible"; page[11].visibility = (document.layers) ? "show" : "visible"; page[12].visibility = (document.layers) ? "show" : "visible"; page[13].visibility = (document.layers) ? "show" : "visible"; page[31].visibility = (document.layers) ? "show" : "visible"; page[32].visibility = (document.layers) ? "show" : "visible"; g_bGetSysDT = true; //Get Datetime and EventStatus g_bLiveMode = true; g_bSearchMode = false; g_bConfigMode = false; g_bIsSeqMode = false; /*if((g_alarmMode==true)||(g_exportMode==true)){ viewFrameNone(); } else { viewFrameLive(); //OCX顯示區域設定 }*/ viewFrameLive(); //OCX顯示區域設定 SetLiveStream(); // default 0xffff g_bLive = 1; //cgi.setLiveStream(0xff); /*if(g_bLive==1) { setAudioChannel1(); }*/ //CameraMenuOut(); DisableNxNMenuView(false); //關閉nxn,seq,full選單 NxNMenuMouseOut(); var mode;//=g_LiveModeIdx; var mode; if(MAX_CHANNELS==4) mode=1; else if(MAX_CHANNELS==8) mode=4; else if(MAX_CHANNELS==16) mode=5; g_LiveModeIdx=mode; g_OldHightLightCam=0; SelectNxNMenu(mode); setAudioChannel1(); //設定Audio,依據Mouse Down選在哪一個Camera //CameraMenuSelect(1); //模擬按下按鈕1的動作,因為第一次進入live須顯示4x4,g_LiveCamera的值須設定才會顯示按下 this.ifrm_View.location.replace("none.html"); } function MenuOver(idx) { if(idx!=g_MenuIndex) setIdSrc('img_menu_'+idx,'img/menu_'+idx+'_o.gif'); } function MenuOut() { for(i=0; i<=3; i++) setIdSrc('img_menu_'+i,'img/menu_'+i+'_n.gif'); setIdSrc('img_menu_'+g_MenuIndex,'img/menu_'+g_MenuIndex+'_a.gif'); if(g_UserLevel>0) SetLevelSetting(); } function MenuOutExit() { setIdSrc('img_menu_4','img/menu_4_n.gif'); } function SetNxNMenuBtnState(idx) { if(idx!=3) // 3:full screen , 3不用顯示按鈕變化,以便恢復full前的狀態 { //setIdSrc('img_menuView_'+g_LiveModeIdx,'img/menuView_'+g_LiveModeIdx+'_n.gif'); //setIdSrc('img_menuView_'+idx,'img/menuView_'+idx+'_a.gif'); if(idx==2 && g_LiveModeIdx==2){ // exit seq var tmp=g_OldLiveModeIdx; g_OldLiveModeIdx=g_LiveModeIdx; g_LiveModeIdx=tmp; }else if(idx==2 && g_LiveModeIdx!=2){ // enter seq g_SeqDoubleClickIdx=g_OldLiveModeIdx; g_OldLiveModeIdx=g_LiveModeIdx; g_LiveModeIdx=idx; }else{ // other g_OldLiveModeIdx=g_LiveModeIdx; g_LiveModeIdx=idx; } } } // 0:1x1, 1:2x2,2:seq,3:full,4:3x3,5:4x4 function SelectNxNMenu(idx,initFlag) { if((initFlag==undefined) || (initFlag==null)){ if(idx!=g_LiveModeIdx){ initFlag=GetHighLightNxNSeqIndex(idx); } } SetNxNMenuBtnState(idx); //依據選取的idx顯示button, 1x1,2x2..nxn,seq,full if(g_bLiveMode) { switch(idx) { case 0: InitNxNMenu(1,initFlag); break; case 1: InitNxNMenu(2,initFlag); break; case 2: var tmp=InitSeqMenu(); //if(g_bIsSeqMode==false) // exit seq // idx=g_LiveModeIdx; break; case 3: menu_full(); break; case 4: InitNxNMenu(3,initFlag); break; case 5: InitNxNMenu(4,initFlag); break; } }else if(g_bSearchMode) { switch(idx) { case 0: InitNxNSearchMenu(1,initFlag); // ifrm_View break; case 1: InitNxNSearchMenu(2,initFlag); break; case 3: ifrm_View.search_full(); break; case 4: InitNxNSearchMenu(3,initFlag); break; case 5: InitNxNSearchMenu(4,initFlag); break; } } NxNMenuMouseOut(); //SetLevelSetting(); } function NxNMenuMouseOver(idx) { if(idx<=5) { if(idx!=g_LiveModeIdx){ if(idx==1 || idx==4) setIdSrc('img_menuView_'+idx,'img/menuView_'+idx+1+'_o.gif'); else setIdSrc('img_menuView_'+idx,'img/menuView_'+idx+'_o.gif'); } } } // 1x1,2x2,3x3,4x4的Pic控制 function NxNMenuMouseOut() { // Live Mode /*if(g_bViewMenu) { for(i=0; i<=1; i++) setIdSrc('img_menuView_'+g_TableMenuButton[i],'img/menuView_'+g_TableMenuButton[i]+'_n.gif'); setIdSrc('img_menuView_'+g_LiveModeIdx,'img/menuView_'+g_LiveModeIdx+'_a.gif'); } else*/ for(i=0; i0) SetLevelSetting(); //權限控制,因為需要關閉一些使用者不能使用的按鈕 } function hideAllSubMenu() { page[1].visibility = (document.layers) ? "hide" : "hidden"; page[8].visibility = (document.layers) ? "hide" : "hidden"; page[9].visibility = (document.layers) ? "hide" : "hidden"; page[10].visibility = (document.layers) ? "hide" : "hidden"; page[11].visibility = (document.layers) ? "hide" : "hidden"; page[12].visibility = (document.layers) ? "hide" : "hidden"; page[13].visibility = (document.layers) ? "hide" : "hidden"; page[14].visibility = (document.layers) ? "hide" : "hidden"; page[15].visibility = (document.layers) ? "hide" : "hidden"; page[16].visibility = (document.layers) ? "hide" : "hidden"; page[17].visibility = (document.layers) ? "hide" : "hidden"; page[18].visibility = (document.layers) ? "hide" : "hidden"; page[19].visibility = (document.layers) ? "hide" : "hidden"; page[20].visibility = (document.layers) ? "hide" : "hidden"; page[21].visibility = (document.layers) ? "hide" : "hidden"; page[31].visibility = (document.layers) ? "hide" : "hidden"; page[32].visibility = (document.layers) ? "hide" : "hidden"; } function CameraMenuover(camIndex) { var idx; if(g_LiveCamera[camIndex-1]==0) { setIdSrc('img_CameraMenu'+camIndex,'img/Button_'+camIndex.toFill(2)+'_hover.bmp'); } } // Camera 1..16 function CameraMenuOut() //Show Camera status { var idx; for(i=1; i<=MAX_CHANNELS; i++) { idx=getPrefixCH("Button_",i); if(g_LiveCamera[i-1]==0) setIdSrc('img_CameraMenu'+i,'img/'+idx+'.bmp'); else setIdSrc('img_CameraMenu'+i,'img/'+idx+'_pressed.bmp'); } } function CameraMenuSeq(pos) { // pos: 1..n var idx; for(var i=1; i<=MAX_CHANNELS; i++) { idx=getPrefixCH("Button_",i); setIdSrc('img_CameraMenu'+i,'img/'+idx+'.bmp'); } idx=getPrefixCH("Button_",pos); setIdSrc('img_CameraMenu'+pos,'img/'+idx+'_pressed.bmp'); } // 選取某一個 camera 的事件 // camIndex 1.,n function CameraMenuSelect(camIndex) { var nIdx; var div; var quo; var val; var flag=false; switch(g_LiveModeIdx){ case 0: nIdx=1; break; case 1: nIdx=2; break; case 4: nIdx=3; break; case 5: nIdx=4; break; } div=Math.pow(nIdx,2); quo=Math.ceil(MAX_CHANNELS/div); for(var j=0;jMAX_CHANNELS? MAX_CHANNELS: div*(j+1); // ensure div*(j+1) <= max if(camIndex<=val && flag==false){ flag=true; InitNxNMenu(nIdx,j); // LiveCameraIndex=camIndex-1; /*for(var k=0;kMAX_CHANNELS) break; g_LiveCamera[val]=1; }*/ }else{ ; /*for(var k=0;kMAX_CHANNELS) break; g_LiveCamera[val]=0; }*/ } } CameraMenuOut(); //SelectNxNMenu(0); //處理右邊視窗顯示的cam setAudioChannel1(); } function PT_Panover(str) { setIdSrc('img_PT_Pan'+str,'img/PT_Pan'+str+'_hover.bmp'); } function PT_Pan_down(str) { setIdSrc('img_PT_Pan'+str,'img/PT_Pan'+str+'_pressed.bmp'); } function PT_PanOut() { setIdSrc("img_PT_PanUp","img/PT_PanUp.bmp"); setIdSrc("img_PT_PanLeft","img/PT_PanLeft.bmp"); setIdSrc("img_PT_PanRight","img/PT_PanRight.bmp"); setIdSrc("img_PT_PanDown","img/PT_PanDown.bmp"); if(g_bPTZactive) PT_Stop(); g_bPTZactive = false; } function PT_PanUp() { if(g_bPTZactive) PT_Stop(); g_bPTZactive = false; } function PT_Zoomover(str) { setIdSrc('img_PT_Zoom'+str,'img/Zoom'+str+'_hover.bmp'); } function PT_Zoom_down(str) { setIdSrc('img_PT_Zoom'+str,'img/Zoom'+str+'_pressed.bmp'); } function PT_ZoomOut() { setIdSrc("img_PT_ZoomOut","img/ZoomOut.bmp"); setIdSrc("img_PT_ZoomIn","img/ZoomIn.bmp"); if(g_bPTZactive) PT_Stop(); g_bPTZactive = false; } function PT_Focusover(str) { setIdSrc('img_PT_Focus'+str,'img/Focus'+str+'_hover.bmp'); } function PT_Focus_down(str) { setIdSrc('img_PT_Focus'+str,'img/Focus'+str+'_pressed.bmp'); } function PT_FocusOut() { setIdSrc("img_PT_FocusFar","img/FocusFar.bmp"); setIdSrc("img_PT_FocusNear","img/FocusNear.bmp"); if(g_bPTZactive) PT_Stop(); g_bPTZactive = false; } function PT_Irisover(str) { setIdSrc('img_PT_Iris'+str,'img/Iris'+str+'_hover.bmp'); } function PT_Iris_down(str) { setIdSrc('img_PT_Iris'+str,'img/Iris'+str+'_pressed.bmp'); } function PT_IrisOut() { setIdSrc("img_PT_IrisClose","img/IrisClose.bmp"); setIdSrc("img_PT_IrisOpen","img/IrisOpen.bmp"); if(g_bPTZactive) PT_Stop(); g_bPTZactive = false; } function PT_Pan(active) { var tmpCam = ocx.GetMouseDownCamera(); cgi.ptzId = tmpCam; cgi.user_level = g_UserLevel; /*var nCam=0; for(var i = 0;i < MAX_CHANNELS;i++) { if((tmpCam & 0x01<1) for(var j=0;j> 11) & 0x7FF; arySmartGrid[iGrid*2-1] = "0x"+itmpReturnGrid.toString(16); } } function MotionGridCancel() { //page[3].visibility = (document.layers) ? "hide" : "hidden"; SetMainFrameMask(0); setIdClass("SetupFrame","SetupFrame"); viewFrameSearchhide(); ifrm_View.viewFrameSearch(); UnShowMotionGrid(); SetLiveStream(0); page[26].visibility = (document.layers) ? "hide" : "hidden"; } function EventCameraOver(camIndex) { var idx; if(g_EventSearchCameraSelect[camIndex-1]==0) { idx=getPrefixCH("Button_",camIndex); setIdSrc('img_Search_Event_ch'+camIndex,'img/'+idx+'_hover.bmp'); } } function EventCameraOut() //Show Camera status { var idx; for(var i=1; i<=MAX_CHANNELS; i++) { idx=getPrefixCH("Button_",i); if(g_EventSearchCameraSelect[i-1]==0) setIdSrc('img_Search_Event_ch'+i,'img/'+idx+'.bmp'); else setIdSrc('img_Search_Event_ch'+i,'img/'+idx+'_pressed.bmp'); } } function EventCameraSelect(camIndex) { g_EventSearchCameraSelect[camIndex-1]=(g_EventSearchCameraSelect[camIndex-1]==0?1:0); EventCameraOut(); // ifrm_View.CameraSelect(camIndex); } //*********************** function RelayOver(RelayIndex) { if(g_AryAlarmMap[RelayIndex-1]=="disabled") return; if(g_AryAlarmStatus[RelayIndex-1]=="active") return; setIdSrc('img_Outputs'+RelayIndex,'img/Relay_0'+RelayIndex+'_inactive_hover.bmp'); //Relay_01_active_hover.bmp //Relay_01_inactive_hover.bmp } function RelayOut(RelayIndex) //Show Camera status { if(g_AryAlarmMap[RelayIndex-1]=="disabled") return; if(g_AryAlarmStatus[RelayIndex-1]=="active") return; reSetOutputs(); } function RelaySelect(RelayIndex) { if(g_AryAlarmMap[RelayIndex-1]=="disabled") return; cgi.AlarmOutputs(RelayIndex-1); } //*********************** function SmartCameraOver(camIndex) { var idx; if(g_SmartSearchCameraSelect[camIndex-1]==0) { idx=getPrefixCH("Button_",camIndex); setIdSrc('img_Search_Smart_ch'+camIndex,'img/'+idx+'_hover.bmp'); } } function SmartCameraOut() //Show Camera status { var idx; for(var i=1; i<=MAX_CHANNELS; i++) { idx=getPrefixCH("Button_",i); if(g_SmartSearchCameraSelect[i-1]==0) setIdSrc('img_Search_Smart_ch'+i,'img/'+idx+'.bmp'); else setIdSrc('img_Search_Smart_ch'+i,'img/'+idx+'_pressed.bmp'); } } function SmartCameraSelect(camIndex) { //for(var i=0;iMAX_CHANNELS-1) g_OldHightLightCam=(n*n*npFlag); //須處理 3x3-2 的ch8 ch9問題 if(bitWise(g_liveMask,g_OldHightLightCam)==1){ ocx.SetHighLightCh(-1); //檔ch8 ch9 }else if(n==1){ // 1x1 ocx.SetHighLightCh(npFlag); g_OldHightLightCam=npFlag; }else if((g_LiveCamera[g_OldHightLightCam]==0) && (g_LiveCamera[0]==0)){ ocx.SetHighLightCh(-1); //恢復原本的HighLightCh }else{ ocx.SetHighLightCh(g_OldHightLightCam); //恢復原本的HighLightCh } // Audio setAudioChannel1(); } // 初始化 MOSA Viewer OCX畫面 function InitViewer(n,idx) { // n最大4, 因為4*4=16 //idx 0..n-1,指定一開始顯示的序列,ex:2x2的map, 0為1234, 1為5678 var maxnp = MAX_CHANNELS; var np = Math.pow(n,2); // 2的n次方 //設定ATOMViewer 畫面 g_liveMask=0; //current mask state MOSAViewer.SetDisplayMode(n); // 1x1 or 2x2 or 3x3 or 4x4 for(var j=0;j=maxnp){ //超過max ch的設定mask MOSAViewer.SetCameraMap(j,j); g_liveMask=bitWiseSet(g_liveMask,j); //當3x3-2時,檔 ch 17,18對應的ch 8,9 } else{ MOSAViewer.SetCameraMap(j,idx*np+j); } } SetCovertSetting(g_liveMask); // cover mask } //n: nxn的模式,idx為seq idx, 2x2下 0:1234, 1:5678 function InitLiveCameraArray(n,idx) { // n最大4, 因為4*4=16 //idx 0..n-1,指定一開始顯示的序列,ex:2x2的map, 0為1234, 1為5678 var maxnp = MAX_CHANNELS; var np = Math.pow(n,2); // 2的n次方 var ndiv = Math.ceil(maxnp/np); // 16/9 = 1.xxx取ceil=2 //設定g_LiveCamera[]的值 for(var j=0;j 1x1,2x2,3x3,4x4 { var map=[0,1,4,5]; var map2=[1,4,9,16]; var nxn=0; for(var i=0;i=ndiv) npFlag=-1; return npFlag; } function GetNxNSeqNextIndex(n) { //n max 4, because 4*4=16 var maxnp = MAX_CHANNELS; var np = Math.pow(n,2); // 2^n var ndiv = Math.ceil(maxnp/np); // 16/9 = 1.xxx ceil=2 var npFlag=-1; npFlag=GetNxNSeqIndex(n); npFlag=(npFlag+1)%ndiv; return npFlag; } // seq==null,next seq function InitNxNSearchMenu(n,seq) { // n max 4, because 4*4=16 var npFlag=-1; if(seq==null){ npFlag=GetNxNSeqNextIndex(n); }else npFlag=seq; g_NxNIndex=npFlag+1; InitLiveCameraArray(n,npFlag); //for(var i=0;iMAX_CHANNELS-1) g_OldHightLightCam=(n*n*npFlag); //ch highlight 3x3-2 的ch8 ch9 if(bitWise(g_liveMask,g_OldHightLightCam)==1){ ifrm_View.ocx.SetHighLightCh(-1); //ch8 and ch9 }else if(n==1){ ifrm_View.ocx.SetHighLightCh(npFlag); g_OldHightLightCam=npFlag; }else if((g_LiveCamera[g_OldHightLightCam]==0) && (g_LiveCamera[0]==0)) ifrm_View.ocx.SetHighLightCh(-1); else ifrm_View.ocx.SetHighLightCh(g_OldHightLightCam); ifrm_View.setPlaybackAudioChannel(); //Search mode audio and MouseDownCamera /*nMode=n-1; ocx.SetHighLightCh(SearchCameraIndex); setPlaybackAudioChannel(); parent.NxNMenuMouseOut(); */ } function SetSeqCameraDwellTime() { // set enableLiveCamera[] var enableLiveCamera=new Array(MAX_CHANNELS); getLiveCameraEnable(enableLiveCamera); hx.setUrl("Display.xml"); if((g_OldLiveModeIdx!=1) || (MAX_CHANNELS==4)){ // multiscreen Seq for(var i=0;i0) //Admin除外 0:admin { if(CovertCamera[i]==1) //Camera Covert g_SeqCamera[i] = 0; } } }else { // quad Seq var maxquad=0; if(MAX_CHANNELS==16) maxquad=4; else if(MAX_CHANNELS==8) maxquad=2; //else if(MAX_CHANNELS==4) maxquad=1; for(var k=0;k0) //Admin除外 0:admin { if(fcover==false) //Camera Covert { g_SeqCamera[k] = 0; } } } } } function ExecSeqMode() { if(g_OldLiveModeIdx==1 && (MAX_CHANNELS>4)){ MOSAViewer.SetDisplayMode(2); }else{ MOSAViewer.SetDisplayMode(1); } g_SeqNextIndex=g_SeqIndex; g_SeqIndex=-1; var nSeqAudio = 0; //Soya 20091115 Add nSeqAudio=Math.pow(2,g_SeqIndex); // 1,2,4,8 if(nSeqAudio<1) nSeqAudio = 0; cgi.setLiveAudio(nSeqAudio); } function InitSeqMenu() { var nMaxCovert = 0; for(var i = 0;i < MAX_CHANNELS;i++) { nMaxCovert += i.toPow(2); } if((g_UserLevel==2)&&(g_covert==nMaxCovert)) { SelectNxNMenu(g_LiveModeIdx,GetHighLightNxNSeqIndex(g_LiveModeIdx)); g_OldLiveModeIdx=g_SeqDoubleClickIdx; return; } // 設定mode g_bIsSeqMode=(g_bIsSeqMode==true?false:true); // true: seq mode, false: normal // enter seq if(g_bIsSeqMode==true) { //g_OldSeqLightCam=g_OldHightLightCam; // enter seq mode g_QuadIndex = 1; DisableNxNMenuView_seq(g_bIsSeqMode); // disable 1x1 2x2..nxn //設定camera dwell time,and power limit control SetSeqCameraDwellTime(); g_SeqIndex=getSeqNextCamera(-1); // 取得第一個seq的ch if(g_SeqIndex==-1){//沒有可seq的 g_bIsSeqMode = false; setTimeout("SelectNxNMenu(g_OldLiveModeIdx);",2000); g_LiveModeIdx=g_OldLiveModeIdx; return; } // run seq mode, login.html有runseq()每秒執行跳台檢測 ExecSeqMode(); }else{ // exit seq SelectNxNMenu(g_LiveModeIdx,GetHighLightNxNSeqIndex(g_LiveModeIdx)); g_OldLiveModeIdx=g_SeqDoubleClickIdx; cgi.setLiveAudio(0); //CameraMenuSelect(g_OldHightLightCam); setAudioChannel12(); //Soya 20091124 Add } } //取得下一個seq,若目前所指向的 function getSeqNextCamera(seqIdx) { // -1表示從0..maxch-1 if(seqIdx==null) return -1; // seqIdx: 0..n-1, 若-1, 則表示找第一個 if(seqIdx>=MAX_CHANNELS){ return getSeqNextCamera(-1); } for(var i=seqIdx+1;i0))// &&(g_LiveCamera[i]>0)) // 檔目前選取的camera { return i; } } //全找不到 return -1; } function getSeqSec(idx) { var ngetSeqSec=0; switch(idx) { case "0": ngetSeqSec = 90; break; case "1": ngetSeqSec = 80; break; case "2": ngetSeqSec = 70; break; case "3": ngetSeqSec = 60; break; case "4": ngetSeqSec = 50; break; case "5": ngetSeqSec = 40; break; case "6": ngetSeqSec = 30; break; case "7": ngetSeqSec = 20; break; case "8": ngetSeqSec = 10; break; case "9": ngetSeqSec = 5; break; case "10": ngetSeqSec = 2; break; case "11": ngetSeqSec = 0; break; } return ngetSeqSec; } function getLiveCameraEnable(arr) { hx.setUrl("Camera.xml"); var idx; for(var j=0;j86400)) { var newStart = new Date((tmpEnd-86400)*1000); newStart = newStart.format("yyyy/mm/dd",true)+" "+newStart.format("HH:MM:ss",true); var newYY = newStart.substr(0,4); var newMM = newStart.substr(5,2); var newDD = newStart.substr(8,2); var newH = newStart.substr(11,2); var newAP = 0; if(g_Time1224==0)//12H { if(newH>12) { newH = newH-12; newAP = 1; } } var newM = newStart.substr(14,2); setIdValue("sel_Search_Event_Start_YY" ,newYY.toInt()); setIdValue("sel_Search_Event_Start_MM" ,newMM.toInt()); setIdValue("sel_Search_Event_Start_DD" ,newDD.toInt()); setIdValue("sel_Search_Event_Start_H" ,newH.toInt()); setIdValue("sel_Search_Event_Start_M" ,newM.toInt()); setIdValue("sel_Search_Event_Start_AP" ,newAP.toInt()); delete newStart; } } //***No Used*** function GetSearchEventEnd() { var sYY = getIdValue("sel_Search_Event_Start_YY"); var sMM = getIdValue("sel_Search_Event_Start_MM"); var sDD = getIdValue("sel_Search_Event_Start_DD"); var sH = getIdValue("sel_Search_Event_Start_H"); var sM = getIdValue("sel_Search_Event_Start_M"); var eYY = getIdValue("sel_Search_Event_End_YY"); var eMM = getIdValue("sel_Search_Event_End_MM"); var eDD = getIdValue("sel_Search_Event_End_DD"); var eH = getIdValue("sel_Search_Event_End_H"); var eM = getIdValue("sel_Search_Event_End_M"); if(g_Time1224==0)//12H { var sAP = getIdValue("sel_Search_Event_Start_AP"); if(sAP==1) { sH = sH.toInt() + 12; } var eAP = getIdValue("sel_Search_Event_End_AP"); if(eAP==1) { eH = eH.toInt() + 12; } } var tmpStart = Date.UTC(sYY,sMM-1,sDD,sH,sM,0) / 1000; var tmpEnd = Date.UTC(eYY,eMM-1,eDD,eH,eM,0) / 1000; var tmpTime = tmpEnd-tmpStart; if((tmpTime<0)||(tmpTime>86400)) { var newEnd = new Date((tmpStart+86400)*1000); newEnd = newEnd.format("yyyy/mm/dd",true)+" "+newEnd.format("HH:MM:ss",true); var newYY = newEnd.substr(0,4); var newMM = newEnd.substr(5,2); var newDD = newEnd.substr(8,2); var newH = newEnd.substr(11,2); var newAP = 0; if(g_Time1224==0)//12H { if(newH>12) { newH = newH-12; newAP = 1; } } var newM = newEnd.substr(14,2); setIdValue("sel_Search_Event_End_YY" ,newYY.toInt()); setIdValue("sel_Search_Event_End_MM" ,newMM.toInt()); setIdValue("sel_Search_Event_End_DD" ,newDD.toInt()); setIdValue("sel_Search_Event_End_H" ,newH.toInt()); setIdValue("sel_Search_Event_End_M" ,newM.toInt()); setIdValue("sel_Search_Event_End_AP" ,newAP.toInt()); delete newEnd; } } //***No Used*** function GetSearchSmartStart() { var sYY = getIdValue("sel_Search_Smart_Start_YY"); var sMM = getIdValue("sel_Search_Smart_Start_MM"); var sDD = getIdValue("sel_Search_Smart_Start_DD"); var sH = getIdValue("sel_Search_Smart_Start_H"); var sM = getIdValue("sel_Search_Smart_Start_M"); var eYY = getIdValue("sel_Search_Smart_End_YY"); var eMM = getIdValue("sel_Search_Smart_End_MM"); var eDD = getIdValue("sel_Search_Smart_End_DD"); var eH = getIdValue("sel_Search_Smart_End_H"); var eM = getIdValue("sel_Search_Smart_End_M"); if(g_Time1224==0)//12H { var sAP = getIdValue("sel_Search_Smart_Start_AP"); if(sAP==1) { sH = sH.toInt() + 12; } var eAP = getIdValue("sel_Search_Smart_End_AP"); if(eAP==1) { eH = eH.toInt() + 12; } } var tmpStart = Date.UTC(sYY,sMM-1,sDD,sH,sM,0) / 1000; var tmpEnd = Date.UTC(eYY,eMM-1,eDD,eH,eM,0) / 1000; var tmpTime = tmpEnd-tmpStart; if((tmpTime<0)||(tmpTime>86400)) { var newStart = new Date((tmpEnd-86400)*1000); newStart = newStart.format("yyyy/mm/dd",true)+" "+newStart.format("HH:MM:ss",true); var newYY = newStart.substr(0,4); var newMM = newStart.substr(5,2); var newDD = newStart.substr(8,2); var newH = newStart.substr(11,2); var newAP = 0; if(g_Time1224==0)//12H { if(newH>12) { newH = newH-12; newAP = 1; } } var newM = newStart.substr(14,2); setIdValue("sel_Search_Smart_Start_YY" ,newYY.toInt()); setIdValue("sel_Search_Smart_Start_MM" ,newMM.toInt()); setIdValue("sel_Search_Smart_Start_DD" ,newDD.toInt()); setIdValue("sel_Search_Smart_Start_H" ,newH.toInt()); setIdValue("sel_Search_Smart_Start_M" ,newM.toInt()); setIdValue("sel_Search_Smart_Start_AP" ,newAP.toInt()); delete newStart; } } //***No Used*** function GetSearchSmartEnd() { var sYY = getIdValue("sel_Search_Smart_Start_YY"); var sMM = getIdValue("sel_Search_Smart_Start_MM"); var sDD = getIdValue("sel_Search_Smart_Start_DD"); var sH = getIdValue("sel_Search_Smart_Start_H"); var sM = getIdValue("sel_Search_Smart_Start_M"); var eYY = getIdValue("sel_Search_Smart_End_YY"); var eMM = getIdValue("sel_Search_Smart_End_MM"); var eDD = getIdValue("sel_Search_Smart_End_DD"); var eH = getIdValue("sel_Search_Smart_End_H"); var eM = getIdValue("sel_Search_Smart_End_M"); if(g_Time1224==0)//12H { var sAP = getIdValue("sel_Search_Smart_Start_AP"); if(sAP==1) { sH = sH.toInt() + 12; } var eAP = getIdValue("sel_Search_Smart_End_AP"); if(eAP==1) { eH = eH.toInt() + 12; } } var tmpStart = Date.UTC(sYY,sMM-1,sDD,sH,sM,0) / 1000; var tmpEnd = Date.UTC(eYY,eMM-1,eDD,eH,eM,0) / 1000; var tmpTime = tmpEnd-tmpStart; if((tmpTime<0)||(tmpTime>86400)) { var newEnd = new Date((tmpStart+86400)*1000); newEnd = newEnd.format("yyyy/mm/dd",true)+" "+newEnd.format("HH:MM:ss",true); var newYY = newEnd.substr(0,4); var newMM = newEnd.substr(5,2); var newDD = newEnd.substr(8,2); var newH = newEnd.substr(11,2); var newAP = 0; if(g_Time1224==0)//12H { if(newH>12) { newH = newH-12; newAP = 1; } } var newM = newEnd.substr(14,2); setIdValue("sel_Search_Smart_End_YY" ,newYY.toInt()); setIdValue("sel_Search_Smart_End_MM" ,newMM.toInt()); setIdValue("sel_Search_Smart_End_DD" ,newDD.toInt()); setIdValue("sel_Search_Smart_End_H" ,newH.toInt()); setIdValue("sel_Search_Smart_End_M" ,newM.toInt()); setIdValue("sel_Search_Smart_End_AP" ,newAP.toInt()); delete newEnd; } } function SetMainFrameMask(nMask) { if(nMask==1) //Show { page[3].visibility = (document.layers) ? "show" : "visible"; setIdClass("SetupFrame","SetupFramePop"); } else { page[3].visibility = (document.layers) ? "hide" : "hidden"; setIdClass("SetupFrame","SetupFrame"); } } function SetPleaseWaitMask(nMask,nCancel) { var tbl = document.getElementById("tbl_PleaseWait"); setIdDisplay("tbl_SearchProgressBar","none"); tbl.deleteRow(-1); var addtr = tbl.insertRow(-1); var addtd = addtr.insertCell(-1); var strHtml; if(parent.g_nLanguage==17) //CH strHtml = "
"; else strHtml = "
"; addtd.innerHTML = strHtml; if(nMask==1) //Show { //page[3].visibility = (document.layers) ? "show" : "visible"; page[28].visibility = (document.layers) ? "show" : "visible"; page[29].visibility = (document.layers) ? "show" : "visible"; document.getElementById("DivShim").style.display = "block"; setIdClass("SetupFrame","SetupFramePop"); } else { //page[3].visibility = (document.layers) ? "hide" : "hidden"; page[28].visibility = (document.layers) ? "hide" : "hidden"; page[29].visibility = (document.layers) ? "hide" : "hidden"; document.getElementById("DivShim").style.display = "none"; setIdClass("SetupFrame","SetupFrame"); } if(nCancel==1) //Show setIdVisibility("btn_cancel_search",true); else setIdVisibility("btn_cancel_search",false); document.getElementById("Search_ProgressBar1").style.width = "0%"; setIdInnerHTML("td_SearchProgressBar" ,"0%"); } function SetDaylightSavingMask(nMask, nType) { if(nType==0) //0:Playback, 1:Export setIdInnerHTML("td_DLSB_Select_Play" ,IDS_WM0460); else setIdInnerHTML("td_DLSB_Select_Play" ,IDS_WM0463); if(nMask==1) //1:Show { page[33].visibility = (document.layers) ? "show" : "visible"; page[30].visibility = (document.layers) ? "show" : "visible"; document.getElementById("DivShim").style.display = "block"; } else { page[33].visibility = (document.layers) ? "hide" : "hidden"; page[30].visibility = (document.layers) ? "hide" : "hidden"; document.getElementById("DivShim").style.display = "none"; } } function PTZshot(idx) { //Soya 20091115 Add var tmpCam = ocx.GetMouseDownCamera(); cgi.ptzId = tmpCam; cgi.user_level = g_UserLevel; /*var nCam=0; for(var i = 0;i < MAX_CHANNELS;i++) { if((tmpCam & 0x01<2 SetDaylightSavingMask(0,0); ifrm_View.DoDSTPlay(); } function DSTCancel() { SetDaylightSavingMask(0,0); } function GetDayCount(nYear, nMonth) { var nYearTemp = nYear % 4; var nDay = 0; if((nMonth==1)||(nMonth==3)||(nMonth==5)||(nMonth==7)||(nMonth==8)||(nMonth==10)||(nMonth==12)) { nDay = 31; } if((nMonth==4)||(nMonth==6)||(nMonth==9)||(nMonth==11)) { nDay = 30; } if(nMonth==2) { if(nYearTemp==0) { nDay = 29; } else { nDay = 28; } } return nDay; } function TimeChechDD() { var nYY = getIdValue("sel_Search_Time_YY"); var nMM = getIdValue("sel_Search_Time_MM"); var nDD = getIdValue("sel_Search_Time_DD"); var nTheDay = GetDayCount(nYY, nMM); if(nDD>nTheDay) setIdValue("sel_Search_Time_DD",nTheDay); } function TimeChechMMDD() { var nYY = getIdValue("sel_Search_Time_YY"); var nMM = getIdValue("sel_Search_Time_MM"); var nDD = getIdValue("sel_Search_Time_DD"); var nTheDay = GetDayCount(nYY, nMM); var hs1 = new HandleSelect("sel_Search_Time_DD",0); for(i=0; inTheDay) setIdValue("sel_Search_Event_Start_DD",nTheDay); } function EventStartChechMMDD() { var nYY = getIdValue("sel_Search_Event_Start_YY"); var nMM = getIdValue("sel_Search_Event_Start_MM"); var nDD = getIdValue("sel_Search_Event_Start_DD"); var nTheDay = GetDayCount(nYY, nMM); var hs1 = new HandleSelect("sel_Search_Event_Start_DD",0); for(i=0; inTheDay) setIdValue("sel_Search_Event_End_DD",nTheDay); } function EventEndChechMMDD() { var nYY = getIdValue("sel_Search_Event_End_YY"); var nMM = getIdValue("sel_Search_Event_End_MM"); var nDD = getIdValue("sel_Search_Event_End_DD"); var nTheDay = GetDayCount(nYY, nMM); var hs1 = new HandleSelect("sel_Search_Event_End_DD",0); for(i=0; inTheDay) setIdValue("sel_Search_Smart_Start_DD",nTheDay); } function SmartStartChechMMDD() { var nYY = getIdValue("sel_Search_Smart_Start_YY"); var nMM = getIdValue("sel_Search_Smart_Start_MM"); var nDD = getIdValue("sel_Search_Smart_Start_DD"); var nTheDay = GetDayCount(nYY, nMM); var hs1 = new HandleSelect("sel_Search_Smart_Start_DD",0); for(i=0; inTheDay) setIdValue("sel_Search_Smart_End_DD",nTheDay); } function SmartEndChechMMDD() { var nYY = getIdValue("sel_Search_Smart_End_YY"); var nMM = getIdValue("sel_Search_Smart_End_MM"); var nDD = getIdValue("sel_Search_Smart_End_DD"); var nTheDay = GetDayCount(nYY, nMM); var hs1 = new HandleSelect("sel_Search_Smart_End_DD",0); for(i=0; i