var isPTZ = "Err::Unknown OID on 1.4.7"; isPTZ = (isPTZ == "YES" || isPTZ == "yes" || isPTZ == "Yes") ? true:false; var isOEM = "0"; isOEM = (isOEM == "1") ? true:false; var requiredMajorVersion = 9; var requiredMinorVersion = 0; var requiredRevision = 0; var libprodID = "7a"; var useFlash = false; var isNav = (navigator.appName == "Netscape"); var isNav6 = (isNav && (parseFloat(navigator.appVersion) >= 5.0)); var isIE = ((navigator.appVersion.indexOf("MSIE") != -1) || (navigator.appVersion.indexOf("Trident") != -1)); var isWin = (navigator.appVersion.indexOf("Win") != -1); var isMac = (navigator.appVersion.indexOf("Mac") != -1); var isNT = (navigator.appVersion.indexOf("Windows NT") != -1); var isOpera = (navigator.userAgent.indexOf("Opera") != -1); if (isOpera) isIE = false; var isMacIE = (isMac && isIE); var isIpod = (navigator.userAgent.indexOf("iPod") != -1); var isIphone = (navigator.userAgent.indexOf("iPhone") != -1); var isIpad = (navigator.userAgent.indexOf("iPad") != -1); var isSafari = (navigator.userAgent.indexOf("Safari") != -1); var NavVers = 0.0; var isW3C = (document.getElementById) ? true:false; var isFirefox = (navigator.userAgent.indexOf("Firefox") != -1); var isOpera = (navigator.userAgent.indexOf("Opera") != -1); var isAndroid = (navigator.userAgent.indexOf("Android") != -1); var isMobile = (isIpod || isIphone); var IE64 = false; var IEVers = 0.0; if (isIE) { var start = navigator.appVersion.indexOf("MSIE"); var end = navigator.appVersion.indexOf(";",start); IEVers = parseFloat(navigator.appVersion.substring(start+4, end)); if (navigator.userAgent.indexOf(" x64;") != -1) { IE64 = true; } } var isMozilla = false; if (isNav) { var start = navigator.userAgent.indexOf("Mozilla/"); NavVers = parseFloat(navigator.userAgent.substring(start+8)); if (NavVers>=5.0) { start = navigator.userAgent.indexOf("Netscape/"); if (start<0) isMozilla = true; else NavVers = parseFloat(navigator.userAgent.substring(start+9)); } } var canSpush = false; if (isIpod || isIphone || isFirefox || isSafari || isOpera) { canSpush = true; } var offsetLeft = 0, offsetTop = 0; if (isIE) { if (isMac) { offsetLeft = 20; offsetTop = 10; if (IEVers > 4.5) { offsetLeft = 10; offsetTop = 80; } } else { offsetLeft = 30; offsetTop = 75; } } Encoder = { EncodeType : "numerical", isEmpty : function(val){ if(val){ return ((val===null) || val.length==0 || /^\s+$/.test(val)); }else{ return true; } }, HTML2Numerical : function(s){ var arr1 = new Array(' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','à','á','â','ã','Ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','Ö','×','ø','ù','ú','û','Ü','ý','þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','Ø','ù','ú','û','ü','ý','þ','ÿ','"','&','<','>','œ','œ','š','š','ÿ','ˆ','˜',' ',' ',' ','‌','‍','‎','‏','–','—','‘','’','‚','“','”','„','†','†','‰','‹','›','€','ƒ','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','ϑ','ϒ','ϖ','•','…','′','′','‾','⁄','℘','ℑ','ℜ','™','ℵ','←','↑','→','↓','↔','↵','←','↑','→','↓','↔','∀','∂','∃','∅','∇','∈','∉','∋','∏','∑','−','∗','√','∝','∞','∠','∧','∨','∩','∪','∫','∴','∼','≅','≈','≠','≡','≤','≥','⊂','⊃','⊄','⊆','⊇','⊕','⊗','⊥','⋅','⌈','⌉','⌊','⌋','⟨','⟩','◊','♠','♣','♥','♦'); var arr2 = new Array(' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','"','&','<','>','Œ','œ','Š','š','Ÿ','ˆ','˜',' ',' ',' ','‌','‍','‎','‏','–','—','‘','’','‚','“','”','„','†','‡','‰','‹','›','€','ƒ','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','ϑ','ϒ','ϖ','•','…','′','″','‾','⁄','℘','ℑ','ℜ','™','ℵ','←','↑','→','↓','↔','↵','⇐','⇑','⇒','⇓','⇔','∀','∂','∃','∅','∇','∈','∉','∋','∏','∑','−','∗','√','∝','∞','∠','∧','∨','∩','∪','∫','∴','∼','≅','≈','≠','≡','≤','≥','⊂','⊃','⊄','⊆','⊇','⊕','⊗','⊥','⋅','⌈','⌉','⌊','⌋','〈','〉','◊','♠','♣','♥','♦'); return this.swapArrayVals(s,arr1,arr2); }, NumericalToHTML : function(s){ var arr1 = new Array(' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','"','&','<','>','Œ','œ','Š','š','Ÿ','ˆ','˜',' ',' ',' ','‌','‍','‎','‏','–','—','‘','’','‚','“','”','„','†','‡','‰','‹','›','€','ƒ','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','ϑ','ϒ','ϖ','•','…','′','″','‾','⁄','℘','ℑ','ℜ','™','ℵ','←','↑','→','↓','↔','↵','⇐','⇑','⇒','⇓','⇔','∀','∂','∃','∅','∇','∈','∉','∋','∏','∑','−','∗','√','∝','∞','∠','∧','∨','∩','∪','∫','∴','∼','≅','≈','≠','≡','≤','≥','⊂','⊃','⊄','⊆','⊇','⊕','⊗','⊥','⋅','⌈','⌉','⌊','⌋','〈','〉','◊','♠','♣','♥','♦'); var arr2 = new Array(' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','à','á','â','ã','Ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','Ö','×','ø','ù','ú','û','Ü','ý','þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','Ø','ù','ú','û','ü','ý','þ','ÿ','"','&','<','>','œ','œ','š','š','ÿ','ˆ','˜',' ',' ',' ','‌','‍','‎','‏','–','—','‘','’','‚','“','”','„','†','†','‰','‹','›','€','ƒ','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','ϑ','ϒ','ϖ','•','…','′','′','‾','⁄','℘','ℑ','ℜ','™','ℵ','←','↑','→','↓','↔','↵','←','↑','→','↓','↔','∀','∂','∃','∅','∇','∈','∉','∋','∏','∑','−','∗','√','∝','∞','∠','∧','∨','∩','∪','∫','∴','∼','≅','≈','≠','≡','≤','≥','⊂','⊃','⊄','⊆','⊇','⊕','⊗','⊥','⋅','⌈','⌉','⌊','⌋','⟨','⟩','◊','♠','♣','♥','♦'); return this.swapArrayVals(s,arr1,arr2); }, numEncode : function(s){ if(this.isEmpty(s)) return ""; var e = ""; for (var i = 0; i < s.length; i++) { var c = s.charAt(i); if (c < " " || c > "~") { c = "&#" + c.charCodeAt() + ";"; } e += c; } return e; }, htmlDecode : function(s){ var c,m,d = s; if(this.isEmpty(d)) return ""; d = this.HTML2Numerical(d); arr=d.match(/&#[0-9]{1,5};/g); if(arr!=null){ for(var x=0;x= -32768 && c <= 65535){ d = d.replace(m, String.fromCharCode(c)); }else{ d = d.replace(m, ""); } } } return d; }, htmlEncode : function(s,dbl){ if(this.isEmpty(s)) return ""; dbl = dbl | false; if(dbl){ if(this.EncodeType=="numerical"){ s = s.replace(/&/g, "&"); }else{ s = s.replace(/&/g, "&"); } } s = this.XSSEncode(s,false); if(this.EncodeType=="numerical" || !dbl){ s = this.HTML2Numerical(s); } s = this.numEncode(s); if(!dbl){ s = s.replace(/&#/g,"##AMPHASH##"); if(this.EncodeType=="numerical"){ s = s.replace(/&/g, "&"); }else{ s = s.replace(/&/g, "&"); } s = s.replace(/##AMPHASH##/g,"&#"); } s = s.replace(/&#\d*([^\d;]|$)/g, "$1"); if(!dbl){ s = this.correctEncoding(s); } if(this.EncodeType=="entity"){ s = this.NumericalToHTML(s); } return s; }, XSSEncode : function(s,en){ if(!this.isEmpty(s)){ en = en || true; if(en){ s = s.replace(/\'/g,"'"); //no HTML equivalent as &apos is not cross browser supported s = s.replace(/\"/g,"""); s = s.replace(//g,">"); s = s.replace(/\\/g,"\"); // no HTML equivalent for backslash }else{ s = s.replace(/\'/g,"'"); //no HTML equivalent as &apos is not cross browser supported s = s.replace(/\"/g,"""); s = s.replace(//g,">"); s = s.replace(/\\/g,"\"); // no HTML equivalent for backslash } return s; }else{ return ""; } }, // returns true if a string contains html or numerical encoded entities hasEncoded : function(s){ if(/&#[0-9]{1,5};/g.test(s)){ return true; }else if(/&[A-Z]{2,6};/gi.test(s)){ return true; }else{ return false; } }, // will remove any unicode characters stripUnicode : function(s){ return s.replace(/[^\x20-\x7E]/g,""); }, // corrects any double encoded & entities e.g &amp; correctEncoding : function(s){ return s.replace(/(&)(amp;)+/,"$1"); }, // Function to loop through an array swaping each item with the value from another array e.g swap HTML entities with Numericals swapArrayVals : function(s,arr1,arr2){ if(this.isEmpty(s)) return ""; var re; if(arr1 && arr2){ //ShowDebug("in swapArrayVals arr1.length = " + arr1.length + " arr2.length = " + arr2.length) // array lengths must match if(arr1.length == arr2.length){ for(var x=0,i=arr1.length;x ' + 'IQrecorder '+writeRec(disabled_flag) + ''; return out; } //example of using the html encode object // set the type of encoding to numerical entities e.g & instead of & //Encoder.EncodeType = "numerical"; // HTML encode text from an input element // This will prevent double encoding. // var encoded = Encoder.htmlEncode(document.getElementById('input')); // To encode but to allow double encoding which means any existing entities such as // & will be converted to &amp; // var dblEncoded = Encoder.htmlEncode(document.getElementById('input'),true); // Decode the now encoded text //var decoded = Encoder.htmlDecode(encoded); // if true, needs serverpush applet because browser unable to display // serverpush // var needsApplet = (isIE && !isMac) || isNav6 || isOpera; var needsApplet = isIE || isNav6 || isOpera; if (canSpush) needsApplet = false; // if true, needs iframes for getting output from // setting commands. This is because Java wasn't working well var needsIframe = isMac; function propsAlert(arg, freq) { var i; var count=0; if (!freq) freq = 20; var str = ""; arg = getObject(arg); for (i in arg) { if (i=="innerHTML") str += i+ ":[deleted to save output]\n"; else str += i + ":" + arg[i] + "\n"; if (i == "style") { for (var j in arg.style) { str += "style " + j + ":" + arg.style[j] + "\n"; count++; if (count%freq == 0) { alert(str); str=""; } } } count++; if (count%freq == 0) { alert(str); str=""; } } alert(str); } function arrayAlert(arg) { if (!arg) { alert(arg + " does not exist"); return; } if (!arg.length) { alert(arg + " does not have a length"); return; } for (var ind=0; ind24) || (arr[2]>60)) return false; return true; } function isAnIPAddress(field) { if (field.type != "text") return false; if (field.value.length == 0) return true; var exp = new RegExp("(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$"); var arr = field.value.match(exp); if (arr == null) return false; if (arr[1] > 255) return false; if (arr[2] > 255) return false; if (arr[3] > 255) return false; if (arr[4] > 255) return false; return true; } function isAPassword(field) { if (field == null) return false; if (field.type != "text" && field.type!="password") return false; var val = field.value; if (val == null) return false; if (val.length == 0) return true; if (val.length > 32) return false; var exp = /[^\x21-\x7E]/; if (val.match(exp)) return false; return true; } function getObject(obj) { var theObj = null; if (typeof obj=="object") return obj; if (typeof obj=="string") { var str = (document.all) ? "document.all." + obj:"document." + obj; if (eval(str)) theObj = eval(str); } if (isW3C && !theObj) return document.getElementById(obj); return theObj; } function de(elem) { return document.getElementById(elem); } function getImObj(obj) { var theObj = eval("document."+obj); if (isW3C && !theObj) theObj = document.getElementById(obj); if (!theObj) return null; return theObj; } function hide(obj) { var theObj = getObject(obj); if (!theObj) return; if (theObj.visibility) theObj.visibility = "hidden"; else theObj.style.visibility="hidden"; } function show(obj) { var theObj = getObject(obj); if (!theObj) return; if (theObj.visibility) theObj.visibility = "visible"; else theObj.style.visibility="visible"; } var delay_list=new Array(); function delayEcam2(name, val) { var obj=new Object(); obj.name=name; obj.val=val; delay_list.push(obj); } function issueDelayedEcam2() { var obj=delay_list.shift(); if(obj != null) { setEcam2(obj.name,obj.val); } } function theSendState() { return de("sendState"); } function showEmptySendState() { if (theSendState()) theSendState().innerHTML = " "; } function showSending() { if (theSendState()) theSendState().innerHTML = "SENDING"; } function showWaiting() { if (!theSendState()) return; if (theSendState().innerHTML.indexOf("SEND") >= 0) { theSendState().innerHTML = "WAITING"; } } function showCompleted() { status = "completed sending command to camera"; if (theSendState()) { if(AjaxGetOidValSync("1.2.41.2").indexOf("disabled") >= 0) { if (theSendState().innerHTML.indexOf("SEND") < 0) { theSendState().innerHTML += "."; } setTimeout("showCompleted()", 1000); return; } else { theSendState().innerHTML = "COMPLETED"; issueDelayedEcam2(); } } setTimeout("scheduleEmptySendState()", 1000); } function pollForImagingReady() { if(AjaxGetOidValSync("1.2.41.2").indexOf("disabled") > 0) { showWaiting(); setTimeout("pollForImagingReady()",1000); return; } reloadLater(); } if("enabled".indexOf("disabled") >= 0) { setTimeout("pollForImagingReady()",250); } function scheduleEmptySendState() { if (!theSendState()) return; if (theSendState().innerHTML.indexOf("WAIT") >= 0 || theSendState().innerHTML.indexOf("SEND") >= 0 || theSendState().innerHTML.indexOf("COMPLETE") >= 0) { showEmptySendState(); status = ""; } else setTimeout("scheduleEmptySendState()",100); } function transferCompleted() { if (!theSendState()) return true; if (theSendState().innerHTML.indexOf("SEND") >= 0) return false; if (theSendState().innerHTML.indexOf("WAIT") >= 0) return false; return true; } function getObjectLeft(obj) { var theObj = getObject(obj); if (!theObj) return 0; if (theObj.style && theObj.style.pixelLeft != null) return theObj.style.pixelLeft+ offsetLeft; var rv = theObj.offsetLeft; if (rv) return rv - 0 + offsetLeft; return theObj.x + offsetLeft; } function getObjectTop(obj) { var theObj = getObject(obj); if (!theObj) return; if (theObj.style && theObj.style.pixelTop != null) return theObj.style.pixelTop + offsetTop; var rv = theObj.offsetTop; if (rv) return rv - 0 + offsetTop; return theObj.y; } function getObjectVis(obj) { var theObj = getObject(obj); if (!theObj) return; if (theObj.style) return theObj.style.visibility; else return theObj.visibility; } function isHiding(obj) { var vis = getObjectVis(obj); if (vis == "hide" || vis =="hidden" || vis == "") return true; return false; } function getClickX(evt) { if (evt.pageX) return evt.pageX + offsetLeft; if (isMacIE) { return window.event.offsetX + offsetLeft + document.body.scrollLeft; } return window.event.offsetX + offsetLeft; } function getClickY(evt) { if (evt.pageY) return evt.pageY + offsetTop; if (isMacIE) return window.event.offsetY + offsetTop + document.body.scrollTop; return window.event.offsetY + offsetTop; } var webport = "80"; var https_port = "443"; var hostname = window.location.hostname; function loadIndexPage() { var loc; if (document.location.protocol == 'http:') { loc = "http://" + hostname; if (webport != "80") loc += ":" + webport; } else { loc = "https://" + hostname; if (https_port != "443") loc += ":" + https_port; } loc += "/"; window.location.href = loc; } function logout() { var expires = new Date(); SetCookie("SrvrCreds", "00000000000000000000000000000000", expires, "/"); loadIndexPage(); return false; } function reboot() { setEcam2("OidCB2.11","ON"); setTimeout('loadIndexPage()',90000); alert("The camera is being rebooted.  The main webpage will load after the reboot is completed."); return false; } function factoryReboot() { setEcam2("OidCB2.13","ON"); setTimeout('loadIndexPage()',90000); alert("The camera is being rebooted.  The main webpage will load after the reboot is completed."); return false; } function logoutLater() { status = "waiting for commands to complete before logging out"; if (transferCompleted()) { status = ""; logout(); } else setTimeout("logoutLater();", 100); } function reloadLater() { status = "waiting for commands to complete before reloading page"; if (transferCompleted()) { var oldhref = window.location.href; var start = oldhref.indexOf("?dummy"); var newhref; if (start>=0) { var newver = oldhref.substring(start+7)-0+1; newhref = oldhref.substring(0,start)+"?dummy=" + newver; } else { newhref = oldhref+"?dummy=0"; } if (document.images) { window.location.replace(newhref); } else window.location.href = newhref; status = ""; } else setTimeout("reloadLater();", 100); } var loadLaterLocation = ""; function loadLater(loc) { status = "waiting for commands to complete before reloading page"; if (transferCompleted()) { if (document.images) { window.location.replace(loc); } else window.location.href = loc; status = ""; } else { if (!loadLaterLocation) loadLaterLocation = loc; setTimeout("loadLater(loadLaterLocation);", 100); } } function checkTransfer() { if (! transferCompleted()) { window.open("incomplt.html","incomplete", "height=400,width=600,scrollbars"); } return false; } function factory(setting, value, phrase) { var msg = "This will set all " + phrase + " settings to factory default values.\r\nDo you want to continue?"; if (confirm(msg)) { setEcam2(setting, value); reloadLater(); } return false; } var helpwin = null; function helpMe(section) { if (!helpwin || helpwin.closed) { helpwin = window.open("help."+'en-US'+".html#" + section, "helpwin", "height=600,width=600,scrollbars"); } else { helpwin.location.hash = section; helpwin.focus(); } return false; } var PageTitle = "Missing Page Title"; var PageHelp = "Missing Page Help"; function helpMeAuto(section) { newwindow2=window.open('','name','height=600,width=600,scrollbars,resizable'); var doc = newwindow2.document; doc.open(); doc.write('IQA32WA IQEYE364261: Help'); doc.write(''); doc.write(''); doc.write(''); doc.write(''); doc.write(''); doc.write(' '); doc.write(''); doc.write(''); doc.write(' '); doc.write(''); doc.write(''); doc.write(''); doc.write(''); doc.write(' '); doc.write(' '); doc.write(''); doc.write(''); doc.write('
'); doc.write('
'); doc.write(''+PageTitle+'
'); doc.write(PageHelp); AssembleHelp (doc); doc.write('
'); doc.write(''); doc.close(); if (!isFirefox) newwindow2.location.hash = section; newwindow2.focus(); return false; } function AssembleHelp (doc) { var arrElements = document.getElementsByTagName("td"); for (var i=0; i'); } doc.write('

'+element.attributes["helpsub"].value+'

'); if (element.attributes["myhelp"]) { doc.write (element.attributes["myhelp"].value); } } else if (element.attributes["helpbold"]) { doc.write('

'+element.attributes["helpbold"].value+': '); if (element.attributes["myhelp"]) { doc.write (element.attributes["myhelp"].value); } } else if (element.attributes["help_li_start"]) { doc.write('

  • '+element.attributes["help_li_start"].value+': '); if (element.attributes["myhelp"]) { doc.write (element.attributes["myhelp"].value+'
  • '); } } else if (element.attributes["help_li"]) { doc.write('
  • '+element.attributes["help_li"].value+': '); if (element.attributes["myhelp"]) { doc.write (element.attributes["myhelp"].value+'
  • '); } } else if (element.attributes["help_li_end"]) { doc.write('
  • '+element.attributes["help_li_end"].value+': '); if (element.attributes["myhelp"]) { doc.write (element.attributes["myhelp"].value+'
'); } } } } function formatIsValid(field) { return true; } function preSetEcam() { return; } function postSetEcam(field) { return; } function setEcam(field) { if (! formatIsValid(field)) return false; preSetEcam(field); var fname = field.name; var ftype = field.type; var fval = field.value; if (ftype == "select-one") { fval = field.options[field.selectedIndex].value; if (fval == null || fval.length == 0) { fval = field.options[field.selectedIndex].text; } } else if (ftype == "text") { } else if (ftype == "password") { } else if (ftype == "checkbox") fval = (field.checked)? "enabled":"disabled"; if (fval.match("&") || (ftype == "text")) fval = '"' + fval + '"'; setEcam2(fname, escape(fval)); postSetEcam(field); return false; } var commandBufferSize = 40; var commandBuffer = new Array(); for (var i=0; i -1) { commandBuffer[ind].output = iframeText(); setTimeout("window.commandIframe.location.href='get.oid?2.27';",500); } else if (newhref.indexOf(commandBuffer[ind].name) > -1) { commandBuffer[ind].output = iframeText(); } else if (newhref.indexOf(window.location.href) > -1) { setTimeout("window.commandIframe.location.href='get.oid?2.27';",500); commandBuffer[ind].output = 'netscape7 bug'; } else setTimeout("getReplyFromIframe(" + ind + ")", 100); } function getOIDFromIframe(name) { if (!window.commandIframe) return null; if (window.commandIframe.location.href) { if (window.commandIframe.location.href.indexOf("get.oid?" + name) > -1) return iframeText(); if (window.commandIframe.location.href.indexOf(window.location.href) > -1) return null; } setTimeout("getOIDFromIframe('" + name + "')",100); } function sendCommand(ind) { var name = commandBuffer[ind].name; var val = commandBuffer[ind].val; commandBuffer[ind].output = null; if (needsIframe) { if (!window.commandIframe) return; var name = commandBuffer[ind].name; var val = commandBuffer[ind].val; var href = "set.oid?" + name + "=" + val; window.status = "setting " + href; window.commandIframe.location.href = href; getReplyFromIframe(ind); } else { AjaxSetOid (name, val, ind); } getCommandOutput(ind); } function getCommandOutput(ind) { var output = commandBuffer[ind].output; if (output != null) { var start = output.indexOf("%"); if (start == -1) start = output.indexOf("Error"); if (start != -1) { var stop = output.toLowerCase().indexOf(""); var msg = output.substring(start, stop); if (msg.indexOf("%Info") != -1) { window.status = msg; } else alert(msg); } showCompleted(); commandBuffer[ind].name = null; } else if (needsIframe) setTimeout("getCommandOutput(" + ind + ")", 100); } function getOIDVal(oidnum) { var output; if (needsIframe) { if (!window.commandIframe) return null; window.commandIframe.location.href = "get.oid?" + oidnum; output = getOIDFromIframe(oidnum); output = null; } else { output = AjaxGetOidValSync (oidnum); } if (output == null) return ""; var loutput = output.toLowerCase(); var start = loutput.indexOf(""); if (start == -1) return ""; var stop = loutput.indexOf(""); return msg = output.substring(start+5, stop); } function setEcam2(name, val) { var sendState=theSendState(); if (sendState) { if (sendState.innerHTML.indexOf("WAIT") >= 0) { delayEcam2(name,val); return false; } showSending(); status = "sending command to camera"; setTimeout("showWaiting()", 250); } var ind = 0; while (commandBuffer[ind].name != null) ind = (++ind)%commandBufferSize; commandBuffer[ind].name = name; commandBuffer[ind].val = val; setTimeout("sendCommand(" + ind + ");",1); return false; } function submit(n0,v0) { if (arguments.length<=2) return setEcam2(n0,v0); var val=v0; for (var n=2;n"); var stop = str.indexOf (""); if (start > 0 && (stop > start)) { result = str.substring (start+5, stop); } return result; } var AjaxErrs = new Array(); AjaxErrs[12001] = "out of handles"; AjaxErrs[12002] = "internet timeout"; AjaxErrs[12003] = "extended error"; AjaxErrs[12004] = "internal error"; AjaxErrs[12005] = "invalid url"; AjaxErrs[12006] = "unrecognized scheme"; AjaxErrs[12007] = "name not resolved"; AjaxErrs[12012] = "internet shutdown"; AjaxErrs[12016] = "invalid operation"; AjaxErrs[12017] = "operation canceled"; AjaxErrs[12018] = "incorrect handle type"; AjaxErrs[12019] = "incorrect handle state"; AjaxErrs[12020] = "no proxy request"; AjaxErrs[12021] = "registry value not found"; AjaxErrs[12022] = "bad registry param"; AjaxErrs[12023] = "no direct access available"; AjaxErrs[12024] = "no context supplied"; AjaxErrs[12025] = "no callback"; AjaxErrs[12026] = "request pending"; AjaxErrs[12027] = "incorrect format"; AjaxErrs[12028] = "item not found"; AjaxErrs[12029] = "cannot connect"; AjaxErrs[12030] = "connection aborted"; AjaxErrs[12031] = "connection reset"; AjaxErrs[12032] = "force retry"; AjaxErrs[12033] = "invalid proxy"; AjaxErrs[12036] = "internet handle exists"; AjaxErrs[12150] = "no http headers"; AjaxErrs[12151] = "no returned headers"; AjaxErrs[12152] = "http invalid server response"; AjaxErrs[12153] = "http invalid header"; AjaxErrs[12154] = "http invalid query"; AjaxErrs[12155] = "http header exists"; AjaxErrs[12156] = "redirect failed"; function AjaxCheckReady () { var code; var text; if (AjaxAsyncRequest.readyState == 4) { if (AjaxAsyncRequest.status == 200) { var result; result = AjaxParseResponse (); if (result) { code = 0; text = result; } else { code = 1; text = "Unable to parse response"; } } else if (AjaxAsyncRequest.status == 404) { code = 2; text = "Request URL does not exist"; } else { if (AjaxAsyncRequest.status == 12029) { code = 4; text = "Request timeout"; } else { code = 5; text = "XML Error: status code is " + AjaxAsyncRequest.status; if (AjaxErrs[AjaxAsyncRequest.status] != undefined) text += ": " + AjaxErrs[AjaxAsyncRequest.status]; } } AjaxDone (code, AjaxAsyncRequest.status, text); } } function AjaxGetOid (oid) { if (!AjaxAsyncRequest) { if (AjaxInitAsync () == false) return false; } var url = "get.oid?" + oid; AjaxAsyncRequest.open ("GET", url, true); AjaxAsyncRequest.onreadystatechange = AjaxCheckReady; AjaxAsyncRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); AjaxAsyncRequest.send(null); return true; } function AjaxDone (result_code, http_status, result_text) {} function AjaxGetOidValSync (oid) { if (!AjaxSyncRequest) { if (AjaxInitSync () == false) return false; } var url = "get.oid?" + oid; AjaxSyncRequest.open ("GET", url, false); AjaxSyncRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); AjaxSyncRequest.send(null); if (AjaxSyncRequest.readyState == 4 && AjaxSyncRequest.status == 200) { return AjaxSyncRequest.responseText; } return null; } function AjaxSetOid (oid, val, ind) { if (!AjaxSyncRequest) { if (AjaxInitSync () == false) return false; } var url = "set.oid?" + oid + "=" + val; AjaxSyncRequest.open ("GET", url, false); AjaxSyncRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); AjaxSyncRequest.send(null); if (AjaxSyncRequest.readyState == 4) { if (AjaxSyncRequest.status == 200) { commandBuffer[ind].output = AjaxSyncRequest.responseText; } } return true; } function SetCookie(name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function GetCookie(Name) { var search = Name + "="; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(offset, end)); } } return null; } function DeleteCookie (name) { if (GetCookie (name)) document.cookie = name + "=" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } var UsingActiveX = -1; function UseActiveX () { if (useFlash) return 1; if (UsingActiveX >= 0) { return UsingActiveX; } if (isIE && isWin) { var val = GetCookie("activex"); if (val == null) { var now = new Date(); now.setTime(now.getTime() + 1000*60*60*24*365*1000); if (isIE ){ SetCookie("activex","1",now); UsingActiveX = 1; } else { SetCookie("activex","0",now); UsingActiveX = 0; } } else { if (val) UsingActiveX = 1; else UsingActiveX = 0; } } else UsingActiveX = 0; return UsingActiveX; } function CreateApplet (DivID, app_string) { var d = document.getElementById (DivID); d.innerHTML = app_string; } function CreateActiveXControl (DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString, id, noport) { if (useFlash) { CreateFlashControl(DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString, id); } else if (canSpush) { var now = new Date(); var outString = ''; var d = document.getElementById(DivID); if (d) d.innerHTML = outString; } else if (IE64) { var d = document.getElementById(DivID); if (d) d.innerHTML = "Streaming with 64-bit IE not supported. Use 32-bit."; } else { CreateActiveX(DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString, id, noport); } } var AxIdBase; if (!isOEM) { AxIdBase = ' CLASSID="CLSID:EF991872-9158-4570-A7FF-E7DBB6A4B8E9" CODEBASE="'+location.protocol+'//'+location.host+'/'; AxIdBase += 'iqweb.ocx#Version=1,0,6,0"'; AxIdBase264 = ' CLASSID="CLSID:0F552A36-CECA-43ac-B7A7-E1C1C8B1B0D1" CODEBASE="'+location.protocol+'//'+location.host+'/'; AxIdBase264 += 'iqweb264.cab#Version=1,0,6,1"'; } else { AxIdBase = ' CLASSID="CLSID:D8A88EF3-4BB8-4943-808E-2D0CC3AAC299" CODEBASE="'+location.protocol+'//'+location.host+'/'; AxIdBase += 'camweb.ocx#Version=1,0,6,0"'; AxIdBase264 = ' CLASSID="CLSID:CCB691A8-4694-481b-A752-DF01E46A8E19" CODEBASE="'+location.protocol+'//'+location.host+'/'; AxIdBase264 += 'camweb264.cab#Version=1,0,5,1"'; } function EnableOur264 () { AxIdBase = AxIdBase264; } function CreateActiveX(DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString, id, noport) { var outString = '\n' + '\n' + '\n' + '\n' + '\n'; if (!noport) { outString += '\n'; } outString += logging + streamDptzParam; outString += '\n'; outString += '
ActiveX Camera Control' + '' + '
Error' + '
The ActiveX Control did not load' + '
Click here' + ' to display with a Java Applet instead.' + '
\n'; var d = document.getElementById(DivID); if (d) d.innerHTML = outString; } function Create264RecordControl (DivID, url, id, noport) { var outString = '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + + ''; if (!noport) { outString += '\n'; } outString += '\n'; outString += '
ActiveX Recording Control' + '' + '
Error' + '
The ActiveX Control did not load' + '
\n'; var d = document.getElementById(DivID); if (d) d.innerHTML = outString; } function Destroy264RecordControl (DivID) { return; var d = document.getElementById(DivID); if (d) d.innerHTML = ""; } function CreateAudioControl (DivID, id, noport) { var outString = '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + + ''; if (!noport) { outString += '\n'; } outString += '
ActiveX Audio Control' + '' + '
Error' + '
The ActiveX Control did not load' + '
\n'; var d = document.getElementById(DivID); if (d) d.innerHTML = outString; } function GetPlayerVersion() { var UNDEF = "undefined"; var SHOCKWAVE_FLASH = "Shockwave Flash"; var SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash"; var FLASH_MIME_TYPE = "application/x-shockwave-flash"; var OBJECT = "object"; var playerVersion = [0,0,0]; var win = window; var doc = document; var nav = navigator; var d = null; if (typeof nav.plugins != UNDEF && (typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT || typeof nav.plugins[SHOCKWAVE_FLASH+" 2.0"] == OBJECT)) { var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; d = nav.plugins[SHOCKWAVE_FLASH + swVer2].description; if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0; } } else if (typeof win.ActiveXObject != UNDEF) { var a = null, fp6Crash = false; try { a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7"); } catch(e) { try { a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6"); playerVersion = [6,0,21]; a.AllowScriptAccess = "always"; } catch(e) { if (playerVersion[0] == 6) { fp6Crash = true; } } if (!fp6Crash) { try { a = new ActiveXObject(SHOCKWAVE_FLASH_AX); } catch(e) {} } } if (!fp6Crash && a) { try { d = a.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } catch(e) {} } } return playerVersion; } function hasPlayerVersion(reqMajorVer, reqMinorVer, reqRevision) { var pv = GetPlayerVersion(); return (pv[0] > reqMajorVer || (pv[0] == reqMajorVer && pv[1] > reqMinorVer) || (pv[0] == reqMajorVer && pv[1] == reqMinorVer && pv[2] >= reqRevision)) ? true : false; } function CreateFlashControl (DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString, id) { var hasRequestedVersion = hasPlayerVersion(requiredMajorVersion, requiredMinorVersion, requiredRevision); if (hasRequestedVersion) { var attributes=imAttr.split(" "); var i; var startIdx; var endIdx; var myOffsetX = 0; var myOffsetY = 0; var displayAreaWidth; var displayAreaHeight; var myImgWidth; var myImgHeight; var locationAndSize; var windowMode="window"; for(i in attributes) { if(attributes[i].indexOf("width")>=0) { startIdx = attributes[i].indexOf("\""); endIdx = attributes[i].lastIndexOf("\""); displayAreaWidth= parseInt(attributes[i].substring(startIdx+1, endIdx)); myImgWidth = displayAreaWidth; } else if(attributes[i].indexOf("height")>=0) { startIdx = attributes[i].indexOf("\""); endIdx = attributes[i].lastIndexOf("\""); displayAreaHeight= parseInt(attributes[i].substring(startIdx+1, endIdx)); myImgHeight = displayAreaHeight; } } if(streamDptzParam != null) { if (streamDptzParam.indexOf("Windowless")>=0) { windowMode = "opaque"; } if (streamDptzParam.indexOf("OffsetX")>=0) { var params = streamDptzParam.split("<"); var valueStr = "value=\""; var valueStrLen = valueStr.length; for(j in params) { if(params[j] != null) { if (params[j].indexOf("OffsetX")>=0) { startIdx = params[j].indexOf(valueStr)+valueStrLen; endIdx = params[j].lastIndexOf("\""); myOffsetX = parseInt(params[j].substring(startIdx, endIdx)); } else if (params[j].indexOf("OffsetY")>=0) { startIdx = params[j].indexOf(valueStr)+valueStrLen; endIdx = params[j].lastIndexOf("\""); myOffsetY = parseInt(params[j].substring(startIdx, endIdx)); } else if (params[j].indexOf("DisplayWidth")>=0) { startIdx = params[j].indexOf(valueStr)+valueStrLen; endIdx = params[j].lastIndexOf("\""); myImgWidth = parseInt(+params[j].substring(startIdx, endIdx)); } else if (params[j].indexOf("DisplayHeight")>=0) { startIdx = params[j].indexOf(valueStr)+valueStrLen; endIdx = params[j].lastIndexOf("\""); myImgHeight = parseInt(+params[j].substring(startIdx, endIdx)); } } } } } locationAndSize = "offsetX="+myOffsetX + "&"+ "offsetY="+myOffsetY + "&" + "imgWidth="+myImgWidth + "&" + "imgHeight="+myImgHeight; window.id = document.forms[0].id; var flashElementStr = AC_FL_RunContent( "id", id, "wmode", windowMode, "src", "FlashLiveImagePlayer", "width", displayAreaWidth, "height", displayAreaHeight, "align", "middle", "quality", "high", "bgcolor", "#869ca7", "name", "FlashLiveImagePlayer", "allowScriptAccess","always", "type", "application/x-shockwave-flash", "pluginspage", "http://www.adobe.com/go/getflashplayer", "imgstr", imageString, "locationandsize", locationAndSize); var d = document.getElementById(DivID); if (d) d.innerHTML = flashElementStr; } else { var alternateContent = 'This content requires the Adobe Flash Player. ' + 'Get Flash'; document.write(alternateContent); } } function CreateControl (DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString) { var doingHttps; if (self.location.protocol == "https:") doingHttps = true; else doingHttps = false; CreateActiveXControl(DivID, imAttr, logging, streamDptzParam, isCamera_6, isCamera_7, imageString, "Camera1", 1); } function CreateCameoControl (DivID, imAttr, imageString, id, windowless) { var param = '\n' + '\n' + '\n' + '\n' + '\n'; CreateActiveXControl (DivID, imAttr, "", param, false, true, imageString, id, 1); } var PrimaryH264Width = '1920'; var PrimaryH264Height = '1080'; var SecondaryH264Width = '1'; var SecondaryH264Height = '1'; var is16by9 = ("16:9" == "16:9"); function CreateQT264Control (DivID, id, res) { var outstring; var width, height; if (res == "low" && SecondaryH264Width <= 1) res = "hi"; if (res == "low") { width = SecondaryH264Width; height = SecondaryH264Height; } else { width = PrimaryH264Width; height = PrimaryH264Height; } if (width > 640) { width /= 2; height /= 2; } var url = "rtsp://"+location.host+"/rtsp/now.mp4"; if (res == "low") url += "?res=low"; outstring = ''; outstring += ''; outstring += ''; outstring += ''; outstring += ''; outstring += ''; outstring += ''; outstring += ''; outstring += ' 720) { width /= 2; height /= 2; } var url = "rtsp://"+location.hostname; if (isCondor && isIE) { url += '/rtsp/stream'+res; } else { url += '/rtsp/now.mp4'; if (res == "low") url += "?res=low"; } if (isRaptor) { if (is16by9) { width = (height * 16) / 9; } } outstring = ''; outstring += ''; outstring += ''; outstring += ''; outstring += ''; outstring += ''; var d = document.getElementById(DivID); if (d) d.innerHTML = outstring; var vlc = document.getElementById(isIE ? id : id+'embed'); var options = [':rtsp-tcp']; if (vlc && vlc.playlist) { vlc.playlist.items.clear(); var itemId = vlc.playlist.add(url, "", options); if ( itemId != -1 ) vlc.playlist.playItem (itemId); } vlc.style.width = width; vlc.style.height = height; } function CreateSpushControl (DivID, imAttr, imageString, id) { var out; out = ''; var d = document.getElementById(DivID); if (d) d.innerHTML = out; } function GetElementPosition (id) { e = document.getElementById(id); var left = 0; var top = 0; while (e.offsetParent){ left += e.offsetLeft; top += e.offsetTop; e = e.offsetParent; } left += e.offsetLeft; top += e.offsetTop; return {x:left, y:top}; } function MouseCoords (ev) { if (ev.pageX || ev.pageY){ return {x:ev.pageX, y:ev.pageY}; } return { x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, y:ev.clientY + document.body.scrollTop - document.body.clientTop }; } function trimString (str) { str = this != window? this : str; return str.replace(/^\s+/g, '').replace(/\s+$/g, ''); } String.prototype.trim = trimString; function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function AC_Generateobj(objAttrs, params, embedAttrs) { var str = ''; if (isIE && isWin && !isOpera) { str += ' '; str += ''; } else { str += '