function isPCDev(){ return location.hostname==="10.10.25.57"||location.hostname==="127.0.0.1"; }; function isPCDevFixedInit(){ return isPCDev()&&browser()==="Firefox"; }; function hostname(){ return isPCDev()?"10.10.25.15":location.hostname; }; function browser(){ return navigator.userAgent.indexOf("MSIE")>=0?"MSIE":(navigator.userAgent.indexOf("Firefox")>=0?"Firefox":"rest"); }; function getInternetExplorerVersion(){ var rv=-1; if(navigator.appName=="Microsoft Internet Explorer"){ var ua=navigator.userAgent; var re=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); if(re.exec(ua)!=null){ rv=parseFloat(RegExp.$1); } } return rv; }; function onParametersChange(){ onParametersChange2(); }; function backString(_1,_2){ if(_1.lastIndexOf(_2)===-1){ return null; }else{ return _1.substring(_1.lastIndexOf(_2)+1,_1.length); } }; function getCameraParam(_3){ if(!image.freeze){ if(isPCDevFixedInit()){ return "3"; }else{ var _4=new XMLHttpRequest(); var _5="/get?"+_3+"&id="+(new Date()).getTime(); try{ _4.open("GET",_5,false); _4.send(null); var _6=backString(_4.responseText,"="); return _6===null?null:decodeURIComponent(_6); } catch(e){ return null; } } } }; function setCameraParam(_7,_8){ if((!image.freeze)||(_7==="ip")){ if(!isPCDevFixedInit()){ var _9=new XMLHttpRequest(); var _a="/set?"+_7+"="+_8+"&id="+(new Date()).getTime(); try{ _9.open("GET",_a,false); _9.send(null); var _8=backString(_9.responseText,"="); return _8===null?null:decodeURIComponent(_8); } catch(e){ } av.savedParams(_7==="params"); } } }; function getCameraRegister(_b,_c){ if(!image.freeze){ if(isPCDevFixedInit()){ return "3"; }else{ var _d=new XMLHttpRequest(); var _e="/getreg?page="+_b+"®="+_c+"&id="+(new Date()).getTime(); try{ _d.open("GET",_e,false); _d.send(null); var _f=backString(_d.responseText,"="); return _f===null?0:Number(_f); } catch(e){ return null; } } } }; function setCameraRegister(_10,reg,_11){ if(!image.freeze){ if(!isPCDevFixedInit()){ var _12=new XMLHttpRequest(); var url="/setreg?page="+_10+"®="+reg+"&val="+_11+"&id="+(new Date()).getTime(); try{ _12.open("GET",url,false); _12.send(null); } catch(e){ } av.savedParams(false); } } }; function slowdown(){ var _13=(new Date).getTime(); while(_13===(new Date).getTime()){ } }; var av={documentTitle:function(){ return "Arecont Vision Camera"; },saved:true,savedParams:function(b){ if(b!==this.saved){ this.saved=b; } },registerControlDependency:function(_14,_15){ if(_15!==null){ _15.listeners.push(_14); if(!_15.checked||_15.disabled){ ReadOnlyVisual(_14,true); } if(_14.hasOwnProperty("associatedControl")&&_14.associatedControl!==null){ av.registerControlDependency(_14.associatedControl,_15); } } },pwdStrAdmin:"setPwd admin",pwdStrViewer:"setPwd viewer",setPassword:function(_16,_17){ var _18,p0,p1; function _19(_1a,v0,v1){ if(typeof v0!=="string"||typeof v1!=="string"){ alert("Fill in the password and confirm!"); }else{ if(v0!==v1){ alert("The password and its confirmation must be identical! Try again."); }else{ if(v0==="empty"){ alert("Press Erase to erase the password."); }else{ var i; for(i=0;i"||v0.charAt(i)==" "){ document.title="pword:"+v0+" "+"i="+v0.charAt(i)+" "+v0.length+" "+i; break; } } if(i, etc! Try again."); }else{ p1=setCameraParam(_1a,v0); if(v0!=p1){ alert("The password setup failed! Your current password is:"+p1); }else{ if(_1a==="admin"){ setTimeout("location.reload(true);",1000); }else{ alert("The viewer password is set successfully!"); } } } } } } }; if(_16===this.pwdStrAdmin){ _18="admin"; }else{ if(_16===this.pwdStrViewer){ _18="viewer"; }else{ return; } } if(_17===null){ if(confirm("Are you sure?")){ setCameraParam(_18,"empty"); if(_16===this.pwdStrAdmin){ dijit.byId("textbox"+"admin password").setValue(""); dijit.byId("textbox"+"confirmation1").setValue(""); }else{ dijit.byId("textbox"+"viewer password").setValue(""); dijit.byId("textbox"+"confirmation2").setValue(""); } } }else{ _19(_18,_17[0].getValue(),_17[1].getValue()); } }}; var avutil={getTime:function(){ return (new Date()).getTime(); },createNamed:function(_1b,_1c){ var el=document.createElement(_1b); el.id=_1c; return el; },createAppend:function(_1d,_1e,_1f){ if(typeof _1d==="string"){ _1d=document.getElementById(_1d); } if(typeof _1e==="string"){ _1e=document.createElement(_1e); } if(typeof _1f==="string"){ _1e.id=_1f; } _1d.appendChild(_1e); return _1e; },insertText:function(_20,_21){ if(typeof _20==="string"){ _20=document.getElementById(_20); } var _22=document.createTextNode(_21); _20.appendChild(_22); return _22; },remove:function(id){ var _23=document.getElementById(id); _23.parentNode.removeChild(_23); },ipValidator:function(_24){ var re=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i; if(re.test(_24)){ var _25=_24.split("."); if((parseInt(_25[0],10)==255)||(parseInt(_25[0],10)>=224&&parseInt(_25[0],10)<=239)||(parseInt(_25[0],10)==127)||(parseInt(_25[0],10)==0)||(parseInt(_25[3],10)<1)||(parseInt(_25[3],10)==255)){ return false; } for(i=0;i<_25.length;i++){ if(parseInt(_25[i],10)>255){ return false; } } return true; }else{ return false; } },maskValidator:function(_26){ var re=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i; if(re.test(_26)){ var _27=_26.split("."); for(i=0;i<_27.length;i++){ if(parseInt(_27[i],10)>255){ return false; } } return true; }else{ return false; } },gatewayValidator:function(_28){ var re=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i; if(re.test(_28)){ var _29=_28.split("."); if((parseInt(_29[0],10)==255)||(parseInt(_29[0],10)>=224&&parseInt(_29[0],10)<=239)||(parseInt(_29[0],10)==127)||((parseInt(_29[0],10)==0)&&((parseInt(_29[1],10)!=0)||(parseInt(_29[2],10)!=0)||(parseInt(_29[3],10)!=0)))||(parseInt(_29[3],10)==255)){ return false; } for(i=0;i<_29.length;i++){ if(parseInt(_29[i],10)>255){ return false; } } return true; }else{ return false; } },limit:function(_2a,_2b,_2c){ var low=Math.min(_2b,_2c),_2d=Math.max(_2b,_2c); return Math.max(Math.min(_2a,_2d),low); }}; function divisible(_2e,_2f,_30){ if(typeof _30==="undefined"||_30===0){ return Math.round(_2e/_2f)*_2f; }else{ if(_30==1){ return Math.ceil(_2e/_2f)*_2f; }else{ if(_30==-1){ return Math.floor(_2e/_2f)*_2f; } } } }; function getImageDims(){ var _31={}; _31.left=Number(getCameraParam("imgleft")); _31.top=Number(getCameraParam("imgtop")); _31.width=Number(getCameraParam("imgwidth")); _31.height=Number(getCameraParam("imgheight")); if(typeof _31.left==="number"&&typeof _31.top==="number"&&typeof _31.width==="number"&&typeof _31.height==="number"){ return _31; } }; function getSensorDims(){ var _32={}; _32.left=Number(getCameraParam("sensorleft")); _32.top=Number(getCameraParam("sensortop")); _32.width=Number(getCameraParam("sensorwidth")); _32.height=Number(getCameraParam("sensorheight")); if(typeof _32.left==="number"&&typeof _32.top==="number"&&typeof _32.width==="number"&&typeof _32.height==="number"){ return _32; } }; function getMaxSensorDims(){ var _33={}; _33.left=0; _33.top=0; _33.width=Number(getCameraParam("maxsensorwidth")); _33.height=Number(getCameraParam("maxsensorheight")); if(typeof _33.width==="number"&&typeof _33.height==="number"){ return _33; }else{ return getSensorDims(); } }; function checkDims(img){ proceed=true; return (proceed==true); }; function checkImgSize(){ var _34={}; _34.left=image.left.getValue(); _34.top=image.top.getValue(); _34.right=image.right.getValue(); _34.bottom=image.bottom.getValue(); return checkDims(_34); }; function ReadOnlyVisual(_35,val){ var i; _35.associatedControl&&_35.associatedControl.set("readOnly",val); _35.set("readOnly",val); if(_35.listeners&&_35.listeners.length){ for(i=0;i<_35.listeners.length;i++){ _35.listeners[i]&&ReadOnlyVisual(_35.listeners[i],val); } } }; function disableVisual(_36,val){ var i; _36.associatedControl&&_36.associatedControl.set("disabled",val); _36.set("disabled",val); if(_36.listeners&&_36.listeners.length){ for(i=0;i<_36.listeners.length;i++){ _36.listeners[i]&&disableVisual(_36.listeners[i],val); } } }; function createCheckbox(_37,_38,on,off,_39,_3a,_3b){ var _3c=(typeof _38==="function")?_38("get"):getCameraParam(_38),_3d=document.getElementById("leading_region"),_3e=false; if(_3c===null){ _3c=""; _3e=true; } var _3f=document.createElement("prelabel"); _3f.innerHTML="
"+((_3b&&_3b.pre)?_3b.pre:""); _3d.appendChild(_3f); var _40=avutil.createNamed("input","checkBox"+_37); _3d.appendChild(_40); var _41=document.createElement("label"); _41.htmlFor=_40.id; _41.value=_41.innerHTML=" "+_37; _3d.appendChild(_41); _3d.appendChild(document.createElement("br")); var _42=new dijit.form.CheckBox({name:"checkBox",value:_3c,checked:(_3c==on),param:_38,listeners:[],onChange:function(val){ var i; this.value=val?on:off; if(_3a){ this.onChange2(); } for(i=0;i"),i; if(!(_49&&_49.noLegend)){ if(_4a===null){ _4a=""; _4d=true; } var div=document.createElement("span"); div.innerHTML=_4e+"
"+_44+"

"; _4b.appendChild(div); } for(i=0;i<_46.length;i++){ var _4f=avutil.createNamed("input","radio"+_44+i); _4b.appendChild(_4f); var _50=document.createElement("label"); _50.htmlFor=_4f.id; _50.value=_50.innerHTML=" "+_46[i][1]; _4b.appendChild(_50); _4b.appendChild(document.createElement("br")); _4c[i]=new dijit.form.RadioButton({name:_44,value:_46[i][0],checked:(_4a===_46[i][0]),param:_45,listeners:[],onChange:function(val){ var i; if(_48&&val===true){ this.onChange2i(); } for(i=0;i"+_52+":  "; div.innerHTML+=(_5a&&_5a.rtspLinkData)?"
":""; div.appendChild(avutil.createNamed("input","textbox"+_52+_60)); if(typeof _53==="number"&&typeof _54==="number"){ _5e=new dijit.form.NumberTextBox({name:"textbox",value:parseInt(_5b,10),constraints:{min:_53,max:_54,pattern:"#####"},style:"width:55px",param:_56},"textbox"+_52+_60); }else{ _5e=new dijit.form.TextBox({name:"textbox",value:_5b,style:(_5a&&_5a.rtspLinkData)?"width: 270px; font-style: italic; font-size: 75%;":((_5a&&_5a.stampData)?"width: 200px;":((_5a&&_5a.password)?"width: 170px;":"width: 130px;")),maxLength:(_5a&&_5a.maxLength)?_5a.maxLength:255,type:(_5a&&_5a.password)?"password":"input",param:_56},"textbox"+_52+_60); } _5f&&disableVisual(_5e,true); function _61(_62){ if((_62 instanceof dijit.form.NumberTextBox)&&!isNaN(_62.value)){ if(_62.value<_62.constraints.min){ _62.setValue(_62.constraints.min); } if(_62.value>_62.constraints.max){ _62.setValue(_62.constraints.max); } } var _63=!(_62 instanceof dijit.form.NumberTextBox)||(!isNaN(_62.value)&&_62.constraints.min<=_62.value&&_62.value<=_62.constraints.max); return _63&&(_55==null||_55(_62.value)); }; function _64(){ if(_61(this)){ if(typeof _56==="function"){ _56("set",this.value); }else{ setCameraParam(_56,this.value); } onParametersChange(); }else{ alert(_52+" has invalid value!"); } }; if(_59){ _5e.onBlur=_64; }else{ _5e.onSet=_64; _5e.getValue=function(){ return _61(this)?this.value:null; }; } av.registerControlDependency(_5e,_58); return _5e; }; function createSlider(_65,_66,_67,_68,_69,_6a,_6b,_6c,_6d){ var _6e=(typeof _68==="function")?_68("get"):getCameraParam(_68),_6f=false,_70=document.getElementById("leading_region"); var _71=(_67-_66+1)/(_6a-_69+1); var _72=(_67+_66)/2; var _73=(_6a+_69)/2-0.01; var _74=(_66===_69&&_67===_6a); function _75(val){ if(_74){ return val; }else{ if(val===_66){ return _69; }else{ if(val===_67){ return _6a; }else{ var _76=(val-_72)/_71; var r=Math.round(Math.round(_76)+_73); return avutil.limit(r,_6a,_69); } } } }; function _77(_78){ if(_69<=_6a){ if(_78<=_69){ return _66; }else{ if(_78>=_6a){ return _67; } } }else{ if(_78>=_69){ return _66; }else{ if(_78<=_6a){ return _67; } } } if(_74){ return _78; }else{ var _79=_66+(_78-_69)*(_67-_66)/(_6a-_69)-0.01; var r=Math.round(_79); return avutil.limit(r,_67,_66); } }; if(_6e===null){ _6e=String(_66<0?0:_66); _6f=true; } var div=document.createElement("div"); div.innerHTML+="
"+_65+":  "; div.appendChild(avutil.createNamed("input","textbox"+_65)); div.appendChild(document.createElement("br")); var _7a=avutil.createNamed("div","slider"+_65); _7a.appendChild(avutil.createNamed("span","hrule"+_65)); _7a.appendChild(avutil.createNamed("span","hruleLabels"+_65)); div.appendChild(_7a); _70.appendChild(div); var _7b=new dijit.form.HorizontalSlider({name:"slider",value:Number(_77(_6e)),minimum:_66,maximum:_67,discreteValues:Math.min(Math.abs(_6a-_69)+1,_67-_66+1),intermediateChanges:true,style:(_6d&&_6d.sliderWidth?"width:"+_6d.sliderWidth+";":"width:270px;"),_mouseWheeled:function(evt){ },onChange:function(_7c){ this.primaryControl.set("value",_77(_75(Math.round(this.value)))); if(_6c){ this.primaryControl.onChange2(); } av.saved=false; }},"slider"+_65); var _7d=new dijit.form.HorizontalRule({count:Math.min(11,Math.abs(_6a-_69)+1),style:"height: 5px;"},"hrule"+_65); var _7e,_7f; _7f=(_6d&&_6d.rend&&typeof _6d.rend==="string")?String(_67-1)+"    "+_6d.rend:_67; if(_6a-_69===3){ _7e=[_66,Math.round((_67+_66)/3),Math.round((_67+_66)*2/3),_67]; }else{ _7e=[_66,Math.round((_66+_67)/2-0.01),_7f]; } var _80=new dijit.form.HorizontalRuleLabels({style:"height: 1em; font-size: 75%;",labels:_7e},"hruleLabels"+_65); var _81=new dijit.form.NumberTextBox({name:"textbox",value:Number(_77(_6e)),constraints:{min:_66,max:_67},style:"width:35px;",param:_68,onChange:function(){ if(_6d&&_6d.rend&&typeof _6d.rend==="string"&&(this.value===_67||this.value===_6d.rend)){ this.set("disabled",true); this.set("displayedValue",_6d.rend); }else{ if(_6d&&_6d.rend&&typeof _6d.rend==="string"&&_66<=this.value&&this.value<_67){ this.set("disabled",false); this.set("displayedValue",this.value); } } },onKeyPress:function(evt){ var val; if(evt.keyCode===13){ val=parseInt(this.get("value"),10); if(typeof val==="number"){ this.value=val; this.onBlur(); } } },onBlur:function(){ if(_82(this)){ this.set("value",_77(_75(Math.round(this.value)))); this.associatedControl.set("value",this.value); } }},"textbox"+_65); _81.associatedControl=_7b; _7b.primaryControl=_81; _6f&&disableVisual(_81,true); _81.onChange(); function _82(_83){ return !isNaN(_83.value)&&(_83.constraints?_83.constraints.min:_83.minimum)<=_83.value&&_83.value<=(_83.constraints?_83.constraints.max:_83.maximum); }; function _84(){ if(_82(this.associatedControl)){ if(typeof _68==="function"){ _68("set",_75(this.associatedControl.value)); }else{ setCameraParam(_68,_75(this.associatedControl.value)); } onParametersChange(); }else{ alert(_65+" has invalid value!"); } }; if(_6c){ _81.onChange2=_84; }else{ _81.onSet=_84; _81.getValue=function(){ return _82(this.associatedControl)?_75(this.associatedControl.value):null; }; } av.registerControlDependency(_81,_6b); return _81; }; function createButton(_85,_86,_87,_88){ var _89=document.getElementById("leading_region"),_8a; if(typeof _88==="object"&&_88.pre==="br"){ avutil.createAppend(_89,_88.pre); } avutil.insertText(_89," "); avutil.createAppend(_89,"button","button"+_85); avutil.insertText(_89," "); if(typeof _86==="function"){ _8a=new dijit.form.Button({label:_85,id:_85+"-"+_86.toString().length,onClick:_86},"button"+_85); }else{ if(_86.substring(0,7)==="setPwd "){ _8a=new dijit.form.Button({label:_85,id:_85+"-"+_86.substring(7),onClick:function(){ av.setPassword(_86,_87); }},"button"+_85); }else{ _8a=new dijit.form.Button({label:_85,id:_85+"-"+_86+"-"+_87.length+"-"+_87.join().length,onClick:function(){ var i,_8b,_8c=_86; if(_86==="onSetVideo"&&checkImgSize()){ applyVideo(); _8c="onSet"; }else{ if(_86==="onSetVideo"){ document.title="onSetVideo empty"; return; }else{ if(_86==="onSetSave"){ _8c="onSet"; _8b="true"; } } } if((_85==="Apply & Save to Flash")&&dijit.byId("radioDHCP/Fixed Selection0").attr("checked")&&!(getCameraParam("netopt")&1)){ var _8d=getCameraParam("netopt")|1; _8d=_8d&(~(1<<3)); setCameraParam("params","save"); av.saved=true; setCameraParam("netopt",_8d); image.freeze=true; clearTimeout(image.idTimeoutShort); clearTimeout(image.idTimeoutLong); alert("Please reopen browser with new IP address"); $(":input").attr("disabled",true); return; } var _8e=false; for(i=0;i<_87.length;i++){ if(typeof _87[i]==="object"){ if(_87[i]==dijit.byId("textboxIP Address1")){ if(getCameraParam("ip")!==dijit.byId("textboxIP Address1").getValue()){ _8e=true; } }else{ _87[i][_8c](); av.saved=false; } }else{ if(typeof _87[i]==="function"){ _87[i](); } } } if(_85==="Apply & Save to Flash"){ setCameraParam("params","save"); av.saved=true; } if((_8e)&&!(getCameraParam("netopt")&1)){ var _8f=dijit.byId("textboxIP Address1").getValue(); if(!avutil.ipValidator(_8f)){ alert("IP Address has invalid value!"); return; } setCameraParam("ip",_8f); image.freeze=true; clearTimeout(image.idTimeoutShort); clearTimeout(image.idTimeoutLong); window.location.replace("http://"+_8f); alert("Please wait while webpage is reloading with new IP address"); $(":input").attr("disabled",true); disableVisual(this,true); } if(_8b==="true"){ setCameraParam("params","save"); } }},"button"+_85); } } if(typeof _88==="object"&&_88.suf==="br"){ avutil.createAppend(_89,_88.suf); } return _8a; }; function createText(_90,_91,id,_92){ var _93=document.getElementById("leading_region"),div=document.createElement("div"),_94=(_92&&_92.noLeadBr?"":"
"),_95=(_92&&_92.noPostBr?"":"
"),_96=(_92&&_92.left?"":"
"); id&&(div.id=id); if(_91===true){ div.innerHTML+=(_94+"
"+_90+"

"); }else{ if(_92&&_92.rtspLinkData===true){ div.innerHTML+=(_94+""+_90+""+_95); }else{ if(_92&&_92.fontSmaller===true){ div.innerHTML+=(_94+""+_90+""+_95); }else{ div.innerHTML+=(_94+_96+_90+_95); } } } _93.appendChild(div); return div; }; function accessFull(){ var _97=getCameraParam("viewer"); return _97!=="Access denied!"; }; function upgrade(F){ function _98(){ document.getElementById("PostForm").submit(); alert("The firmware was upgraded. Please wait about 2 minutes while the camera is rebooting and refresh this web page."); }; if(!accessFull()){ alert("Access denied!"); return; } if(F.UpgradeFile.value==""){ alert("Please select a file to upgrade !"); return false; } clearInterval(image.irisTimeout); imageRemove(); setTimeout(_98,2000); }; function createUpgradeForm(){ var _99=document.getElementById("leading_region"),_9a="


"+"
"+"\t \tFirmware Upgrade:

"+"\t

"+"\t"+"
",div=avutil.createAppend(_99,"div"); div.innerHTML+=_9a; }; function upload(F){ function _9b(){ document.getElementById("SpeakerForm").submit(); alert("The file was uploaded. Please wait about 2 minutes while the camera is rebooting and refresh this web page."); }; if(F.SpeakerFile.value==""){ alert("Please select a file to upload !"); return false; } setTimeout(_9b,2000); }; function createSpeakerForm(){ var _9c=document.getElementById("leading_region"),_9d="


"+"
"+"\t \tSpeaker File Upload:

"+"\t

"+"\t"+"
",div=avutil.createAppend(_9c,"div"); div.innerHTML+=_9d; }; var image={type:1,idTimeoutShort:null,idTimeoutLong:null,irisTimeout:null,timeLoadingStarted:avutil.getTime(),loading:true,base_model:2805,maxsensorwidth:1920,maxsensorheight:1088,resolution:"half",fpsMaxVal:30,h264BitrateCheck:false,audioEnable:false,is_sdPlayback:false,is_scaling:false,is_90rotation:false,channel:1,MDrequest:true,rtsp_viewer_psd:0,freeze:false,makeH264String:function(){ return "?res="+this.resolution.getValue()+"&x0="+this.left.getValue()+"&y0="+this.top.getValue()+"&x1="+this.right.getValue()+"&y1="+this.bottom.getValue()+(this.h264BitrateCheck?"&bitrate="+this.h264BitrateNumber.getValue():"&qp="+this.h264Quality.getValue()+(this.h264EnableRatelimit.getValue()=="on"?"&ratelimit="+this.h264Ratelimit.getValue():""))+(0=this.right&&this.left===0){ this.right=_1; this.width=_1; }else{ if(this.left>=this.right&&this.left>=_1){ this.left-=_1; this.width=_1; }else{ if(this.top>=this.bottom&&this.top===0){ this.bottom=_1; this.height=_1; }else{ if(this.top>=this.bottom&&this.top>=_1){ this.top-=_1; this.height=_1; } } } } }},setActual:function(){ this.actual.iResolution=(this.resolution.getValue()==="full"?1:2); this.actual.left=Number(this.left.getValue()); this.actual.top=Number(this.top.getValue()); this.actual.right=Number(this.right.getValue()); this.actual.bottom=Number(this.bottom.getValue()); this.actual.width=this.actual.right-this.actual.left; this.actual.height=this.actual.bottom-this.actual.top; },makeDivisible:function(){ this.actual.makeDivisible(); },getWidth:function(_2){ return this.actual.width/(_2===true?1:this.actual.iResolution); },getHeight:function(_3){ return this.actual.height/(_3===true?1:this.actual.iResolution); },getLeft:function(_4){ return this.actual.left/(_4===true?1:this.actual.iResolution); },getTop:function(_5){ return this.actual.top/(_5===true?1:this.actual.iResolution); },getRight:function(_6){ return this.actual.right/(_6===true?1:this.actual.iResolution); },getBottom:function(_7){ return this.actual.bottom/(_7===true?1:this.actual.iResolution); },Resolution:function(){ return this.actual.iResolution; },toScreen:true,dispRatio:1,mouseMode:"view",ptDown:null,mm:[],mdEnable:0,zoneSize:8,mdTableReady:0,zbnum:8,gridVer:8,gridHor:8,gridSize:32}; function getClientWH(){ var _8=document.getElementById("central_region"); return {w:Math.max(_8.clientWidth-10,80),h:Math.max(_8.clientHeight-15,45)}; }; function antiGamma(_9){ ret=_9; return ret; }; function setGamma(_a){ var i,_b=[]; x=[0,4,8,16,32,64,96,128,160,192,224]; if(_a<40){ _a=40; }else{ if(_a>100){ _a=100; } } for(i=10;i>=4;i--){ _b[i]=255*Math.pow((x[i]-8)/216,_a/100)+0.5; } for(i=3;i>=0;i--){ _b[i]=x[i]*_b[4]/32+0.5; } for(i=10;i>=0;i--){ setCameraRegister(3,160+i,Math.floor(_b[i])); slowdown(); } setCameraRegister(3,159,1); return Math.round(_b[4]); }; function onParametersChange2(){ if(image.type===3){ clearTimeout(image.idTimeoutShort); image.idTimeoutShort=setTimeout("imageReset()",500); } }; function imageTypeSelection(_c,_d){ if(_c==="get"){ return image.type; }else{ if(_d==2){ var _e=1*image.fps.getValue(); dijit.byId("textbox"+"Frames Per Second").setValue(_e); dijit.byId("slider"+"Frames Per Second").setValue(_e); } image.type=_d; imageReset(); } }; function applyVideo(){ image.makeDivisible(); image.setActual(); image.jpegString=image.makeJpegString(); image.rtspLink.set("value",image.rtspUri_external()); imageReset(); }; function applyVideoIfDims(){ if(checkImgSize()){ applyVideo(); } }; function redraw_seleted_window(_f){ var _10={}; _10.ptLeft=Math.round((_f.left/image.Resolution()-image.getLeft())*image.dispRatio); _10.ptTop=Math.round((_f.top/image.Resolution()-image.getTop())*image.dispRatio); _10.ptWidth=Math.round((_f.width/image.Resolution())*image.dispRatio); _10.ptHeight=Math.round((_f.height/image.Resolution())*image.dispRatio); _10.offLeft=_10.ptLeft+$("#overlay").offset().left,_10.offTop=_10.ptTop+$("#overlay").offset().top; $("#inlay").offset({left:_10.offLeft,top:_10.offTop}); $("#inlay").width(_10.ptWidth); $("#inlay").height(_10.ptHeight); return _10; }; function channel(_11,_12){ if(_11==="get"){ return image.channel; }else{ image.channel=_12; applyVideo(); } }; function mouseMode(_13,_14){ if(_13==="get"){ return image.mouseMode; }else{ image.mouseMode=_14; var _15={}; if(model.hasFocus()&&(_14!="focus")){ dijit.byId("checkBox"+"View Focus Window").set("value",false); } if(model.hasSDcard()&&(_14!="sd_imgsize")){ dijit.byId("checkBox"+"View SD Recording ROI").set("value",false); } if(_14=="focus"){ if(image.is_sdPlayback!=true){ color="transparent"; _15.left=getCameraParam("focusleft"); _15.top=getCameraParam("focustop"); _15.width=getCameraParam("focusright")-_15.left; _15.height=getCameraParam("focusbottom")-_15.top; $("#bg-table").css("background-color",color); $("#border-table").css("border-color","#FFFFFF"); redraw_seleted_window(_15); dijit.byId("radio"+"Control Video with Mouse"+"0").set("checked",true); dijit.byId("checkBox"+"View Focus Window").set("value",true); } }else{ if(_14=="backlight"&&getCameraParam("exposure")=="off"){ color="#00FF00"; border="#AAFFAA"; _15.left=getCameraParam("expwndleft"); _15.top=getCameraParam("expwndtop"); _15.width=getCameraParam("expwndwidth"); _15.height=getCameraParam("expwndheight"); $("#bg-table").css("background-color",color); redraw_seleted_window(_15); }else{ if(_14=="white_balance"&&getCameraParam("wbwndctrl")=="on"){ color="#E0FFFF"; border="#00FFFF"; _15.left=getCameraParam("wbwndleft"); _15.top=getCameraParam("wbwndtop"); _15.width=getCameraParam("wbwndwidth"); _15.height=getCameraParam("wbwndheight"); $("#bg-table").css("background-color",color); redraw_seleted_window(_15); }else{ if(_14=="sd_imgsize"){ if(image.is_sdPlayback!=true){ color="transparent"; _15.left=getCameraParam("sd_imgleft"); _15.top=getCameraParam("sd_imgtop"); _15.width=getCameraParam("sd_imgright")-_15.left; _15.height=getCameraParam("sd_imgbottom")-_15.top; $("#bg-table").css("background-color",color); $("#border-table").css("border-color","#CC6600"); redraw_seleted_window(_15); dijit.byId("radio"+"Control Video with Mouse"+"0").set("checked",true); dijit.byId("checkBox"+"View SD Recording ROI").set("value",true); } }else{ if((_14!="ptz")&&(_14!="backlight")&&(_14!="white_balance")){ dijit.byId("radio"+"Control Video with Mouse"+"0").set("checked",true); } $("#inlay").offset({left:0,top:0}); $("#inlay").width(0); $("#inlay").height(0); } } } } } }; function vbr(_16,_17){ if(_16==="get"){ return "vbr"; }else{ image.h264BitrateCheck=false; dijit.byId("radio"+"cbr0").set("checked",false); tmp_bitrate=1*image.h264BitrateNumber.getValue(); image.h264BitrateNumber.setValue(0); } }; var tmp_bitrate; function cbr(_18,_19){ if(_18==="get"){ if(tmp_bitrate=1*getCameraParam("bitrate")){ dijit.byId("radio"+"vbr0").set("checked",false); image.h264BitrateCheck=true; return "cbr"; } }else{ image.h264BitrateCheck=true; dijit.byId("radio"+"vbr0").set("checked",false); image.h264BitrateNumber.setValue(tmp_bitrate); } }; function videoToScreen(_1a,_1b){ if(_1a==="get"){ return image.toScreen; }else{ image.toScreen=_1b; imageReset(); } }; function preload(){ var _1c=document.getElementById("hiddenImage"); _1c.src=image.jpegUri(); }; function myErrorHandler(){ image.loading=false; }; function showimage(){ var _1d=document.getElementById("hiddenImage"); var _1e=document.getElementById("mainImage"); clearInterval(image.idTimeoutLong); clearTimeout(image.idTimeoutShort); if(image.loading==false){ image.loading=true; }else{ if(model.isDualsensor()){ var _1f,_20; if(browser()=="MSIE"){ var _21=new Image(); _21.src=this.src; _1f=_21.width; _20=_21.height; }else{ _1f=this.width; _20=this.height; } if((image.getWidth()/_1f)>1.2&&(image.getWidth()/_1f)<1.8){ $("#mainImage").width(Math.round(image.dispRatio*_1f)); $("#mainImage").height(Math.round(image.dispRatio*_20)); }else{ $("#mainImage").width(Math.round(image.dispRatio*image.getWidth())),$("#mainImage").height(Math.round(image.dispRatio*image.getHeight())); } }else{ if(image.is_sdPlayback==true){ }else{ if(image.is_scaling==true){ if(browser()=="MSIE"){ var _21=new Image(); _21.src=this.src; _1f=_21.width; _20=_21.height; }else{ _1f=this.width; _20=this.height; } $("#mainImage").width(Math.round(_1f)); $("#mainImage").height(Math.round(_20)); } } } _1e.src=this.src; } image.idTimeoutLong=setInterval("preload()",5000); prepareMDTable(); if(image.mdEnable){ drawMDcells(); } }; function foo(){ }; function hidfoo(){ }; function mainfoo(){ }; function loadImage(){ var _22=document.getElementById("mainImage"); _22.src=image.jpegUri(); }; function imageRemove(){ var _23=document.getElementById("central_region"); clearTimeout(image.idTimeoutShort); clearInterval(image.idTimeoutLong); while(_23!==null&&_23.hasChildNodes()){ if(_23.lastChild.id==="overlay"){ break; } _23.removeChild(_23.lastChild); } }; var idTimeoutDelay; function imageSetup(){ var _24=document.getElementById("central_region"); if(image.type===2){ if(browser()==="MSIE"){ var obj=document.createElement("object"); _24.appendChild(obj); obj.classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"; obj.codebase="C:Program Files (x86)VideoLANVLCaxvlc.dll"; obj.events="True"; obj.id="vlc"; obj.name="vlcplayer"; obj.width=image.dispRatio*image.getWidth(); obj.height=image.dispRatio*image.getHeight(); var _25=document.createElement("param"); _25.setAttribute("Src",image.rtspUri()); _25.setAttribute("Autoplay","True"); _25.setAttribute("ShowDisplay","True"); obj.appendChild(_25); setTimeout(function(){ var vlc=document.getElementById("vlc"); var _26=vlc.playlist.add(image.rtspUri()); vlc.playlist.playItem(_26); },100); }else{ var _27=document.createElement("embed"); _27.src=image.rtspUri(); _27.autoplay="true"; _27.type="application/x-vlc-plugin"; _27.width=image.dispRatio*image.getWidth(); _27.height=image.dispRatio*image.getHeight(); $("#overlay").width(_27.width); $("#overlay").height(_27.height); _24.appendChild(_27); } }else{ if(image.type===1||image.type===3){ _24.innerHTML+="
\t\"\"
\"\""; var w=Math.round(image.dispRatio*image.getWidth()),h=Math.round(image.dispRatio*image.getHeight()); var rot; if(image.is_90rotation&&(image.right.getValue()>image.maxsensorheight)){ rot=w; w=h; h=rot; } $("#mainImage").width(w); $("#mainImage").height(h); $("#overlay").width(w); $("#overlay").height(h); var _28=document.getElementById("hiddenImage"); var _29=document.getElementById("mainImage"); $("#mainImage").mousedown(function(e){ e.preventDefault(); }); $("#mainImage").mousemove(function(e){ e.preventDefault(); }); $("#mainImage").mouseup(function(e){ e.preventDefault(); }); if(image.type===1){ _28.onload=showimage; _28.onError=myErrorHandler; var _2a=0; if(image.is_sdPlayback==true){ _2a=1000/image.sd_fps.getValue(); _2a=(_2a>40)?_2a-10:0; } _29.onload=function(){ image.idTimeoutShort=setTimeout(preload,_2a); }; _28.src=image.jpegUri(); }else{ _28.onload=function(){ _29.src=_28.src; }; } } } image.mdTableReady=0; }; function imageReset(){ imageRemove(); if(image.toScreen){ var _2b=getClientWH(); if(image.is_90rotation&&(image.right.getValue()>image.maxsensorheight)){ image.dispRatio=Math.min(_2b.w/image.getHeight(),_2b.h/image.getWidth(),128); }else{ image.dispRatio=Math.min(_2b.w/image.getWidth(),_2b.h/image.getHeight(),128); } }else{ image.dispRatio=1; } imageSetup(); }; function calculateGrid(ext){ var _2c=getSensorDims(),_2d={},_2e=image.zoneSize; if(image.is_90rotation){ _2d.hor=Math.ceil(_2c.height/_2e/32); _2d.ver=Math.ceil(_2c.width/_2e/32); }else{ _2d.hor=Math.ceil(_2c.width/_2e/32); _2d.ver=Math.ceil(_2c.height/_2e/32); } if(_2d.hor>image.zbnum){ _2d.hor=image.zbnum; } if(_2d.ver>image.zbnum){ _2d.ver=image.zbnum; } _2d.size=_2e*32*image.dispRatio/image.Resolution(); return _2d; }; function drawGrid(_2f){ }; function drawGridScreen(_30,_31,_32){ var tbl=$("#lay-table")[0],row,_33,i,j; tbl.style.tableLayout="fixed"; tbl.width=Math.ceil(_30*_32); tbl.height=Math.ceil(_31*_32); _32=Math.ceil(_32); if(browser()==="MSIE"){ for(i=0;i<_31;i++){ row=tbl.insertRow(); for(j=0;j<_30;j++){ _33=row.insertCell(); _33.id=i+"_"+j; image.mm[i,j]=0; } } }else{ for(i=0;i<_31;i++){ row=tbl.insertRow(i); for(j=0;j<_30;j++){ _33=row.insertCell(j); _33.setAttribute("height",_32-3); _33.id=i+"_"+j; image.mm[i,j]=0; } } } }; function cleargrid(){ var _34; for(i=0;i=image.gridHor){ break; } if(!(_39&(1<=image.gridHor||i>=image.gridVer){ _3e+=(1<<(k%8)); }else{ if(document.getElementById(i+"_"+j).style.backgroundColor!="red"){ _3e+=(1<<(k%8)); } } k++; if(k%8==0){ _3d=_3e.toString(16); if(_3d.length<2){ _3c+="0"; } _3c+=_3d; _3e=0; } } } setCameraParam("mdprivasymask",_3c); getPrivacy(); }; function prepareMDTable(){ function _3f(){ var tbl=document.getElementById("lay-table"); while(tbl.hasChildNodes()){ tbl.removeChild(tbl.firstChild); } }; if(image.mdEnable){ if(image.mdTableReady===0){ var _40=calculateGrid(); _3f(); image.gridHor=_40.hor; image.gridVer=_40.ver; image.gridSize=_40.size; drawGridScreen(_40.hor,_40.ver,_40.size); image.mdTableReady=1; getPrivacy(); } }else{ if(image.mdTableReady){ _3f(); } } }; function showMDGrid(){ if((image.type==1)&&(image.is_sdPlayback!=true)){ image.MDrequest=true; $("#lay-table").css("style","opacity:0.6; filter:Alpha(opacity=60);"); if(browser()!="MSIE"){ $("#lay-table").css("border-color","#00FF00"); } applyVideo(); } }; function hideMDGrid(){ if(image.type==1){ image.MDrequest=false; $("#lay-table").css("style","opacity:0; filter:Alpha(opacity=0);"); $("#lay-table").css("border-color","transparent"); applyVideo(); } }; function eventsRegistration(){ function _1(_2,cX,cY){ var _3={}; _3.left=Math.round(2*cX-_2.right); _3.top=Math.round(2*cY-_2.bottom); _2.right=Math.round(2*cX-_2.left); _2.bottom=Math.round(2*cY-_2.top); _2.left=_3.left; _2.top=_3.top; }; function _4(_5,_6){ return Math.abs(_5.X-_6.X)+Math.abs(_5.Y-_6.Y); }; function _7(_8,_9){ var _a=(_8.X-_9.X)*(_8.Y-_9.Y); return (_a>0?"down":(_a<0?"up":null)); }; function _b(){ $("#inlay").offset({left:0,top:0}); $("#inlay").width(0); $("#inlay").height(0); }; function _c(e){ return (browser()==="MSIE"?{X:e.offsetX,Y:e.offsetY}:{X:e.layerX,Y:e.layerY}); }; function _d(bn){ return (browser()==="MSIE"&&getInternetExplorerVersion()<9)?bn===1:bn===0; }; function _e(bn){ return (bn===2); }; function _f(bn){ return _d(bn)?"primary":(_e(bn)?"secondary":null); }; function _10(e){ return e.target.id==="overlay"; }; function _11(e){ return _d(e.button)||(_e(e.button)&&(image.mouseMode==="motion"||image.mouseMode==="privacy")); }; function _12(e){ if((image.mouseMode==="motion"||image.mouseMode==="privacy")&&(e.ctrlKey||e.shiftKey)){ return e.shiftKey?"over":"under"; }else{ return null; } }; function _13(_14,_15,how){ if((image.mouseMode==="ptz"||image.mouseMode==="ptzback")&&_15>10){ var _16=1; if(model.isDualsensor()){ _16=(getCameraParam("upscaling")=="on"?1:1.6); } image.left.set("value",_14.left*_16); image.top.set("value",_14.top*_16); image.right.set("value",_14.right*_16); image.bottom.set("value",_14.bottom*_16); applyVideo(); if(image.mouseMode==="ptzback"){ image.left.onSet(); image.top.onSet(); image.right.onSet(); image.bottom.onSet(); } } if((image.mouseMode==="backlight"||image.mouseMode==="ptzback")&&_15>10&&_14.width>=128&&_14.height>=128){ if(how==="default"){ setCameraParam("exposure","on"); }else{ setCameraParam("exposure","off"); setCameraParam("expwndleft",_14.left); setCameraParam("expwndtop",_14.top); setCameraParam("expwndwidth",_14.width); setCameraParam("expwndheight",_14.height); } } if((image.mouseMode==="white_balance")&&_15>10&&_14.width>=64&&_14.height>=64){ if(how==="default"){ setCameraParam("wbwndctrl","off"); if(getCameraParam("procversion")<"15777"){ setCameraParam("exposure","on"); } }else{ if(getCameraParam("procversion")<"15777"){ setCameraParam("exposure","off"); } setCameraParam("wbwndleft",_14.left); setCameraParam("wbwndtop",_14.top); setCameraParam("wbwndwidth",_14.width); setCameraParam("wbwndheight",_14.height); setCameraParam("wbwndctrl","on"); } } }; function _17(_18,_19,how,_1a,_1b){ var _1c=32,_1d,_1e; function _1f(_20,_21){ setCameraParam("pmaskleft",_20.left); setCameraParam("pmasktop",_20.top); setCameraParam("pmaskright",_20.right); setCameraParam("pmaskbottom",_20.bottom); setCameraParam("pmaskblock",_21); }; if(getCameraParam("pmask")!=="on"){ alert("To change privacy mask, check Enable Privacy Mask checkbox."); } if(how==="default"){ _1d={left:Math.ceil(_18.left/_1c)-1,top:Math.ceil(_18.top/_1c)-1,right:Math.ceil(_18.right/_1c)-1,bottom:Math.ceil(_18.bottom/_1c)-1}; _1f(_1d,"off"); }else{ if(_1a!==null&&_1b!==null){ _1e=(how==="primary"?"on":"off"); _1d={left:Math.ceil(_18.left/_1c)-1,top:Math.ceil(_18.top/_1c)-1,right:Math.ceil(_18.right/_1c)-1,bottom:Math.ceil(_18.bottom/_1c)-1}; var _22=Math.abs((_1d.right-_1d.left)/(Math.max(_1d.bottom-_1d.top,1))),r={},Y0=(_1a==="under"?_1d.top:_1d.bottom),Y1=Y0,Y2=(_1a==="under"?_1d.bottom:_1d.top),dy=(_1a==="under"?1:-1),_23=0,dx=((_1b==="down"&&_1a==="under")||(_1b==="up"&&_1a==="over")?1:-1),X1,_24; while(Y1+_23!==Y2){ _24=Math.round(_22*Math.abs(Y1+_23-Y0)); if(_24===Math.round(_22*Math.abs(Y1+_23+1-Y0))){ _23+=dy; }else{ X1=(dx>0?_1d.left:_1d.right+dx*_24); r={left:X1,top:Y1,right:X1+_24,bottom:Y1+_23}; _1f(r,_1e); Y1+=_23+dy; _23=0; } } }else{ _1e=(how==="primary"?"on":"off"); _1d={left:Math.ceil(_18.left/_1c)-1,top:Math.ceil(_18.top/_1c)-1,right:Math.ceil(_18.right/_1c)-1,bottom:Math.ceil(_18.bottom/_1c)-1}; _1f(_1d,_1e); } } }; function _25(_26,_27,how){ var _28=32*image.zoneSize,_29,_2a; function _2b(_2c,_2d){ var i,j; alert("MD:"+_2c.left+" "+_2c.top+" "+_2c.right+" "+_2c.bottom+" "+_2d+" "+_28); }; _2a=(how==="primary"?"on":"off"); _29={left:Math.ceil(_26.left/_28)-1,top:Math.ceil(_26.top/_28)-1,right:Math.ceil(_26.right/_28)-1,bottom:Math.ceil(_26.bottom/_28)-1}; setMDMask(_29,_2a); }; function _2e(_2f,_30,how){ if(_2f.left<_2f.right&&_2f.top<_2f.bottom){ if(how==="default"){ _2f.left=Math.round(_2f.right/4); _2f.top=Math.round(_2f.bottom/4); _2f.width=Math.round(_2f.right/2); _2f.height=Math.round(_2f.bottom/2); _2f.right=Math.round(_2f.right*3/4); _2f.bottom=Math.round(_2f.bottom*3/4); } setCameraParam("focusleft",_2f.left); setCameraParam("focustop",_2f.top); setCameraParam("focusright",_2f.right); setCameraParam("focusbottom",_2f.bottom); if(how==="default"){ redraw_seleted_window(_2f); } } }; function _31(_32,_33,how){ if(_32.left<_32.right&&_32.top<_32.bottom){ if(image.is_sdPlayback!=true){ setCameraParam("sd_imgleft",_32.left); setCameraParam("sd_imgtop",_32.top); setCameraParam("sd_imgright",_32.right); setCameraParam("sd_imgbottom",_32.bottom); redraw_seleted_window(_32); } } }; function _34(_35,_36,how,_37,_38){ _35.right=_35.left+_35.width; _35.bottom=_35.top+_35.height; if((image.mouseMode==="ptz"||image.mouseMode==="backlight"||image.mouseMode==="white_balance"||image.mouseMode==="ptzback")&&(how==="default"||how==="primary")){ _13(_35,_36,how); } if(image.mouseMode==="privacy"&&(how==="default"||how==="primary"||how==="secondary")){ _17(_35,_36,how,_37,_38); } if(image.mouseMode==="motion"){ _25(_35,_36,how); } if(image.mouseMode==="focus"){ _2e(_35,_36,how); } if(image.mouseMode==="sd_imgsize"){ _31(_35,_36,how); } }; $("#central_region").mousedown(function(e){ if(!_10(e)||!_11(e)){ return; } image.ptDown=_c(e); $("#midlay").empty(); var _39,_3a; switch(image.mouseMode){ case "view": _39="#888888"; _3a="#FFFFFF"; break; case "ptz": _39="#0000FF"; _3a="#AAAAFF"; break; case "backlight": _39="#00FF00"; _3a="#AAFFAA"; break; case "white_balance": _39="#E0FFFF"; _3a="#00FFFF"; break; case "ptzback": _39="#00BBBB"; _3a="#AAFFFF"; break; case "motion": _39="#FFAA00"; _3a="#FFDDAA"; break; case "privacy": _39="#FF44BB"; _3a="#FFAADD"; break; case "focus": _39="transparent"; _3a="#FFFFFF"; break; case "sd_imgsize": _39="transparent"; _3a="#CC6600"; break; default: _39="#444444"; _3a="FFFFFF"; break; } if(_e(e.button)){ _39="#FFFFFF"; } $("#bg-table").css("background-color",_39); $("#border-table").css("border-color",_3a); return false; }); var _3b=0; $("#central_region").mousemove(function(e){ if(!_10(e)||image.ptDown===null||!_11(e)){ return; } e.stopImmediatePropagation(); var pt1=image.ptDown,pt2=_c(e); var _3c=Math.min(pt1.X,pt2.X),_3d=Math.min(pt1.Y,pt2.Y),_3e=Math.abs(pt1.X-pt2.X),_3f=Math.abs(pt1.Y-pt2.Y),_40=_3c+$("#overlay").offset().left,_41=_3d+$("#overlay").offset().top; if(image.mouseMode!=="privacy"&&image.mouseMode!=="motion"){ $("#inlay").offset({left:_40,top:_41}); $("#inlay").width(_3e); $("#inlay").height(_3f); }else{ var _42=(image.mouseMode==="privacy"?"pm":"pm"),_43=(_d(e.button)?"mask":"unmask"),_44=((_12(e)===null||_7(pt1,pt2)===null)?"rect":(_7(pt1,pt2)+"-"+_12(e))),id="#"+_42+"-"+_43+"-"+_44; if(image.mouseMode==="privacy"){ $("#inlay").offset({left:_40,top:_41}); $("#inlay").width(_3e); $("#inlay").height(_3f); } $(id).width(_3e).height(_3f); $("#midlay").offset({left:_40,top:_41}); $("#midlay").children().not(id).remove(); if($("#midlay").children(id).length===0){ $("#midlay").append($(id).clone()); } } return false; }); $("#central_region").mouseup(function(e){ if(_10(e)&&image.ptDown!==null&&image.mouseMode==="view"&&_d(e.button)){ _b(); image.ptDown=null; return; } e.stopImmediatePropagation(); _b(); if(!_10(e)||image.ptDown===null||!_11(e)){ image.ptDown=null; return; } var pt1=image.ptDown,pt2=_c(e); image.ptDown=null; $("#midlay").empty(); var _45=Math.min(pt1.X,pt2.X),_46=Math.min(pt1.Y,pt2.Y),_47=Math.abs(pt1.X-pt2.X),_48=Math.abs(pt1.Y-pt2.Y),_49={}; _49.left=Math.round((image.getLeft()+_45/image.dispRatio)*image.Resolution()); _49.top=Math.round((image.getTop()+_46/image.dispRatio)*image.Resolution()); _49.width=Math.round(_47*image.Resolution()/image.dispRatio); _49.height=Math.round(_48*image.Resolution()/image.dispRatio); if((image.is_sdPlayback!=true)&&(image.mouseMode=="white_balance"||image.mouseMode=="backlight"||image.mouseMode=="focus"||image.mouseMode=="sd_imgsize")){ redraw_seleted_window(_49); } _34(_49,_4(pt1,pt2),_f(e.button),_12(e),_7(pt1,pt2)); return false; }); $("#central_region").dblclick(function(e){ image.ptDown=null; $("#midlay").empty(); if(_10(e)){ var _4a=((image.mouseMode==="privacy"||image.mouseMode==="motion")?getMaxSensorDims():getImageDims()); _34(_4a,1000,"default"); } }); $("#central_region")[0].f1080pChange=function(){ image.ptDown=null; $("#midlay").empty(); var _4b,_4c=getMaxSensorDims(); image.maxsensorwidth=_4c.width; image.maxsensorheight=_4c.height; _4b=image.mouseMode; image.mouseMode="ptz"; _34(_4c,1000,"default"); image.mouseMode=_4b; if(image.mdEnable){ dijit.byId("checkBox"+"DisableMD").setValue(false); val=getCameraParam("mdzonesize"); image.zoneSize=val; dijit.byId("textbox"+"Zone Size").setValue(val); dijit.byId("slider"+"Zone Size").setValue(val); image.mdTableReady=0; } }; $(document).bind("contextmenu",function(){ return false; }); var _4d=false; $(window).resize(function(){ if(image.toScreen){ if(_4d!==false){ clearTimeout(_4d); } _4d=setTimeout(imageReset,1000); } if(image.mouseMode=="white_balance"||image.mouseMode=="backlight"||image.mouseMode=="focus"||image.mouseMode=="sd_imgsize"){ setTimeout(imageReset,1000); mouseMode("set","view"); } }); $(window).bind("beforeunload",function(){ if((!av.saved)&&(getCameraParam("admin")!="Access denied!")){ return "There are unsaved changes. Please click \"Save All Settings to Flash\" button in Administration tab to save settings."; } }); }; var model={has1080:function(){ return (this.name.substring(0,5)==="10005"); },hasH264:function(){ return true; },hasWDR:function(){ return (this.releasename.substring(3,4)==="6"); },hasCasinoMode:function(){ return ((this.releasename.substring(0,1)==="2")&&(this.releasename.substring(3,4)==="5")); },hasDN:function(){ return (this.feature&1); },hasIR:function(){ return (this.feature&2); },hasAI:function(){ return (this.feature&4); },hasBinning:function(){ return (this.feature&32); },hasFocus:function(){ return (this.feature&256); },hasFocusAid:function(){ return (this.feature&512); },hasAudio:function(){ return (this.feature&2048); },hasSDcard:function(){ return (this.feature&4096); },hasPIris:function(){ return (this.feature&8192); },hasScaling:function(){ return (this.feature&32768); },hasRotate90:function(){ return (this.feature&65536); },hasAdjustableIR:function(){ return (this.feature&131072); },is2M:function(){ return (this.name.substring(0,4)==="2805"); },isProduction:function(){ return (this.production&2); },isDualsensor:function(){ return (this.enclosure==5); }}; dojo.addOnLoad(function theAddOnLoad(){ var _1=document.getElementById("leading_region"),_2,_3=[],_4=[],_5=[],_6=[],_7=[],_8=[],_9=[],md=[],pm=[],_a=[],_b=[],_c=[],_d=image.fpsMaxVal,_e=accessFull(),qi={}; function _f(_10,_11){ var tmp; if(_10==="get"){ tmp=getCameraParam("fps")||0; return (1<=tmp&&tmp<=_d)?tmp:_d+1; }else{ setCameraParam("fps",(1<=_11&&_11<=_d)?_11:0); } }; function _12(_13,_14){ if(_13==="get"){ return getCameraParam("1080p_mode"); }else{ setCameraParam("1080p_mode",_14); $("#central_region")[0].f1080pChange(); } }; var _15=(function(){ var _16,_17=0,_18=65535; return {maxrate:function(){ return _18; },bool:function(_19,_1a){ if(_19==="get"){ _16=_16||Number(getCameraParam("bitrate"))||0; return _16>0; }else{ if(_19==="set"){ _16=_1a?_18:0; } } },number:function(_1b,_1c){ if(_1b==="get"){ _16=_16||Number(getCameraParam("bitrate"))||0; return _16; }else{ if(_1b==="set"){ _16=Number(_1c); setCameraParam("bitrate",_16); if(_16==0||_16>=_17){ setCameraParam("bitrate",_16); }else{ alert("Rates less than 100kbps are not allowed."); } } } }}; })(); var _1d=(function(){ var _1e; function _1f(_20,_21,_22){ var v; if(_21==="get"){ _1e=_1e||getCameraParam("netopt")||0; return (_1e&_20)!==0; }else{ if(_21==="set"){ _1e=(_22?_1e|_20:_1e&~_20); setCameraParam("netopt",_1e); } } }; return {dhcp:function(_23,_24){ return _1f(1,_23,_24); },lockIP:function(_25,_26){ return _1f(8,_25,_26); },limitMTU:function(_27,_28){ return _1f(128,_27,_28); },mcast:function(_29,_2a){ return _1f(64,_29,_2a); },setter:function(){ setCameraParam("netopt",_1e); }}; })(); var _2b={leftControl:null,topControl:null,width:function(_2c,_2d){ var _2e; if(_2c==="get"){ _2e=getCameraParam("imgwidth"); return Number(_2e)+Number(this.leftControl.getValue()); }else{ if(_2c==="set"){ _2e=Number(_2d)-Number(this.leftControl.getValue()); setCameraParam("imgwidth",_2e); } } },height:function(_2f,_30){ var _31; if(_2f==="get"){ _31=getCameraParam("imgheight"); return Number(_31)+Number(this.topControl.getValue()); }else{ if(_2f==="set"){ _31=Number(_30)-Number(this.topControl.getValue()); setCameraParam("imgheight",_31); } } }}; function _32(_33,_34){ return _2b.width(_33,_34); }; function _35(_36,_37){ return _2b.height(_36,_37); }; function _38(_39,_3a){ if(_39==="get"){ return getCameraRegister(3,21); }else{ if(_39==="set"){ setCameraRegister(3,21,_3a); } } }; var _3b=[1990,1970,1954,1935,1917,1901,1883,1866,1848,1833,1816,1801,1786,1769,1754,1739,1726,1711,1696,1683,1669,1654,1642,1627,1616,1604,1591,1578,1566,1554,1543,1530,1518,1507,1496,1487,1474,1465,1454,1444,1433,1422,1412,1403,1394,1385,1373,1364,1357,1347,1337,1328,1321,1313,1303,1295,1287,1278,1271,1263,1255,1246,1239,1232,1225,1218,1212,1203,1195,1190,1185,1175,1168,1162,1156,1149,1144,1138,1131,1125,1118,1112,1106,1101,1096,1091,1086,1079,1074,1068,1063,1058,1053,1046,1043,1038,1031,1028,1023,1016]; function _3c(_3d,_3e){ var i,sum=0,tmp,_3f,min=10000,_40; if(_3d==="get"){ for(i=161;i<=170;i++){ sum+=1*getCameraRegister(3,i); } for(tmp=1;tmp<=100;tmp++){ if(_3b[tmp-1]==sum){ break; }else{ _3f=sum-_3b[tmp-1]; if(_3f<0){ _3f=-_3f; } if(_3f100){ tmp=_40; } if(tmp<40){ tmp=40; } return tmp; }else{ setGamma(antiGamma(_3e)); } }; function _41(_42,_43){ var tmp,val; if(_42==="get"){ tmp=getCameraParam("motiondetect"); }else{ setCameraParam("motiondetect",_43); tmp=_43; } image.mdEnable=(tmp==="on")?1:0; if(image.mdEnable){ dijit.byId("checkBox"+"DisableMD").setValue(false); if(_42==="set"){ val=getCameraParam("mdzonesize"); image.zoneSize=val; dijit.byId("textbox"+"Zone Size").setValue(val); dijit.byId("slider"+"Zone Size").setValue(val); mouseMode("set","motion"); } image.mdTableReady=0; showMDGrid(); }else{ dijit.byId("checkBox"+"DisableMD").setValue(true); if(_42==="set"){ mouseMode("set","view"); } } if(_42==="get"){ return tmp; } }; function _44(_45,_46){ var tmp,val; var _47=calculateGrid(); var _48=_47.hor*_47.ver; if(_45==="get"){ val=getCameraParam("mdsensitivity"); tmp=Math.round(val*100/_48); if(tmp>100){ tmp=100; } return tmp; }else{ tmp=Math.round(_46*_48/100); setCameraParam("mdsensitivity",tmp); } }; function _49(_4a,_4b){ var tmp,val; if(_4a==="get"){ tmp=getCameraParam("mdtotalzones"); }else{ setCameraParam("mdtotalzones",_4b); tmp=_4b; } if(_4a==="set"){ image.zbnum=(_4b==1024)?32:8; val=getCameraParam("mdzonesize"); image.zoneSize=val; dijit.byId("textbox"+"Zone Size").setValue(val); dijit.byId("slider"+"Zone Size").setValue(val); val=getCameraParam("mddetail"); dijit.byId("textbox"+"Detail").setValue(val); dijit.byId("slider"+"Detail").setValue(val); val=getCameraParam("mdlevelthreshold"); dijit.byId("textbox"+"Level Threshold").setValue(val); dijit.byId("slider"+"Level Threshold").setValue(val); val=_44("get",null); dijit.byId("textbox"+"Motion Sensitivity, %").setValue(val); dijit.byId("slider"+"Motion Sensitivity, %").setValue(val); } if(_4a==="get"){ return tmp; } }; var _4c,_4d; function _4e(val){ }; var _4f,_50,_51=0; var _52,_53; function _54(){ _4d=1*getCameraParam("focus"); if(_4d<=1*_4c+10&&_4d>=1*_4c-10){ if(_51==0){ $("#border-table").css("border-color","#FFFF00"); } }else{ if(_4d>_4c){ $("#border-table").css("border-color","#00FF00"); }else{ if(_4d<_4c){ $("#border-table").css("border-color","#FF0000"); } } } _4c=_4d; if(_51==1){ _52=getCameraParam("focus=status"); if(_52!="on"){ clearTimeout(_50); clearInterval(_4f); $("#border-table").css("border-color","#FFFFFF"); _51=0; if(_52=="toodark"){ _53.setValue("Stopped. Too Dark!"); }else{ _53.setValue("DONE."); } }else{ _53.setValue("In process.."); } } }; function _55(){ clearInterval(_4f); }; function _56(_57,_58){ _4c=setCameraParam(_57,_58); _4e(_4c); if(_57=="zoom"&&dijit.byId("checkBox"+"Enable Auto Focus after Zoom").getValue()){ _59(); }else{ clearInterval(_4f); _51=0; _4f=setTimeout(_54,1000); } }; function _59(){ clearInterval(_4f); _51=1; _4f=setInterval(_54,1000); _53.setValue("In process.."); }; function _5a(_5b,_5c){ if(_5b==="set"){ if(_5c){ clearInterval(_4f); _51=2; _4f=setInterval(_54,1000); }else{ clearInterval(_4f); $("#border-table").css("border-color","#FFFFFF"); _51=0; } } }; function _5d(){ if(_5e.getValue()=="on"){ var _5f=1*getCameraRegister(3,80),_60=1*getCameraRegister(3,98); if(_60<=1){ if(_5f&256){ dijit.byId("textbox"+"Iris Status").setValue("Zoomed In"); }else{ if(_5f&32){ dijit.byId("textbox"+"Iris Status").setValue("Too Dark"); }else{ dijit.byId("textbox"+"Iris Status").setValue("Evaluating"); } } }else{ if(_60==3||_60==4){ dijit.byId("textbox"+"Iris Status").setValue("Closing"); }else{ if(_60==5){ dijit.byId("textbox"+"Iris Status").setValue("Closed"); }else{ if(_60==6||_60==7||_60==8){ dijit.byId("textbox"+"Iris Status").setValue("Opening"); }else{ dijit.byId("textbox"+"Iris Status").setValue("Unknown"); } } } } }else{ dijit.byId("textbox"+"Iris Status").setValue("Disabled"); } }; var dt=new Date(); var tm0=new String(); var _61=new String(); var tm=new String(); var _62=dt.getTimezoneOffset(); function _63(){ var _64; var _65; _64=dt.toJSON(); _65=_64.split("T"); _64=_65[0].split("-"); _65=_64[1]+"/"+_64[2]+"/"+_64[0]+" "+_65[1]; _64=_65.split("Z"); _65=_64[0]; _64=_65.split("."); _65=_64[0]; return _65; }; function _66(){ if(!image.freeze){ tm0=getCameraParam("sd_stampspan"); } tm=tm0.split(","); if(tm[0]>2208988800){ dt.setTime((tm[0]-2208988800-_62*60)*1000); _67.setValue(_63()); }else{ _67.setValue("N/A"); } if(tm[1]>2208988800){ dt.setTime((tm[1]-2208988800-_62*60)*1000); _68.setValue(_63()); }else{ if(1*_68){ _68.setValue("N/A"); }else{ _68.setValue("No recording!!"); } } if(image.is_sdPlayback){ tm0=getCameraParam("sd_playbackstamp"); tm=tm0.split(","); if(tm[0]>2208988800){ dt.setTime((tm[0]-2208988800-_62*60)*1000); _69.setValue(_63()); } } }; function _6a(_6b,_6c){ var tmp,val; if(_6b==="get"){ var _6d=new Date(); setCameraParam("ntp_timestamp",(_6d.getTime()/1000+2208988800)); tmp=getCameraParam("sd_recording"); }else{ setCameraParam("sd_recording",_6c); tmp=_6c; } if(_6b==="get"){ return tmp; } }; function _6e(_6f,_70){ if(_6f==="set"){ image.is_sdPlayback=_70; applyVideo(); if(image.is_sdPlayback==true){ ReadOnlyVisual(_69,true); var _71=Date.parse(_69.getValue())/1000+2208988800; setCameraParam("sd_playbackstamp",_71); }else{ ReadOnlyVisual(_69,false); } } }; function _72(_73,_74){ if(_73==="get"){ tm0=getCameraParam("sd_playbackstamp"); tm=tm0.split(","); if(tm[0]>2208988800){ dt.setTime((tm[0]-2208988800-_62*60)*1000); return _63(); } } }; function _75(_76,_77){ if(_76==="set"){ if(_77=="on"){ image.is_scaling=true; }else{ image.is_scaling=false; } applyVideo(); } }; function _78(_79,_7a){ if(_79==="get"){ tmp=getCameraParam("scaling"); return tmp; }else{ setCameraParam("scaling",_7a); if(_7a=="off"){ ViewScaling.setValue(false); } applyVideo(); } }; function _7b(_7c,_7d){ if(_7c==="get"){ tmp=1*getCameraParam("rotate"); if(tmp==90||tmp==270){ image.is_90rotation=true; } return tmp; }else{ setCameraParam("rotate",_7d); if(_7d==90||_7d==270){ image.is_90rotation=true; }else{ image.is_90rotation=false; } applyVideo(); } }; function _7e(_7f,_80){ if(_7f==="set"){ image.audioEnable=(_80=="on")?true:false; } }; function _81(){ if(image.is_sdPlayback){ _6e("set",false); _82.set("label","Click to Play"); mouseMode("set","sd_imgsize"); }else{ _6e("set",true); _82.set("label","Click to Stop"); mouseMode("set","view"); } }; _1.style.fontSize="150%"; model.name=getCameraParam("model=fullname")||""; model.releasename=getCameraParam("model=releasename")||""; image.base_model=1*getCameraParam("model"); model.feature=1*(getCameraParam("features")||""); model.enclosure=1*(getCameraParam("enclosure=code")||""); model.production=1*getCameraRegister(6,166); model.internalpn=getCameraParam("model=internal")||""; if(_e){ avutil.createAppend(_1,"hr"); createText("Image",true,"_picture",{noLeadBr:true}); createSlider("Brightness",-50,50,"brightness",-50,50,null,true); createSlider("Sharpness",0,4,"sharpness",0,4,null,true); createSlider("Saturation",0,6,"saturation",0,6,null,true); createSlider("Blue",-10,10,"blue",-10,10,null,true); createSlider("Red",-10,10,"red",-10,10,null,true); if(model.hasWDR()){ createSlider("Contrast",40,100,_3c,40,100,null,true); }else{ createSlider("Gamma",40,100,_3c,40,100,null,true); } if(model.hasRotate90()){ image.flipped=createRadioSet("Rotate Image",_7b,[[0,"0"],[90,"90"],[180,"180"],[270,"270"]],null,true); }else{ image.flipped=createCheckbox("Flip Image","rotate",180,0,null,true); } createCheckbox("Auto Exposure","autoexp","on","off",null,true); createCheckbox("Auto White Balance","white_balance","on","off",null,true); if(model.hasCasinoMode()){ var _83=createCheckbox("Casino Mode","casino_mode","on","off",null,true); dojo.connect(_83,"onChange",function(){ for(var i=0;i<5;i++){ if(_84[i].value==getCameraParam("lowlight")){ _84[i].attr("checked",true); break; } } }); } createCheckbox("Bandwidth Saving Mode","bandwidthsaving","on","off",null,true); if(model.hasWDR()){ createCheckbox("WDR Motion Compensation","motion_compensation","on","off",null,true); createText("* Disabling WDR Motion Compensation may lead to excess motion blur",false,null,{fontSmaller:true}); } createRadioSet("Lighting","freq",[["50","50Hz"],["60","60Hz"]],null,true); createRadioSet("Illumination","illum",[["auto","Automatic"],["indoor","Indoor"],["outdoor","Outdoor"],["mix","Mixed"]],null,true); createText("* Mixed mode compensates for excessive red and blue levels of illumination.",false,null,{fontSmaller:true}); var _84=createRadioSet("Exposure Mode","lowlight",[["highspeed","High Speed"],["speed","Speed"],["balance","Balanced"],["quality","Quality"],["moonlight","Moonlight (TM)"]],null,true); createSlider("Exposure (ms)",1,80,"shortexposures",1,80,_84[0],true); if((getCameraParam("model")!=1105)||(getCameraParam("model=releasename")=="1555DN")){ createSlider("Low Light Noise Filter (%)",0,100,"spacialfilter",0,100,null,true); } if(model.isDualsensor()){ var _85=createRadioSet("Day/Night","daynight",[["auto","Automatic"],["day","Day"],["night","Night"],["dual","Dual Channel Streaming"]],null,true); createSlider("Switching Level",1,100,"nightgain",64,512,_85[0],true); createSlider("Toggle Guard",1,4,"daygain",1,4,_85[0],true,{sliderWidth:"200px"}); createCheckbox("Upscale 1.2MP to 3MP","upscaling","on","off",null,true); }else{ if(model.hasDN()){ var _85=createRadioSet("Day/Night","daynight",[["auto","Automatic"],["day","Day"],["night","Night"]],null,true); model.hasDN()||(disableVisual(_85[0],true),disableVisual(_85[1],true),disableVisual(_85[2],true)); createSlider("Switching Level",1,100,"nightgain",64,512,_85[0],true); createSlider("Toggle Guard",1,4,"daygain",1,4,_85[0],true,{sliderWidth:"200px"}); if(model.hasAdjustableIR()){ createRadioSet("Adjustable IR","adjustable_ir",[["adaptive","Enable"],["disable","Disable"]],null,true); createSlider("IR-Tele Level",0,7,"irtelepos",0,7,null,true); createSlider("IR-Wide Level",0,7,"irwidepos",0,7,null,true); }else{ if(model.hasIR()){ createRadioSet("IR Light","ir",[["on","Automatic"],["off","Off"],["alwayson","Always On"]],null,true); } } } } avutil.createAppend(_1,"br"); if(model.hasAI()){ var _5e=createCheckbox("Enable Auto Iris","autoiris","on","off",null,true); model.hasAI()||disableVisual(_5e,true); createTextBox("Iris Status",null,null,null,function(){ image.irisTimeout=setInterval(_5d,1000); },null,null,false); avutil.createAppend(_1,"br"); }else{ if(model.hasPIris()){ var _5e=createCheckbox("Enable P-Iris","piris","on","off",null,true); if(model.isProduction()){ createSlider("P-Iris Closing Level",0,20,"pirispos",0,20,null,true); } createTextBox("Iris Status",null,null,null,function(){ image.irisTimeout=setInterval(_5d,1000); },null,null,false); avutil.createAppend(_1,"br"); } } if(model.hasBinning()&&!model.isDualsensor()&&!(model.hasWDR()&&(model.is2M()||!model.hasDN()))){ createText("Binning",false,null,{left:true}); if(!model.hasWDR()){ createCheckbox("Binning in Day Mode","day_binning","on","off",null,true); } if(model.hasDN()){ createCheckbox("Binning in Night Mode","night_binning","on","off",null,true); } if(model.has1080()){ createCheckbox("1080p Mode",_12,"on","off",null,true); } } if(model.hasScaling()){ createText("
Downscaling",false,null,{left:true}); EnableScaling=createCheckbox("Enable Scaling",_78,"on","off",null,true); ViewScaling=createCheckbox("View Scaled Video",_75,"on","off",EnableScaling,true); var _2=document.createElement("div"); _1.appendChild(_2); var _86=getCameraParam("scaling_size"); _2.innerHTML="
Scaling Size: "; var _87=document.getElementById("scaling_size"); _87.value=_86; _87.onchange=function(){ setCameraParam("scaling_size",_87.value); if((ViewScaling.attr("checked")==true)&&(image.type==2)){ applyVideo(); } }; } } avutil.createAppend(_1,"hr"); createText("Video",true,"_video",{noLeadBr:true}); avutil.createAppend(_1,"hr"); var _88=createRadioSet("Show Video Type",imageTypeSelection,[[0,"Disable Video"],[1,"MJPEG over HTTP"],[2,"H.264 over RTP/UDP"]],null,true,{noLeadBr:true}); _88[0].onClick=function(){ if(getCameraParam("admin")!="Access denied!"){ disableVisual(_82,true); } }; _88[1].onClick=function(){ if(getCameraParam("admin")!="Access denied!"){ disableVisual(_82,false); } }; _88[2].onClick=function(){ if(getCameraParam("admin")!="Access denied!"){ disableVisual(_82,true); }else{ var _89=prompt("Please enter viewer password:"); if(_89!=null){ image.rtsp_viewer_psd=_89; }else{ image.rtsp_viewer_psd=""; } if(browser()==="Firefox"){ imageReset(); } } }; model.hasH264()||disableVisual(_88[2],true); if(browser()==="MSIE"){ createText("* For H.264 streaming, please make sure ActiveX Plugin is installed during VLC installation and axvlc.dll is at exactly the same path as
C:\\Program Files (x86)\\VideoLAN\\VLC\\axvlc.dll",false,null,{fontSmaller:true}); } createCheckbox("Fit Video to Window",videoToScreen,true,false,null,true); var _8a; if(_e){ _8a=[["view","No Control"],["ptz","PTZ"],["backlight","ROI Exposure Reference"],["white_balance","ROI White Balance Reference"]]; }else{ _8a=[["view","No Control"],["ptz","PTZ"]]; } createRadioSet("Control Video with Mouse",mouseMode,_8a,null,true); createText("* Mouse-related control requires running MJPEG video
* Click and move to select window to set.
* Double click to reset to default settings.",false,null,{fontSmaller:true}); avutil.createAppend(_1,"hr"); _3.push(image.resolution=createRadioSet("Resolution","imgres",[["half","Half"],["full","Full"]],null,false,{noLeadBr:true})); _3.push(image.jpegQuality=createSlider("JPEG Quality",1,21,"imgquality",1,21,_88[1],false)); var dim=getMaxSensorDims(); image.maxsensorwidth=dim.width; image.maxsensorheight=dim.height; _3.push(image.left=_2b.leftControl=createTextBox("Left",0,null,null,"imgleft",null,null,false)); _3.push(image.top=_2b.topControl=createTextBox("Top",0,null,null,"imgtop",null,null,false)); _3.push(image.right=createTextBox("Right",64,null,null,_32,null,null,false)); _3.push(image.bottom=createTextBox("Bottom",64,null,null,_35,null,null,false)); createButton("Preview",applyVideoIfDims,_3,{pre:"br"}); if(_e){ createButton("Apply","onSetVideo",_3,{suf:"br"}); createText("* "Preview" will not apply changes to the camera
* "Apply" will apply changes to the camera; Click "Save all setting to flash" in administration section to save all changes
",false,null,{fontSmaller:true}); } avutil.createAppend(_1,"hr"); createText("H.264",true,"_h264",{noLeadBr:true}); avutil.createAppend(_1,"hr"); createText("H.264 RTSP/RTP/AVP stream",false,null); _4.push(createTextBox("RTSP Unicast port",1,65535,null,"rtspport",null,null,false)); createRadioSet("vbr",vbr,[["vbr","Variable Bitrate Control"]],null,true,{noLegend:true}); _4.push(image.h264Quality=createTextBox("H.264 Quality (36..16)",16,36,null,"qp",null,null,false,{pre:"    "})); createText("* 36 - lowest quality, 16 - highest quality",false,null,{fontSmaller:true}); _4.push(image.h264EnableRatelimit=createCheckbox("Enable Rate Limit","ratelimit_mode","on","off",null,false,{pre:"    "})); _4.push(image.h264Ratelimit=createTextBox("Rate Limit (0-65535 kbps)",0,65535,null,"ratelimit",null,null,false,{pre:"    "})); avutil.createAppend(_1,"br"); createRadioSet("cbr",cbr,[["cbr","Constant Bitrate Control"]],null,true,{noLegend:true}); _4.push(image.h264BitrateNumber=createTextBox("Bitrate (0-65535 kbps)",0,_15.maxrate(),null,_15.number,null,null,false,{pre:"    "})); _4.push(image.fps=createSlider("Frames Per Second",1,_d+1,_f,1,_d+1,null,false,{rend:"Max"})); if(model.hasAudio()){ if(getCameraParam("enclosure=code")=="2"){ createRadioSet("Audio Input","audioinput",[["mic","Microphone"],["linein","Line-in"]],null,true); } _4.push(createCheckbox("Enable Audio in RTSP",_7e,"on","off",null,true,{noLegend:true})); createSlider("Microphone Volume",1,3,"mic_boost",0,2,null,true); if(getCameraParam("enclosure=code")=="2"){ createSlider("Line-in Volume",1,46,"linein_volume",0,45,null,true); } } createButton("Preview ",applyVideoIfDims,_4,{pre:"br"}); if(_e){ createButton("Apply ","onSetVideo",_4,{suf:"br"}); } image.rtspLink=createTextBox("Link for external media players","","",null,function(){ },null,null,false,{rtspLinkData:true}); if(_e){ createText("* "Preview" will not apply changes to the camera
* "Apply" will apply changes to the camera; Click "Save all setting to flash" in administration section to save all changes
",false,null,{fontSmaller:true}); } avutil.createAppend(_1,"hr"); createText("RTP/UDP multicast stream",false,null); var _8b; _5.push(_8b=createCheckbox("Enable RTP Multicast",_1d.mcast,true,false,null,false)); _5.push(createTextBox("IP Address","","",null,"streamip",2,null,false)); _5.push(createTextBox("RTP Port",1,65535,null,"rtpport",null,null,false)); _5.push(createTextBox("SAP Destination IP","","",null,"sapip",null,null,false)); if(_e){ createButton(" Apply ","onSet",_5,{suf:"br"}); } avutil.createAppend(_1,"hr"); if(_e){ if(model.hasFocus()){ if(getCameraParam("enclosure")=="MicroDome"){ createText("Focus",true,"_focus",{noLeadBr:true}); avutil.createAppend(_1,"hr"); createCheckbox("View Focus Window",mouseMode,true,false,null,true); avutil.createAppend(_1,"br"); }else{ createText("Zoom & Focus",true,"_focus",{noLeadBr:true}); avutil.createAppend(_1,"hr"); createCheckbox("View Focus Window",mouseMode,true,false,null,true); avutil.createAppend(_1,"br"); avutil.insertText(_1,"Zoom:"); avutil.createAppend(_1,"br"); var val; createButton("+20",function(){ _56("zoom",20); },null,{pre:""}); createButton("+5",function(){ _56("zoom",5); },null,{pre:""}); createButton("+1",function(){ _56("zoom",1); },null,{pre:""}); avutil.createAppend(_1,"br"); createButton("-20 ",function(){ _56("zoom",-20); },null,{pre:""}); createButton("-5 ",function(){ _56("zoom",-5); },null,{pre:""}); createButton("-1 ",function(){ _56("zoom",-1); },null,{pre:""}); createCheckbox("Enable Auto Focus after Zoom","af_zoom","on","off",null,true); avutil.createAppend(_1,"br"); } _53=createTextBox("Focus",null,null,null,null,null,null,false); disableVisual(_53,false); ReadOnlyVisual(_53,true); createButton("+20",function(){ _56("focus",20); },null,{pre:""}); createButton("+5",function(){ _56("focus",5); },null,{pre:""}); createButton("+1",function(){ _56("focus",1); },null,{pre:""}); avutil.createAppend(_1,"br"); createButton("-20 ",function(){ _56("focus",-20); },null,{pre:""}); createButton("-5 ",function(){ _56("focus",-5); },null,{pre:""}); createButton("-1 ",function(){ _56("focus",-1); },null,{suf:""}); createButton("  Full-range Focus  ",function(){ _4c=setCameraParam("focus","fullrange"); _4e(_4c); _59(); },null,{pre:"br"}); createButton("Short-range Focus",function(){ _4c=setCameraParam("focus","shortrange"); _4e(_4c); _59(); },null,{pre:"br"}); createButton("    Stop    ",function(){ _56("focus",0); },null,{pre:"br",suf:"br"}); createText("* A GREEN focus window indicates moving toward optimal
* A RED focus window indicates moving away from optimal
* A YELLOW focus window indicates no change
* The focus window will turn GREY when complete",false,null,{fontSmaller:true}); avutil.createAppend(_1,"br"); avutil.createAppend(_1,"hr"); }else{ avutil.remove("menu_focus"); } createText("Network",true,"_network",{noLeadBr:true}); avutil.createAppend(_1,"hr"); createText("IP Options",false,null); var _8c; _8.push(_8c=createRadioSet("DHCP/Fixed Selection",_1d.dhcp,[[true,"DHCP"],[false,"Fixed IP"]],null,false)); _8c[0].onClick=function(){ ReadOnlyVisual(_8d,true); ReadOnlyVisual(_8e,true); ReadOnlyVisual(_8f,true); disableVisual(_90,true); }; _8c[1].onClick=function(){ ReadOnlyVisual(_8d,false); ReadOnlyVisual(_8e,false); ReadOnlyVisual(_8f,false); disableVisual(_90,false); }; var _8f; var _8d; var _8e; _8.push(_8f=createTextBox("IP Address","","",avutil.ipValidator,"ip",1,null,false)); _8.push(_8d=createTextBox("Subnet Mask","","",avutil.maskValidator,"subnetmask",null,null,false)); _8.push(_8e=createTextBox("Default Gateway","","",avutil.gatewayValidator,"gateway",null,null,false)); if(_1d.dhcp("get")){ ReadOnlyVisual(_8d,true); ReadOnlyVisual(_8e,true); ReadOnlyVisual(_8f,true); } if(_1d.lockIP("get")){ ReadOnlyVisual(_8f,true); disableVisual(_8c[0],true); disableVisual(_8c[1],true); } var _90; _8.push(_90=createCheckbox("Lock IP",_1d.lockIP,true,false,null,false)); dojo.connect(_90,"onClick",function(){ if(_90.checked){ if(_8f.get("value")===getCameraParam("ip")){ ReadOnlyVisual(_8f,true); disableVisual(_8c[0],true); disableVisual(_8c[1],true); }else{ _90.set("checked",false); alert("Please enter new IP and save to flash before locking IP"); } }else{ ReadOnlyVisual(_8f,false); disableVisual(_8c[0],false); disableVisual(_8c[1],false); } }); if(_1d.dhcp("get")){ disableVisual(_90,true); } var _91; _8.push(_91=createCheckbox("Limit MTU Size",_1d.limitMTU,true,false,null,false)); _8.push(createTextBox("To",256,1500,null,"mtu",null,_91,false)); var _92=createButton("Apply & Save to Flash","onSet",_8,{pre:"br",suf:"br"}); avutil.createAppend(_1,"hr"); createText("Ethernet",false,null); var _93=createRadioSet("Link Speed","eth_negotiation",[["auto","Autonegotiation"],["fixed","Fixed 100MBaseT / Full Duplex"]],null,false); var _94=createRadioSet("Multicast Reception","multicast_rec",[["on","Enable"],["off","Disable"]],null,false); _93[0].onClick=function(){ if(getCameraParam("eth_negotiation")=="fixed"){ if(confirm("When switching between auto negotiation and Fixed 100Mb / Full Duplex, you must also change the settings on the switch to match. Failure to do so may cause unreliable Ethernet connectivity.")){ setCameraParam("eth_negotiation","auto"); av.saved=false; }else{ for(i=0;i * The default Video DSCP value 34 provides a low drop probability and assures forwarding traffic
* The default Management DSCP value 0 provides best effort traffic
* It is not recommended to change the default values for DSCP
* Refer to the Arecont Vision Web Browser Manual for more detailed information regarding the QoS settings",false,null,{fontSmaller:true}); avutil.createAppend(_1,"hr"); createText("Miscellaneous",false,null); avutil.createAppend(_1,"br"); _7.push(createTextBox("Camera Name","","",null,"name",null,null,false,{maxLength:32})); _7.push(createTextBox("Second HTTP Port",1,65535,null,"webserverport",null,null,false)); createButton("Apply","onSet",_7,{pre:"br",suf:"br"}); avutil.createAppend(_1,"hr"); if(browser()==="MSIE"){ $("#lay-table").css("border-color","transparent"); } createText("Motion Detection",true,"_motion",{noLeadBr:true}); var _96; var _97; var _98; _98=createCheckbox("DisableMD","motiondetect","off","on",null,true); var _99=document.getElementById("leading_region"); var len=_99.childNodes.length; _99.removeChild(_99.childNodes[len-1]); _99.removeChild(_99.childNodes[len-2]); _99.removeChild(_99.childNodes[len-3]); _98.domNode.style.display="none"; _96=createCheckbox("Enable",_41,"on","off",null,true); hideMDGrid(); _97=createCheckbox("Extended",_49,1024,64,_98,true); if(dijit.byId("checkBoxExtended").getValue()==1024){ image.zbnum=32; }else{ image.zbnum=8; } md.push(image.zoneSize=createSlider("Zone Size",2,15,"mdzonesize",2,15,_98,true)); md.push(createSlider("Detail",1,255,"mddetail",1,255,_98,true)); md.push(createSlider("Level Threshold",2,31,"mdlevelthreshold",2,31,_98,true)); md.push(createSlider("Motion Sensitivity, %",0,100,_44,0,100,_98,true)); createText("* Left click and move to select window to set mask.
* Right click and move to select window to reset mask.",false,null,{fontSmaller:true}); avutil.createAppend(_1,"hr"); createText("Privacy Mask",true,"_privacy",{noLeadBr:true}); var _9a; pm.push(_9a=createCheckbox("Enable Privacy Mask","pmask","on","off",null,true)); dojo.connect(_9a,"onClick",function(){ if(_9a.checked){ mouseMode("set","privacy"); }else{ mouseMode("set","view"); } }); createText("* Left click and drag to set mask
* Right click and drag to erase mask",false,null,{fontSmaller:true}); avutil.createAppend(_1,"hr"); createText("Administration",true,"_administration",{noLeadBr:true}); avutil.createAppend(_1,"hr"); createText("Access Control",false,null); createText("(Up to 16 digits, letters and symbols, excluding # % & ` \" < >)",false,null,{fontSmaller:true}); createText("Username: \t\tadmin",false,null,{left:true}); _a.push(createTextBox("Admin Password","","",null,function(){ },null,null,false,{password:true,maxLength:16})); _a.push(createTextBox("Confirmation","","",null,function(){ },1,null,false,{password:true,maxLength:16})); createButton("Set",av.pwdStrAdmin,_a,{pre:"br"}); createButton("Erase",av.pwdStrAdmin,null,{suf:"br"}); avutil.createAppend(_1,"br"); createText("Username: \t\tviewer",false,null,{left:true}); _b.push(createTextBox("Viewer Password","","",null,function(){ },null,null,false,{password:true,maxLength:16})); _b.push(createTextBox("Confirmation","","",null,function(){ },2,null,false,{password:true,maxLength:16})); createButton("Set",av.pwdStrViewer,_b,{pre:"br"}); createButton("Erase",av.pwdStrViewer,null,{suf:"br"}); avutil.createAppend(_1,"hr"); createText("Save & Restore Settings",false,null,{left:true}); createButton("Save All Settings to Flash",function(){ if(confirm("Are you sure?")){ setCameraParam("params","save"); av.saved=true; } },null,{pre:"br",suf:"br"}); createButton("Restore to Factory Default",function(){ if(confirm("Are you sure?")){ setTimeout("window.location.reload()",5000); setCameraParam("params","factory"); av.saved=true; } },null,{pre:"br",suf:"br"}); createButton("Reboot the Camera",function(){ if(confirm("Are you sure? If there are unsaved changes, please click \"Save All Settings to Flash\" button to save settings.")){ setCameraParam("params","reboot"); } },null,{pre:"br",suf:"br"}); avutil.createAppend(_1,"hr"); createUpgradeForm(); avutil.createAppend(_1,"hr"); if(model.hasSDcard()){ createText("SD Card",true,"_sdcard",{noLeadBr:true}); createCheckbox("View SD Recording ROI",mouseMode,true,false,null,true); avutil.createAppend(_1,"br"); var _69=createTextBox("Playback",null,null,null,_72,null,null,false,{stampData:true}); var _82=createButton("Click to Play",_81,null,{pre:"br",suf:"br"}); var _9b=createRadioSet("SD Card Recording:",_6a,[["on","Continuous Recording"],["off","Stop Continuous Recording AND
Enable Event-triggered Recording"]],null,true,{noLeadBr:true}); createCheckbox("Network Failure","sd_networkfail","on","off",null,true,{pre:"    "}); createCheckbox("Motion Alarm","sd_motionalarm","on","off",null,true,{pre:"    "}); createCheckbox("I/O Alarm","sd_ioalarm","on","off",null,true,{pre:"    "}); image.sd_fps=createSlider("Recording Framerate",1,30,"sd_fps",1,30,null,true); var _9c=createRadioSet("SD Card Image Resolution","sd_imgres",[["half","Half"],["full","Full"]],null,true,{noLeadBr:true}); var _67=createTextBox("Start",null,null,null,function(){ setInterval(_66,1000); },null,null,false,{stampData:true}); ReadOnlyVisual(_67,true); var _68=createTextBox("End",null,null,null,function(){ },null,null,false,{stampData:true}); ReadOnlyVisual(_68,true); var _9d=createButton("Delete All Records",function(){ if(confirm("Are you sure?")){ setCameraParam("sd","format"); } },null,{pre:"br",suf:"br"}); avutil.createAppend(_1,"hr"); if(getCameraParam("sd")!=="present"){ disableVisual(_69,true); disableVisual(_82,true); disableVisual(_9b[0],true); disableVisual(_9b[1],true); dijit.byId("checkBox"+"Network Failure").set("disabled",true); dijit.byId("checkBox"+"Motion Alarm").set("disabled",true); dijit.byId("checkBox"+"I/O Alarm").set("disabled",true); dijit.byId("slider"+"Recording Framerate").set("disabled",true); dijit.byId("textbox"+"Recording Framerate").set("disabled",true); disableVisual(_9c[0],true); disableVisual(_9c[1],true); disableVisual(_67,true); disableVisual(_68,true); disableVisual(_9d,true); } }else{ avutil.remove("menu_sdcard"); } createText("About",true,"_about"); createText("Camera Type: \t\t"+(qi.model=model.releasename),false,null,{left:true}); createText("Firmware: \t\t"+(qi.firm=getCameraParam("fwversion")),false,null,{left:true}); createText("JPEG Engine: \t\t"+getCameraParam("procversion"),false,null,{left:true}); createText("Net Version: \t\t"+getCameraParam("netversion"),false,null,{left:true}); createText("MAC Address: \t\t"+(qi.mac=getCameraParam("mac")),false,null,{left:true}); if(model.internalpn!=4294967295){ createText("Internal P/N: \t\t"+model.internalpn,false,null,{left:true}); } avutil.createAppend(_1,"br"); }else{ image.flipped=(getCameraParam("rotate")==180); createText("About",true,"_about"); createText("Camera Type: \t\t"+(qi.model=model.releasename),false,null,{left:true}); createText("Firmware: \t\t"+(qi.firm=getCameraParam("fwversion")),false,null,{left:true}); createText("JPEG Engine: \t\t"+getCameraParam("procversion"),false,null,{left:true}); createText("Net Version: \t\t"+getCameraParam("netversion"),false,null,{left:true}); createText("MAC Address: \t\t"+(qi.mac=getCameraParam("mac")),false,null,{left:true}); if(model.internalpn!=4294967295){ createText("Internal P/N: \t\t"+model.internalpn,false,null,{left:true}); } avutil.remove("menu_picture"); avutil.remove("menu_focus"); avutil.remove("menu_network"); avutil.remove("menu_motion"); avutil.remove("menu_privacy"); avutil.remove("menu_administration"); avutil.remove("menu_sdcard"); } document.getElementById("navMenu").style.visibility="visible"; var _9e=document.getElementById("quick_info"); _9e.innerHTML="

"+"Model "+qi.model+"
"+(qi.firm?"Firmware "+qi.firm:"")+"
"+"MAC  "+qi.mac+"

"; applyVideo(); eventsRegistration(); });