var g_channelNum=4; var g_bAudio=false; var gExitChannel=new Array(); var gExitSubType=new Array(); var gexiti; var g_playAll=true; var g_recordAll=true; var g_talk=true; var gca=0; var gcb=0; var gcc=0; var gcd=0; var gAutoPlayAll=false; var gHashCookie = new Hash.Cookie('NetSuveillanceWebCookie',{duration: 30}); var settings = { username:'' } function savesetting() { gHashCookie.extend(settings); } function resize() { AllW =document.documentElement.clientWidth; AllH=document.documentElement.clientHeight; if(AllH<=623) { AllH=623; } MvH=AllH-27; MvW=MvH*64/51; $('mm').setStyle('width',MvW+201); $('ml').setStyle('width',MvW); $('ml').setStyle('height',MvH); $('mt').setStyle('width',MvW+201); $('mr').setStyle('height',MvH-2); $('mrdown2').setStyle('height',MvH-354-232); $('frameL').setStyle('height',MvH-354-232); $('frameR').setStyle('height',MvH-354-232); $('QS').setStyle('left', screen.width-170); if(screen.width<$(mr).getCoordinates().right+170) { $('QS').setStyle('left', $(mr).getCoordinates().right+10); } if(g_bQS&&!g_bClose) { $('QS').style.display=''; } $('QS').setStyle('top', screen.height-550); if (window.ActiveXObject) { var ua = navigator.userAgent.toLowerCase(); var ie=ua.match(/msie ([\d.]+)/)[1] if(ie==6.0){ position_fixed(document.getElementById("QS"),wwidth-150,wheight-150); if(screen.width-wwidth>60) { $('QS').style.display='none'; }else { if(g_bQS&&!g_bClose) { $('QS').style.display=''; } } } } } window.addEvent('resize' ,function () { resize(); }); window.addEvent('domready',function(){ resize(); inilanguage(); getsetting(); }); function getsetting(){ if (gHashCookie.get('username')) { settings['username'] = gHashCookie.get('username'); } else { settings['username'] = ''; } $('username').setProperty('value', settings['username']); } function tl(s){ var ret; ret=ocx.Translate(s); return ret; } function getcl(){ var t= new Array(); var ts=new Array(); var strsplita=String.fromCharCode(16); var strsplitb=String.fromCharCode(9); var sc; sc=ocx.GetChannelName(); if (sc !=""){ sc=sc.substr(0, sc.length-1); t=sc.split(strsplita); g_channelNum=t.length; } showSelectNumb(); } function showSelectNumb() { switch(g_channelNum) { case 1: { $('full').style.marginLeft="20px"; $('v4').style.display="none" ; $('v9').style.display="none" ; $('v16').style.display="none" ; $('v25').style.display="none" ; $('v36').style.display="none" ; break; } case 2: case 3: case 4: { $('full').style.marginLeft="20px"; $('v9').style.display="none" ; $('v16').style.display="none" ; $('v25').style.display="none" ; $('v36').style.display="none" ; break; } case 5: case 6: case 7: case 8: { $('full').style.marginLeft="20px"; $('v16').style.display="none" ; $('v25').style.display="none" ; $('v36').style.display="none" ; break; } case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: { $('full').style.marginLeft="20px"; $('v25').style.display="none" ; $('v36').style.display="none" ; break; } case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: { $('v36').style.display="none" ; break; } case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: { break; } default: break; } } function Logout() { if(ocx.Logout()) { $('m').style.top="-10000px"; $('l').style.display=""; $('preSetIn').value=1; $('cruiseIn').value=1; $('QS').style.display='none'; g_bClose=true; } } function PlayAll() { if(g_playAll) { if(ocx.PlayAll()) { g_playAll=false; $('palyAll').title=tl('WebBT.StopPlayAll'); } } else { if(ocx.StopRealPlayAll()) { g_playAll=true; $('palyAll').title=tl('WebBT.PlayAll'); } } } function RecordAll() { if(g_recordAll) { if(true==ocx.startRecordAll("C:\\record")) { g_recordAll=false; $('recordAll').title=tl('WebBT.StopRecordAll'); $('recordAll').removeClass($('recordAll').className); $('recordAll').addClass('noRecordAll'); } } else { if(ocx.stopRecordAll()) { g_recordAll=true; $('recordAll').title=tl('WebBT.RecordAll'); $('recordAll').removeClass($('recordAll').className); $('recordAll').addClass('recordAll'); } } } function OpenAudio() { if(g_bAudio) { if(ocx.CloseSound(1)) { g_bAudio=false; $('audio').removeClass($('audio').className); $('audio').addClass('d13') } } else { if(ocx.OpenSound(-1)) { $('audio').removeClass($('audio').className); $('audio').addClass('d132') g_bAudio=true; } } } function inilanguage(){ $('t1').setText(tl('WebTitle.Playback')); $('t2').setText(tl('WebTitle.Log')); $('t4').setText(tl('WebTitle.LocalConfig')); $('t3').setText(tl('WebTitle.RemoteCfg')); $('t5').setText(tl('WebTitle.LogOut')); $('zoom').setText(tl('WebPtz.Zoom')); $('focus').setText(tl('WebPtz.Focus')); $('iris').setText(tl('WebPtz.Iris')); $('MonitorModule').setText(tl('ConfigManage.MonitorModule')); $('other').setText(tl('WebTitle.OtherSet')); $('PtzControl').setText(tl('Title.PtzControl')); $('preset').setText(tl('WebPtz.Preset')+':'); $('cruise').setText(tl('WebPtz.Cruise')+':'); $('userNameInput').setText(tl('WebInput.UserName')); $('passWordInput').setText(tl('WebInput.Password')); $('loginBT').setText(tl('WebBT.LogIn')); $('palyAll').title=tl('WebBT.PlayAll'); $('snap').title=tl('Desktop.Snapshot'); $('recordAll').title=tl('WebBT.RecordAll'); $('audio').title=tl('Desktop.Audio'); $('presetGo').setText(tl('PtzControl.Goto')); $('presetAdd').setText(tl('OneClick.Add')); $('presetDel').setText(tl('OneClick.Delete')); $('cruiseStart').setText(tl('PtzControl.Start')); $('cruiseStop').setText(tl('PtzControl.Stop')); $('cruiseEdit').setText(tl('PtzControl.Edit')); $('Llogo').setText(tl('WebTitle.UserLogin')); $('ColorTitle').setText(tl('Title.ColorTitle')); $('Reboot').setText(tl('WebBT.Reboot')); $('Talk').setText(tl('Desktop.StartTalk')); $('QSC').setText(tl('PlayBack.Close')); } function otherCtr() { $('playCtr').style.display="none"; $('otherCtl').style.display=""; } function playCtr() { $('playCtr').style.display=""; $('otherCtl').style.display="none"; } function StartTalk() { if(g_talk) { if(ocx.StartTalk()) { $('Talk').setText(tl('Desktop.StopTalk')); g_talk=false; } } else { if(ocx.StopTalk()) { $('Talk').setText(tl('Desktop.StartTalk')); g_talk=true; } } } function Close() { $('QS').style.display='none'; g_bClose=true; } function position_fixed(el, eltop, elleft){ // check is IE6 if( !window.XMLHttpRequest ){ el.style.position = "absolute"; window.attachEvent('onscroll', function(){ //el.style.top = ( document.documentElement.scrollTop + eltop )+"px"; }); }else{ el.style.position = "fixed"; } }