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){ _14.set("disabled",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(); 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(_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); } }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); } }else{ $("#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"); setCameraParam("exposure","on"); }else{ 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; $(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.name.substring(0,4)==="2805"); },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); },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=[],md=[],pm=[],_9=[],_a=[],_b=[],_c=image.fpsMaxVal,_d=accessFull(),qi={}; function _e(_f,_10){ var tmp; if(_f==="get"){ tmp=getCameraParam("fps")||0; return (1<=tmp&&tmp<=_c)?tmp:_c+1; }else{ setCameraParam("fps",(1<=_10&&_10<=_c)?_10:0); } }; function _11(_12,_13){ if(_12==="get"){ return getCameraParam("1080p_mode"); }else{ setCameraParam("1080p_mode",_13); $("#central_region")[0].f1080pChange(); } }; var _14=(function(){ var _15,_16=0,_17=65535; return {maxrate:function(){ return _17; },bool:function(_18,_19){ if(_18==="get"){ _15=_15||Number(getCameraParam("bitrate"))||0; return _15>0; }else{ if(_18==="set"){ _15=_19?_17:0; } } },number:function(_1a,_1b){ if(_1a==="get"){ _15=_15||Number(getCameraParam("bitrate"))||0; return _15; }else{ if(_1a==="set"){ _15=Number(_1b); setCameraParam("bitrate",_15); if(_15==0||_15>=_16){ setCameraParam("bitrate",_15); }else{ alert("Rates less than 100kbps are not allowed."); } } } }}; })(); var _1c=(function(){ var _1d; function _1e(_1f,_20,_21){ var v; if(_20==="get"){ _1d=_1d||getCameraParam("netopt")||0; return (_1d&_1f)!==0; }else{ if(_20==="set"){ _1d=(_21?_1d|_1f:_1d&~_1f); setCameraParam("netopt",_1d); } } }; return {dhcp:function(_22,_23){ return _1e(1,_22,_23); },lockIP:function(_24,_25){ return _1e(8,_24,_25); },limitMTU:function(_26,_27){ return _1e(128,_26,_27); },mcast:function(_28,_29){ return _1e(64,_28,_29); },setter:function(){ setCameraParam("netopt",_1d); }}; })(); var _2a={leftControl:null,topControl:null,width:function(_2b,_2c){ var _2d; if(_2b==="get"){ _2d=getCameraParam("imgwidth"); return Number(_2d)+Number(this.leftControl.getValue()); }else{ if(_2b==="set"){ _2d=Number(_2c)-Number(this.leftControl.getValue()); setCameraParam("imgwidth",_2d); } } },height:function(_2e,_2f){ var _30; if(_2e==="get"){ _30=getCameraParam("imgheight"); return Number(_30)+Number(this.topControl.getValue()); }else{ if(_2e==="set"){ _30=Number(_2f)-Number(this.topControl.getValue()); setCameraParam("imgheight",_30); } } }}; function _31(_32,_33){ return _2a.width(_32,_33); }; function _34(_35,_36){ return _2a.height(_35,_36); }; function _37(_38,_39){ if(_38==="get"){ return getCameraRegister(3,21); }else{ if(_38==="set"){ setCameraRegister(3,21,_39); } } }; var _3a=[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 _3b(_3c,_3d){ var i,sum=0,tmp,_3e,min=10000,_3f; if(_3c==="get"){ for(i=161;i<=170;i++){ sum+=1*getCameraRegister(3,i); } for(tmp=1;tmp<=100;tmp++){ if(_3a[tmp-1]==sum){ break; }else{ _3e=sum-_3a[tmp-1]; if(_3e<0){ _3e=-_3e; } if(_3e100){ tmp=_3f; } if(tmp<40){ tmp=40; } return tmp; }else{ setGamma(antiGamma(_3d)); } }; function _40(_41,_42){ var tmp,val; if(_41==="get"){ tmp=getCameraParam("motiondetect"); }else{ setCameraParam("motiondetect",_42); tmp=_42; } image.mdEnable=(tmp==="on")?1:0; if(image.mdEnable){ dijit.byId("checkBox"+"DisableMD").setValue(false); if(_41==="set"){ val=getCameraParam("mdzonesize"); image.zoneSize=val; dijit.byId("textbox"+"Zone Size").setValue(val); dijit.byId("slider"+"Zone Size").setValue(val); } image.mdTableReady=0; showMDGrid(); }else{ dijit.byId("checkBox"+"DisableMD").setValue(true); } if(_41==="get"){ return tmp; } }; function _43(_44,_45){ var tmp,val; var _46=calculateGrid(); var _47=_46.hor*_46.ver; if(_44==="get"){ val=getCameraParam("mdsensitivity"); tmp=Math.round(val*100/_47); if(tmp>100){ tmp=100; } return tmp; }else{ tmp=Math.round(_45*_47/100); setCameraParam("mdsensitivity",tmp); } }; function _48(_49,_4a){ var tmp,val; if(_49==="get"){ tmp=getCameraParam("mdtotalzones"); }else{ setCameraParam("mdtotalzones",_4a); tmp=_4a; } if(_49==="set"){ image.zbnum=(_4a==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=_43("get",null); dijit.byId("textbox"+"Motion Sensitivity, %").setValue(val); dijit.byId("slider"+"Motion Sensitivity, %").setValue(val); } if(_49==="get"){ return tmp; } }; var _4b,_4c; function _4d(val){ dijit.byId("textbox"+"Focus Aid").setValue(val); }; var _4e,_4f,_50=0; var _51,_52; function _53(){ _4c=1*getCameraParam("focus"); dijit.byId("textbox"+"Focus Aid").setValue(_4c); if(_4c<=1*_4b+10&&_4c>=1*_4b-10){ if(_50==0){ $("#border-table").css("border-color","#FFFF00"); } }else{ if(_4c>_4b){ $("#border-table").css("border-color","#00FF00"); }else{ if(_4c<_4b){ $("#border-table").css("border-color","#FF0000"); } } } _4b=_4c; if(_50==1){ _51=getCameraParam("focus=status"); if(_51!="on"){ clearTimeout(_4f); clearInterval(_4e); $("#border-table").css("border-color","#FFFFFF"); _50=0; if(_51=="toodark"){ _52.setValue("Stopped. Too Dark!"); }else{ _52.setValue("DONE."); } }else{ _52.setValue("In process.."); } } }; function _54(){ clearInterval(_4e); }; function _55(_56,_57){ _4b=setCameraParam(_56,_57); _4d(_4b); if(_56=="zoom"&&dijit.byId("checkBox"+"Enable Auto Focus after zoom").getValue()){ _58(); }else{ clearInterval(_4e); _50=0; _4e=setTimeout(_53,1000); } }; function _58(){ clearInterval(_4e); _50=1; _4e=setInterval(_53,1000); _52.setValue("In process.."); }; function _59(_5a,_5b){ if(_5a==="set"){ if(_5b){ clearInterval(_4e); _50=2; _4e=setInterval(_53,1000); }else{ clearInterval(_4e); $("#border-table").css("border-color","#FFFFFF"); _50=0; } } }; function _5c(){ if(_5d.getValue()=="on"){ var _5e=1*getCameraRegister(3,80),_5f=1*getCameraRegister(3,98); if(_5f<=1){ if(_5e&256){ dijit.byId("textbox"+"Iris Status").setValue("Zoomed In"); }else{ if(_5e&32){ dijit.byId("textbox"+"Iris Status").setValue("Too Dark"); }else{ dijit.byId("textbox"+"Iris Status").setValue("Evaluating"); } } }else{ if(_5f==3||_5f==4){ dijit.byId("textbox"+"Iris Status").setValue("Closing"); }else{ if(_5f==5){ dijit.byId("textbox"+"Iris Status").setValue("Closed"); }else{ if(_5f==6||_5f==7||_5f==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 _60=new String(); var tm=new String(); var _61=dt.getTimezoneOffset(); function _62(){ var _63; var _64; _63=dt.toJSON(); _64=_63.split("T"); _63=_64[0].split("-"); _64=_63[1]+"/"+_63[2]+"/"+_63[0]+" "+_64[1]; _63=_64.split("Z"); _64=_63[0]; _63=_64.split("."); _64=_63[0]; return _64; }; function _65(){ if(!image.freeze){ tm0=getCameraParam("sd_stampspan"); } tm=tm0.split(","); if(tm[0]>2208988800){ dt.setTime((tm[0]-2208988800-_61*60)*1000); _66.setValue(_62()); }else{ _66.setValue("N/A"); } if(tm[1]>2208988800){ dt.setTime((tm[1]-2208988800-_61*60)*1000); _67.setValue(_62()); }else{ if(1*_67){ _67.setValue("N/A"); }else{ _67.setValue("No recording!!"); } } if(image.is_sdPlayback){ tm0=getCameraParam("sd_playbackstamp"); tm=tm0.split(","); if(tm[0]>2208988800){ dt.setTime((tm[0]-2208988800-_61*60)*1000); _68.setValue(_62()); } } }; function _69(_6a,_6b){ var tmp,val; if(_6a==="get"){ var _6c=new Date(); setCameraParam("ntp_timestamp",(_6c.getTime()/1000+2208988800)); tmp=getCameraParam("sd_recording"); }else{ setCameraParam("sd_recording",_6b); tmp=_6b; } if(_6a==="get"){ return tmp; } }; function _6d(_6e,_6f){ if(_6e==="set"){ image.is_sdPlayback=_6f; applyVideo(); if(image.is_sdPlayback==true){ ReadOnlyVisual(_68,true); var _70=Date.parse(_68.getValue())/1000+2208988800; setCameraParam("sd_playbackstamp",_70); }else{ ReadOnlyVisual(_68,false); } } }; function _71(_72,_73){ if(_72==="get"){ tm0=getCameraParam("sd_playbackstamp"); tm=tm0.split(","); if(tm[0]>2208988800){ dt.setTime((tm[0]-2208988800-_61*60)*1000); return _62(); } } }; function _74(_75,_76){ if(_75==="set"){ if(_76=="on"){ image.is_scaling=true; }else{ image.is_scaling=false; } applyVideo(); } }; function _77(_78,_79){ if(_78==="get"){ tmp=getCameraParam("scaling"); return tmp; }else{ setCameraParam("scaling",_79); if(_79=="off"){ ViewScaling.setValue(false); } applyVideo(); } }; function _7a(_7b,_7c){ if(_7b==="get"){ tmp=1*getCameraParam("rotate"); if(tmp==90||tmp==270){ image.is_90rotation=true; } return tmp; }else{ setCameraParam("rotate",_7c); if(_7c==90||_7c==270){ image.is_90rotation=true; }else{ image.is_90rotation=false; } applyVideo(); } }; function _7d(_7e,_7f){ if(_7e==="set"){ image.audioEnable=(_7f=="on")?true:false; } }; function _80(){ if(image.is_sdPlayback){ _6d("set",false); _81.set("label","Click to Play"); mouseMode("set","sd_imgsize"); }else{ _6d("set",true); _81.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")||""); model.production=1*getCameraRegister(6,166); model.internalpn=getCameraParam("model=internal")||""; if(_d){ 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,_3b,40,100,null,true); }else{ createSlider("Gamma",40,100,_3b,40,100,null,true); } if(model.hasRotate90()){ image.flipped=createRadioSet("Rotate Image",_7a,[[0,"0"],[90,"90"],[180,"180"],[270,"270"]],null,true); }else{ image.flipped=createCheckbox("Flip Image","rotate",180,0,null,true); } createCheckbox("Flexible Cropping","cropping","on","off",null,true); createCheckbox("Auto Exposure","autoexp","on","off",null,true); if(model.hasCasinoMode()){ createCheckbox("Casino Mode","casino_mode","on","off",null,true); } createCheckbox("Bandwidth Saving Mode","bandwidthsaving","on","off",null,true); if(model.hasWDR()){ createCheckbox("WDR Motion Compensation","motion_compensation","on","off",null,true); createText("* disabling motion_compensation will improve rolling issue but causing image 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); var _82=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,_82[0],true); createSlider("Low light noise filter (%)",0,100,"spacialfilter",0,100,null,true); if(model.isDualsensor()){ var _83=createRadioSet("Day/Night","daynight",[["auto","Automatic"],["day","Day"],["night","Night"],["dual","Dual Channel Streaming"]],null,true); createSlider("Switching Level",1,100,"nightgain",64,512,_83[0],true); createSlider("Toggle Guard",1,4,"daygain",1,4,_83[0],true,{sliderWidth:"200px"}); createCheckbox("Upscale 1.2MP to 3MP","upscaling","on","off",null,true); }else{ if(model.hasDN()){ var _83=createRadioSet("Day/Night","daynight",[["auto","Automatic"],["day","Day"],["night","Night"]],null,true); model.hasDN()||(disableVisual(_83[0],true),disableVisual(_83[1],true),disableVisual(_83[2],true)); createSlider("Switching Level",1,100,"nightgain",64,512,_83[0],true); createSlider("Toggle Guard",1,4,"daygain",1,4,_83[0],true,{sliderWidth:"200px"}); if(model.hasFocus()){ createCheckbox("Focus after D/N switching","af_dn","on","off",null,true); } if(model.hasIR()){ createCheckbox("Enable IR light at night","ir","on","off",null,true); } } } avutil.createAppend(_1,"br"); if(model.hasAI()){ var _5d=createCheckbox("Enable Auto Iris","autoiris","on","off",null,true); model.hasAI()||disableVisual(_5d,true); createTextBox("Iris Status",null,null,null,function(){ image.irisTimeout=setInterval(_5c,1000); },null,null,false); avutil.createAppend(_1,"br"); }else{ if(model.hasPIris()){ var _5d=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(_5c,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",_11,"on","off",null,true); } } if(model.hasScaling()){ createText("
Downscaling",false,null,{left:true}); EnableScaling=createCheckbox("Enable Scaling",_77,"on","off",null,true); ViewScaling=createCheckbox("View Scaled Video",_74,"on","off",EnableScaling,true); var _2=document.createElement("div"); _1.appendChild(_2); var _84=getCameraParam("scaling_size"); _2.innerHTML="
Scaling Size: "; var _85=document.getElementById("scaling_size"); _85.value=_84; _85.onchange=function(){ setCameraParam("scaling_size",_85.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 _86=createRadioSet("Show Video Type",imageTypeSelection,[[0,"Disable Video"],[1,"MJPEG over HTTP"],[2,"H.264 over RTP/UDP"]],null,true,{noLeadBr:true}); _86[0].onClick=function(){ if(getCameraParam("admin")!="Access denied!"){ disableVisual(_81,true); } }; _86[1].onClick=function(){ if(getCameraParam("admin")!="Access denied!"){ disableVisual(_81,false); } }; _86[2].onClick=function(){ if(getCameraParam("admin")!="Access denied!"){ disableVisual(_81,true); }else{ var _87=prompt("Please enter viewer password:"); if(_87!=null){ image.rtsp_viewer_psd=_87; }else{ image.rtsp_viewer_psd=""; } if(browser()==="Firefox"){ imageReset(); } } }; model.hasH264()||disableVisual(_86[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 _88; if(_d){ _88=[["view","No Control"],["ptz","PTZ"],["backlight","ROI Reference"],["white_balance","ROI White Balance"],["motion","Motion Detection Mask"],["privacy","Privacy Mask"],["focus","Focus Window"],["sd_imgsize","SD Recording ROI"]]; }else{ _88=[["view","No Control"],["ptz","PTZ"]]; } createRadioSet("Control Video with Mouse",mouseMode,_88,null,true); createCheckbox("Auto White Balance","white_balance","on","off",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,_86[1],false)); var dim=getMaxSensorDims(); image.maxsensorwidth=dim.width; image.maxsensorheight=dim.height; _3.push(image.left=_2a.leftControl=createTextBox("Left",0,null,null,"imgleft",null,null,false)); _3.push(image.top=_2a.topControl=createTextBox("Top",0,null,null,"imgtop",null,null,false)); _3.push(image.right=createTextBox("Right",64,null,null,_31,null,null,false)); _3.push(image.bottom=createTextBox("Bottom",64,null,null,_34,null,null,false)); createButton("Preview",applyVideoIfDims,_3,{pre:"br"}); if(_d){ 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:"    "})); _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,_14.maxrate(),null,_14.number,null,null,false,{pre:"    "})); _4.push(image.fps=createSlider("Frames per second",1,_c+1,_e,1,_c+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",_7d,"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(_d){ createButton("Apply ","onSetVideo",_4,{suf:"br"}); } image.rtspLink=createTextBox("Link for external media players","","",null,function(){ },null,null,false,{rtspLinkData:true}); if(_d){ 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 _89; _5.push(_89=createCheckbox("Enable RTP Multicast",_1c.mcast,true,false,null,false)); _5.push(createTextBox("IP Address","","",avutil.ipValidator,"streamip",2,null,false)); _5.push(createTextBox("RTP Port",1,65535,null,"rtpport",null,null,false)); _5.push(createTextBox("SAP Destination IP","","",avutil.ipValidator,"sapip",null,null,false)); if(_d){ createButton(" Apply ","onSet",_5,{suf:"br"}); } avutil.createAppend(_1,"hr"); if(_d){ if(model.hasFocus()){ createText("Zoom & Focus",true,"_focus",{noLeadBr:true}); avutil.createAppend(_1,"hr"); avutil.insertText(_1,"Zoom:"); avutil.createAppend(_1,"br"); var val; createButton("+20",function(){ _55("zoom",20); },null,{pre:""}); createButton("+5",function(){ _55("zoom",5); },null,{pre:""}); createButton("+1",function(){ _55("zoom",1); },null,{pre:""}); avutil.createAppend(_1,"br"); createButton("-20 ",function(){ _55("zoom",-20); },null,{pre:""}); createButton("-5 ",function(){ _55("zoom",-5); },null,{pre:""}); createButton("-1 ",function(){ _55("zoom",-1); },null,{pre:""}); createCheckbox("Enable Auto Focus after zoom","af_zoom","on","off",null,true); avutil.createAppend(_1,"br"); _52=createTextBox("Focus",null,null,null,null,null,null,false); disableVisual(_52,false); ReadOnlyVisual(_52,true); createButton("+20",function(){ _55("focus",20); },null,{pre:""}); createButton("+5",function(){ _55("focus",5); },null,{pre:""}); createButton("+1",function(){ _55("focus",1); },null,{pre:""}); avutil.createAppend(_1,"br"); createButton("-20 ",function(){ _55("focus",-20); },null,{pre:""}); createButton("-5 ",function(){ _55("focus",-5); },null,{pre:""}); createButton("-1 ",function(){ _55("focus",-1); },null,{suf:""}); createButton("  Full-range Focus  ",function(){ _4b=setCameraParam("focus","fullrange"); _4d(_4b); _58(); },null,{pre:"br"}); createButton("Short-range Focus",function(){ _4b=setCameraParam("focus","shortrange"); _4d(_4b); _58(); },null,{pre:"br"}); createButton("    Stop    ",function(){ _55("focus",0); },null,{pre:"br",suf:"br"}); createTextBox("Focus Aid",0,65535,null,"focus",null,null,false); createButton("Update Focus Aid",function(){ _55("focus",0); },null,{pre:""}); createText("* The larger focus aid value indicates better focusing
* Focus window turning GREEN indicates focusing better
* Focus window turning RED indicates focusing worse
* Focus window turning YELLOW indicates no change
* Focus window turning GREY indicates Focusing is done",false,null,{fontSmaller:true}); avutil.createAppend(_1,"br"); avutil.createAppend(_1,"hr"); }else{ if(model.hasFocusAid()){ createText("Focus",true,"_focus",{noLeadBr:true}); avutil.createAppend(_1,"hr"); FocusAidEnable=createCheckbox("Enable Focus Aid",_59,true,false,null,true); createTextBox("Focus Aid",0,65535,null,"focus",null,null,false); 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 _8a; _8.push(_8a=createRadioSet("DHCP/Fixed Selection",_1c.dhcp,[[true,"DHCP"],[false,"Fixed IP"]],null,false)); _8a[0].onClick=function(){ ReadOnlyVisual(_8b,true); ReadOnlyVisual(_8c,true); ReadOnlyVisual(_8d,true); disableVisual(_8e,true); }; _8a[1].onClick=function(){ ReadOnlyVisual(_8b,false); ReadOnlyVisual(_8c,false); ReadOnlyVisual(_8d,false); disableVisual(_8e,false); }; var _8d; var _8b; var _8c; _8.push(_8d=createTextBox("IP Address","","",avutil.ipValidator,"ip",1,null,false)); _8.push(_8b=createTextBox("Subnet Mask","","",avutil.maskValidator,"subnetmask",null,null,false)); _8.push(_8c=createTextBox("Default Gateway","","",avutil.gatewayValidator,"gateway",null,null,false)); if(_1c.dhcp("get")){ ReadOnlyVisual(_8b,true); ReadOnlyVisual(_8c,true); ReadOnlyVisual(_8d,true); } if(_1c.lockIP("get")){ ReadOnlyVisual(_8d,true); disableVisual(_8a[0],true); disableVisual(_8a[1],true); } var _8e; _8.push(_8e=createCheckbox("Lock IP",_1c.lockIP,true,false,null,false)); dojo.connect(_8e,"onClick",function(){ if(_8e.checked){ if(_8d.get("value")===getCameraParam("ip")){ ReadOnlyVisual(_8d,true); disableVisual(_8a[0],true); disableVisual(_8a[1],true); }else{ _8e.set("checked",false); alert("Please enter new IP and save to flash before locking IP"); } }else{ ReadOnlyVisual(_8d,false); disableVisual(_8a[0],false); disableVisual(_8a[1],false); } }); if(_1c.dhcp("get")){ disableVisual(_8e,true); } var _8f; _8.push(_8f=createCheckbox("Limit MTU Size",_1c.limitMTU,true,false,null,false)); _8.push(createTextBox("To",256,1500,null,"mtu",null,_8f,false)); var _90=createButton("Apply & Save to Flash","onSet",_8,{pre:"br",suf:"br"}); avutil.createAppend(_1,"hr"); createText("Ethernet",false,null); var _91=createRadioSet("Link Speed","eth_negotiation",[["auto","Autonegotiation"],["fixed","Fixed 100MBaseT / Full Duplex"]],null,false); var _92=createRadioSet("Multicast Reception","multicast_rec",[["on","Enable"],["off","Disable"]],null,false); _91[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 * 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}); pm.push(createCheckbox("Enable Privacy Mask","pmask","on","off",null,true)); createText("* Select 'Privacy Mask' mouse control.
* 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("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}); _9.push(createTextBox("Admin Password","","",null,function(){ },null,null,false,{password:true,maxLength:16})); _9.push(createTextBox("Confirmation","","",null,function(){ },1,null,false,{password:true,maxLength:16})); createButton("Set",av.pwdStrAdmin,_9,{pre:"br"}); createButton("Erase",av.pwdStrAdmin,null,{suf:"br"}); avutil.createAppend(_1,"br"); createText("Username: \t\tviewer",false,null,{left:true}); _a.push(createTextBox("Viewer Password","","",null,function(){ },null,null,false,{password:true,maxLength:16})); _a.push(createTextBox("Confirmation","","",null,function(){ },2,null,false,{password:true,maxLength:16})); createButton("Set",av.pwdStrViewer,_a,{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"}); avutil.createAppend(_1,"hr"); createUpgradeForm(); avutil.createAppend(_1,"hr"); if(model.hasSDcard()){ createText("SD Card",true,"_sdcard",{noLeadBr:true}); var _68=createTextBox("Playback",null,null,null,_71,null,null,false,{stampData:true}); var _81=createButton("Click to Play",_80,null,{pre:"br",suf:"br"}); var _97=createRadioSet("SD Card Recording:",_69,[["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 _98=createRadioSet("SD Card Image Resolution","sd_imgres",[["half","Half"],["full","Full"]],null,true,{noLeadBr:true}); var _66=createTextBox("Start",null,null,null,function(){ setInterval(_65,1000); },null,null,false,{stampData:true}); ReadOnlyVisual(_66,true); var _67=createTextBox("End",null,null,null,function(){ },null,null,false,{stampData:true}); ReadOnlyVisual(_67,true); var _99=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(_68,true); disableVisual(_81,true); disableVisual(_97[0],true); disableVisual(_97[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(_98[0],true); disableVisual(_98[1],true); disableVisual(_66,true); disableVisual(_67,true); disableVisual(_99,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 _9a=document.getElementById("quick_info"); _9a.innerHTML="

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

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