function NiceScroll(c){this.taId=c;this.ta=id(this.taId);if(1!=this.ta.nodeType)return null;this.st=el("label");this.sb=el("div");this.sbcH=this.avg=this.stH=this.scH=this.sbH=0;this.n=20;this.enabled=!0;this.mousePos=null;this.show=this.onSb=this.isScroll=!1;this.wtId=this.checkTt=null;this.woSpeed=this.wSpeed=this.wtCounter=0;this.sbStyle={position:"absolute",zIndex:1001,width:"0.583em",mTop:0,mLeft:0};this.stStyle={width:"0.583em",display:"inline-block",background:"#34A9DA",borderRadius:"3px",
position:"relative",cursor:"pointer"};this.stOpacity=0.1;"function"!=typeof this.init&&(NiceScroll.prototype.init=function(){this.sb.id=this.taId+"niceScrollSb"+(new Date).getTime();setStyle(this.sb,{backgroundColor:this.sbStyle.background||"transparent"});this.sb.appendChild(this.st);document.body.appendChild(this.sb);setStyle(this.sb,this.sbStyle);setStyle(this.st,this.stStyle);this._reset();!1==OS.portable?setStyle(this.ta,{overflow:"hidden"}):setStyle(this.ta,{overflow:"scroll"});this._shSb();
this._bind();this._scrollCheck()},NiceScroll.prototype._scrollCheck=function(){var b=this;this.checkTt=window.setTimeout(function(){b._scrollCheck()},10);this._check()},NiceScroll.prototype.scrollBarSet=function(b){if("object"==typeof b)for(var a in b)this.sbStyle[a]=b[a]},NiceScroll.prototype.scrollTipSet=function(b){if("object"==typeof b)for(var a in b)this.stStyle[a]=b[a]},NiceScroll.prototype.scrollTipOpacity=function(b){this.stOpacity=b},NiceScroll.prototype.scrollTo=function(b){b=parseFloat(b);
if(!0==isNaN(b))return!1;this.ta.scrollTop=b},NiceScroll.prototype._reset=function(){var b=$(this.ta).offset(),a=this.ta.offsetWidth,d=this.ta.offsetHeight-this.sbStyle.mTop,g=this.ta.scrollHeight-this.sbStyle.mTop,c=parseFloat(getNodeDefaultView(this.ta,"borderTopWidth"))||0,f=parseFloat(getNodeDefaultView(this.ta,"borderBottomWidth"))||0,h=parseFloat(getNodeDefaultView(this.ta,"borderRightWidth"))||0;parseFloat(getNodeDefaultView(this.ta,"borderLeftWidth"));this.scH=g-d+c+f;this.stH=parseInt(0.7*
(d/g)*d)+25;this.sbcH=d-(this.stH+2);this.avg=this.scH/this.sbcH;0>=g-d?(setStyle(this.sb,{visibility:"hidden",top:"-9999px"}),this.show=!1):(this.show=!0,setStyle(this.sb,{visibility:"visible"}),setStyle(this.sb,{top:b.top+c+this.sbStyle.mTop+"px",height:d+"px",left:b.left-this.sbStyle.mLeft+a-h-parseInt(this.sb.offsetWidth)+"px"}),setStyle(this.st,{top:this.ta.scrollTop/this.scH*this.sbcH+"px",height:this.stH+"px"}))},NiceScroll.prototype._bind=function(){function b(a){a=a||window.event;var b=a.touches[0].clientY,
c=b-d.mousePos.y,c=parseFloat(d.st.style.top)-c,c=c>=d.sbcH?d.sbcH:0>=c?0:c;d.st.style.top=c+"px";d.mousePos.y=b;d.isScroll=!0;!1==OS.portable&&(d.ta.scrollTop=d.scH*(c/d.sbcH),eventPreventDefault(a));clearSelection(a)}function a(g){detachEvnt(document,"touchmove",b);detachEvnt(document,"touchend",a);!1==d.onSb&&(d.isScroll=!1)}var d=this;document.attachEvent?(this.ta.attachEvent("onmousewheel",function(a){a=a||window.event;d._scroll(a)}),this.sb.attachEvent("onmousewheel",function(a){a=a||window.event;
d._scroll(a)})):(this.ta.addEventListener("mousewheel",function(a){a=a||window.event;d._scroll(a)},!1),this.ta.addEventListener("DOMMouseScroll",function(a){a=a||window.event;d._scroll(a)},!1),this.sb.addEventListener("mousewheel",function(a){a=a||window.event;d._scroll(a)},!1),this.sb.addEventListener("DOMMouseScroll",function(a){a=a||window.event;d._scroll(a)},!1));attachEvnt(this.ta,"touchstart",function(g){g=g||window.event;d.mousePos={x:g.touches[0].clientX,y:g.touches[0].clientY};attachEvnt(document,
"touchmove",b);attachEvnt(document,"touchend",a)});attachEvnt(this.st,"click",function(a){a=a||window.event;stopProp(a)});this.st.onmousedown=function(a){var b=0;d.mousePos=getMousePos(a);document.onmouseup=function(a){a=a||window.event;document.onmousemove=null;document.onmouseup=null;!1==d.onSb&&(d.isScroll=!1);stopProp(a)};document.onmousemove=function(a){var g=getMousePos(a),c=g.y-d.mousePos.y,c=parseFloat(d.st.style.top)+c;b++;!1==isIENormal?0==b%4&&(c=c>=d.sbcH?d.sbcH:0>=c?0:c,d.st.style.top=
c+"px",d.mousePos.y=g.y,d.ta.scrollTop=d.scH*(c/d.sbcH)):(c=c>=d.sbcH?d.sbcH:0>=c?0:c,d.st.style.top=c+"px",d.mousePos.y=g.y,d.ta.scrollTop=d.scH*(c/d.sbcH));d.isScroll=!0;clearSelection(a)}};$("#"+this.sb.id)[0].onmouseover=function(a){a=a||window.event;d.onSb=!0;!0==d.show&&d._scrollShow(a)};$("#"+this.sb.id)[0].onmouseout=function(){d.onSb=!1;d.isScroll=!1}},NiceScroll.prototype._close=function(){this.sb.style.visibility="hidden";this.enabled=!1},NiceScroll.prototype._open=function(){this.enabled=
!0},NiceScroll.prototype._shSb=function(){this.sb.style.visibility="none"==this.ta.style.display||"hidden"==this.ta.visibility?"hidden":"visible"},NiceScroll.prototype._check=function(){null==id(this.taId)?(window.clearTimeout(this.checkTt),this.sb.parentNode.removeChild(this.sb)):!1!=this.enabled&&(!1==checkInHorize(this.ta)?this.sb.style.display="none":(this.sb.style.display="block",0>=parseInt(this.ta.offsetHeight)&&(this.sb.style.visibility="hidden"),this._reset()))},NiceScroll.prototype._getWheelDelta=
function(b){b=b||window.event;return b.wheelDelta?window.opera&&9.5>window.opera.version?-b.wheelDelta:b.wheelDelta:40*-b.detail},NiceScroll.prototype._wheelAnimateHandle=function(){var b=0,a=this;a.wtId=window.setTimeout(function(){a._wheelAnimateHandle()},5);if(0>a.wtCounter)clearTimeout(a.wtId),a.wtId=null,!1==a.onSb&&(a.isScroll=!1);else{b=parseFloat(a.ta.scrollTop)+parseInt(a.wSpeed);if(b>=a.scH||0>=b)a.wtCounter=0;a.ta.scrollTop=b;b=a.ta.scrollTop/a.scH*a.sbcH;isNaN(b)||(a.st.style.top=b+"px");
a.wtCounter--}},NiceScroll.prototype._wheelAnimate=function(b,a){var d=!1;this.wtId?(this.wtCounter=(d=0>(this.woSpeed^b))?a:50>this.wtCounter+a?this.wtCounter+a:50,this.wSpeed=d?b:1.05*this.wSpeed):(this.wtCounter=a,this.woSpeed=this.wSpeed=b,this._wheelAnimateHandle())},NiceScroll.prototype._scrollShow=function(b){$("#"+this.sb.id).stop(!0).css("visibility","visible").css("opacity",1);this.isScroll=!0;eventPreventDefault(b)},NiceScroll.prototype._scroll=function(b){b=b||window.event;var a=0<this._getWheelDelta(b)?
-1:1;!0==this.show&&!0==this.enabled&&(this._scrollShow(b),this._wheelAnimate(5*a,7))})}
function DateControl(c,b){this.table;this.weekList;this.hourList;this.dateCon=id(c);this.weekIsMouseDown=!1;this.selDate=[0,0,0,0,0,0,0];this.dateArray=[0,0,0,0,0,0,0];this.cellWidth=this.cellHeight=22;this.cellSeColor="#A0D468";this.cellDeColor="#FCFCFC";this.cellPadding=1;void 0==DateControl.prototype.init&&(DateControl.prototype.hourStr=label.lHour,DateControl.prototype.weekDayNum=7,DateControl.prototype.lineStr="-",DateControl.prototype.selTag="selTag",DateControl.prototype.cellBorderWidth=1,
DateControl.prototype.iCellIndex=0,DateControl.prototype.weekArray=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun],DateControl.prototype._init=function(){this._initOptions();this._dateConInit();this._hourListInit();this._weekListInit();this._dateTableInit()},DateControl.prototype.reset=function(a){var d,b,c,f=this.iCellIndex;if(!1!=a instanceof Array&&void 0!=a&&a.length==this.weekDayNum)for(var h=0;h<this.weekDayNum;h++){b=this.table.rows[h];d=a[h];for(var k=0;24>k;k++)c=
b.cells[k],c=c.childNodes[f],void 0!=d?(this._setSel(c,d%2),d>>=1):this._setSel(c,0)}},DateControl.prototype._initOptions=function(){for(var a in b)"undefined"!=typeof this[a]&&(this[a]=b[a])},DateControl.prototype.getSelDate=function(){var a,d,b=this.weekDayNum,c=this.table.rows;this.selDate=[0,0,0,0,0,0,0];for(var f=0;f<b;f++){d=c[f];for(var h=0;24>h;h++)a=d.cells[h],a=a.childNodes[0],a=parseInt(a.getAttribute("sel")),1==a&&(this.selDate[f]+=Math.pow(2,h))}return this.selDate},DateControl.prototype._dateConInit=
function(){this.dateCon.style.overflow="hidden"},DateControl.prototype._hourListInit=function(){var a=document.createElement("ul"),d,b,c=this;a.className="hourList";for(var f=0;24>=f;f++)d=document.createElement("li"),24!=f?(b=document.createElement("span"),b.innerHTML=f,d.appendChild(b),d.style.width=this.cellWidth+2*this.cellPadding+this.cellBorderWidth+"px",b.onclick=function(a){return function(){for(var d=c.table.rows,b=d.length,g=c.iCellIndex,f=1,p=0;p<b&&(f&=parseInt(d[p].cells[a].childNodes[g].getAttribute("sel")),
0!=f);p++);f=1-f;for(p=0;p<b;p++)c._setSel(d[p].cells[a].childNodes[g],f);clearSelection()}}(f)):(d.style.color="#6EBFD9",d.innerHTML=this.hourStr),a.appendChild(d);this.dateCon.appendChild(a);this.hourList=a},DateControl.prototype._weekListInit=function(){var a=document.createElement("ul"),d,b=this;a.className="weekList";for(var c=0,f=this.weekDayNum;c<f;c++)d=document.createElement("li"),d.style.height=this.cellHeight+2*this.cellPadding+this.cellBorderWidth+"px",d.style.lineHeight=this.cellHeight+
2*this.cellPadding+this.cellBorderWidth+"px",d.innerHTML=this.weekArray[c],d.onclick=function(a){return function(){for(var d=b.table.rows[a].cells,c=b.iCellIndex,e=1,f=0,p=d.length;f<p&&(e&=parseInt(d[f].childNodes[c].getAttribute("sel")),0!=e);f++);e=1-e;f=0;for(p=d.length;f<p;f++)b._setSel(d[f].childNodes[c],e);clearSelection()}}(c),a.appendChild(d);this.dateCon.appendChild(a);this.weekList=a},DateControl.prototype._setSel=function(a,d){a.setAttribute("sel",d);a.style.backgroundColor=1==d?this.cellSeColor:
this.cellDeColor},DateControl.prototype._dateCellCreate=function(){for(var a,d,b,c,f=this,h=0,k=this.weekDayNum;h<k;h++){d=this.table.insertRow(-1);void 0!=this.dateArray&&(a=this.dateArray[h]);for(var l=0;24>l;l++)b=d.insertCell(-1),b.style.padding=this.cellPadding+"px",b.className="weekTd",c=document.createElement("i"),c.className="tableICell",c.style.height=this.cellHeight+"px",c.style.width=this.cellWidth+"px",b.appendChild(c),this._setSel(c,0),void 0!=a?(this._setSel(c,a%2),a>>=1):this._setSel(c,
0),c.onmouseover=function(a){!0==f.weekIsMouseDown&&f._setSel(this,1-parseInt(this.getAttribute("sel")))},c.onmousedown=function(a){f._setSel(this,1-parseInt(this.getAttribute("sel")))}}3==this.table.rows[0].cells[0].nodeType&&(this.iCellIndex=1)},DateControl.prototype._dateCellBind=function(){var a=this;this.table.onmousedown=function(d){a.weekIsMouseDown=!0;document.onmouseup=function(d){a.weekIsMouseDown=!1}};this.table.onmouseup=function(d){a.weekIsMouseDown=!1}},DateControl.prototype._dateTableCreate=
function(){this.table=document.createElement("table");this.table.className="tableWeek";this.table.cellspacing="0px";this.table.cellpadding="0px";this.dateCon.appendChild(this.table)},DateControl.prototype._dateTableInit=function(){this._dateTableCreate();this._dateCellCreate();this._dateCellBind()});this._init()}
function PageFunc(){this.pathStr="../";this.htmlPathStr=this.pathStr+"pc/";this.gLoginId="Login";this.cloudPageId="CloudAccountPage";this.loadPageData={url:"",id:"",options:{},handle:{},handlePre:{}};this.loginPageData={url:"",id:""};this.showLoginHideNodesDelayHd;this.helpIdStr="helpStr";this.helpTopClassStr="helpTopClass";this.LGKEYSTR="lgKey";this.LGKEYMD5STR="lgKeyMD5";this.LGUSER="lgUser";this.LGKEYTIMESTR="lgKeyTime";this.PLGINFOCLOSE="plgInfClose";this._gPageHeightLg=0;this.gDomainDNS="tplogin.cn";
this.gDomainDetectArr=null;this.g_cur_host_mac="00-00-00-00-00-00";this.g_pageLoadDelayTime=0;this.g_pageLoadingShow=!0;this.g_pageLoadDelayTimeoutHd=null;this.$Init=function(){Load.call(jQuery);$.getExplorer();$.initUrl()};this.refreshSession=function(c){$.refreshSession(this.htmlPathStr+"Content.htm",c)};this.loadPageHandleBg=function(){for(var c=$("i.helpBtn"),b,a,d=0,g=c.length;d<g;d++)a=c[d],b=a.getAttribute(helpIdStr),a=a.getAttribute(helpTopClassStr),null!=b&&helpBind(c[d],b,a)};this.loadLgLessPage=
function(c,b,a,d){d=void 0==d?{}:d;d.htmlPathStr=this.pathStr+"loginLess/";this.loadPage(c,b,a,d)};this.loadAppPage=function(c,b,a,d){d=void 0==d?{}:d;d.htmlPathStr="";this.loadPage(c,b,a,d)};this.showDetailCon=function(){var c=$("div.detailConRs"),b=$("div.detailCon");null!=b[0]&&b.css("visibility","visible");null!=c[0]&&c.css("visibility","visible")};this.bDetailConHidden=function(){var c=$("div.detailConRs"),b=$("div.detailCon");return null==b[0]&&null==c[0]||"hidden"==b.css("visibility")||"hidden"==
c.css("visibility")?!0:!1};this.hideDetailCon=function(){var c=$("div.detailConRs"),b=$("div.detailCon");null!=b[0]&&b.css("visibility","hidden");null!=c[0]&&c.css("visibility","hidden")};this.loadPage=function(c,b,a,d,g){var e=this;window.setTimeout(function(){var f=e.htmlPathStr,h=null;try{"function"==typeof hideBox&&hideBox(),"function"==typeof helpClose&&helpClose(),"function"==typeof closeAlert&&closeAlert(),"function"==typeof closeConfirm&&closeConfirm(),"function"==typeof closeLoading&&closeLoading(),
"function"==typeof removeNoteAll&&removeNoteAll(),"function"==typeof basicAppUpgradeInfoClose&&basicAppUpgradeInfoClose()}catch(k){log(k)}d=void 0==d?{}:d;f=void 0==d.htmlPathStr?f:d.htmlPathStr;!1!==d.bRecordLoadPage&&"function"==typeof setLoadPage&&setLoadPage(c,b,d,a,g);!0==$.local&&log(c);!0==g_pageLoadingShow&&!1!==d.pageLoadingShow&&(h=$.setTimeout(function(){showToast()},g_pageLoadDelayTime),clearTimeout(g_pageLoadDelayTimeoutHd),g_pageLoadDelayTimeoutHd=setTimeout(function(){try{!0==bDetailConHidden()&&
("BasicRePlay.htm"!=c&&closeToast(),showDetailCon())}catch(a){log(a)}},5E3),d.callBackLoadedDom=function(){!0==g_pageLoadingShow&&(clearTimeout(h),closeToast(),!1==$.local&&hideDetailCon())});$.load(f+c,function(d){"function"==typeof a&&a(d)},b,d,function(a){closeProgBar();"function"==typeof g&&g(a)})},0)};this.unloadDetail=function(c){(c=id(c))&&emptyNodes(c)};this.detailShow=function(c,b){$("#"+c).fadeIn(800,b)};this.detailHide=function(c,b){$("#"+c).fadeOut(800,function(){$("#"+c).css("display",
"none");window.unloadDetail(b)})};this.selectChange=function(c,b){id(c).value=b.options[b.selectedIndex].text};this.showCon=function(c){var b=id(c),a,d=document.body.childNodes,g;for(g in d)a=d[g],void 0!=a.nodeName&&"DIV"==a.nodeName.toUpperCase()&&a.id!=c&&setStyle(a,{display:"none"});setStyle(b,{display:"block"})};this.loginChange=function(c){function b(){for(var b in f)e=f[b],"CloudAccountPage"==e.id&&"none"==d?h.setStyle(e,{display:d}):"Con"==e.id&&"block"==d?h.setStyle(e,{display:d,position:"static",
visibility:"visible",top:"0px"}):void 0!=e.nodeName&&"DIV"==e.nodeName.toUpperCase()&&e.id!=h.gLoginId&&e.id!=h.CoverId&&"timePickerCon"!=e.id&&"laydate_box"!=e.id&&h.setStyle(e,{display:d});h.setStyle(a,{display:g});"function"==typeof showLoginHideNodesDelayHd&&showLoginHideNodesDelayHd()}var a=this.id(this.gLoginId),d="block",g="none",e,f=document.body.childNodes,h=this;if(void 0==LOADHELPTYPE||gLoadType!=LOADHELPTYPE)!0==c&&(d="none",g="block",_gPageHeightLg=parseInt(document.body.offsetHeight)),
emptyNodes(a),!0==c?(c=$.authRltObj.code,ESYSRESET==c?(document.body.style.height="auto",loadPage("LoginChgPwd.htm","Login",b,{bRecordLoadPage:!1,pageLoadingShow:!1}),emptyNodes(id("Con")),setLoadPage("Content.htm","Con")):ENEEDACTIVATE==c?(document.body.style.height="auto",loadPage("LoginActivate.htm","Login",b,{bRecordLoadPage:!1,pageLoadingShow:!1}),emptyNodes(id("Con")),setLoadPage("Content.htm","Con")):(document.body.style.height="auto",loadPage("Login.htm","Login",null,{bRecordLoadPage:!1,pageLoadingShow:!1},
b))):(document.body.style.height="100%",this.loadPageData.options=this.loadPageData.options||{},this.loadPageData.options.bRecordLoadPage=!1,"Content.htm"!=this.loadPageData.url&&(emptyNodes(id("Con")),this.loadPageData.url="Content.htm",this.loadPageData.id="Con"),this.loadPage(this.loadPageData.url,this.loadPageData.id,function(){"function"==typeof h.loadPageData.handle&&h.loadPageData.handle()},this.loadPageData.options,function(){b();"function"==typeof h.loadPageData.handlePre&&h.loadPageData.handlePre()}))};
this.setLoadPage=function(c,b,a,d,g){this.loadPageData.url=c;this.loadPageData.id=b;this.loadPageData.options=a;this.loadPageData.handle=d;this.loadPageData.handlePre=g};this.localSgInit=function(){try{this.sessionLS.init(),!0==isIE&&!1==isIENormal&&function(){sessionLS.setExpire(3E3);window.setTimeout(arguments.callee,1E3)}()}catch(c){}this.getLgPwd()};this.auth=function(){$.auth($.username,$.pwd,$.oriPwd)};this.getLgPwd=function(){try{$.tmpPwdMD5=$.pwdMD5=sessionLS.getItem(this.LGKEYMD5STR),$.pwd=
sessionLS.getItem(this.LGKEYSTR),$.username=sessionLS.getItem(this.LGUSER)}catch(c){}};this.showLogin=function(c){this.showLoginHideNodesDelayHd=c;this.loginChange(!0)};this.unloadLogin=function(){this.loginChange(!1)};this.ifrmOrgUrl=function(c){return"/stok="+encodeURIComponent($.session)+"?code="+c};this.iFrmOnload=function(c,b,a){var d;a=ENONE;c=id(c);var g,e;try{d=c.contentWindow?c.contentWindow.document.body?c.contentWindow.document.body.innerHTML:null:c.contentDocument.document.body?c.contentDocument.document.body.innerHTML:
null;if(/(<pre>)?(.+)(<\/pre>)+/.test(d)||/(<pre>)?(.+)/.test(d))g=RegExp.$2;e=JSON.parse(g);a=e[ERR_CODE];a!=ENONE&&closeProgBar();b(a,e)}catch(f){closeProgBar(),b(EINVFMT)}};this.windowSleep=function(c){var b=new Date;for(c=b.getTime()+c;!(b=new Date,b.getTime()>c););};this.getCurrPcMac=function(){var c,b=$.getPeerMac();if(ENONE!=b.errorno||""==b.data)return"00-00-00-00-00-00";c=b.data.indexOf("\r\n");return b.data.substring(0,c)};this.cloneLocalMac=function(){var c=$.readEx(SYSTEM_DATA_ID),b=this.getCurrPcMac(),
a=ENONE;c.mac[1]!=b&&(c.mac[1]=b,a=$.write($.toText(c),$.block));return a};this.logSave=function(){var c=$.domainUrl;c.lastIndexOf("/")==c.length-1&&(c=c.substring(0,c.length-1));location.href=c+$.orgURL("/syslog.txt?disposition=1");return!0};this.pageRedirect=function(){var c=window.top.location.href;USER_GROUP_REMOTE!=$.authRltObj.group&&!1==/^((http:\/\/)*(\d{1,3}\.){3}\d{1,3})/g.test(c)&&0>c.indexOf(gDomainDNS)&&!1==$.local&&(window.top.location.href=$.httpTag+gDomainDNS)};this.pageOnload=function(){var c=
[{tag:"link",url:"../web-static/dynaform/DataGrid.css"},{tag:"link",url:"../web-static/dynaform/DatePick.css"}],b=[{tag:"script",url:"../web-static/dynaform/DataGrid.js"}],a=[{tag:"script",url:"../web-static/lib/ajax.js"},{tag:"script",url:"../web-static/dynaform/uci.js"},{tag:"script",url:"../web-static/language/cn/str.js"},{tag:"script",url:"../web-static/language/cn/error.js"},{tag:"script",url:"../web-static/lib/verify.js"},{tag:"script",url:"../web-static/dynaform/DatePick.js"},{tag:"script",
url:"../web-static/lib/jsencrypt.js"},{tag:"script",url:"../web-static/dynaform/menu.js"},{tag:"script",url:"../web-static/dynaform/qrcode.js"}];this.loadExternResource({scripts:[{tag:"script",url:"../web-static/lib/json.js"},{tag:"script",url:"../web-static/lib/jquery-1.10.1.js"}],callBack:function(){this.loadExternResource({scripts:a,callBack:function(){$Init();$.setexternJSP(replaceJSP);$.setExternPageHandle(loadPageHandleBg);$.setLoginErrHandle(showLogin);this.loadExternResource({scripts:b,links:c,
callBack:function(){gLoadType==LOADHELPTYPE&&this.loadExternResource({links:[{tag:"script",url:"../web-static/dynaform/help.css"}]})}});this.compatibleShow();this.localSgInit();if(!0==$.local)this.htmlPathStr=this.pathStr+"admin/",this.loadPage("Content.htm","Con");else if(gLoadType==LOADHELPTYPE)$.session="",$.setLg("",""),this.loadLgLessPage("HelpFrame.htm","Con",null,{pageLoadingShow:!1});else{this.loadPage("Content.htm","Con",null,{pageLoadingShow:!1});try{window.history&&window.history.pushState&&
(window.onpopstate=function(){window.history.pushState("forward",null,"");window.history.forward(1)},window.history.pushState("forward",null,""),window.history.forward(1))}catch(a){}}}})}});document.oncontextmenu=function(a){return!1};try{document.msCapsLockWarningOff=!0}catch(d){}if(isIESix)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(g){}};this.loadExternResource=function(c){var b,a,d,g,e=document.getElementsByTagName("head")[0];b={links:null,scripts:null,callBack:null};for(var f in c)b[f]=
c[f];c=b.links;a=b.scripts;d=b.callBack;if(void 0!=c)for(var h in c)b=document.createElement("link"),b.rel="stylesheet",b.href=c[h].url,e.appendChild(b);if(void 0!=a){var k;b=document.createElement("script");b.type="text/javascript";if(void 0!=d)for(h in g=void 0!=b.readyState,k=function(b){a[b].loadState=!0;for(var g in a)if(!1==a[g].loadState)return;d()},a)a[h].loadState=!1;for(h in a)b=document.createElement("script"),b.type="text/javascript",void 0!=d&&(g?b.onreadystatechange=function(a){return function(){if("loaded"==
this.readyState||"complete"==this.readyState)this.onreadystatechange=null,k(a)}}(h):b.onload=function(a){return function(){k(a)}}(h)),b.src=a[h].url,e.appendChild(b)}};this.upSysNtpTime=function(){var c={};try{c[uciSystem.fileName]={},c[uciSystem.fileName][uciSystem.actionName.bootSetDate]={},c[uciSystem.fileName][uciSystem.actionName.bootSetDate][uciSystem.optName.seconds]=parseInt((new Date).getTime()/1E3),$.action(c)}catch(b){log(b)}}}
function Cover(){Style.call(this);this.CoverId="Cover";this.CoverIdB="CoverB";this.hideCover=function(c,b){var a=id(this.CoverId);this.setStyle(a,{display:"none",visibility:"hidden"});this.setStyle(a,b);"function"==typeof c&&c(a);emptyNodes(a)};this.showCover=function(c,b){var a=id(this.CoverId);this.setStyle(a,{display:"block",visibility:"visible"});this.setStyle(a,b);$(a).css("opacity","0.1");"undefined"!=typeof c&&c(a)};this.showCoverB=function(c,b){var a=id(this.CoverIdB);void 0==a&&(a=document.createElement("div"),
a.id=this.CoverIdB,document.body.appendChild(a));this.setStyle(a,{display:"block",visibility:"visible"});this.setStyle(a,b);$(a).css("opacity","0.5");"undefined"!=typeof c&&c(a)};this.hideCoverB=function(c,b){var a=id(this.CoverIdB);void 0!=a&&(this.setStyle(a,{display:"none",visibility:"hidden"}),this.setStyle(a,b),"function"==typeof c&&c(a),emptyNodes(a))};this.setHideFlag=function(c){hideFlag=c}}
function Style(){this.disableCol="#b2b2b2";this.setStyle=function(c,b){if(null!=c&&null!=b&&1==c.nodeType)for(var a in b)try{c.style[a]=b[a]}catch(d){}};this.getNodeDefaultView=function(c,b){var a=null;if(!c)return null;try{return a=c.currentStyle?c.currentStyle:document.defaultView.getComputedStyle(c,null),void 0!=b?a[b]:a}catch(d){}};this.disableHover=function(c,b){if(c){c=c instanceof window.jQuery?c:$(c);for(var a=0;a<c.length;a++)$(c[a]).removeClass(b),$(c[a]).addClass(b+"Dis")}};this.enableHover=
function(c,b){if(c){c=c instanceof window.jQuery?c:$(c);for(var a=0;a<c.length;a++)$(c[a]).removeClass(b+"Dis"),$(c[a]).addClass(b)}}}
function LocalStorageSD(){try{this.sessionLS=null==this.sessionStorage?{file_name:"user_data_default_SD",dom:null,init:function(){var b=document.createElement("input");b.type="hidden";b.addBehavior("#default#userData");document.body.appendChild(b);b.save(this.file_name);this.dom=b},setItem:function(b,a){this.dom.setAttribute(b,a);this.dom.save(this.file_name)},getItem:function(b,a){this.dom.load(this.file_name);return this.dom.getAttribute(b)},removeItem:function(b){this.dom.removeAttribute(b);this.dom.save(this.file_name)},
setExpire:function(b){var a=new Date,a=new Date(a.getTime()+b);this.dom.load(this.file_name);this.dom.expires=a.toUTCString();this.dom.save(this.file_name)}}:sessionStorage}catch(c){}}
function Explorer(){this.isMsEdge=this.isIE11=this.isOpera=this.isSafari=this.isChrome=this.isFirefox=this.isIETen=this.isIETenLess=this.isIENormal=this.isIEEight=this.isIESeven=this.isIESix=this.isIE=!1;this.explorerInfo=navigator.userAgent;this.explorerTypeArr=["IE",0,"8.0"];this.getIEInfo=function(){var c=/msie ((\d+\.)+\d+)/i.test(explorerInfo)?document.mode||RegExp.$1:!1;!1!=c&&(6>=c?(this.isIESix=!0,this.explorerTypeArr=["IE",0,"6.0"]):7==c?(this.isIESeven=!0,this.explorerTypeArr=["IE",0,"7.0"]):
8==c?(this.isIEEight=!0,this.explorerTypeArr=["IE",0,"8.0"]):9<=c&&(9==c?this.explorerTypeArr=["IE",0,"9.0"]:10==c&&(this.isIETen=!0,this.explorerTypeArr=["IE",0,"10.0"]),this.isIENormal=!0),10>=c&&(this.isIETenLess=!0),this.isIE=!0);!0==/Trident\/[\d\.]+[\w\W]*rv:11\.[\d\.]+/i.test(explorerInfo)&&(this.isIENormal=this.isIE=this.isIE11=!0,this.explorerTypeArr=["IE",0,"11.0"])};this.judgeExplore=function(){var c=navigator.userAgent;this.getIEInfo();if(!1==this.isIE)if(s=c.match(/edge\/([\d.]+)/i))this.isMsEdge=
s[1],this.explorerTypeArr=["edge",4,s[1]];else if(s=c.match(/firefox\/([\d.]+)/i))this.isFirefox=s[1],this.explorerTypeArr=["firefox",1,s[1]];else if(s=c.match(/chrome\/([\d.]+)/i))this.isChrome=s[1],this.explorerTypeArr=["chrome",2,s[1]];else if(s=c.match(/opera.([\d.]+)/i))this.isOpera=s[1],this.explorerTypeArr=["opera",5,s[1]];else if(s=c.match(/version\/([\d.]+).*safari/i))this.isSafari=s[1],this.explorerTypeArr=["safari",3,s[1]]};this.compatibleShow=function(){if(!0==this.isIESix){var c,b,a,
d,g;0<=document.cookie.indexOf("ieSixClosed")||(c=$("div.ieSixCompatible"),void 0==c[0]&&(c=el("div"),c.className="ieSixCompatible",b=el("div"),b.className="ieSixCpCon",a=el("i"),d=el("span"),d.className="spanNote",d.innerHTML=label.IESixCpTip,g=el("span"),g.className="spanClose",g.innerHTML=label.iknown,g.onclick=function(){document.cookie="ieSixClosed=true";c.style.visibility="hidden";c.style.top="-9999px"},b.appendChild(a),b.appendChild(d),b.appendChild(g),c.appendChild(b),document.body.appendChild(c)))}};
this.createGroupRadio=function(c){var b;if(void 0==c)return b;!0==this.isIE&&!1==this.isIENormal?b=document.createElement("<input name='"+c+"' />"):(b=document.createElement("input"),b.name=c);return b};this.judgeExplore()}
function Tool(){this.gAppPreUrl="";Style.call(this);this.logSwitch=!1;this.id=function(c){if(void 0!=c)return document.getElementById(c)};this.el=function(c){try{return document.createElement(c)}catch(b){return null}};this.replaceJSP=function(c){var b=null,a,d=/{%(\w+)\.(\w+)%}/i,b=d.exec(c);try{for(;null!=b;)a=language[b[1]][b[2]],c=c.replace("{%"+b[1]+"."+b[2]+"%}",a),b=d.exec(c)}catch(g){}try{c=c.replace(/{#appPreUrl#}/g,gAppPreUrl)}catch(e){}return c};this.getoffset=function(c,b){for(var a=c,
d={top:0,left:0};a!=b&&null!=a;)d.left+=parseInt(a.offsetLeft),d.top+=parseInt(a.offsetTop),a=a.offsetParent;return d};this.attachEvnt=function(c,b,a){0==b.indexOf("on")&&(b=b.substring(2));document.body.attachEvent?c.attachEvent("on"+b,a):c.addEventListener(b,a,!1)};this.detachEvnt=function(c,b,a){0==b.indexOf("on")&&(b=b.substring(2));document.body.attachEvent?c.detachEvent("on"+b,a):c.removeEventListener(b,a,!1)};this.stopProp=function(c){c=c||window.event;void 0!=c&&(c.stopPropagation?c.stopPropagation():
c.cancelBubble=!0)};this.eventPreventDefault=function(c){c=c||window.event;void 0!=c&&(c.preventDefault?c.preventDefault():c.returnValue=!1)};this.clearSelection=function(){try{window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}catch(c){log("clearSelection: "+c)}};this.setDomCursorPos=function(c,b){if(c.setSelectionRange)c.focus(),c.setSelectionRange(b,b);else if(c.createTextRange){var a=c.createTextRange();a.collapse(!0);a.moveEnd("character",b);a.moveStart("character",
b);a.select()}};this.getMousePos=function(c){c=c||window.event;var b=document;return c.pageX||c.pageY?{x:c.pageX,y:c.pageY}:{x:c.clientX+b.documentElement.scrollLeft-b.documentElement.clientLeft,y:c.clientY+b.documentElement.scrollTop-b.documentElement.clientTop}};this.isArray=function(c){return"[object Array]"===Object.prototype.toString.call(c)};this.upDown=function(c,b,a,d,g){if(void 0!=a&&void 0!=d){var e=this.el("label");e.className=d;e.onclick=function(){$("#"+b).slideToggle("normal",function(){e.className=
e.className==a?d:a;if(g)try{g()}catch(b){}})};c.appendChild(e);return e}};this.arrowUpDown=function(c,b,a){this.upDown(c,b,"arrowUp","arrowDown",a)};this.getChildNode=function(c,b,a){c=c.childNodes;var d=[],g=0,e;e=b.split(" ");b=e[0];for(var f=e[1],h=0,k=c.length;h<k;h++)e=c[h],1==e.nodeType&&e.tagName.toLowerCase()==b&&(void 0!=f&&e.type==f?(d[g]=e,g++):void 0==f&&(d[g]=e,g++));return void 0!=a?d[a]:d[0]};this.checkInHorize=function(c){for(;null!=c&&"HTML"!=c.nodeName.toUpperCase();){if("hidden"==
this.getNodeDefaultView(c,"visibility")||"none"==this.getNodeDefaultView(c,"display"))return!1;c=c.parentNode}return!0};this.setUrlHash=function(c,b){var a,d,g;a="";var e=location.href;d=location.hash;void 0!=c&&void 0!=b&&0!=c.length&&(0!=d.length?(g=d.indexOf(c),0<=g?(a=d.substring(0,g),d=d.substring(g),g=d.indexOf("#"),0<g?(d=d.substring(g),d=a+c+"="+b+d):d=a+c+"="+b):("#"!=d.substring(d.length-1)&&(a="#"),d+=a+c+"="+b),location.href=e.substring(0,e.indexOf("#"))+d):e.lastIndexOf("#")==e.length-
1?location.href+=c+"="+b:location.href+="#"+c+"="+b)};this.getUrlHash=function(c){var b=location.hash,a,d="";if(0<b.indexOf(c)){var b=b.substring(1).split("#"),g;for(g in b)if(a=b[g].split("="),a[0]==c){d=a[1];break}}return d};this.changeUrlHash=function(c){var b=location.href,a=b.indexOf("#");void 0!=c&&(location.href=0<a?b.substring(0,a+1)+c:b+"#"+c)};this.setInputCursor=function(c){this.setDomCursorPos(c,c.value.length)};this.getCNStrLen=function(c){return c.replace(/[^\x00-\xFF]/g,"xxx").length};
this.getDisplayStrLen=function(c){return c.replace(/[^\x00-\xFF]/g,"xx").length};this.getStrInMax=function(c,b){var a="",d,g=0;d=c.replace(/[A-Z]/g,"xx");if(getDisplayStrLen(d)<=b)return c;for(var e=1;e<=b;e++){d=c.charAt(g);if(""==d)break;1<getDisplayStrLen(d)?(e+=getDisplayStrLen(d)-1,a+=d,beCut=!0):!0==/[A-Z]/g.test(d)?(e++,a+=d,beCut=!0):a+=d;g++}return a+"..."};this.EncodeURLIMG=document.createElement("img");this.escapeDBC=function(c){var b=this.EncodeURLIMG;if(!c)return"";if(window.ActiveXObject)return execScript('SetLocale "zh-cn"',
"vbscript"),c.replace(/[\d\D]/g,function(a){window.vbsval="";execScript('window.vbsval=Hex(Asc("'+a+'"))',"vbscript");return"%"+window.vbsval.slice(0,2)+"%"+window.vbsval.slice(-2)});b.src="nothing.png?separator="+c;return b.src.split("?separator=").pop()};this.encodeURL=function(c){return encodeURIComponent(c)};this.doNothing=function(){return!0};this.htmlEscape=function(c){void 0!=c&&(c=c.toString().replace(/[<>&"]/g,function(b){switch(b){case "<":return"&lt;";case ">":return"&gt;";case "&":return"&amp;";
case '"':return"&quot;"}}));return c};this.orgAuthPwd=function(c){return this.securityEncode(c,"RDpbLfCPsJZ7fiv","yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciXTysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgMLwygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3sfQ1xtXcPcf1aT303wAQhv66qzW")};this.securityEncode=function(c,b,a){var d="",g,e,f,h,k=187,l=187;e=c.length;f=b.length;h=a.length;g=e>f?e:f;for(var m=0;m<g;m++)l=
k=187,m>=e?l=b.charCodeAt(m):m>=f?k=c.charCodeAt(m):(k=c.charCodeAt(m),l=b.charCodeAt(m)),d+=a.charAt((k^l)%h);return d};this.simulateMouseC=function(c){simulateMouseC=!0==isIE&&!1==isIENormal?function(b){var a=document.createEventObject();a.sceenX=100;a.sceenY=0;a.clientX=0;a.clientY=0;a.ctrlKey=!1;a.altKey=!1;a.shiftKey=!1;a.button=0;b.fireEvent("onclick",a)}:function(){};simulateMouseC(c)};this.checkCapsLockUp=function(c){var b=c||window.event;c=b.keyCode?b.keyCode:b.which;b=b.shiftKey?b.shiftKey:
16==c?!0:!1;return 65<=c&&90>=c&&!b||97<=c&&122>=c&&b?!0:!1};this.emptyNodes=function(c){for(;c&&c.firstChild;)c.removeChild(c.firstChild)};this.netSpeedTrans=function(c){c=parseInt(c);c=1073741824<=c?(c/1073741824).toFixed(0)+"GB/s":1048576<=c?(c/1048576).toFixed(0)+"MB/s":(c/1024).toFixed(0)+"KB/s";return c.toString()};this.log=function(){var c="",b=arguments.length;if(!0===this.logSwitch||!0==$.local){for(var a=0;a<b;a++)c+="'"+arguments[a]+"', ";try{eval("console.log("+(c+"'.'")+")")}catch(d){}}};
this.compareObj=function(c,b){var a=!0,d;for(d in c)if("object"==typeof c[d])if(void 0!=b[d]){if(a=compareObj(c[d],b[d]),!1==a)return!1}else return!1;else if(c[d]!=b[d])return!1;return a};this.strToArry=function(c){if(!0==/^\((\-?\w+\,)+\-?\w+\)$/gi.test(c))return c.substring(1,c.length-1).split(",")}}
function Switch(c,b,a){this.switchCon=id(c);this.switchBall=$("#"+c+" i.switchBall")[0];this.switchBg=$("#"+c+" i.switchBg")[0];this.switchTip=$("#"+c+" ~ label")[0];this.callback=a;this.state=b;this.rightPos;this.padding=-9;this.step=20;this.stepTime=5;"function"!=typeof Switch.prototype.switchInit&&(Switch.prototype.switchInit=function(){var a=this.state,b=this.switchBall,c=this.switchBg;null!=this.switchCon&&null!=b&&(this.rightPos=c.offsetWidth,this.setState(a),"function"==typeof this.callback&&
this.callback(a),b.onmousedown=this.draggableBind(),c.onclick=this.switchBgClick())},Switch.prototype.setState=function(a){var b=this.switchCon,c=this.switchBall,f=this.switchBg,h=this.switchTip;this.state=a;b.value=a;c.style.left=0-c.offsetWidth/2+a*this.rightPos+"px";if(1==a){f.style.background="#6289D7";if(!isIETenLess||isIETen)f.style.background="linear-gradient(#6289D7, #6599FF)";null!=h&&(h.innerHTML=label.open)}else{f.style.background="#A7A9AE";if(!isIETenLess||isIETen)f.style.background="linear-gradient(#A7A9AE, #B8BBC0)";
null!=h&&(h.innerHTML=label.close)}},Switch.prototype.switchChgState=function(a){a=1-a;this.setState(a);"function"==typeof this.callback&&this.callback(a)},Switch.prototype.switchCHandle=function(){var a=this.state,b=this.switchBall,c=1==a?-1:1,f=parseInt(b.style.left),h=this.rightPos,k=this;1==a&&f<=this.padding||0==a&&f>=h+this.padding?this.switchChgState(a):(b.style.left=f+c*h+"px",window.setTimeout(function(){k.switchCHandle()},10))},Switch.prototype.msMove=function(a,b,c){b=b.x-c.x;c=this.switchBg.offsetWidth-
a.offsetWidth/2;b=-10<b?b:-10;a.style.left=(b>c?c:b)+"px"},Switch.prototype.switchBgClick=function(){var a=this;return function(b){b=b||window.event;a.switchBg==(b.target||b.srcElement)&&a.switchCHandle()}},Switch.prototype.draggableBind=function(){var a=this;return function(b){b=b?b:window.event;var c=getMousePos(b),f=b.target||b.srcElement,h={x:c.x-f.offsetLeft};document.onmousemove=function(b){b=b?b:window.event;b=getMousePos(b);clearSelection();a.msMove(f,b,h)};document.onmouseup=function(b){clearSelection();
document.onmousemove=null;document.onmouseup=null;a.switchCHandle()};stopProp(b)}});this.switchInit()}
function HighSet(){this.hsStatSet=function(c,b,a){var d,g;void 0==a?(d=$("ul.gridStatus")[0],g=$("ul.gridStatus label")[0],statPic=$("ul.gridStatus i")[0]):(d=$("#"+a)[0],g=$("#"+a+" label")[0],statPic=$("#"+a+" i")[0]);switch(c){case "null":d.style.visibility="hidden";break;case "correct":g.innerHTML=b;statPic.style.background="url(../web-static/images/routerBg.png) -353px -122px no-repeat";d.style.visibility="visible";break;case "error":g.innerHTML=b;statPic.style.background="url(../web-static/images/routerBg.png) -306px -209px no-repeat";
d.style.visibility="visible";break;case "link":g.innerHTML=b;statPic.style.background="url(../web-static/images/routerBg.png) -372px -123px no-repeat";d.style.visibility="visible";break;case "exception":g.innerHTML=b;statPic.style.background="url(../web-static/images/routerBg.png) -334px -123px no-repeat";d.style.visibility="visible";break;default:d.style.visibility="hidden"}};this.disInputTip=function(c,b){null!=c&&void 0!=b&&("error"==b.toLowerCase()?this.setStyle(c,{visibility:"visible",background:"url(../../web-static/images/wzd.png) no-repeat -116px -243px"}):
"ok"==b.toLowerCase()?this.setStyle(c,{visibility:"visible",background:"url(../../web-static/images/wzd.png) no-repeat -95px -243px"}):"warn"==b.toLowerCase()?this.setStyle(c,{visibility:"visible",background:"url(../../web-static/images/wzd.png) no-repeat -137px -243px"}):c.style.visibility="hidden")};this.initHoverBd=function(){$("input.hoverBd").bind("focus",function(){this.parentNode.style.border="1px solid #A0D468"}).bind("blur",function(){this.parentNode.style.border="1px solid #FFFFFF"})};this.disableInput=
function(c,b){var a="object"==typeof c?c:id(c);a.disabled=b?!0:!1;a.style.color=b?"#999999":"#333333"};this.disableBtn=function(c,b){var a="object"==typeof c?c:id(c),d=a.className;a.disabled!=b&&(a.disabled=b?!0:!1,a.className=b?d.replace("subBtn","subBtnDis"):d.replace("subBtnDis","subBtn"))};this.disableClick=function(c,b,a){c="object"==typeof c?c:id(c);a=null;null==c.disableTimes&&(c.disableTimes=0);if(!0==b)return 0>=c.disableTimes&&(c.oldOnClick=c.onclick,c.onclick=null),a=c.oldOnClick,c.disableTimes++,
a;c.disableTimes--;0>=c.disableTimes&&(null==c.onclick&&(c.onclick=c.oldOnClick),c.oldOnClick=null);return null};this.hsLoading=function(c,b,a){var d=id(c),g,e;e="../web-static/images/loading.gif";var f=12,h="hsLoadingCon",k="";null!=d&&(null!=a&&(e=a.imgUrl||e,f=a.loadingLeft||f,h=a.conClassName||h,k=a.noteStr||k),g=d.parentNode,clearTimeout(g.handleDelayHd),!0==b?(g.style.position="relative",a=$("#"+c+" ~ div."+h),null==a[0]?(a=el("div"),a.className=h,g.appendChild(a),b=el("img"),b.src=e,a.appendChild(b),
e=el("span"),a.appendChild(e)):(b=a.find("img")[0],e=a.find("span")[0],a=a[0]),a.style.top=d.offsetTop+parseInt((d.offsetHeight-parseInt(getNodeDefaultView(b,"height")))/2)+"px",a.style.left=d.offsetLeft+d.offsetWidth+f+"px",0!=k.length&&(e.innerHTML=k,a.style.width=parseInt(getNodeDefaultView(b,"width"))+e.offsetWidth+parseInt(getNodeDefaultView(e,"marginLeft"))+"px"),a.style.visibility="visible"):g.handleDelayHd=window.setTimeout(function(){var a=$("#"+c+" ~ div."+h)[0];g.handleDelayHd=null;void 0!=
a&&(a.style.visibility="hidden")},500))};this.hsSwitchState=function(c,b){var a=$("#"+c+" ~ span.hsSwitchState")[0];null!=a&&(1==b?(a.innerHTML=statusStr.opened,a.style.color="#86B157"):(a.innerHTML=statusStr.closed,a.style.color="#FB6E52"))}}
function Basic(){this.gIsFactory=!1;this.NET_STATE_INDEX=0;this.LINK_EPTMGT_INDEX=1;this.APPS_MGT_INDEX=2;this.ROUTE_SET_INDEX=3;this.contentPageLoad=function(){loadBasic()};this.gBasicMenu={menuIndex:NET_STATE_INDEX,subMenuUrl:""};this.setBasicMenu=function(a,b){this.gBasicMenu.menuIndex=void 0==a?this.gBasicMenu.menuIndex:a;this.gBasicMenu.subMenuUrl=void 0==b?this.gBasicMenu.subMenuUrl:b};this.setBasicSubMenuUrl=function(a){this.gBasicMenu.subMenuUrl=a};this.loadBasic=function(a,b,g){this.setBasicMenu(a,
b);loadPage("Basic.htm","Con",g)};this.basicAutoFit=function(){var a=document.documentElement.clientHeight;768>a?document.body.style.height="768px":900<a&&(document.body.style.height="900px");document.body.style.fontSize="12px"};this.setInnerText=function(a,b){isFirefox?id(a).textContent=b:id(a).innerText=b};this.setDomSize=function(a,b){var g=b.width?b.width:null,c=b.height?b.height:null,f=b.paddingTop?b.paddingTop:0,h=b.paddingBottom?b.paddingBottom:0,k=b.paddingLeft?b.paddingLeft:0,l=b.paddingRight?
b.paddingRight:0;isFirefox&&(null!=g&&(g=g+k+l),null!=c&&(c=c+f+h));null!=g&&(a.style.width=g+"px");null!=c&&(a.style.height=c+"px");a.style.padding=f+"px "+l+"px "+h+"px "+k+"px"};this.getInnerText=function(a){var b={};return b=isFirefox?id(a).textContent:id(a).innerText};var c=!1,b=[];this.usrdefErrHandle=function(a){var b="";switch(parseInt(a)){case ENONE:return!0;case IPCUSRDEFIDERR:b=errStr.usrdefNoExist;break;case IPCUSRDEFDATAERR:b=errStr.usrdefDataInvalid;break;case IPCUSRDEFTESTERR:b=errStr.usrdefTesting;
break;case IPCUSRDEFTALKERR:b=errStr.usrdefTalking;break;default:b=errStr.invRequestFail}closeToast();showAlert(b,objOrId);return!1};this.devSoundListen=function(a,b){var g=uciUsrDefAlarm.fileName,c=uciUsrDefAlarm.secName.testAudio,f=uciUsrDefAlarm.optName.id,h=uciUsrDefAlarm.optName.force;id(a).onclick=function(){var a={};a[g]={};a[g][c]={};a[g][c][f]=b;a[g][c][h]=1;showToast();$.action(a,function(a){!0==usrdefErrHandle(a[ERR_CODE])&&showToast("success")})}};this.devSoundFocus=function(a,b){id(a).onmouseover=
function(){!1==c&&(id("devsound_"+b).style.border="1px solid #578FFF",id("testListen_"+b).style.display="")};id(a).onmouseout=function(){!1==c&&(id("devsound_"+b).style.border="1px solid #E1E3E6",0!=b&&(id("devsound_"+b).style.borderTop=0),id("testListen_"+b).style.display="none")}};this.usrDefSoundListen=function(a,d){var g=uciUsrDefAlarm.fileName,c=uciUsrDefAlarm.secName.testAudio,f=uciUsrDefAlarm.optName.id,h=uciUsrDefAlarm.optName.force;id(a).onclick=function(){var a={};a[g]={};a[g][c]={};a[g][c][f]=
b[d];a[g][c][h]=1;showToast();$.action(a,function(a){!0==usrdefErrHandle(a[ERR_CODE])&&showToast("success")})}};this.usrDefSoundDel=function(a,d){var g=uciUsrDefAlarm.fileName,c=uciUsrDefAlarm.secName.deleteAudio,f=uciUsrDefAlarm.optName.id;id(a).onclick=function(){var a={},k=getInnerText("soundList").replace(/[^0-9]/ig,"");a[g]={};a[g][c]={};a[g][c][f]=[b[d]];showToast();$.action(a,function(a){ENONE==a[ERR_CODE]&&(id("usrdef_"+d).style.display="none",setInnerText("soundList",label.soundList+label.lBrackets+
(k-1)+label.rBrackets),showToast("success"))})}};this.usrDefSoundRename=function(a,b){id(a).onclick=function(){var a=getInnerText("usrdef_text"+b);id("usrdef_edit"+b).value=a;c=!0;id("usrdef_edit"+b).style.display="";id("usrdef_save"+b).style.display="";id("usrdef_cancel"+b).style.display="";id("usrdef_text"+b).style.display="none";id("usrdef_test"+b).style.display="none";id("usrdef_delete"+b).style.display="none";id("usrdef_rename"+b).style.display="none"}};this.usrDefSoundSave=function(a,d){var g=
uciUsrDefAlarm.fileName,e=uciUsrDefAlarm.secName.modifyAudio,f=uciUsrDefAlarm.optName.id,h=uciUsrDefAlarm.optName.name;id(a).onclick=function(){var a={},l=id("usrdef_edit"+d).value;l?(c=!1,a[g]={},a[g][e]={},id("usrdef_edit"+d).style.display="none",id("usrdef_text"+d).style.display="",setInnerText("usrdef_text"+d,l),id("usrdef_test"+d).style.display="",id("usrdef_delete"+d).style.display="",id("usrdef_rename"+d).style.display="",id("usrdef_save"+d).style.display="none",id("usrdef_cancel"+d).style.display=
"none",a[g][e][f]=[b[d]],a[g][e][h]=[l],showToast(),$.action(a,function(a){!0==usrdefErrHandle(a[ERR_CODE])&&showToast("success")})):showAlert(errStr.ipcUsrDefAudioLenErr)}};this.usrDefSoundCancel=function(a,b){id(a).onclick=function(){c=!1;id("usrdef_edit"+b).style.display="none";id("usrdef_save"+b).style.display="none";id("usrdef_cancel"+b).style.display="none";id("usrdef_text"+b).style.display="";id("usrdef_test"+b).style.display="";id("usrdef_delete"+b).style.display="";id("usrdef_rename"+b).style.display=
"";closeNoteAll()}};this.usrDefSoundNameCheck=function(a,b){id(a).oninput=function(){for(var a=0,c=0,f=id("usrdef_edit"+b).value,a=0;a<f.length;a++){var h=f.charCodeAt(a);1<=h&&126>=h||65376<=h&&65439>=h?c++:c+=3;if(32<c){id("usrdef_edit"+b).value=id("usrdef_edit"+b).value.substr(0,a);break}}}};this.usrDefSoundFocus=function(a,b){id(a).onmouseover=function(){!1==c&&(id("usrdef_"+b).style.border="1px solid #578FFF",id("usrdef_test"+b).style.display="",id("usrdef_delete"+b).style.display="",id("usrdef_rename"+
b).style.display="",id("usrdef_save"+b).style.display="none",id("usrdef_cancel"+b).style.display="none")};id(a).onmouseout=function(){!1==c&&(id("usrdef_"+b).style.border="1px solid #E1E3E6",id("usrdef_"+b).style.borderTop=0,id("usrdef_test"+b).style.display="none",id("usrdef_delete"+b).style.display="none",id("usrdef_rename"+b).style.display="none",id("usrdef_save"+b).style.display="none",id("usrdef_cancel"+b).style.display="none")}};this.setUsrDefSoundName=function(a){var b=0,g=0;a=a.substring(a.lastIndexOf("\\")+
1);a=a.substring(0,a.indexOf(".g711"));for(b=0;b<a.length;b++){var c=a.charCodeAt(b);1<=c&&126>=c||65376<=c&&65439>=c?g++:g+=3;if(32<g){a=a.substr(0,b);break}}return a};this.openSoundInfo=function(a,b,g,c){id(a).onclick=function(){showSoundInfo(b,g,c);id("confCon").onmousewheel=function(){return!1};id("confCon").onkeydown=function(a){a=a||window.event;if(38==a.keyCode||40==a.keyCode)return!1}}};this.showSoundInfo=function(a,d,g){var e=0,f={},h={},k={},l=uciUsrDefAlarm.fileName,m=uciUsrDefAlarm.secName.usrDefAudio,
n=uciUsrDefAlarm.optName.id,p=uciUsrDefAlarm.optName.name,r=uciUsrDefAlarm.secName.modifyAudio,u={},t={},q={},t=(document.body.offsetHeight-id("soundInfoEditCon").scrollHeight)/2;0>t&&(t=0);q=(document.body.offsetWidth-id("soundInfoEditCon").scrollWidth)/2;0>q&&(q=0);c=!1;f[l]={};f[l][KEY_TABLE]=[m];$.query(f,function(c){if(ENONE==c[ERR_CODE]){h=c[l][m];k=formatTableData(h);for(var y in k)c=k[y],b[e]=c[n],c[p]?setInnerText("usrdef_text"+e,c[p]):(setInnerText("usrdef_text"+e,g),f[l]={},f[l][r]={},
f[l][r][n]=[b[e]],f[l][r][p]=[g],$.action(f,function(a){!0==usrdefErrHandle(a[ERR_CODE])&&showToast("success")})),id("usrdef_edit"+e).style.display="none",id("usrdef_save"+e).style.display="none",id("usrdef_cancel"+e).style.display="none",id("usrdef_text"+e).style.display="",id("usrdef_"+e).style.display="",e++;for(setInnerText("soundList",label.soundList+label.lBrackets+(a+e)+label.rBrackets);e<d;e++)id("usrdef_"+e).style.display="none"}showCover(function(a){id("soundInfoEditCon").style.top=t+"px";
id("soundInfoEditCon").style.left=q+"px";id("soundInfoEditCon").style.position="fixed";id("soundInfoEditCon").style.zIndex=1019;$("#"+a.id).css("opacity","0");u=new NiceScroll("SoundInfoShowCon");u.scrollTipOpacity(1);u.scrollTipSet({background:"#999999"});u.scrollBarSet({zIndex:1019,mLeft:11,mTop:0});u.init()});setHideFlag(!0)})};this.closeSoundInfo=function(a,b,g,c){var f=id(a),h=uciUsrDefAlarm.fileName,k=uciUsrDefAlarm.secName.usrDefAudio,l=uciUsrDefAlarm.optName.id,m=uciUsrDefAlarm.optName.name;
f.onclick=function(){var a={},p={},r,u=[];p[b]={};p[b][NAME]="sound_alarm_info";p[h]={};p[h][KEY_TABLE]=[k];for(var t=0;t<g.length;t++)u.push(g[t]);$.query(p,function(g){if(ENONE==g[ERR_CODE]){a=g[h][k];var p=formatTableData(a),t;for(t in p){var w=p[t];w[m]||(w[m]=label.usrdefSound);u.push({str:w[m],value:w[l]})}r=g[b].sound_alarm_info.sound_alarm_type;$("#selOptsUlsoundTypeSelect").empty();void 0!=id("selOptsUlsoundTypeSelect")&&id("soundTypeSelect").parentNode.removeChild(id("selOptsUlsoundTypeSelect"));
"function"==typeof c&&c(u,r,f)}},!1);setHideFlag(!1);hideCover(function(){closeNoteAll();id("soundInfoEditCon").style.top="-9999px";document.getElementsByClassName&&document.getElementsByClassName("detailCon")[0].style.pointerEvents&&(document.getElementsByClassName("detailCon")[0].style.pointerEvents="auto")});id("confCon").onmousewheel=function(){return!0};id("confCon").onkeydown=function(a){a=a||window.event;if(38==a.keyCode||40==a.keyCode)return!0}}};this.uploadSoundFile=function(a,b,g,c){};this.checkFile=
function(a){a=id(a).value;return""==a?(showAlert(label.upWarn),!1):-1==a.search(/\.g711$/)?(showAlert(errStr.fileFmttErr),!1):!0}}
function ShowTips(){this.alertTimeHd;this.shAltObjOrId;this.showAlert=function(c,b,a,d){showAlertEx(c,btn.ok,b,a,d)};this.showAlertEx=function(c,b,a,d,g){!0==isIESix?(alert(c),errStr.invPermissionDenied==c&&$.logout()):this.showCover(function(){var e=id("Error"),f=id("hsErr"),h,k=this;this.shAltObjOrId=a;h=$("div.hsTip input.subBtn")[0];null==f&&(f=document.createElement("div"),f.id="hsErr",f.className="hsTip",h=el("iframe"),h.frameborder=0,h.className="tipIframe",f.appendChild(h),h=document.createElement("p"),
h.className="detail",f.appendChild(h),h=document.createElement("input"),h.type="button",h.className="subBtn btnA",h.value=b,f.appendChild(h),e.appendChild(f));getChildNode(f,"p").innerHTML=c;d&&(f.style.marginLeft="280px");h.onclick=function(){errStr.invPermissionDenied==c?$.logout():("function"==typeof g&&g(),k.closeAlert(!0))};e.style.visibility="visible";e.style.display="block";e.style.top="160px";!1==OS.portable?setStyle(e,{position:"fixed"}):setStyle(e,{position:"absolute"});!1==OS.iPhone&&!1==
OS.iPad&&h.focus();this.alertTimeHd=$.setTimeout(function(){k.closeAlert(null,c)},3E4)})};this.closeAlert=function(c,b){null!=b&&errStr.invPermissionDenied==b&&$.logout();this.hideCover(function(){var a=id("Error"),b=this.shAltObjOrId;if(null!=a)if(a.style.top="-9999px",a.style.visibility="hidden",clearTimeout(this.alertTimeHd),this.alertTimeHd=null,!0!=c||void 0==b||"object"!=typeof b&&0==b.length)this.shAltObjOrId="";else try{"object"!=typeof b&&(b=id(b)),b.focus(),b.select()}catch(g){}})};this.showConfirmIpc=
function(c,b,a,d){this.showCover(function(){var g=id("Confirm"),e=id("hsConf"),f,h=this;!0==isIESix?(g=confirm(c),this.closeConfirm(),b(g)):(null==e&&(e=document.createElement("div"),e.id="hsConf",e.className="hsTip",f=el("iframe"),f.frameborder=0,f.className="tipIframe",e.appendChild(f),f=document.createElement("p"),f.className="detail",e.appendChild(f),f=document.createElement("input"),f.type="button",f.className="subBtnB btnA",e.appendChild(f),f=document.createElement("input"),f.type="button",
f.className="subBtn btnA",e.appendChild(f),g.appendChild(e)),f=$("#hsConf input"),f[0].value=void 0!=a?a:btn.cancel,f[1].value=void 0!=d?d:btn.ok,f[0].onclick=function(){h.closeConfirm();b(!1)},f[1].onclick=function(){h.closeConfirm();b(!0)},getChildNode(e,"p").innerHTML=c,g.style.visibility="visible",g.style.display="block",g.style.top="160px",!1==OS.portable?setStyle(g,{position:"fixed"}):setStyle(g,{position:"absolute"}))})};this.showConfirm=function(c,b){this.showCover(function(){var a=id("Confirm"),
d=id("hsConf"),g,e=this;!0==isIESix?(a=confirm(c),this.closeConfirm(),b(a)):(null==d&&(d=document.createElement("div"),d.id="hsConf",d.className="hsTip",g=document.createElement("p"),g.className="detail",d.appendChild(g),g=document.createElement("input"),g.type="button",g.className="subBtnB btnA",g.value=btn.cancel,d.appendChild(g),g=document.createElement("input"),g.type="button",g.className="subBtn btnA marBtn",g.value=btn.ok,d.appendChild(g),a.appendChild(d)),g=$("#hsConf input"),g[0].onclick=
function(){e.closeConfirm();b(!1)},g[1].onclick=function(){e.closeConfirm();b(!0)},getChildNode(d,"p").innerHTML=c,a.style.visibility="visible",a.style.display="block",a.style.top="160px",!1==OS.portable?setStyle(a,{position:"fixed"}):setStyle(a,{position:"absolute"}))})};this.closeConfirm=function(){this.hideCover(function(){var c=id("Confirm"),b=id("hsConf");null!=c&&(c.style.top="-9999px",c.style.visibility="hidden",b&&c.removeChild(b))})};this.showConfirmB=function(c,b){this.showCover(function(){var a=
id("Confirm"),d=id("hsConf"),g,e=this;!0==isIESix?(a=confirm(c),this.closeConfirm(),b(a)):(null==d&&(d=document.createElement("div"),d.id="hsConf",d.className="hsTip",g=document.createElement("i"),g.className="confirmImg",d.appendChild(g),g=document.createElement("p"),g.className="detailImg",d.appendChild(g),g=document.createElement("input"),g.type="button",g.className="subBtnB ok",g.value=btn.cloudRetry,d.appendChild(g),g=document.createElement("input"),g.type="button",g.className="subBtn cancel",
g.value=btn.cloudBack,d.appendChild(g),a.appendChild(d)),g=$("#hsConf input"),g[0].onclick=function(){e.closeConfirm();b(!0)},g[1].onclick=function(){e.closeConfirm();b(!1)},getChildNode(d,"p").innerHTML=c,a.style.visibility="visible",a.style.display="block",a.style.top="90px",!1==OS.portable?setStyle(a,{position:"fixed"}):setStyle(a,{position:"absolute"}))})};this.closeConfirmB=function(){this.hideCover(function(){var c=id("Confirm");null!=c&&(c.style.top="-9999px",c.style.visibility="hidden")})};
this.showConfirmC=function(c,b,a,d,g,e){this.showCover(function(){var f=id("Confirm"),h=id("hsConf"),k,l=this;!0==isIESix?(f=confirm(b),this.closeConfirm(),a(f)):(null==h&&(h=document.createElement("div"),h.id="hsConf",h.className="hsTipC",k=el("iframe"),k.frameborder=0,k.className="tipIframe",h.appendChild(k),k=document.createElement("h4"),k.className="title",h.appendChild(k),k=document.createElement("i"),k.id="closeTip",h.appendChild(k),k=document.createElement("p"),k.className="detail",h.appendChild(k),
k=document.createElement("input"),k.type="button",k.className="subBtnB btnA",h.appendChild(k),k=document.createElement("input"),k.type="button",k.className="subBtn btnA",h.appendChild(k),f.appendChild(h)),k=$("#hsConf input"),k[0].value=void 0==d?btn.cancel:d,k[1].value=void 0==g?btn.ok:g,k[0].onclick=function(){l.closeConfirm();a(!1)},k[1].onclick=function(){l.closeConfirm();a(!0)},id("closeTip").onclick=function(){l.closeConfirm();(void 0==e||e)&&a(!1)},getChildNode(h,"h4").innerHTML=c,getChildNode(h,
"p").innerHTML=b,f.style.visibility="visible",f.style.display="block",f.style.top="160px",!1==OS.portable?setStyle(f,{position:"fixed"}):setStyle(f,{position:"absolute"}))})};this.showConfirmD=function(c,b,a,d,g,e,f,h){this.showCover(function(){var k=id("Confirm"),l=id("hsConf"),m,n=this;!0==isIESix?(k=confirm(b),this.closeConfirm(),a(k)):(null==l&&(l=document.createElement("div"),l.id="hsConf",l.className="hsTipC",m=el("iframe"),m.frameborder=0,m.className="tipIframe",l.appendChild(m),m=document.createElement("h4"),
m.className="title",l.appendChild(m),m=document.createElement("i"),m.id="closeTip",l.appendChild(m),m=document.createElement("p"),m.className="detail",l.appendChild(m),m=document.createElement("input"),m.type="button",m.className="subBtnB btnA",l.appendChild(m),m=document.createElement("input"),m.type="button",m.className="subBtnB btnA",l.appendChild(m),m=document.createElement("input"),m.type="button",m.className="subBtn btnA",m.style.marginLeft="8px",l.appendChild(m),k.appendChild(l)),m=$("#hsConf input"),
m[0].value=void 0==d?btn.cancel:d,m[1].value=void 0==g?btn.ok:g,m[2].value=void 0==e?btn.ok:e,m[0].onclick=function(){n.closeConfirm();a(!1)},m[1].onclick=function(){n.closeConfirm();a(!0)},m[2].onclick=function(){n.closeConfirm();f(!0)},id("closeTip").onclick=function(){n.closeConfirm();(void 0==h||h)&&a(!1)},getChildNode(l,"h4").innerHTML=c,getChildNode(l,"p").innerHTML=b,k.style.visibility="visible",k.style.display="block",k.style.top="160px",!1==OS.portable?setStyle(k,{position:"fixed"}):setStyle(k,
{position:"absolute"}))})};this.showNote=function(c,b,a,d){var g=id(c),e=$("div.cloudManageCon")[0]||$("div.basicConR1")[0]||$("div.lgCon")[0]||document.body,f,h,k="#FF5500";h=1;for(f=g;;){if(f==e||null==f){null==f&&(e=g.offsetParent);break}f=f.offsetParent}if(void 0!=g){void 0!=d&&(k=void 0==d.changeColor?k:d.changeColor,h=void 0==d.changeBW?h:d.changeBW);attachEvnt(id(c),"focus",function(){closeNoteAll()});d=id(c+"noteDiv");if(null==d){d=el("div");d.className=void 0==a?"noteDiv":"noteDiv "+a;d.id=
c+"noteDiv";a=c=el("span");c.className="noteStr";d.appendChild(c);c=f=el("i");f.className="noteArrow";d.appendChild(f);e.appendChild(d);f=getNodeDefaultView(g,"border-left-color");if(void 0==f||0==f.length)f=getNodeDefaultView(g,"borderLeftColor");g.orgBC=f;f=getNodeDefaultView(g,"border-left-width");if(void 0==f||0==f.length)f=getNodeDefaultView(g,"borderLeftWidth");g.orgBW=f=isNaN(parseInt(f))&&""!=parseInt(f)?0:parseInt(f);g.changeBW=h=parseInt(h);g.wd=parseInt(getNodeDefaultView(g,"width"));g.ht=
parseInt(getNodeDefaultView(g,"height"));g.lineht=parseInt(getNodeDefaultView(g,"lineHeight"))}else h=$(d),a=h.find("span")[0],c=h.find("i.noteArrow")[0];void 0!=b&&(a.innerHTML=b);g.style.borderColor=k;g.style.boxShadow="";g.style.borderWidth=g.changeBW+"px";b=2*(g.orgBW-g.changeBW);g.style.height=g.ht+b+"px";g.style.width=g.wd+b+"px";g.lineht&&(g.style.lineHeight=g.lineht+b+"px");e=getoffset(g,e);height=d.offsetHeight;d.style.top=e.top+g.clientHeight/2-height/2+"px";d.style.left=e.left+g.clientWidth+
9+"px";c.style.top=d.clientHeight/2-5+"px";d.style.visibility="visible"}};this.closeNote=function(c){var b=id(c);c=id(c+"noteDiv");if(void 0!=c){try{void 0!=b.orgBC&&0!=b.orgBC.length&&(b.style.borderColor=b.orgBC,b.style.borderWidth=b.orgBW+"px",b.style.height=b.ht+"px",b.style.width=b.wd+"px",b.style.borderColor="",b.style.boxShadow="",b.style.lineHeight=b.lineht+"px")}catch(a){log(a)}c.style.visibility="hidden"}};this.closeNoteAll=function(){$("input").each(function(){(0<="text password number file button".indexOf(this.type.toLowerCase())||
0<=this.className.indexOf("text"))&&0<this.id.length&&closeNote(this.id)})};this.removeNoteAll=function(){$("div.noteDiv").each(function(){this.parentNode.removeChild(this)})};this.showLoading=function(c,b,a,d){closeLoading();showCover(function(g){var e,f,h,k,l;g=$("#"+g.id);f=0.1;void 0!=a&&(e=a.loadConClass,h=a.loadClass,k=a.coverLoadingClass,l=a.detailClass,f=a.coverOpacity||0);g.css("opacity",f);f=el("div");f.className="LoadConCover";document.body.appendChild(f);g=el("div");g.className=e||"coverLoadCon";
f.appendChild(g);e=el("div");e.className=h||"coverLoad";g.appendChild(e);void 0==k?(h=el("img"),h.className="coverLoading",h.src="../web-static/images/loading.gif"):(h=el("i"),h.className=k);e.appendChild(h);k=el("p");k.className=l||"coverLoadNote";k.innerHTML=void 0==c?label.checkingWait:c;e.appendChild(k);d=void 0==d?!0:d;!0==d&&(l=el("input"),l.type="button",l.className="coverLoadClose cancelBtn",l.value=btn.cancel,l.onclick=function(){closeLoading(b)},e.appendChild(l))})};this.closeLoading=function(c){var b=
$("div.LoadConCover")[0];null!=b&&($("#"+this.CoverId).css("opacity",""),document.body.removeChild(b),hideCover(c))};this.showPhWzdAlert=function(c,b){this.showCover(function(){var a,d,g,e=this;a=id("phWzdAlertCon");null==a?(a=document.createElement("div"),a.className="phWzdAlertCon",a.id="phWzdAlertCon",document.body.appendChild(a),d=document.createElement("img"),d.src="../web-static/images/redWarn.png",a.appendChild(d),d=document.createElement("p"),a.appendChild(d),g=document.createElement("label"),
a.appendChild(g),g.innerHTML=btn.confirm):(d=$("#phWzdAlertCon p")[0],g=$("#phWzdAlertCon label")[0]);a.style.top="150px";a.style.visibility="visible";d.innerHTML=c;g.onclick=function(){"function"==typeof b&&b();e.closePhWzdAlert()}})};this.closePhWzdAlert=function(){this.hideCover(function(){var c=id("phWzdAlertCon");null!=c&&(c.style.top="-9999px")})};this.gToastConCoverId="toastConCover";this.showToast=function(c,b){showCover(function(a){var d=0,g="toastCon",e="toastConCover",f=$("#"+gToastConCoverId),
h=!1,k="../web-static/images/loading.gif",l="";void 0!=b&&(d=b.coverOpacity||0,g=b.toastConCN||g,e=b.toastConverCN||e,h=b.stopSuccessTime||h,k=b.loadGifUrl||k,l=b.noteStr||l);$("#"+a.id).css("opacity",d);null==f[0]?(f=el("div"),f.className=e,f.id=gToastConCoverId,toastCon=el("div"),toastCon.className=g,f.appendChild(toastCon),a=el("iframe"),a.frameborder=0,toastCon.appendChild(a),d=el("img"),toastCon.appendChild(d),a=el("span"),toastCon.appendChild(a),document.body.appendChild(f),attachEvnt(window,
"resize",function(){if("hidden"!=f.style.visibility){var a=(document.body.clientHeight-parseInt(getNodeDefaultView(toastCon,"height")))/2;f.style.top=parseInt(a)+"px"}})):(a=f.find("span")[0],d=f.find("img")[0],toastCon=f.find("div")[0],f=f[0]);try{clearTimeout(f.closeTimehd),clearTimeout(f.timeouthd)}catch(m){}switch(c){case "success":l=l||label.optSuccess;d.src="../web-static/images/correct.png";!0!==h&&(f.closeTimehd=window.setTimeout(closeToast,500));d.style.margin="20px 0 0 110px";break;case "setNTPSuccess":l=
l||label.saveNTPAddrSuccess;d.src="../web-static/images/correct.png";!0!==h&&(f.closeTimehd=window.setTimeout(closeToast,500));d.style.margin="20px 0 0 110px";break;case "fwUpload":l=l||label.fwUploadTip;d.src=k;d.style.margin="20px 0 0 110px";break;case "aiFwUpload":l=l||label.aiFwUploadTip;d.src=k;d.style.margin="20px 0 0 110px";break;case "bakUpload":l=l||label.bakUploadingTip;d.src=k;d.style.margin="20px 0 0 110px";break;case "warning":l=l||label.warning;d.src="../web-static/images/warning.png";
!0!==h&&(f.closeTimehd=window.setTimeout(closeToast,1E3));d.style.margin="20px 0 0 110px";break;default:l=l||label.plWait,d.src=k,d.style.margin="20px 0 0 110px"}f.style.top=parseInt((document.body.clientHeight-parseInt(getNodeDefaultView(toastCon,"height")))/2)+"px";a.innerHTML=l;f.style.visibility="visible";f.timeouthd=$.setTimeout(closeToast,12E4)})};this.closeToast=function(){var c=id(gToastConCoverId);if(null!=c){try{clearTimeout(c.timeouthd),clearTimeout(c.closeTimehd)}catch(b){log(b)}c.timeouthd=
null;c.closeTimehd=null;hideCover(function(){c.style.visibility="hidden";c.style.top="-9999px"})}}}
function Select(){this.selectUpInit=function(c,b,a,d,g,e){selectInit(c,b,a,d,g,{type:"up"},e)};this.selectInit=function(c,b,a,d,g,e,f){function h(a){for(var b,d,g=a.childNodes,c=0,e=g.length;c<e;c++)if(d=g[c],"li"==d.tagName.toLowerCase()&&(b=d.childNodes[0].style.visibility,d.style.backgroundColor="visible"==b?z:w,d.style.color="visible"==b?E:A,$.det_mutex_list))for(b=0;b<B.length;b++)d.title==B[b]&&0<=$.inArray(b+1,$.det_mutex_list[curIntelligentMode-1][uciDetectionCapability.optName.unsupportedList])&&
(d.style.color=C);a.style.visibility="hidden";a.style.top="-9999px";a.parentNode.style.position="static";"function"==typeof K&&K()}function k(a,b){var g=id(c),e=a.parentNode,f=e.childNodes,h=$("#"+c+" span.value")[0],k;if(3!=a.childNodes[0].nodeType){g.value=a.valueStr;h.value=a.valueStr;for(var l=0,m=f.length;l<m;l++)k=f[l],"li"==k.tagName.toLowerCase()&&(k.childNodes[0].style.visibility="hidden",k.style.backgroundColor=w,k.style.color=A);"visible"!=a.childNodes[0].style.visibility&&"function"==
typeof d&&!1!==b&&d(a.valueStr,g);a.childNodes[0].style.visibility="visible";a.style.backgroundColor=z;a.style.color=E;g=getChildNode(a,"span");g.className="selCross";h.innerHTML=htmlEscape(a.childNodes[1].nodeValue);e.style.visibility="hidden";e.style.top="-9999px";e.parentNode.style.position="static";"function"==typeof L&&L()}}function l(a){for(var b=0,d=a.length;b<d;b++){p=a[b];I=htmlEscape(getStrInMax(p.str.toString(),S));u="hidden";n=document.createElement("li");void 0==p.value&&b==F||F==p.value?
(u="visible",r.innerHTML=I,r.value=F,v.value=F,n.style.backgroundColor=z,n.style.color=E,n.innerHTML="<span class='selCross' style='visibility:"+u+"'></span>"+I):(n.style.color=A,n.innerHTML="<span class='selCrossOut' style='visibility:"+u+"'></span>"+I);n.title=void 0===p.title?p.str:p.title;n.valueStr=void 0!=p.value?p.value:b;n.className="option";n.onclick=function(a){a=a||window.event;k(this);stopProp(a)};if($.det_mutex_list)for(var g=0;g<B.length;g++)n.title==B[g]&&0<=$.inArray(g+1,$.det_mutex_list[curIntelligentMode-
1][uciDetectionCapability.optName.unsupportedList])&&(n.style.color=C,n.onclick=function(){showConfirmIpc(label.resCloseOnTip,function(a){!0==a&&(gResSwitchPageSign=1,unloadLogin())},btn.cancel,btn.goSwitch)});!0===M&&(n.onmouseover=function(a){a=a||window.event;a=a.srcElement||a.target;var b,d;if("span"!=a.tagName.toLowerCase()){b=a.parentNode.childNodes;for(var g=0,c=b.length;g<c;g++)if(d=b[g],"li"==d.tagName.toLowerCase()){d.style.backgroundColor=w;d.style.color=A;if($.det_mutex_list)for(var e=
0;e<B.length;e++)d.title==B[e]&&0<=$.inArray(e+1,$.det_mutex_list[curIntelligentMode-1][uciDetectionCapability.optName.unsupportedList])&&(d.style.color=C);d=getChildNode(d,"span");d.className="selCrossOut"}d=getChildNode(a,"span");d.className="selCross";a.style.backgroundColor=z;a.style.color=E;if($.det_mutex_list)for(e=0;e<B.length;e++)a.title==B[e]&&0<=$.inArray(e+1,$.det_mutex_list[curIntelligentMode-1][uciDetectionCapability.optName.unsupportedList])&&(a.style.color=C)}});t.appendChild(n)}}function m(a){var d=
$("#"+D),g=$("ul."+y.split(" ")[0]),e=id(c).offsetWidth-2,f=id(c).offsetHeight-1,k=-1*b.length*N-1,l=id(c).offsetHeight-1;g.each(function(){"visible"==this.style.visibility&&h(this);return!0});$("body").trigger("click");"up"==O?d.css({visibility:"visible",bottom:f,top:k,width:e,border:"solid 1px #C8CDD9",boxShadow:"0px -1px 2px rgba(0, 0, 0, 0.2)"}):d.css({visibility:"visible",top:l,width:e,border:"solid 1px #C8CDD9",boxShadow:"0px 1px 2px rgba(0, 0, 0, 0.2)"});v.style.borderColor=P;d[0].parentNode.style.position=
"relative";"function"==typeof Q&&Q();U||stopProp(a)}var n,p,r,u="hidden",t=document.createElement("ul"),q=void 0,v=id(c),y="selOptsUl",w="#FFFFFF",z="#EEF3F8",A="#333333",E="#000000",R="#333333",C="#999999",P="#C8CDD9",S,I,x,F=a,L,K,Q,G="#999999",H=1001,J=a=3,O="down",M=!0,D,T=!1;x=void 0;var U=!0==f?!0:!1,N=30,B=[menuStr.motionDetection,menuStr.tamperDetection,menuStr.lineCrossingDetection,menuStr.intrusionDetection,menuStr.regionEntranceDetection,menuStr.regionExitingDetection,menuStr.loiteringDetection,
menuStr.gatheringDetection,menuStr.fastMovingDetection,menuStr.parkingDetection,menuStr.unattendedBaggageDetection,menuStr.objectRemoveDetection,menuStr.abandonandTakenDetection,menuStr.audioAbnormal,menuStr.defocusDetection,menuStr.sceneChangeDetection,menuStr.faceDetection,menuStr.overlineCount,menuStr.peopleDetection,menuStr.vehicleDetection,label.ebikeDetectionEnhance,menuStr.nonVehicleDetection,menuStr.greeter,menuStr.faceComparison,label.faceAlbum,menuStr.passengerFlow,menuStr.peopleVisitDetection,
menuStr.parkingOccupy,menuStr.cryDetection,menuStr.peopleGallery,menuStr.emergencyCall,menuStr.licensePlateRecognition,menuStr.lingerDetection,menuStr.pirDetection,menuStr.disassembleDetection,menuStr.FallingobjectDetection,menuStr.temperatureMeasure,menuStr.maskDetection,menuStr.heatMap,menuStr.targetTrack,menuStr.smartTargetTrack,menuStr.overexposurePeopleSuppression,menuStr.pictureInPicture,menuStr.faceSnapShot,menuStr.smartData,menuStr.petDetection];void 0!=e&&(y=void 0==e.className?y:e.className,
w=void 0==e.colorN?w:e.colorN,z=void 0==e.colorC?z:e.colorC,A=void 0==e.fontColorN?A:e.fontColorN,E=void 0==e.fontColorC?E:e.fontColorC,R=void 0==e.valueColor?R:e.valueColor,C=void 0==e.valueDisColor?C:e.valueDisColor,G=void 0==e.scrollBg?G:e.scrollBg,H=void 0==e.scrollZIndex?H:e.scrollZIndex,a=void 0==e.scrollMLeft?a:e.scrollMLeft,J=void 0==e.scrollMTop?J:e.scrollMTop,O=void 0==e.type?O:e.type,L=e.optHideHd,K=e.optHideAllHd,Q=e.optShowHd,M=void 0==e.spMouseMove?M:e.spMouseMove,N=void 0==e.ulHeight?
N:e.ulHeight,x=void 0==e.listMaxHeight?x:e.listMaxHeight);e=v.parentNode;f=$("#"+c+" span.value");r=f[0];r.value=0;q=parseInt(f.css("width"));f=(0.61*parseInt(f.css("fontSize"))).toFixed(1);S=void 0==g?parseInt(q/f):g;v.value=0;t.className=y;D=(y+c).replace(/ +/gi,"");q=id(D);void 0!=q&&e.removeChild(q);t.id=D;e.appendChild(t);v.onmouseover=function(){T?v.style.cursor="default":(v.style.cursor="",v.style.borderColor="visible"==t.style.visibility?P:"#5A92FF")};v.onmouseout=function(){v.style.borderColor=
P};attachEvnt(document.body,"click",function(a){a=$("#"+D)[0];"undefined"!=typeof a&&h(a)});l(b);void 0!=x&&(g=$(t).children("li").get(0),void 0!=g&&(g=$(g).height(),x=x>g*b.length?(g+1)*b.length:x,$(t).css({height:x+"px"})));v.onclick=m;v.disable=function(a){v.onclick=!0==a?null:m;T=!0==a?!0:!1;r.style.color=!0==a?C:R};v.changeSel=function(a){$("#"+D+" li").each(function(){if(this.valueStr==a)return k(this),!1})};v.resetSel=function(a){$("#"+D+" li").each(function(){if(this.valueStr==a)return k(this,
!1),!1})};v.resetOptions=function(a,b){t.innerHTML="";F=b||0;l(a);v.resetSel(F)};x=new NiceScroll(t.id);x.scrollTipOpacity(1);x.scrollTipSet({background:G});10<$("#"+t.id+" li").length?(G=id(t.id),H=10*G.querySelector("li").clientHeight,0<H&&(G.style.height=H.toString()+"px"),x.scrollBarSet({zIndex:1014,mLeft:a,mTop:J})):x.scrollBarSet({zIndex:H,mLeft:a,mTop:J});x.init()}}
function Help(){var c=this;this.help="Help";this.helpDetail="helpDetail";this.helpContent="helpContent";this.helpURL="Help.htm";this.setHelpURL=function(b){this.helpURL=b};this.helpInit=function(b){var a;a=document.createElement("div");a.style.display="none";a.style.visibility="hidden";a.id=this.helpContent;document.body.appendChild(a);loadLgLessPage(this.helpURL,this.helpContent,b)};this.touchMoveHd=function(b){b=b||window.event;var a=b.touches[0].clientX,d=b.touches[0].clientY,g=id(c.help),a=a-
c.mousePos.x,d=d-c.mousePos.y,e=document.body.clientWidth-g.offsetWidth,f=document.documentElement.scrollHeight-g.offsetHeight,a=0<a?a:0,d=0<d?d:0;g.style.left=(a>e?e:a)+"px";g.style.top=(d>f?f:d)+"px";eventPreventDefault(b);clearSelection(b)};this.touchEndHd=function(b){detachEvnt(document,"touchmove",touchMoveHd);detachEvnt(document,"touchend",touchEndHd)};this.helpBind=function(b,a,d){b&&(b.onclick=function(b){b=b||window.event;helpShow(a,b.target||b.srcElement,d)})};this.helpClose=function(){var b=
id(this.help),a=id(this.helpDetail);null!=a&&null!=b&&(setStyle(b,{visibility:"hidden",top:"-9999px"}),a.innerHTML="")};this.helpVisible=function(b){var a=id(this.help),d=$(b).offset(),g=$("#basicContent").offset();setStyle(a,{visibility:"visible",top:g.top+"px",left:d.left-a.offsetWidth+b.offsetWidth+"px"})};this.helpDetailAppend=function(b){var a=id(b);null!=a&&(b=id(this.helpDetail),b.innerHTML=a.outerHTML)};this.helpShow=function(b,a,d){var g=$("#"+this.help+" p.helpTop");this.helpClose();g.attr("class",
void 0==d?"helpTop":"helpTop "+d);this.helpVisible(a);helpDetailAppend(b)};this.msMove=function(b,a,d){var g=a.x-d.x;a=a.y-d.y;d=document.body.clientWidth-b.offsetWidth;var c=document.documentElement.scrollHeight-b.offsetHeight,g=0<g?g:0;a=0<a?a:0;b.style.left=(g>d?d:g)+"px";b.style.top=(a>c?c:a)+"px"};this.draggableBind=function(b){var a=id(b);return function(b){b=b?b:window.event;b=getMousePos(b);var g={x:b.x-a.offsetLeft,y:b.y-a.offsetTop};document.onmousemove=function(b){b=b?b:window.event;b=
getMousePos(b);clearSelection();msMove(a,b,g)};document.onmouseup=function(){clearSelection();document.onmousemove=null;document.onmouseup=null}}};this.basicAppUpgradeInfoShow=function(b,a,d){var g=id("basicAppUpgradeInfo"),c,f;b=$(b);var h=b.offset();null==g&&(g=document.createElement("div"),g.id="basicAppUpgradeInfo",document.body.appendChild(g),c=document.createElement("p"),c.className="appsHelpTop",c.onmousedown=this.draggableBind(this.help),g.appendChild(c),f=document.createElement("span"),f.className=
"helpDes",f.innerHTML=label.updateNoteStr,c.appendChild(f),f=document.createElement("i"),f.onclick=function(){g.style.display="none";g.style.top="-9999px"},f.className="helpClose",c.appendChild(f),c=document.createElement("div"),c.id="basicAppUpgradeInfoDetail",c.className="basicAppUpgradeInfoDetail",g.appendChild(c),c=new NiceScroll("basicAppUpgradeInfoDetail"),c.scrollTipOpacity(1),c.scrollTipSet({background:"#B0CB33"}),c.scrollBarSet({zIndex:"1004",mLeft:"10"}),c.init());g.style.top=h.top+b[0].offsetHeight+
(d||0)+"px";g.style.left="515px";g.style.display="block";id("basicAppUpgradeInfoDetail").innerHTML="<pre>"+a+"</pre>"};this.basicAppUpgradeInfoClose=function(){var b=id("basicAppUpgradeInfo");null!=b&&(b.style.display="none",b.style.top="-9999px")}}
function LanDetect(){this.lanDetectSuccess=!1;this.LAN_DETECT_TIME=1E3;this.lanDetectTimeHd=null;this.lanDetectHandle=function(c){!1==$.result.timeout&&!1==this.lanDetectSuccess&&(this.lanDetectSuccess=!0,clearTimeout(this.lanDetectTimeHd),c())};this.lanDetecting=function(c){$.detect(function(){lanDetectHandle(c)});this.lanDetectTimeHd=$.setTimeout(function(){lanDetecting(c)},this.LAN_DETECT_TIME)}}
function ProgressBar(){this.progressBarHd=this.progressDeWidth=this.progressBar=null;this.initProgBar=function(){var c=id("ProgressBar"),b,a,d;null==c&&(c=document.createElement("div"),c.id="ProgressBar",document.body.appendChild(c),b=document.createElement("div"),b.className="progressBarCon",c.appendChild(b),d=document.createElement("p"),d.className="progressBarDes",b.appendChild(d),a=document.createElement("div"),a.className="progressBarPCon",b.appendChild(a),d=document.createElement("p"),d.className=
"progressBarPercent",a.appendChild(d),a=document.createElement("div"),a.className="progressBarBg",b.appendChild(a),d=document.createElement("p"),d.className="progressBarDe",a.appendChild(d),d=document.createElement("p"),d.className="progressBarTip",b.appendChild(d));this.progressBar=c;this.progressDeWidth=0};this.progRunning=function(c,b,a){var d=$("div.progressBarBg"),g=$("p.progressBarDe"),e=$("p.progressBarPercent"),f=this.progressDeWidth+2,h=parseInt(d.css("width"))-f-parseInt(g.css("paddingRight")),
k=b/100,l=0,m=this;g.css("width",f+"px");h=parseFloat(h/100);(function(){100<l?void 0!=a&&a():(!0==c&&(e[0].innerHTML=l+"%"),g.css("width",f+h*l+"px"),l++,m.progressBarHd=$.setTimeout(arguments.callee,k))})()};this.showProgBar=function(c,b,a,d,g){this.showCover(function(){this.initProgBar();setStyle(this.progressBar,{display:"block",visibility:"visible",top:"260px"});void 0==b&&(b=statusStr.rebooting);void 0==g?$("p.progressBarTip").css=("visibility","hidden"):$("p.progressBarTip")[0].innerHTML=g;
d=void 0==d?!0:d;$("div.progressBarPCon").css("visibility",!0==d?"visible":"hidden");$("p.progressBarDes")[0].innerHTML=b;this.progRunning(d,c,a)})};this.initProgBarApps=function(c){var b,a;null!=this.progressBar&&this.progressBar.parentNode.removeChild(this.progressBar);b=document.createElement("div");b.className="ProgressBarApps";c.appendChild(b);a=document.createElement("p");a.className="progressBarPercent";b.appendChild(a);c=document.createElement("div");c.className="progressBarBg";b.appendChild(c);
a=document.createElement("p");a.className="progressBarDe";c.appendChild(a);this.progressBar=b;this.progressDeWidth=parseInt($(a).css("width"))};this.showProgBarApps=function(c,b,a){var d=this;showCover(function(g){$(g).css("opacity","0");d.initProgBarApps(c);setStyle(d.progressBar,{display:"block",visibility:"visible",top:"0px"});d.progRunningP(!0,b,a,1E3)})};this.progRunningP=function(c,b,a,d){function g(b){p=parseInt(b.count);r=b[ERR_CODE];ERR_PERCENT==p?(u.closeProgBar(),"function"==typeof a&&
a(!1,r)):(!0==c&&!1==isNaN(p)&&(100<=p&&(p=100),h[0].innerHTML=p+"%"),l.css("width",m+n*p+"px"),100<=p?"function"==typeof a&&a(!0):u.progressBarHd=$.setTimeout(e,d))}function e(){"function"==typeof b&&b(g)}var f=this.progressBar,h=$(f).find("p.progressBarPercent"),k=$(f).find("div.progressBarBg"),l=$(f).find("p.progressBarDe"),m=this.progressDeWidth+2,n=parseInt(k.css("width"))-m-parseInt(l.css("paddingRight")),p=0,r=ENONE,u=this;l.css("width",m+"px");n=parseFloat(n/100);e()};this.showProgBarP=function(c,
b,a,d){this.showCover(function(){this.initProgBar();setStyle(this.progressBar,{display:"block",visibility:"visible",top:"260px"});void 0==c&&(c=statusStr.rebooting);a=void 0==a?!0:a;$("div.progressBarPCon").css("visibility",!0==a?"visible":"hidden");$("p.progressBarDes")[0].innerHTML=c;this.progRunningP(a,b,d,100)})};this.closeProgBar=function(){"function"==typeof hideCover&&hideCover();setStyle(this.progressBar,{display:"none",visibility:"hidden",top:"-9999px"});clearTimeout(this.progressBarHd)}}
function BlockGrid(){this._ops={id:"",data:null,dataInfo:[]};"function"!=typeof BlockGrid.prototype.blockInit&&(BlockGrid.prototype.blockInit=function(c){this._optionsInit(c);this.create()},BlockGrid.prototype._optionsInit=function(c){var b,a;for(a in c)if(b=c[a],"undefined"!=typeof this._ops[a])if("object"!=typeof b||b instanceof Array||null==this._ops[a])this._ops[a]=b;else for(var d in b)this._ops[a][d]=b[d]},BlockGrid.prototype.create=function(){var c,b;this.con=id(this._ops.id);emptyNodes(this.con);
for(var a=0;a<this._ops.dataInfo.length;a++){var d=this._ops.dataInfo[a],g=this._ops.data[a];c=document.createElement("li");c.onclick=function(){var a=$(this).find("i")[0],b=a.style.visibility;a.style.visibility="visible"==b?"hidden":"visible"};c.innerHTML=d.str;b=document.createElement("i");c.appendChild(b);g==d.value&&(b.style.visibility="visible");this.con.appendChild(c)}},BlockGrid.prototype.getData=function(){for(var c=$("#"+this._ops.id).find("i"),b=[],a,d=0;d<c.length;d++)a=this._ops.dataInfo[d],
a="visible"==c[d].style.visibility?a.value:a.unValue,b.push(a);return b})}
function TimeControlSet(){this.ENABLED="1";this.DISABLED="0";this.ACTION_ADD=0;this.ACTION_EDIT=1;this.gTimeLimitItem=this.gTimeLimitKeyName=this.blockGrid=null;this.gTimeLimitAction=this.ACTION_ADD;this.netCtrlListCreate=function(c,b,a,d,g){var e=id("netControlList"),f,h,k,l=document,m,n,p,r=0,u=uciHostsInfo.optName.name,t=uciHostsInfo.optName.startTime,q=uciHostsInfo.optName.endTime,v=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun];emptyNodes(e);f=l.createElement("ul");e.appendChild(f);
g=void 0==g?!1:g;for(var y in c){var w="";r++;for(var z in c[y])p=z,m=c[y][z];h=l.createElement("li");$(h).hover(function(){$(this).find("i").css("visibility","visible")},function(){$(this).find("i").css("visibility","hidden")});f.appendChild(h);k=l.createElement("i");k.onclick=function(a,d){return function(){b(a,d)}}(p,c);h.appendChild(k);h.onclick=function(b,c,e){return function(f){f=f||window.event;if(c!=(f.target||f.srcElement)){f=b[u];var h=b[t],k=b[q];gTimeLimitAction=ACTION_EDIT;gTimeLimitItem=
b;gTimeLimitKeyName=e;n=objToWeekList(b);setNetControlPanel(f,h,k,n,a,d,g);netControlPanelDis(!0);beEdit=!0}}}(m,k,p);k=l.createElement("pre");k.innerHTML=htmlEscape(getStrInMax(m[u],16));h.appendChild(k);k=l.createElement("span");k.innerHTML=!0==g?m[t]+label.wlanOn+" / "+m[q]+label.wlanOff:label.limitTime+label.colon+m[t]+" - "+m[q];h.appendChild(k);k=l.createElement("span");n=objToWeekList(m);for(var A in n)n[A]==ENABLED&&(w+=v[A]+label.sep);0<w.length&&(w=w.substring(0,w.length-1));k.innerHTML=
label.repeat+label.colon+w;h.appendChild(k)}e.num=r};this.objToWeekList=function(c){var b=[],a=[uciHostsInfo.optName.mon,uciHostsInfo.optName.tue,uciHostsInfo.optName.wed,uciHostsInfo.optName.thu,uciHostsInfo.optName.fri,uciHostsInfo.optName.sat,uciHostsInfo.optName.sun],d;for(d in a)c[a[d]]==ENABLED?b.push(ENABLED):b.push(DISABLED);return b};this.weekListToObj=function(c,b){var a=[uciHostsInfo.optName.mon,uciHostsInfo.optName.tue,uciHostsInfo.optName.wed,uciHostsInfo.optName.thu,uciHostsInfo.optName.fri,
uciHostsInfo.optName.sat,uciHostsInfo.optName.sun],d;for(d in b)c[a[d]]=b[d]};this.initTimeOptions=function(c,b){for(var a,d=0;d<b;d++)a=d,10>d&&(a="0"+d),a={str:a,value:a},c.push(a)};this.setNetControlPanel=function(c,b,a,d,g,e,f){var h=b.split(":");b=a.split(":");a=h[0];var h=h[1],k=b[0];b=b[1];netControlPanelInit(g,e,f);id("netControlName").value=c;id("beginHour").changeSel(a);id("beginMinute").changeSel(h);id("endHour").changeSel(k);id("endMinute").changeSel(b);blockGrid=new BlockGrid;blockGrid.blockInit({id:"netControlWeek",
data:d,dataInfo:[{str:label.MonB,value:ENABLED,unValue:DISABLED},{str:label.TueB,value:ENABLED,unValue:DISABLED},{str:label.WenB,value:ENABLED,unValue:DISABLED},{str:label.ThuB,value:ENABLED,unValue:DISABLED},{str:label.FriB,value:ENABLED,unValue:DISABLED},{str:label.StaB,value:ENABLED,unValue:DISABLED},{str:label.SunB,value:ENABLED,unValue:DISABLED}]})};this.netControlPanelDis=function(c){var b=id("VigNetControlCon");!0===c?showCoverB(function(){b.style.visibility="visible";b.style.top="150px"}):
hideCoverB(function(){b.style.visibility="hidden";b.style.top="-9999px"})};this.netControlPanelInit=function(c,b,a){var d=id("VigNetControlCon"),g=[],e=[],f;null==d?(d=document.createElement("div"),d.className="VigNetControlCon",d.id="VigNetControlCon",document.body.appendChild(d)):emptyNodes(d);!0==(void 0==a?!1:a)?(a=label.beginClock,f=label.endClock):(a=label.beginTime,f=label.endTime);d.innerHTML='<div class="vigNetControl" id="vigNetControl"><ul class="netControlLine"><label class="desc">'+label.periodDesc+
'</label><input type="text" class="text timeDesc" id="netControlName" maxlength="32"></ul><ul class="netControlLine"><label class="desc">'+a+'</label><li class="netControlText"><span class="netSelectSpan"><span id="beginHour" class="select netSelect"><span class="value hsTimeCon"></span><i class="arrow eptArrow"></i></span></span><label>'+label.hour+'</label></li><li class="netControlText"><span class="netSelectSpan"><span id="beginMinute" class="select netSelect"><span class="value hsTimeCon"></span><i class="arrow eptArrow"></i></span></span><label>'+
label.minute+'</label></li></ul><ul class="netControlLine"><label class="desc">'+f+'</label><li class="netControlText"><span class="netSelectSpan"><span id="endHour" class="select netSelect"><span class="value hsTimeCon"></span><i class="arrow eptArrow"></i></span></span><label>'+label.hour+'</label></li><li class="netControlText"><span class="netSelectSpan"><span id="endMinute" class="select netSelect"><span class="value hsTimeCon"></span><i class="arrow eptArrow"></i></span></span><label>'+label.minute+
'</label></li></ul><ul class="netControlLine"><label class="desc">'+label.repeat+'</label><ul class="netControlWeek" id="netControlWeek"></ul></ul><div class="netControlBtn"><input type="button" class="subBtn eptBtnA" value="'+btn.ok+'" id="btnSaveWeek"><input type="button" class="cancelBtn eptBtnA" value="'+btn.cancel+'" id="btnCancelWeek"></div></div>';initTimeOptions(g,24);initTimeOptions(e,60);id("btnSaveWeek").onclick=c;id("btnCancelWeek").onclick=function(){netControlPanelDis(!1);beEdit=!1};
"function"!=typeof b&&(b=selectInitEptMgt);b("beginHour",g,"0");b("beginMinute",e,"0");b("endHour",g,"0");b("endMinute",e,"0")}}
function Slp(){this.ROLE_LOCAL=0;this.ROLE_REMOTE=1;this._gMedia=this._gController="";this._gRole=ROLE_LOCAL;this.setController=function(c){_gController=c};this.getController=function(){return _gController};this.setMedia=function(c){_gMedia=c};this.getMedia=function(){return _gMedia};this.setRole=function(c){_gRole=c};this.getRole=function(){return _gRole};this.initImagePath=function(c){for(var b in imagePath)imagePath[b]=c+"/"+imagePath[b]};this.cloneObj=function(c){var b={};if("object"!=typeof c)return c;
c.constructor==Array&&(b=[]);for(var a in c)b[a]=cloneObj(c[a]);return b};this.hideLeadingZeros=function(c){return c.replace(/0*(\d+)/g,"$1")};this.calcNextIndex=function(c,b){if(null==c||!(c instanceof Array))return-1;var a=[],d;for(d in c){var g=c[d][".name"];"undefined"!=typeof g&&"string"==typeof g&&(g=g.replace(/^.*_(\d+)$/g,"$1"),a[g]=!0)}g=a.length;if(!/\D/g.test(b)&&b>=g)return b;for(d=/\D/g.test(b)?1:b;d<=g;d++)if("undefined"==typeof a[d])return d;return g+1};this.formatTableData=function(c){var b=
[];if(null==c||!(c instanceof Array))return b;for(var a in c){var d=c[a],g;for(g in d)d[g][SEC_NAME]=g,b[a]=d[g]}return b}}
function DragLine(c){this.name=this.id="";this.lowerBound=this.value=0;this.upperBound=100;this.cb="";this.needInput=this.needLabel="y";this.needScale="n";this.scaleNum=3;this.scaleText=[label.low,label.medium,label.high];this.scaleSidePad=5;this.errFix=!1;if("function"!=typeof DragLine.prototype.init){var b=function(a,b,c,e){if(!e)return a;a<b&&(a=b);a>c&&(a=c);return a};DragLine.prototype.init=function(a){this.paraInit(a);this.create()};DragLine.prototype.paraInit=function(a){for(var b in a)void 0!=
this[b]&&void 0!=a[b]&&(this[b]=a[b])};DragLine.prototype.create=function(){var a=this.id,d=id(a);if(null!=d){this.value=b(this.value,this.lowerBound,this.upperBound,!0);var c=document.createElement("label");c.className="dragLineLabel";c.id=a+"DragLineLabel";c.innerHTML=this.name;"y"==this.needLabel&&d.appendChild(c);c=document.createElement("i");c.className="dragLineStrip";c.id=a+"DragLineStrip";c.onclick=this.stripOnClick();d.appendChild(c);var e=document.createElement("i");e.className="dragLineStripLeft";
e.id=a+"dragLineStripLeft";c.appendChild(e);var f=document.createElement("i");f.className="dragLinePointer";f.id=a+"DragLinePointer";f.onmousedown=this.dragableBind();c.appendChild(f);var h=document.createElement("input");h.className="dragLineInput";h.id=a+"DragLineInput";h.type="text";h.onchange=this.inputBlurHd();h.onkeyup=this.inputValueChange();h.maxLength=this.upperBound.toString().length;h.onfocus=function(){h.className="dragLineInput dragLineInputFocus"};h.onblur=function(){h.className="dragLineInput"};
"y"==this.needInput&&d.appendChild(h);if("y"==this.needScale){var k,l;k=c.offsetWidth;l=a=0;1<this.scaleNum&&(l=parseFloat(k/(this.scaleNum-1)),a=parseInt(l));k=document.createElement("ul");k.className="scaleUl";for(var m=1;m<=this.scaleNum;m++)l=document.createElement("li"),l.className="scaleLi",1==m?(l.style.left=0-6*getDisplayStrLen(this.scaleText[0])/2+7+"px",l.innerHTML=this.scaleText[0]):m==this.scaleNum?(l.style.left=0-6*getDisplayStrLen(this.scaleText[this.scaleNum-1])/2+7+a*(this.scaleNum-
1)+"px",l.innerHTML=this.scaleText[this.scaleNum-1]):(l.style.left=0-6*getDisplayStrLen(this.scaleText[m-1])/2+7+a*(m-1)+"px",l.innerHTML=this.scaleText[m-1]),k.appendChild(l);d.appendChild(k)}this.dragLineStrip=c;this.dragLineStripLeft=e;this.dragLinePointer=f;this.dragLineInput=h;this.base=(this.dragLineStrip.offsetWidth-this.dragLinePointer.offsetWidth)/(this.upperBound-this.lowerBound);f.style.left=this.base*(this.value-this.lowerBound)+"px";e.style.width=this.base*(this.value-this.lowerBound)+
"px";h.value=this.value}};DragLine.prototype.setValue=function(a){var d=this.dragLineInput,c=this.dragLinePointer,e=this.dragLineStripLeft;a=b(parseInt(a,10),this.lowerBound,this.upperBound,this.errFix);d.value=a;a=b(parseInt(a,10),this.lowerBound,this.upperBound,!0);a=(a-this.lowerBound)*this.base;c.style.left=a+"px";e.style.width=a+"px"};DragLine.prototype.getValue=function(){return this.dragLineInput.value};DragLine.prototype.inputBlurHd=function(){var a=this;return function(b){b=parseInt(this.value,
10);!0==isNaN(b)&&(b=0);this.value=b;a.setValue(b);"function"==typeof a.cb&&a.cb(b)}};DragLine.prototype.inputValueChange=function(){var a=this;return function(b){b=b||window.event;var c=parseInt(this.value,10);b=b.keyCode;if(void 0==b||13==b)this.value=c,a.setValue(c),"function"==typeof a.cb&&a.cb(c)}};DragLine.prototype.getAbsoluteLeft=function(a){for(var b=a.offsetLeft;null!=a.offsetParent;)a=a.offsetParent,b+=a.offsetLeft;return b};DragLine.prototype.stripOnClick=function(){var a=this;return function(d){d=
d?d:window.event;getMousePos(d);var c=d.target||d.srcElement,e=a.dragLineStrip.offsetWidth-a.dragLinePointer.offsetWidth;if(void 0==c||c!=a.dragLinePointer)clickPointX=d.clientX,lineX=a.getAbsoluteLeft(a.dragLineStrip),lineX-=document.body.scrollLeft||document.documentElement.scrollLeft,d=clickPointX-lineX,d-=a.dragLinePointer.offsetWidth/2,e=d=b(d,0,e,!0),d=Math.floor(d/a.base),d*a.base+a.base/2<e&&d<a.upperBound&&d++,a.dragLinePointer.style.left=a.base*d+"px",a.dragLineStripLeft.style.width=a.dragLinePointer.style.left,
a.dragLineInput.value=d+a.lowerBound,closeNote(a.dragLineInput.id),"function"==typeof a.cb&&a.cb(a.dragLineInput.value)}};DragLine.prototype.dragableBind=function(){var a=this;return function(d){d=d?d:window.event;$(a.dragLineInput).addClass("dragLineInputFocus");a.ponterClickPos=getMousePos(d);a.orginalX=parseInt(a.dragLinePointer.style.left,10);document.onmousemove=function(d){d=d?d:window.event;var c=getMousePos(d);d=a.dragLineStrip.offsetWidth-a.dragLinePointer.offsetWidth;var c=c.x-a.ponterClickPos.x,
f;c<-d&&(c=-d);c>d&&(c=d);c+=a.orginalX;f=c=b(c,0,d,!0);a.dragLinePointer.style.left=f+"px";c=Math.floor(c/a.base);c*a.base+a.base/2<f&&c<a.upperBound&&c++;a.dragLineInput.value=c+a.lowerBound;closeNote(a.dragLineInput.id);a.dragLineStripLeft.style.width=(c+a.lowerBound)/(a.upperBound-a.lowerBound)*d+"px";clearSelection()};document.onmouseup=function(b){a.setValue(a.dragLineInput.value);"function"==typeof a.cb&&a.cb(a.dragLineInput.value);clearSelection();$(a.dragLineInput).removeClass("dragLineInputFocus");
document.onmousemove=null;document.onmouseup=null};stopProp(d)}}}this.init(c)}
function DayNightSwitch(c){void 0!==c.id&&(this.id="",this.sunrise="00:00",this.sunset="24:00",this.leftLabel="白天",this.rightLabel="夜晚",this.unit=10,this.timeChangeCbk=this.rightCbk=this.leftCbk="",this.intTime="n",this.equalStartEndTime="y","function"!=typeof DayNightSwitch.prototype.DayNightSwitchInit&&(DayNightSwitch.prototype.DayNightSwitchInit=function(b){!0==this.paraInit(b)&&this.create()},DayNightSwitch.prototype.paraInit=function(b){for(var a in b)void 0!=this[a]&&void 0!=b[a]&&(this[a]=
b[a]);this.DayNightSwitchCon=id(this.id);if(void 0==this.DayNightSwitchCon)return!1;0>=this.unit&&(this.unit=10);this.pieces=1440/this.unit;"y"==this.intTime&&(this.sunrise=parseInt(this.sunrise,10),this.sunset=parseInt(this.sunset,10));return!0},DayNightSwitch.prototype.create=function(){var b=document.createElement("div");b.className="DNSTimeLabelDiv";var a=document.createElement("label");a.className="DNSTimeLabel";b.appendChild(a);var d=document.createElement("label");d.className="DNSTimeLabel";
b.appendChild(d);var c=document.createElement("div");c.className="DNSTimeLineDiv";var e=document.createElement("div");e.className="DNSLine";var f=document.createElement("i");f.className="firstPartOfNight timeOfNight";var h=document.createElement("div");h.className="timeOfDay";var k=document.createElement("i");k.className="secondPartOfNight timeOfNight";var l=document.createElement("i");l.className="DNSPointer firstP";l.id=this.id+"firstP";var m=document.createElement("i");m.className="DNSPointer secondP";
m.id=this.id+"secondP";e.appendChild(f);e.appendChild(l);e.appendChild(h);e.appendChild(k);e.appendChild(m);c.appendChild(e);this.DayNightSwitchCon.appendChild(b);this.DayNightSwitchCon.appendChild(c);this.dayBeginPointer=l;this.dayEndPointer=m;this.firstPartOfNight=f;this.secondPartOfNight=k;this.timeLine=e;this.dayBeginTimeLabel=a;this.dayEndTimeLabel=d;this.partOfDay=h;this.TLWidth=e.offsetWidth;this.DBPWidth=l.offsetWidth;this.DEPWidth=m.offsetWidth;if(!isIE){var b=explorerInfo.toLowerCase(),
n,p,r;b.match(/firefox\/([\d.]+)/)||((r=b.match(/chrome\/([\d.]+)/))?n=r[1]:(r=b.match(/opera.([\d.]+)/))?p=r[1]:b.match(/version\/([\d.]+).*safari/));(n||p)&&this.DBPWidth++}this.pixelOfEachUnit=(this.TLWidth-this.DEPWidth-this.DBPWidth)/this.pieces;this.setSunrise(this.sunrise);this.setSunset(this.sunset);l.onmousedown=this.beginPointBind();m.onmousedown=this.endPointBind()},DayNightSwitch.prototype.textOverlay=function(){var b=this.TLWidth-(this.firstPartOfNight.offsetWidth+this.secondPartOfNight.offsetWidth),
b=b-(this.DBPWidth+this.DEPWidth)/2;return(this.dayBeginTimeLabel.offsetWidth+this.dayEndTimeLabel.offsetWidth)/2-b},DayNightSwitch.prototype.bindCbk=function(b){return function(){b()}},DayNightSwitch.prototype.fixLabel=function(){var b=(this.DBPWidth-this.dayBeginTimeLabel.offsetWidth)/2,a=(this.DEPWidth-this.dayEndTimeLabel.offsetWidth)/2,d=this.textOverlay(),b=this.firstPartOfNight.offsetWidth+b,c=this.TLWidth-this.secondPartOfNight.offsetWidth-this.DEPWidth,c=c+a-this.dayBeginTimeLabel.offsetWidth;
0<d&&(b-=d/2,c+=d/2);this.dayBeginTimeLabel.style.left=b+"px";this.dayEndTimeLabel.style.left=c+"px"},DayNightSwitch.prototype.setSunrise=function(b){var a=this.convertTimeToValue(b);if(a>this.convertTimeToValue(this.sunset))return!1;b==this.sunset&&this.setSunset(b);"y"==this.intTime&&(b=parseInt(b,10),b=b.toString());this.sunrise=b;a=Math.floor(a-this.DBPWidth);this.firstPartOfNight.style.width=a+"px";this.dayBeginTimeLabel.innerHTML=b;b=this.TLWidth-a-this.secondPartOfNight.offsetWidth;b-=this.DBPWidth+
this.DEPWidth;this.partOfDay.style.width=b+"px";this.fixLabel();return!0},DayNightSwitch.prototype.setSunset=function(b){var a=this.convertTimeToValue(b);if(a<this.convertTimeToValue(this.sunrise))return!1;a<this.firstPartOfNight.offsetWidth+this.DBPWidth&&(a=this.firstPartOfNight.offsetWidth+this.DBPWidth);"y"==this.intTime&&(b=parseInt(b,10),b=b.toString());this.sunset=b;this.dayEndTimeLabel.innerHTML=b;b=Math.floor(this.TLWidth-a-this.DEPWidth);this.secondPartOfNight.style.width=b+"px";b=this.TLWidth-
this.firstPartOfNight.offsetWidth-b;b-=this.DBPWidth+this.DEPWidth;this.partOfDay.style.width=b+"px";this.fixLabel();return!0},DayNightSwitch.prototype.getSunrise=function(){return this.sunrise},DayNightSwitch.prototype.getSunset=function(){return this.sunset},DayNightSwitch.prototype.beginPointBind=function(){var b=this;return function(a){a=a?a:window.event;var d=getMousePos(a),c=parseInt(b.firstPartOfNight.style.width,10),e=parseInt(b.secondPartOfNight.style.width,10);document.onmousemove=function(a){a=
a?a:window.event;a=getMousePos(a);clearSelection();a=a.x-d.x;a=parseInt(a);var h=b.TLWidth-c-e-b.DBPWidth-b.DEPWidth,k=Math.floor(b.pixelOfEachUnit);"n"==b.equalStartEndTime?0<=a?a>h-k&&(a=h-k):h-a>b.TLWidth-b.DBPWidth-b.DEPWidth-k&&(a=h-(b.TLWidth-b.DBPWidth-b.DEPWidth-k)):a>h&&(a=h);a=c+a;a=0<a?a:0;b.firstPartOfNight.style.width=a+"px";h=b.TLWidth-a-e;h-=b.DBPWidth+b.DEPWidth;b.partOfDay.style.width=h+"px";0!=a&&(a+=b.DBPWidth);b.sunrise=b.convertValueToTime(a);b.dayBeginTimeLabel.innerHTML=b.sunrise;
b.fixLabel()};document.onmouseup=function(a){b.fixLabel();clearSelection();"function"==typeof b.timeChangeCbk&&b.timeChangeCbk("day_begin",b.sunrise);document.onmousemove=null;document.onmouseup=null}}},DayNightSwitch.prototype.endPointBind=function(){var b=this;return function(a){a=a?a:window.event;var d=getMousePos(a),c=parseInt(b.firstPartOfNight.style.width,10),e=parseInt(b.secondPartOfNight.style.width,10);document.onmousemove=function(a){a=a?a:window.event;a=getMousePos(a);clearSelection();
a=d.x-a.x;a=parseInt(a);var h=b.TLWidth-e-c-b.DEPWidth-b.DBPWidth,k=Math.floor(b.pixelOfEachUnit);"n"==b.equalStartEndTime?0<=a?a>h-k&&(a=h-k):h-a>b.TLWidth-b.DBPWidth-b.DEPWidth-k&&(a=h-(b.TLWidth-b.DBPWidth-b.DEPWidth-k)):a>h&&(a=h);a=e+a;0>a&&(a=0);b.sunset=b.convertValueToTime(b.TLWidth-a-b.DEPWidth);b.secondPartOfNight.style.width=a+"px";b.dayEndTimeLabel.innerHTML=b.sunset;a=b.TLWidth-c-a;a-=b.DBPWidth+b.DEPWidth;b.partOfDay.style.width=a+"px";b.fixLabel()};document.onmouseup=function(a){b.fixLabel();
clearSelection();"function"==typeof b.timeChangeCbk&&b.timeChangeCbk("day_end",b.sunset);document.onmousemove=null;document.onmouseup=null}}},DayNightSwitch.prototype.convertTimeToValue=function(b){var a=b.length,d,c=0;"n"==this.intTime?(c=b.lastIndexOf(":"),d=parseInt(b.substring(0,c),10),c=parseInt(b.substring(c+1,a),10)):"y"==this.intTime&&(d=parseInt(b,10));b=Math.ceil((c+60*d)/this.unit);b=Math.floor(b*this.pixelOfEachUnit);return b+=this.DBPWidth},DayNightSwitch.prototype.convertValueToTime=
function(b){var a,d;b-=this.DBPWidth;a=(0>=b?0:Math.floor((b-1)/this.pixelOfEachUnit)+1)*this.unit;b=Math.floor(a/60);hourStr=b.toString();minusStr=(a%60).toString();"n"==this.intTime?(2>hourStr.length&&(hourStr="0"+hourStr),2>minusStr.length&&(minusStr="0"+minusStr),d=hourStr+":"+minusStr):"y"==this.intTime&&(d=hourStr);return d}),this.DayNightSwitchInit(c))}
function BlockSwitch(c){this.option={id:"",blockList:"",className:"",classNameHit:"",click:"",initValue:0,createItemHd:null};"function"!=typeof BlockSwitch.prototype._init&&(BlockSwitch.prototype._init=function(b){this._optionInit(b);this._create()},BlockSwitch.prototype._optionInit=function(b){var a=this.option,d;for(d in b)void 0!=a[d]&&(a[d]=b[d])},BlockSwitch.prototype._create=function(){var b=this.option,a=id(b.id),d=b.blockList,c,e,f,h=this,k=b.classNameHit,l=b.initValue;e=$("#"+b.id+" li");
var m=b.createItemHd;if(null!=a){if(null==d[0].value)for(var n=0,p=d.length;n<p;n++)d[n].value=n;if(0==e.length)for(a.innerHTML="",n=0,p=d.length;n<p;n++)c=d[n],e=c.key,f=c.value,void 0!=m?b=m(n):(b=document.createElement("li"),b.className=c.className,void 0!=l?f===l&&(b.className=c.className+" "+(0==k.length?"hitLi":k)):0==n&&(b.className=c.className+" "+(0==k.length?"hitLi":k)),b.innerHTML=e,b.key=e,b.value=f,b.onclick=function(){h._click(this.key,this.value)}),a.appendChild(b);else if(e.length!=
d.length)log("BlockSwitch._create: blockList is too less.");else for(n=0,p=e.length;n<p;n++)c=d[n],b=e[n],b.key=c.key,b.value=c.value,b.onclick=function(){h._click(this.key,this.value)}}},BlockSwitch.prototype._click=function(b,a){for(var d=this.option,c=id(d.id),e=d.classNameHit,c=c.childNodes,d=d.click,f,h=0,k=c.length;h<k;h++)f=c[h],1==f.nodeType&&"li"==f.tagName.toLowerCase()&&(e=void 0==e?e:"hitLi",f.key==b||f.value==a?0>f.className.indexOf(e)&&(f.className+=" "+e):f.className=f.className.replace(e,
""));this.value=a;this.key=b;"function"==typeof d&&d(b,a)},BlockSwitch.prototype.click=function(b,a){this._click(b,a)});this._init(c)}
function CloudCommon(){this.cloudAccountEmailList=[{key:"gmail.com",value:"https://mail.google.com"},{key:"live.com",value:"http://mail.live.com"},{key:"live.cn",value:"http://mail.live.com"},{key:"hotmail.com",value:"http://mail.live.com"},{key:"outlook.com",value:"http://mail.live.com"},{key:"qq.com",value:"http://mail.qq.com"},{key:"126.com",value:"http://mail.126.com"},{key:"163.com",value:"http://mail.163.com"},{key:"yeah.net",value:"http://mail.yeah.net"},{key:"sina.com",value:"http://mail.sina.com.cn"},
{key:"sohu.com",value:"http://mail.sohu.com"},{key:"21cn.com",value:"http://mail.21cn.com"},{key:"sina.com.cn",value:"http://mail.sina.com.cn"},{key:"tom.com",value:"http://mail.tom.com"},{key:"sogou.com",value:"http://mail.sogou.com"},{key:"foxmail.com",value:"http://mail.foxmail.com"},{key:"188.com",value:"http://mail.188.com"},{key:"wo.cn",value:"http://mail.wo.cn"},{key:"189.cn",value:"http://mail.189.cn"},{key:"139.com",value:"http://mail.10086.cn"},{key:"eyou.com",value:"http://www.eyou.com"},
{key:"aliyun.com",value:"http://mail.aliyun.com"},{key:"263.net",value:"http://mail.263.net"},{key:"2980.com",value:"http://www.2980.com"}];this.emailLinkCheck=function(c){for(var b in cloudAccountEmailList){var a=cloudAccountEmailList[b];if(0<c.indexOf(a.key))return a.value}return null};this.gCloudColObj={cloudBackHd:null,cloudBackBRHd:null,account:""};this.cloudSetBackHd=function(c){gCloudColObj.cloudBackHd=c};this.cloudGoBack=function(){var c=gCloudColObj.cloudBackHd;"function"==typeof c&&c()};
this.cloudSetBackBRHd=function(c){gCloudColObj.cloudBackBRHd=c};this.cloudGoBackBR=function(c){var b=gCloudColObj.cloudBackBRHd;hideCloudPage();"function"==typeof b&&b(c)};this.gCloudAccountBR={bodyHeight:0,account:"",pwd:"",CAPTCHAR:"",accountType:"",success:!1,noteF:"",noteS:"",pwdLen:0,softVersion:"",bFWzd:!1};this.showCloudPage=function(c){var b=id(this.cloudPageId);null==b&&(b=el("div"),b.id=this.cloudPageId,document.body.appendChild(b));loadPage(c,"CloudAccountPage",function(a){ENONE==a[ERR_CODE]&&
cloudPageSetNodes(!0)},{bClearPageTickArray:!1})};this.hideCloudPage=function(){try{emptyNodes(id(this.cloudPageId)),cloudPageSetNodes(!1)}catch(c){}};this.cloudPageSetNodes=function(c){var b="none",a,d=document.body.childNodes,g;!0==c?(cloudPage="block",0==gCloudAccountBR.bodyHeight&&(gCloudAccountBR.bodyHeight=parseInt(document.body.offsetHeight)),document.body.style.height="auto",document.body.style.overflowY="auto"):(b="block",document.body.style.height=gCloudAccountBR.bodyHeight+"px",document.body.style.overflowY=
"",gCloudAccountBR.bodyHeight=0);for(var e in d)a=d[e],void 0!=a.nodeName&&"DIV"==a.nodeName.toUpperCase()&&(g=a.id,g==this.cloudPageId?!0==c?setStyle(a,{display:"block",visibility:"visible",top:"0px"}):setStyle(a,{display:"none",visibility:"hidden",top:"-9999px"}):"Con"==g?!0==c?setStyle(a,{position:"absolute",visibility:"hidden",top:"-9999px"}):setStyle(a,{position:"static",visibility:"visible",top:"0px"}):g!=this.gLoginId&&g!=this.CoverId&&g!=gToastConCoverId&&"laydate_box"!=g&&setStyle(a,{display:b}));
id(this.gLoginId).style.display="none";id(this.CoverId).style.display="none";c=id("laydate_box");null!=c&&(c.style.display="none")};this.cloudErrHandle=function(c){switch(parseInt(c)){case EINVCLOUDERRORGENERIC:case EINVCLOUDERRORPARSEJSON:case EINVCLOUDERRORPARSEJSONNULL:case EINVCLOUDERRORSERVERINTERNALERROR:case EINVCLOUDERRORPERMISSIONDENIED:case EINVCLOUDERRORPARSEJSONID:showStr=errStr.invNetworkErr;break;case EINVERRORPERMISSIONDENIED:showStr=errStr.invPermissionDeny;break;case EINVCLOUDERRORMETHODNOTFOUND:case EINVCLOUDERRORPARAMSNOTFOUND:case EINVCLOUDERRORPARAMSWRONGTYPE:case EINVCLOUDERRORPARAMSWRONGRANGE:case EINVCLOUDERRORINVALIDPARAMS:showStr=
errStr.invRequestFail;break;case EINVCLOUDERRORBINDDEVICEERROR:showStr=errStr.invTPIDLgFail;break;case EINVCLOUDERRORUNBINDDEVICEERROR:showStr=errStr.invTPIDUnBindFail;break;case EINVCLOUDERRORHWIDNOTFOUND:case EINVCLOUDERRORFWIDNOTSUPPORTDEVICE:showStr=label.cloudDeviceInfoExpt;break;case EINVCLOUDERRORDEVICEALIASFORMATERROR:showStr=errStr.invRouterNameFormat;break;case EINVCLOUDERRORACCOUNTUSERNAMEFORMATERROR:showStr=errStr.invCloudAccountFmtErr;break;case EINVCLOUDERRORACCOUNTACTIVEMAILSENDFAIL:case EINVCLOUDERRORRESETMAILSENDFAIL:showStr=
errStr.invCAPTCHASendFail;break;case EINVCLOUDERRORTOKENEXPRIED:case EINVCLOUDERRORTOKENINCORRECT:showStr=errStr.invTPIDTimeout;break;case EINVCLOUDERRORACCOUNTACTIVEFAIL:case EINVCLOUDERRORACCOUNTACTIVETIMEOUT:showStr=errStr.invAccountCheckFail;break;case EINVCLOUDERRORRESETPWDTIMEOUT:case EINVCLOUDERRORRESETPWDFAIL:showStr=errStr.invAccountRstPwdFail;break;default:return{result:!0}}return{result:!1,tip:showStr}}}
function CloudAction(){this.cloudActionQueryStatusWaitHd=this.cloudActionQueryStatusHd=null;this.cloudActionQueryStoped=this.cloudActionStatusQuering=!1;this.CLOUD_STATUS_QUERY_TIMEOUT=1E3;this.CLOUD_STATUS_QUERY_TIMEOUT_WAIT=2E4;this.cloudCloseLoadingHandle=null;this._cloudExptStopHandle=function(){clearTimeout(cloudActionQueryStatusWaitHd);closeLoading();closeToast();"function"==typeof cloudCloseLoadingHandle&&cloudCloseLoadingHandle();_setCloudCloseLoadingHandle(null)};this._cloudQueryErrHandle=
function(c,b){var a="";switch(parseInt(c)){case ENONE:return!0;default:a=errStr.invRequestFail}_cloudExptStopHandle();showAlert(a,b);return!1};this._cloudGetActnErrHandle=function(c,b){var a="";switch(parseInt(c)){case ENONE:return!0;case EINVSENDREQMSGFAILED:a=errStr.invSendReqMsgFailed;break;case ESYSBUSY:case EINVLASTOPTIONISNOTFINISHED:a=errStr.invLastOptionIsNotFinished;break;case ESYSTEM:a=errStr.invRequestFail;break;case ENOMEMORY:a=errStr.invMemoryOut;break;case EINVGETDATAFAILED:a=errStr.invGetDataFailed;
break;case EINVPARAMETER:a=errStr.invParameter;break;case EINVREQUESTTIMEOUT:a=errStr.invRequestTimeout;break;case EINVDEVICEIDNOTEXIST:case EINVERRORDEVICEIDFORMATERROR:case EINVILLEGALDEVICE:a=label.cloudDeviceInfoExpt;break;default:a=cloudErrHandle(c);if(!1==a.result){a=a.tip;break}if("function"==typeof b)return _cloudExptStopHandle(),b(c),!1;a=errStr.invRequestFail}_cloudExptStopHandle();showAlert(a);return!1};this.cloudAccountQueryStop=function(){cloudActionQueryStoped=!0;cloudActionStatusQuering=
!1;clearTimeout(cloudActionQueryStatusHd);clearTimeout(cloudActionQueryStatusWaitHd);_cloudExptStopHandle()};this._cloudStatusDataOrg=function(c){var b={},a=cloudClientStatus;b[a.fileName]={};b[a.fileName][KEY_NAME]=c;return b};this._setCloudCloseLoadingHandle=function(c){cloudCloseLoadingHandle=c};this._cloudAccountStatus=function(c,b,a){cloudActionStatusQuering=!0;$.queryP(_cloudStatusDataOrg(c),function(d){if(_cloudGetActnErrHandle(d[ERR_CODE])){var g=cloudClientStatus,e=parseInt(d[g.fileName][c][g.optName.actionStatus]),
g=g.optValue.queryStatus;switch(e){case g.idle:case g.max:_cloudGetActnErrHandle(EINVSENDREQMSGFAILED);break;case g.timeout:"function"==typeof a?a():_cloudGetActnErrHandle(EINVREQUESTTIMEOUT);break;case g.prepare:case g.trying:cloudActionQueryStatusHd=$.setTimeout(function(){_cloudAccountStatus(c,b,a)},CLOUD_STATUS_QUERY_TIMEOUT);return;case g.failed:case g.success:b(d);break;default:_cloudGetActnErrHandle(void 0)}closeLoading(cloudCloseLoadingHandle);_setCloudCloseLoadingHandle(null);cloudActionStatusQuering=
!1;clearTimeout(cloudActionQueryStatusWaitHd)}})};this._cloudActionQueryStatus=function(c,b,a,d,g){!0!=cloudActionQueryStoped&&(!0==cloudActionStatusQuering&&!1==a?_cloudGetActnErrHandle(EINVLASTOPTIONISNOTFINISHED):(cloudActionStatusQuering=!1,clearTimeout(cloudActionQueryStatusHd),clearTimeout(cloudActionQueryStatusWaitHd),cloudActionQueryStatusWaitHd=$.setTimeout(function(){cloudActionStatusQuering=!1;clearTimeout(cloudActionQueryStatusHd);"function"==typeof d?d():_cloudGetActnErrHandle(EINVREQUESTTIMEOUT)},
CLOUD_STATUS_QUERY_TIMEOUT_WAIT),_cloudAccountStatus(c,b,function(){clearTimeout(cloudActionQueryStatusWaitHd);"function"==typeof g?g():_cloudGetActnErrHandle(EINVREQUESTTIMEOUT)})))};this.cloudAccountState=function(c,b){var a={},d=uciCloudConfig;a[d.fileName]={};a[d.fileName][d.actionName.getAccountStat]={};a[d.fileName][d.actionName.getAccountStat][d.optName.username]=c;cloudActionQueryStoped=!1;$.action(a,function(a){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(a[ERR_CODE],b)){var c=
cloudClientStatus;_cloudActionQueryStatus(c.secName.getAccountStat,function(a){_cloudQueryErrHandle(a[c.fileName][c.secName.getAccountStat][c.optName.errCode])&&(a={},a[d.fileName]={},a[d.fileName][KEY_NAME]=d.secName.deviceStatus,$.action(a,function(a){!0==_cloudGetActnErrHandle(a[ERR_CODE],b)&&b(d.optValue.regestStatus==a[d.fileName][d.secName.deviceStatus])},!0))},!0)}},!0)};this.cloudAccountRstPwdCheckCAPTCHA=function(c,b,a){var d,g={},e=uciCloudConfig;g[e.fileName]={};d=g[e.fileName][e.actionName.checkResetPwdVerifyCode]=
{};d[e.optName.username]=c;d[e.optName.verifyCode]=b;cloudActionQueryStoped=!1;$.action(g,function(b){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var d=cloudClientStatus;_cloudActionQueryStatus(d.secName.checkResetPwdVerifyCode,function(b){a(b[d.fileName][d.secName.checkResetPwdVerifyCode][d.optName.errCode])},!0)}},!0)};this.cloudAccountRstPwdAC=function(c,b,a,d){var g,e={},f=uciCloudConfig;e[f.fileName]={};g=e[f.fileName][f.actionName.getResetPwdVerifyCode]={};g[f.optName.username]=
c;g[f.optName.accountType]=b;cloudActionQueryStoped=!1;_setCloudCloseLoadingHandle(d);$.action(e,function(b){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var d=cloudClientStatus;_cloudActionQueryStatus(d.secName.getResetPwdVerifyCode,function(b){a(b[d.fileName][d.secName.getResetPwdVerifyCode][d.optName.errCode])},!0)}},!0)};this.cloudAccountRstPwd=function(c,b,a,d,g,e){var f,h={},k=uciCloudConfig;h[k.fileName]={};f=h[k.fileName][k.actionName.resetPassword]={};f[k.optName.username]=
c;f[k.optName.verifyCode]=a;f[k.optName.password]=b;f[k.optName.accountType]=d;cloudActionQueryStoped=!1;$.action(h,function(a){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(a[ERR_CODE],g)){var b=cloudClientStatus;_cloudActionQueryStatus(b.secName.resetPassword,function(a){g(a[b.fileName][b.secName.resetPassword][b.optName.errCode])},!0,e)}},!0)};this.cloudAccountBind=function(c,b,a,d){var g,e={},f=uciCloudConfig;e[f.fileName]={};g=e[f.fileName][f.actionName.bind]={};g[f.optName.username]=
c;g[f.optName.password]=b;cloudActionQueryStoped=!1;$.action(e,function(b){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var c=cloudClientStatus;_cloudActionQueryStatus(c.secName.bind,function(b){a(b[c.fileName][c.secName.bind][c.optName.errCode])},!0,d)}},!0)};this.cloudAccountGetRegistAC=function(c,b,a,d){var g,e={},f=uciCloudConfig;e[f.fileName]={};g=e[f.fileName][f.actionName.getRegVerifyCode]={};g[f.optName.username]=c;g[f.optName.accountType]=b;cloudActionQueryStoped=
!1;_setCloudCloseLoadingHandle(d);$.action(e,function(b){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var d=cloudClientStatus;_cloudActionQueryStatus(d.secName.getRegVerifyCode,function(b){a(b[d.fileName][d.secName.getRegVerifyCode][d.optName.errCode])},!0)}},!0)};this.cloudAccountRegist=function(c,b,a,d,g,e){var f,h={},k=uciCloudConfig;h[k.fileName]={};f=h[k.fileName][k.actionName.register]={};f[k.optName.username]=c;f[k.optName.accountType]=b;f[k.optName.verifyCode]=
d;f[k.optName.password]=a;cloudActionQueryStoped=!1;$.action(h,function(a){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(a[ERR_CODE],g)){var b=cloudClientStatus;_cloudActionQueryStatus(b.secName.register,function(a){g(a[b.fileName][b.secName.register][b.optName.errCode])},!0,e)}},!0)};this.cloudAccountUnind=function(c,b){var a={},d=uciCloudConfig;a[d.fileName]={};a[d.fileName][d.actionName.unbind]={};cloudActionQueryStoped=!1;$.action(a,function(a){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(a[ERR_CODE],
c)){var d=cloudClientStatus;_cloudActionQueryStatus(d.secName.unbind,function(a){c(a[d.fileName][d.secName.unbind][d.optName.errCode])},!0,b)}},!0)};this.cloudAccountModifyPwd=function(c,b,a,d,g){var e,f={},h=uciCloudConfig;f[h.fileName]={};e=f[h.fileName][h.actionName.modifyAccountPwd]={};e[h.optName.oldPassword]=c;e[h.optName.newPassword]=b;cloudActionQueryStoped=!1;$.action(f,function(b){if(!0!=cloudActionQueryStoped)if(!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var c=cloudClientStatus;_cloudActionQueryStatus(c.secName.modifyAccountPwd,
function(b){a(b[c.fileName][c.secName.modifyAccountPwd][c.optName.errCode])},!0,d,g)}else hsLoading(!1)},!0)};this.getAppsUninstalledInfo=function(c,b,a,d,g){var e,f={};f[uciAppInfo.fileName]={};e=f[uciAppInfo.fileName][uciAppInfo.actionName.getUninstalledInfo]={};e[uciAppInfo.dynOptName.start]=c;e[uciAppInfo.dynOptName.end]=b;cloudActionQueryStoped=!1;$.action(f,function(b){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var c=cloudClientStatus;_cloudActionQueryStatus(c.secName.getNotInstalledApps,
function(b){a(b[c.fileName][c.secName.getNotInstalledApps][c.optName.errCode])},!0,d,g)}},!0)};this.getAppsCanUpdateInfo=function(c,b,a,d,g){var e,f={};f[uciAppInfo.fileName]={};e=f[uciAppInfo.fileName][uciAppInfo.actionName.getUpdateInfo]={};e[uciAppInfo.dynOptName.start]=c;e[uciAppInfo.dynOptName.end]=b;cloudActionQueryStoped=!1;$.action(f,function(b){if(!0!=cloudActionQueryStoped&&!0==_cloudGetActnErrHandle(b[ERR_CODE],a)){var c=cloudClientStatus;_cloudActionQueryStatus(c.secName.getCanUpdateApps,
function(b){a(b[c.fileName][c.secName.getCanUpdateApps][c.optName.errCode])},!0,d,g)}},!0)}}
function CloudUpgradePush(){this.pageCloudPush=!0;this.gOnlineUpgradeNote="";this.upgradeErrCBCloudPush=null;this.gOnlineUpgradeFail=!1;this.errHandleCloudPush=function(c){switch(c){case ENONE:return!0;case EFWNOTSUPPORTED:case EFILETOOBIG:case EFWEXCEPTION:gOnlineUpgradeNote=errStr.fwFmtErr;break;case EFWNOTINFLANDBL:case EFWNEWEST:gOnlineUpgradeNote=errStr.fwNotSupported;break;case EINVMEMORYOUT:case EINVDOWNLOADFWFAILED:case EINVSENDREQMSGFAILED:case EINVREQUESTTIMEOUT:case EINVCONNECTTINGCLOUDSERVER:case EINVLASTOPTIONISNOTFINISHED:case ESYSBUSY:gOnlineUpgradeNote=errStr.fwDownLoadFailed;
break;case EINVDEVICEIDNOTEXIST:case EINVERRORDEVICEIDFORMATERROR:case EINVILLEGALDEVICE:gOnlineUpgradeNote=label.cloudDeviceInfoExpt;break;default:gOnlineUpgradeNote=errStr.fwUpgradeFailed}$.setTimeout(upgradeFailHdCloudPush,10);return!1};this.setUpgradeErrCBCloudPush=function(c){this.upgradeErrCBCloudPush=c};this.upgradeFailHdCloudPush=function(){"function"==typeof this.upgradeErrCBCloudPush&&(this.upgradeErrCBCloudPush(),this.upgradeErrCBCloudPush=null)};this.checkOnlineUpgrading=function(c,b){var a=
cloudClientStatus.fileName,d={};d[a]={};d[a][KEY_NAME]=cloudClientStatus.secName.clientInfo;!0==$.local?c():$.query(d,function(d){ENONE==d[ERR_CODE]?(d=parseInt(d[a][cloudClientStatus.secName.clientInfo][cloudClientStatus.optName.fwDownloadStatus]),uciCloudConfig.optValue.cloudDownloading==d?onlineUpgradeProgress(b):c()):c()})};this.onlineUpgradeProgress=function(c){var b=cloudClientStatus.fileName;showProgBarP(statusStr.fwDownloading,function(a){var d={},g={};d[b]={};c==UPGRADE_PLUGIN?d[b][KEY_NAME]=
cloudClientStatus.secName.pluginDownloadInfo:c==UPGRADE_FW&&(d[b][KEY_NAME]=cloudClientStatus.secName.clientInfo);g_pageLoadingShow=!1;$.queryP(d,function(d){var f=d[ERR_CODE];g_pageLoadingShow=!0;if(!0==errHandleCloudPush(f)){var h,k;c==UPGRADE_FW?(h=d[b][cloudClientStatus.secName.clientInfo],k=parseInt(h[cloudClientStatus.optName.fwDownloadStatus])):c==UPGRADE_PLUGIN&&(h=d[b][cloudClientStatus.secName.pluginDownloadInfo],k=parseInt(h[cloudClientStatus.optName.pluginDownloadStatus]));uciCloudConfig.optValue.cloudDownloading==
k||uciCloudConfig.optValue.cloudComplete==k?c==UPGRADE_FW?g.count=parseInt(h[cloudClientStatus.optName.fwDownloadProgress]):c==UPGRADE_PLUGIN&&(g.count=parseInt(h[cloudClientStatus.optName.pluginDownloadProgress])):g.count=uciCloudConfig.optValue.cloudOutline==k?ERR_PERCENT:0}else g.count=ERR_PERCENT;g[ERR_CODE]=ENONE;a(g)},!0)},!0,function(a){closeProgBar();!0==a?c==UPGRADE_FW?showProgBar(SYSUPGRADE_SECONDS,label.upgrading,function(){lanDetecting(function(){window.location.reload()})},!0,void 0,
statusStr.upgradeOk,statusStr.upgradeTip):c==UPGRADE_PLUGIN&&showProgBar(PLUGINUPGRADE_SECONDS,label.upgrading,function(){lanDetecting(function(){window.location.reload()})},!0,void 0,statusStr.upgradeOk,statusStr.upgradeTip):(gOnlineUpgradeNote=statusStr.fwDownLoadErr,upgradeFailHdCloudPush())})};this.checkFWVerSuccessCloudPush=function(c,b){var a=uciCloudConfig.fileName,d={},g={};d[a]={};c==UPGRADE_FW?d[a][uciCloudConfig.actionName.downloadFw]=null:c==UPGRADE_PLUGIN&&(g[uciCloudConfig.optName.pluginIdList]=
b,d[a][uciCloudConfig.actionName.updatePlugins]=g);$.action(d,function(a){!0==errHandleCloudPush(a[ERR_CODE])&&onlineUpgradeProgress(c)})};this.onlineUpgradeCheck=function(c,b,a,d){function g(){var d={};d[h]={};d[h][KEY_NAME]=cloudClientStatus.secName.checkPluginVer;$.queryP(d,function(d){if(!0==c(d[ERR_CODE])&&!1==$.local)switch(parseInt(d[h][cloudClientStatus.secName.checkPluginVer][cloudClientStatus.optName.actionStatus])){case 0:case 5:"function"==typeof b&&b(d[h][cloudClientStatus.secName.checkPluginVer][cloudClientStatus.optName.errCode]);
break;case 4:"function"==typeof a&&a();break;default:$.setTimeout(g,500)}else"function"==typeof b&&b()})}function e(){var d={};d[h]={};d[h][KEY_NAME]=cloudClientStatus.secName.checkFwVer;$.queryP(d,function(d){if(!0==c(d[ERR_CODE])&&!1==$.local)switch(parseInt(d[h][cloudClientStatus.secName.checkFwVer][cloudClientStatus.optName.actionStatus])){case 0:case 5:"function"==typeof b&&b(d[h][cloudClientStatus.secName.checkFwVer][cloudClientStatus.optName.errCode]);break;case 4:"function"==typeof a&&a();
break;default:$.setTimeout(e,500)}else"function"==typeof b&&b()})}var f=uciCloudConfig.fileName,h=cloudClientStatus.fileName,k={};k[f]={};d==UPGRADE_FW?k[f][uciCloudConfig.actionName.checkFwVersion]=null:d==UPGRADE_PLUGIN&&(k[f][uciCloudConfig.actionName.checkPluginVer]=null);$.action(k,function(a){!0==c(a[ERR_CODE])&&(d==UPGRADE_PLUGIN?g():d==UPGRADE_FW&&e())})};this.onlineUpgrade=function(c,b,a,d){this.upgradeErrCBCloudPush=c;this.gOnlineUpgradeNote="";this.onlineUpgradeCheck(errHandleCloudPush,
function(){gOnlineUpgradeNote=statusStr.fwDownLoadErr;upgradeFailHdCloudPush()},function(){"function"==typeof b&&b();checkFWVerSuccessCloudPush(a,d)},a)}}
function Phone(){this.OS={windows:!1,windowsPhone:!1,unixPC:!1,iPad:!1,iPhone:!1,iMacPC:!1,iPod:!1,android:!1,nokia:!1,player:!1,Android_UC:!1,portable:!1,curOS:["windows",0,0],checkDeviceMode:function(){var c=navigator.platform,b=navigator.userAgent;if(void 0!=c)if(0<=c.indexOf("Win"))0<=b.indexOf("Windows Phone")?(this.portable=this.windows=this.windowsPhone=!0,this.curOS[0]="windowsPhone",this.curOS[1]=3):(this.windows=!0,this.portable=!1,this.curOS[0]="windows",this.curOS[1]=0,!0==/Windows NT ([\d\.]+)/i.test(navigator.userAgent)&&
(this.curOS[2]=RegExp.$1));else if(0<=b.indexOf("NOKIA"))this.portable=this.nokia=!0;else if(0<=b.indexOf("Android"))this.portable=this.android=!0,this.curOS[0]="android",this.curOS[1]=4;else if(0<=c.indexOf("iPad"))this.portable=this.iPad=!0,this.curOS[0]="iOS",this.curOS[1]=1;else if(0<=c.indexOf("iPhone"))this.portable=this.iPhone=!0,this.curOS[0]="iOS",this.curOS[1]=1;else if(0<=c.indexOf("iPod"))this.portable=this.iPod=!0,this.curOS[0]="iOS",this.curOS[1]=1;else if(0<=b.indexOf("Wii")||0<=b.indexOf("PLASTATION"))this.portable=
this.player=!0;else if(0<=c.indexOf("Mac"))this.iMacPC=!0,this.portable=!1,this.curOS[0]="iOS",this.curOS[1]=1;else{if(0<=c.indexOf("X11")||0<=c.indexOf("Linux")&&0>c.indexOf("arm"))this.unixPC=!0,this.portable=!1,this.curOS[0]="linux",this.curOS[1]=2}else 0<=b.indexOf("Android")?(this.portable=this.android=!0,this.curOS[0]="android",this.curOS[1]=4):this.portable=1024<=document.body.clientWidth||1024<=document.body.clientHeight?!1:!0}};this.phoneSet={bContinuePCSet:!1,bPhoneWizardSet:!1};OS.checkDeviceMode()}
function ChsInput(){this.initCheckInput=function(c,b){function a(){var a;a=this.getAttribute("disabled");if(null==a||"true"!=a.toString()&&"disabled"!=a.toString())"true"==this.getAttribute("checked")?($(this).addClass("chObj"),$(this).removeClass("chObjCheck"),this.setAttribute("checked","false"),a=!1):($(this).addClass("chObjCheck"),this.setAttribute("checked","true"),a=!0),"function"==typeof b&&b(a,parseInt(this.getAttribute("value"),10))}var d,g;if("object"==typeof c)c.className="chObj","true"==
c.getAttribute("checked")&&(c.className+=" chObjCheck"),c.onclick=a;else{d=$("i[name="+c+"]");g=d.length;for(var e=0;e<g;e++)d[e].className="chObj","true"==d[e].getAttribute("checked")&&(d[e].className+=" chObjCheck"),d[e].onclick=a}};this.getCheckboxChs=function(c){c=$("i[name="+c+"]");for(var b=c.length,a=[],d=0;d<b;d++)!0==c.eq(d).hasClass("chObjCheck")&&a.push(c.eq(d).attr("value"));return a};this.changeCheckInput=function(c,b,a){c="string"==typeof c?id(c):c;!0===b||"true"==b?($(c).addClass("chObjCheck"),
c.setAttribute("checked","true")):($(c).addClass("chObj"),$(c).removeClass("chObjCheck"),c.setAttribute("checked","false"));"function"==typeof a&&a(b)};this.initRadioInput=function(c,b){function a(){for(var a=0;a<g;a++)d[a].className="rdObj",d[a].setAttribute("checked","false")}for(var d=$("i[name="+c+"]"),g=d.length,e=0;e<g;e++)d[e].className="rdObj","true"==d[e].getAttribute("checked")&&(a(),d[e].className+=" rdObjCheck",d[e].setAttribute("checked","true")),d[e].onclick=function(){a();this.className+=
" rdObjCheck";this.setAttribute("checked","true");"function"==typeof b&&b()}};this.changeRadioInput=function(c,b,a){c="string"==typeof c?id(c):c;!0===b||"true"==b?(c.className+=" rdObjCheck",c.setAttribute("checked","true")):(c.className="rdObj",c.setAttribute("checked","false"));"function"==typeof a&&a(b)};this.getRadioChs=function(c){var b="";c=$("i[name="+c+"]");for(var a=c.length,d=0;d<a;d++)if(!0==c.eq(d).hasClass("rdObjCheck")){b=c.eq(d).attr("value");break}return b}}
function Plugin(c){"undefined"==typeof PLUGIN_STREAM_MAIN&&(window.PLUGIN_STREAM_MAIN=1,window.PLUGIN_STREAM_MINOR=0,window.PLUGIN_STREAM_THIRD=2);"undefined"==typeof DEFAULT_VIDEO_CONNECTION_TYPE&&(window.HTTP_TS=0,window.RTSP_MULTICAST=1,window.RTSP_UNITCAST=2,window.DEFAULT_VIDEO_CONNECTION_TYPE=3);this._ops={id:"",pluginId:"1223",className:"",iePluId:"",othrPluId:"pluginObj",ip:$.domainIp,bMultipartPreview:1,bMultitrans:1,staticIp:$.staticIp,pppoeIp:$.pppoeIp,vhttpdInnerPort:$.vhttpdInnerPort,
vhttpdExtPort:$.vhttpdExtPort,rtspInnerPort:$.rtspInnerPort,rtspExtPort:$.rtspExtPort,bIsAutoVbr:$.bIsAutoVbr,clientId:0,streamtype:2,connectiontype:RTSP_UNITCAST,streamresolution:PLUGIN_STREAM_MAIN,saveRoad:"",readyHd:null,netChangeHd:null,downloadReadyHd:null};this.resPluObj=null;"function"!=typeof Plugin.prototype.init&&(window.PLUGIN_STATE_RELOGIN=4,window.PLUGIN_STATE_FIN=3,window.PLUGIN_STATE_FULL=2,window.PLUGIN_STATE_ON=1,window.PLUGIN_STATE_OFF=0,window.PLUGIN_STATE_MINUS=-1,window.PLUGIN_AUTH_ERROR=
2,window.AUTO="auto",Plugin.installObj={url:"",exist:1,EXIST:1,NEXIST:0,bUpInfoShow:!1,plFwVersion:"0.0.0.0"},Plugin.prototype.init=function(b){try{this._optionsInit(b),this._crtObjPlu()}catch(a){log(a)}},Plugin.prototype._optionsInit=function(b){var a,d;for(d in b)if(a=b[d],"undefined"!=typeof this._ops[d])if("object"!=typeof a||a instanceof Array||null==this._ops[d])this._ops[d]=a;else for(var c in a)this._ops[d][c]=a[c]},Plugin.prototype._detectBrowser=function(){var b=navigator.userAgent.toLowerCase();
if(null!=/(msie\s|trident.*rv:)([\w.]+)/.exec(b))return"IE"},Plugin.prototype._crtObjPlu=function(){var b,a=this,d=document.getElementById(this._ops.id);try{for(var c=d.getElementsByTagName("object"),e=c.length,f=0;f<e;f++)d.removeChild(c[f]);b=this.resPluObj=document.createElement("object");b.className=this._ops.className;try{"IE"==this._detectBrowser()?(b.id=this._ops.iePluId,b.classid="CLSID:15B54F54-CD6C-4395-A697-FAE11E3562A6"):(b.id=this._ops.othrPluId,b.type="application/x-tp-camera-h264")}catch(h){}d.appendChild(b);
if(!1==this.checkInstalled())"localStoragePlugin"!=this._ops.id&&a.showInstalledTip();else{b.ip=this._ops.ip;b.staticIp=this._ops.staticIp;b.pppoeIp=this._ops.pppoeIp;b.vhttpdInnerPort=this._ops.vhttpdInnerPort;b.vhttpdExtPort=this._ops.vhttpdExtPort;b.rtspInnerPort=this._ops.rtspInnerPort;b.rtspExtPort=this._ops.rtspExtPort;b.bIsAutoVbr=this._ops.bIsAutoVbr;b.streamtype=this._ops.streamtype;b.streamresolution=this._ops.streamresolution;b.connectiontype=this._ops.connectiontype;b.bMultipartPreview=
this._ops.bMultipartPreview;b.bMultitrans=this._ops.bMultitrans;b.rtspServerPort=this._ops.rtspServerPort;"function"==typeof this._ops.readyHd&&b.videoReadyCallback(this._ops.readyHd);"function"==typeof this._ops.netChangeHd&&b.videoConnectCallback(this._ops.netChangeHd);"function"==typeof this._ops.downloadReadyHd&&b.windowReadyCallback(this._ops.downloadReadyHd);var k=$.username?$.username:"",k=k.replace(/%/g,"%25").replace(/"/g,"%22").replace(/,/g,"%2c");b.username=k;b.password=$.pwd;b.md5password=
$.pwdMD5;b.originalPwd=$.oriPwd;$.setPluginAuthHandle(function(b,d){a.setAuthData(b,d)});try{"close"!=sessionLS.getItem(PLGINFOCLOSE)&&!1==Plugin.installObj.bUpInfoShow&&this.checkPluginUpgrade()}catch(l){log(l)}}}catch(m){log(m)}},Plugin.prototype.saveStoragePath=function(b){var a;try{!0==this.resPluObj.bIEProtectedMode?showAlert(errStr.bIEProtectedModeTip):(a=this.resPluObj.saveStoragePath(),b(a))}catch(d){log(d)}},Plugin.prototype.showPluginUpgradeInfo=function(){var b,a,d,c=this;d=c.getBrowserInfo();
!0!=Plugin.installObj.bUpInfoShow&&(Plugin.installObj.bUpInfoShow=!0,b=el("div"),b.className="pluginUpInfoCon",a=el("i"),a.onclick=function(){document.body.removeChild(document.body.childNodes[0]);!0==isIESix&&(document.body.style.height="auto");sessionLS.setItem(PLGINFOCLOSE,"close");basicPHAutoFit()},b.appendChild(a),a=el("label"),a.innerHTML=label.pluginUpInfo1,b.appendChild(a),a=el("label"),a.innerHTML=label.pluginUpInfo2,a.className="pluginInfoDl",a.onclick=function(){Plugin.installObj.exist==
Plugin.installObj.EXIST?(Plugin.installObj.url="",c.getInstalledUrl(d,function(){location.href=$.domainUrl+$.orgURL(Plugin.installObj.url)})):window.open(Plugin.installObj.url+"?browserType="+d.browserType[0]+"&browserVersion="+d.browserVesion+"&browserBit="+d.browserBit[0]+"&browserSys="+d.broswerSys[0]+"&osVersion="+d.osVersion)},b.appendChild(a),a=el("label"),a.innerHTML=label.pluginUpInfo3,b.appendChild(a),document.body.insertBefore(b,document.body.childNodes[0]),basicPHAutoFit())},Plugin.prototype.checkPluginUpgrade=
function(){var b=this;this.getInstalledUrl(this.getBrowserInfo(),function(){!0==b.checkNewPlugin(Plugin.installObj.plFwVersion)&&b.showPluginUpgradeInfo()})},Plugin.prototype.checkNewPlugin=function(b){try{var a,d,c=this.getPluginVersion();if(void 0==c||void 0==b||"0.0.0.0"==b)return!1;a=c.split(".");d=b.split(".");b=0;for(var e=a.length;b<e&&null!=a[b]&&null!=d[b];b++){if(parseInt(a[b],10)<parseInt(d[b],10))return!0;if(parseInt(a[b],10)>parseInt(d[b],10))break}}catch(f){log(f)}return!1},Plugin.prototype.getPluginVersion=
function(){try{return this.resPluObj.pluginVersion}catch(b){log(b)}},Plugin.prototype.checkInstalled=function(b){try{var a=(typeof this.resPluObj.PlayVideo).toLowerCase();if(null!=navigator.userAgent.toLowerCase().match("chrome")||"unknown"!=a&&"function"!=a)return"function"==typeof b&&b(),!1}catch(d){log(d)}return!0},Plugin.prototype.getBrowserInfo=function(){var b;try{return b=0<=navigator.platform.indexOf("64")?["64",1]:["32",0],{browserType:[explorerTypeArr[0],explorerTypeArr[1]],browserVesion:explorerTypeArr[2],
browserBit:b,osVersion:OS.curOS[2],broswerSys:[OS.curOS[0],OS.curOS[1]]}}catch(a){log(a)}},Plugin.prototype.getInstalledUrl=function(b,a){var d,c,e;0!=Plugin.installObj.url.length?"function"==typeof a&&a():(c=uciSystem.optName,d={},d[uciSystem.fileName]={},d[uciSystem.fileName][uciSystem.actionName.getPluginUrl]=e={},e[c.browserType]=b.browserType[1].toString(),e[c.browserVersion]=b.browserVesion.toString(),e[c.browserBits]=b.browserBit[1].toString(),e[c.browserOS]=b.broswerSys[1].toString(),e[c.osVersion]=
b.osVersion.toString(),$.action(d,function(b){ENONE==b[ERR_CODE]&&(Plugin.installObj.exist=b[c.exist]||"",Plugin.installObj.url=b[c.pluginUrl]||"",Plugin.installObj.plFwVersion=b[c.pluginVersion]||"0.0.0.0",0!=Plugin.installObj.url.indexOf("http://")&&0!=Plugin.installObj.url.indexOf("https://")&&Plugin.installObj.exist!=Plugin.installObj.EXIST&&(Plugin.installObj.url="http://"+Plugin.installObj.url));"function"==typeof a&&a()}))},Plugin.prototype.showInstalledTip=function(){function b(){h=a.offsetHeight;
k=a.offsetWidth;f=getoffset(a,d);null!=m&&(f.left=(parseInt(m)-k-n)/2);c.style.top=parseInt((h-c.offsetHeight)/2)+"px";e.style.height=h+"px";e.style.width=k+"px";e.style.left=f.left+"px";e.style.top=f.top+"px";c.style.visibility="visible";!l||"IE"==l.browserType[0]||"firefox"==l.browserType[0]&&"32"==l.browserBit[0]&&52>parseInt(l.browserVesion)||(c.innerHTML="暂不支持此浏览器，请使用IE或版本52.0之前的32位火狐浏览器",c.onclick=null,c.style.textDecoration="none",c.style.cursor="default",$(".vedioActiveX").css("visibility",
"hidden"),$(".previewVedioActiveX").css("visibility","hidden"));c.style.left=f.left+parseInt((k-c.offsetWidth)/2)+"px"}var a=this.resPluObj,d=id(this._ops.id),c=$.find("label.vedioInstallTip")[0],e=$.find("div.vedioInstallBackDiv")[0],f,h,k,l,m=$("#videoPluginPriviewCon").outerWidth(),n=$.BSHOWPTZCTRL?$("#ptzControlCon").outerWidth():0,p=this;try{if(void 0==c){l=this.getBrowserInfo();e=el("div");e.className="vedioInstallBackDiv";d.appendChild(e);c=el("label");c.className="vedioInstallTip";c.onclick=
function(){Plugin.installObj.exist==Plugin.installObj.EXIST?(Plugin.installObj.url="",p.getInstalledUrl(l,function(){location.href=$.domainUrl+$.orgURL(Plugin.installObj.url)})):window.open(Plugin.installObj.url+"?browserType="+l.browserType[0]+"&browserVersion="+l.browserVesion+"&browserBit="+l.browserBit[0]+"&browserSys="+l.broswerSys[0]+"&osVersion="+l.osVersion)};c.innerHTML=label.pluginStallTip;c.style.visibility="hidden";d.appendChild(c);d.style.position="relative";try{d.style.zoom=1}catch(r){}0==
Plugin.installObj.url.length?this.getInstalledUrl(l,b):b()}else b()}catch(u){log(u)}},Plugin.prototype.getResolution=function(){var b=this.resPluObj.vHeight,a=this.resPluObj.vWidth;return{vHeight:b,vWidth:a,resolution:a/b}},Plugin.prototype.setAuthData=function(b,a){try{var d=b?b:"",d=d.replace(/%/g,"%25").replace(/"/g,"%22").replace(/,/g,"%2c");this.resPluObj.username=d;this.resPluObj.password=a;this.resPluObj.md5password=$.pwdMD5}catch(c){log(c)}},Plugin.prototype.reload=function(){},Plugin.prototype.setStreamCode=
function(b){try{this.resPluObj.streamresolution=b}catch(a){log(a)}},Plugin.prototype.setConnectionType=function(b){try{this.resPluObj.connectiontype=b}catch(a){log(a)}},Plugin.prototype.playVideo=function(){try{this.resPluObj.PlayVideo()}catch(b){log(b)}},Plugin.prototype.stopVideo=function(){try{this.resPluObj.StopVideo()}catch(b){log(b)}},Plugin.prototype.stopSpeaker=function(){try{this.resPluObj.StopSpeaker()}catch(b){log(b)}},Plugin.prototype.voiceIntercom=function(b){try{"function"==typeof b&&
this.resPluObj.speakerEventCallback(b),this.resPluObj.StartSpeaker()}catch(a){log(a)}},Plugin.prototype.catchPic=function(b){try{!0==this.resPluObj.bIEProtectedMode?showAlert(errStr.bIEProtectedModeTip):("function"==typeof b&&this.resPluObj.snapshotcallback(b),this.resPluObj.Snapshot("snapshot"))}catch(a){log(a)}},Plugin.prototype.catchPicToBase64=function(b){try{!0==this.resPluObj.bIEProtectedMode?showAlert(errStr.bIEProtectedModeTip):("function"==typeof b&&this.resPluObj.snapshotcallback(b),this.resPluObj.snapShotToBuffer())}catch(a){log(a)}},
Plugin.prototype.getSnapShotPicBase64=function(){try{for(var b=0,a=[],d;0==b;)d=this.resPluObj.SnapShotBase64,"string"==typeof d&&a.push(d),b=this.resPluObj.isGetFullBase64;return a.join("").slice(0,-1)}catch(c){log(c)}},Plugin.prototype.selectStorageFolder=function(){try{if(!0==this.resPluObj.bIEProtectedMode)showAlert(errStr.bIEProtectedModeTip);else return this.resPluObj.setStoragePath()}catch(b){log(b)}},Plugin.prototype.getStorageFolder=function(){try{return this.resPluObj.storageDir}catch(b){log(b)}},
Plugin.prototype.getPlayTime=function(){try{return this.resPluObj.GetCameraTime()}catch(b){log(b)}},Plugin.prototype.saveVideo=function(b,a,d){var c;try{if(PLUGIN_STATE_ON==b){if(!0==this.resPluObj.bIEProtectedMode)return showAlert(errStr.bIEProtectedModeTip),!1;"function"==typeof d&&this.resPluObj.recordcbinvoke(d);c=this.resPluObj.Record()}else PLUGIN_STATE_OFF==b&&(c=this.resPluObj.StopRecord());"function"==typeof a&&a(c)}catch(e){log(e)}},Plugin.prototype.openStorageFolder=function(){try{if(!0==
this.resPluObj.bIEProtectedMode)showAlert(errStr.bIEProtectedModeTip);else return this.resPluObj.openStoragePath()}catch(b){log(b)}},Plugin.prototype.openFileStorageFolder=function(b){try{if(!0==this.resPluObj.bIEProtectedMode)showAlert(errStr.bIEProtectedModeTip);else return this.resPluObj.openFileStoragePath(b)}catch(a){log(a)}},Plugin.prototype.getFileStorageFolder=function(){try{if(!0==this.resPluObj.bIEProtectedMode)showAlert(errStr.bIEProtectedModeTip);else return this.resPluObj.downloadFileStoragePath}catch(b){log(b)}},
Plugin.prototype.getPicFileStoragePath=function(){try{if(!0==this.resPluObj.bIEProtectedMode)showAlert(errStr.bIEProtectedModeTip);else return this.resPluObj.picFileStoragePath}catch(b){log(b)}},Plugin.prototype.getVideoFileStoragePath=function(){try{if(!0==this.resPluObj.bIEProtectedMode)showAlert(errStr.bIEProtectedModeTip);else return this.resPluObj.videoFileStoragePath}catch(b){log(b)}},Plugin.prototype.fluncySelect=function(b){try{this.resPluObj.SetFluncy(b)}catch(a){log(a)}},Plugin.prototype.setAudioVolume=
function(b){try{this.resPluObj.SetAudioVolume(b)}catch(a){log(a)}},Plugin.prototype.getAudioVolume=function(){try{return this.resPluObj.audioVolume}catch(b){log(b)}},Plugin.prototype.fullScreen=function(){try{this.resPluObj.SetFullScreen()}catch(b){log(b)}},Plugin.prototype.updateOsdTime=function(b){try{this.resPluObj.UpdateOSDTime(b)}catch(a){log(a)}},Plugin.prototype.setSize=function(b){try{setStyle(this.resPluObj,b)}catch(a){log(a)}},Plugin.prototype.setAreaComState=function(b){try{this.resPluObj.areaCompensation=
b}catch(a){log(a)}},Plugin.prototype.setACResolution=function(b){try{this.resPluObj.setACReso(b[0],b[1])}catch(a){log(a)}},Plugin.prototype.getAreaComInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getACPos(b,d),a.x=d[0],a.y=d[1],a.width=d[2],a.height=d[3]}catch(c){log(c)}return a},Plugin.prototype.showAreaComInfo=function(b){try{this.resPluObj.addACRect(b.x,b.y,b.width,b.height)}catch(a){log(a)}},Plugin.prototype.delAreaComInfo=function(b){try{this.resPluObj.delACRect(b)}catch(a){log(a)}},
Plugin.prototype.delWhiteBalanceInfo=function(b){try{this.resPluObj.delACRect(b)}catch(a){log(a)}},Plugin.prototype.setWhiteBalanceState=function(b){try{this.resPluObj.whiteBalance=b}catch(a){log(a)}},Plugin.prototype.setWBResolution=function(b){try{this.resPluObj.setWBReso(b[0],b[1])}catch(a){log(a)}},Plugin.prototype.getWhiteBalanceInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getWBPos(b,d),a.x=d[0],a.y=d[1],a.width=d[2],a.height=d[3]}catch(c){log(c)}return a},Plugin.prototype.showWhiteBalanceInfo=
function(b){try{this.resPluObj.addWBRect(b.x,b.y,b.width,b.height)}catch(a){log(a)}},Plugin.prototype.delWhiteBalanceInfo=function(b){try{this.resPluObj.delWBRect(b)}catch(a){log(a)}},Plugin.prototype.AreaChangeCallback=function(b){try{"function"==typeof b&&this.resPluObj.meshChangeCallback(b)}catch(a){log(a)}},Plugin.prototype.sendAudioData=function(b,a){try{return this.resPluObj.sendAudioData(b,a)}catch(d){log(d)}},Plugin.prototype.setOSD=function(b,a,d){var c={white:16777215,black:0,red:15138816,
green:65304,blue:49407},e="on"==a.enabled?PLUGIN_STATE_ON:PLUGIN_STATE_OFF,c=AUTO==d.color_type?16777215:c[d.color],f=parseInt(64*$.resolutionWidth/1920,10)||48;try{AUTO!=d.size?f=parseInt(d.size.split("*")[0]):(f-=f%4,f=128<=f?128:80<=f?80:64<=f?64:48<=f?48:32<=f?32:16),void 0==b||void 0==typeof a.text||void 0==a.text?this.resPluObj.ShowTime(e,a.x_coor,a.y_coor,c,f):this.resPluObj.ShowOSD(b,e,a.x_coor,a.y_coor,c,f,a.text)}catch(h){log(h)}},Plugin.prototype.setOSDLPR=function(b){var a=b.showValue,
d=parseInt(64*$.resolutionWidth/1920,10)||48;try{d=parseInt(b.size),this.resPluObj.showLPROSD(1,a,b.x_coor,b.y_coor,16777215,d,b.text)}catch(c){log(c)}},Plugin.prototype.setOSDByPos=function(b,a,d,c,e){e=1==e?PLUGIN_STATE_ON:PLUGIN_STATE_OFF;var f=parseInt(64*$.resolutionWidth/1920,10)||48;try{this.resPluObj.ShowOSD(b,e,a,d,16777215,f,c)}catch(h){log(h)}},Plugin.prototype.getOsdPosition=function(b){var a={},d=[0,0];try{void 0==b||0>b||"undefined"==typeof b?this.resPluObj.getOSDTimePos(d):this.resPluObj.getOSDTitlePos(b,
d),a.x=0>d[0]?0:d[0],a.y=0>d[1]?0:d[1]}catch(c){log(c)}return a},Plugin.prototype.getLPROsdPosition=function(b){var a={},d=[0,0];try{this.resPluObj.getLPROSDPos(b,d),a.x=0>d[0]?0:d[0],a.y=0>d[1]?0:d[1]}catch(c){log(c)}return a},Plugin.prototype.setRoiStatus=function(b){try{this.resPluObj.bROIOn=b}catch(a){log(a)}},Plugin.prototype.showRoiInfo=function(b){try{this.resPluObj.addROIRect(b.x,b.y,b.width,b.height)}catch(a){log(a)}},Plugin.prototype.getRoiInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getROIRectPos(b,
d),a.x=d[0],a.y=d[1],a.width=d[2],a.height=d[3]}catch(c){log(c)}return a},Plugin.prototype.delRoiInfo=function(b){try{this.resPluObj.delROIArr(b)}catch(a){log(a)}},Plugin.prototype.set3DPositionStatus=function(b){try{this.resPluObj.b3DPositionOn=b}catch(a){log(a)}},Plugin.prototype.get3DPositionStatus=function(){try{return this.resPluObj.b3DPositionOn}catch(b){log(b)}},Plugin.prototype.setRegionFocusStatus=function(b){try{this.resPluObj.bRegionFocusOn=b}catch(a){log(a)}},Plugin.prototype.getRegionFocusStatus=
function(){try{return this.resPluObj.bRegionFocusOn}catch(b){log(b)}},Plugin.prototype.setRegionExposeStatus=function(b){try{this.resPluObj.bRegionExposeOn=b}catch(a){log(a)}},Plugin.prototype.getRegionExposeStatus=function(){try{return this.resPluObj.bRegionExposeOn}catch(b){log(b)}},Plugin.prototype.getPosition=function(b){try{"function"==typeof b&&this.resPluObj.getMousePosCallback(b)}catch(a){log(a)}},Plugin.prototype.setRegionCoverStatus=function(b){try{this.resPluObj.bRegionCoverOn=b}catch(a){log(a)}},
Plugin.prototype.showRegionCoverInfo=function(b){try{this.resPluObj.addRegionCoverRect(b.x,b.y,b.width,b.height)}catch(a){log(a)}},Plugin.prototype.getRegionCoverInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getRegionCoverPos(b,d),a.x=d[0],a.y=d[1],a.width=d[2],a.height=d[3]}catch(c){log(c)}return a},Plugin.prototype.getRegionCoverLen=function(){try{return this.resPluObj.RegionCoverArrLen}catch(b){log(b)}},Plugin.prototype.delRegionCoverInfo=function(b){try{this.resPluObj.delRegionCoverArr(b)}catch(a){log(a)}},
Plugin.prototype.setPTZRegionCoverStatus=function(b){try{this.resPluObj.bRegionCoverPTZOn=b}catch(a){log(a)}},Plugin.prototype.getPTZRegionCoverCurCnt=function(b){b=-1;try{b=this.resPluObj.curPTZRegionCoverCnt}catch(a){log(a)}return b},Plugin.prototype.setPTZRegionCoverLimit=function(b){try{this.resPluObj.RegionCoverPTZLimit=b}catch(a){log(a)}},Plugin.prototype.startEditPTZRegionCoverInfo=function(b){try{this.resPluObj.startPTZRegionCoverEdit(b.lefttop_x,b.lefttop_y,b.righttop_x,b.righttop_y,b.rightbottom_x,
b.rightbottom_y,b.leftbottom_x,b.leftbottom_y)}catch(a){log(a)}},Plugin.prototype.endEditRegionCoverInfo=function(){var b={},a=[0,0,0,0,0,0,0,0];try{this.resPluObj.endPTZRegionCoverEdit(0,a),b={lefttop_x:a[0],lefttop_y:a[1],righttop_x:a[2],righttop_y:a[3],rightbottom_x:a[4],rightbottom_y:a[5],leftbottom_x:a[6],leftbottom_y:a[7]}}catch(d){log(d)}return b},Plugin.prototype.setPtzRegionCoverCB=function(b){try{"function"==typeof b&&this.resPluObj.ptzRegionCoverCallback(b)}catch(a){log(a)}},Plugin.prototype.setLineCrossingState=
function(b){try{this.resPluObj.BorderDetection=b}catch(a){log(a)}},Plugin.prototype.changeDetectDirect=function(b,a){try{this.resPluObj.ChangeDetectDirect(b,a)}catch(d){log(d)}},Plugin.prototype.showLineCrossingInfo=function(b,a){try{this.resPluObj.addBorderDetectionWithIndex(b,parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),a.direction)}catch(d){log(d);try{this.resPluObj.addBorderDetection(parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),a.direction)}catch(c){log(c)}}},
Plugin.prototype.getLineCrossingInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getBorderDetectionPos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=d[3]}catch(c){log(c)}return a},Plugin.prototype.delLineCrossingInfo=function(b){try{this.resPluObj.delBorderDetectionArr(b)}catch(a){log(a)}},Plugin.prototype.setFodLineState=function(b){try{this.resPluObj.bThrowingRecognitionLineOn=b}catch(a){log(a)}},Plugin.prototype.setFodRegionState=function(b){try{this.resPluObj.bThrowingRecognitionRectOn=
b}catch(a){log(a)}},Plugin.prototype.showFodLineInfo=function(b,a){try{this.resPluObj.addThrowingRecognitionLineWithIndex(b,parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),a.direction)}catch(d){log(d);try{this.resPluObj.addThrowingRecognitionLine(parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),a.direction)}catch(c){log(c)}}},Plugin.prototype.showFodRegionInfo=function(b,a){try{this.resPluObj.addThrowingRecognitionRectWithIndex(b,parseInt(a.pt1_x),parseInt(a.pt1_y),
parseInt(a.pt2_x),parseInt(a.pt2_y),parseInt(a.pt3_x),parseInt(a.pt3_y),parseInt(a.pt4_x),parseInt(a.pt4_y))}catch(d){log(d);try{this.resPluObj.addThrowingRecognitionRect(parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),parseInt(a.pt3_x),parseInt(a.pt3_y),parseInt(a.pt4_x),parseInt(a.pt4_y))}catch(c){log(c)}}},Plugin.prototype.getFodLineInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getThrowingRecognitionLinePos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=
d[3]}catch(c){log(c)}return a},Plugin.prototype.delFodLineInfo=function(b){try{this.resPluObj.delThrowingRecognitionLineArr(b)}catch(a){log(a)}},Plugin.prototype.getFodRegionInfo=function(b){var a={},d=[0,0,0,0,0,0,0,0];try{this.resPluObj.getThrowingRecognitionRectPos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=d[3],a.pt3_x=d[4],a.pt3_y=d[5],a.pt4_x=d[6],a.pt4_y=d[7]}catch(c){log(c)}return a},Plugin.prototype.delFodRegionInfo=function(b){try{this.resPluObj.delThrowingRecognitionRectArr(b)}catch(a){log(a)}},
Plugin.prototype.setOverLineDetState=function(b){try{this.resPluObj.OverLineDetectionOn=b}catch(a){log(a)}},Plugin.prototype.showOverLineDetInfo=function(b){try{this.resPluObj.addOverLineDetection(parseInt(b.pt1_x),parseInt(b.pt1_y),parseInt(b.pt2_x),parseInt(b.pt2_y),b.direction)}catch(a){log(a)}},Plugin.prototype.getOverLineDetInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getOverLineDetectionPos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=d[3]}catch(c){log(c)}return a},Plugin.prototype.delOverLineDetInfo=
function(b){try{this.resPluObj.delOverLineDetectionArr(b)}catch(a){log(a)}},Plugin.prototype.setIntelligentState=function(b){try{this.resPluObj.RegionInvasion=b}catch(a){log(a)}},Plugin.prototype.showHighlight=function(b,a){try{this.resPluObj.setHighlightRect(b,a)}catch(d){log(d)}},Plugin.prototype.getIntelligentRegion=function(b){var a={},d=[0,0,0,0,0,0,0,0];try{this.resPluObj.getRegionInvasionPos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=d[3],a.pt3_x=d[4],a.pt3_y=d[5],a.pt4_x=d[6],a.pt4_y=
d[7]}catch(c){log(c)}return a},Plugin.prototype.setPlateRecognitionLinseStatus=function(b){try{this.resPluObj.PlateRecognitionNew=b}catch(a){log(a)}},Plugin.prototype.setPlateRecognitionStatus=function(b){try{this.resPluObj.PlateRecognition=b}catch(a){log(a)}},Plugin.prototype.setPlateRecognitionQuadsStatus=function(b){try{this.resPluObj.PlateRecognitionQuads=b}catch(a){log(a)}},Plugin.prototype.setPlateRecognitionLineStatus=function(b){try{this.resPluObj.PlateRecognitionmLine=b}catch(a){log(a)}},
Plugin.prototype.showIntelligentRegion=function(b,a){try{this.resPluObj.addRegionInvasionWithIndex(b,parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),parseInt(a.pt3_x),parseInt(a.pt3_y),parseInt(a.pt4_x),parseInt(a.pt4_y))}catch(d){log(d);try{this.resPluObj.addRegionInvasion(parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),parseInt(a.pt3_x),parseInt(a.pt3_y),parseInt(a.pt4_x),parseInt(a.pt4_y))}catch(c){log(c)}}},Plugin.prototype.delIntelligentRegion=
function(b){try{this.resPluObj.delRegionInvasionArr(b)}catch(a){log(a)}},Plugin.prototype.getPlateRecognitionRegion=function(b){var a={},d=[0,0,0,0,0,0,0,0];try{this.resPluObj.getPlateRecognitionPos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=d[3],a.pt3_x=d[4],a.pt3_y=d[5],a.pt4_x=d[6],a.pt4_y=d[7]}catch(c){log(c)}return a},Plugin.prototype.showPlateRecognitionQuads=function(b,a){try{this.resPluObj.addPlateRecognitionmQuads(b,parseInt(a.pt1_x),parseInt(a.pt1_y),parseInt(a.pt2_x),parseInt(a.pt2_y),
parseInt(a.pt3_x),parseInt(a.pt3_y),parseInt(a.pt4_x),parseInt(a.pt4_y))}catch(d){log(d)}},Plugin.prototype.delPlateRecognitionQuads=function(){try{this.resPluObj.delPlateRecognitionArr(0)}catch(b){log(b)}},Plugin.prototype.showPlateRecognitionLine=function(b){try{this.resPluObj.addPlateRecognitionmLine(parseInt(b.pt1_x),parseInt(b.pt1_y),parseInt(b.pt2_x),parseInt(b.pt2_y))}catch(a){log(a)}},Plugin.prototype.showLPRLaneLinesAndTriggerLine=function(b){try{this.resPluObj.addPlateRecognitionmLprLine(parseInt(b.lane1pt1_x),
parseInt(b.lane1pt1_y),parseInt(b.lane1pt2_x),parseInt(b.lane1pt2_y),parseInt(b.lane2pt1_x),parseInt(b.lane2pt1_y),parseInt(b.lane2pt2_x),parseInt(b.lane2pt2_y),parseInt(b.triggerpt1_x),parseInt(b.triggerpt1_y),parseInt(b.triggerpt2_x),parseInt(b.triggerpt2_y),0)}catch(a){log(a)}},Plugin.prototype.getLPRLaneLinesAndTriggerLineInfo=function(b){var a={},d=[0,0,0,0,0,0,0,0,0,0,0,0];try{this.resPluObj.getPlateRecognitionmLprLine(d,b),a.lane1pt1_x=d[0],a.lane1pt1_y=d[1],a.lane1pt2_x=d[2],a.lane1pt2_y=
d[3],a.lane2pt1_x=d[4],a.lane2pt1_y=d[5],a.lane2pt2_x=d[6],a.lane2pt2_y=d[7],a.triggerpt1_x=d[8],a.triggerpt1_y=d[9],a.triggerpt2_x=d[10],a.triggerpt2_y=d[11]}catch(c){log(c)}return a},Plugin.prototype.getPlateRecognitionLineInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getPlateRecognitionmLinePos(b,d),a.pt1_x=d[0],a.pt1_y=d[1],a.pt2_x=d[2],a.pt2_y=d[3]}catch(c){log(c)}return a},Plugin.prototype.delPlateRecognitionLine=function(){try{this.resPluObj.delPlateRecognitionmLineArr(1)}catch(b){log(b)}},
Plugin.prototype.intelligentCallback=function(b){try{"function"==typeof b&&this.resPluObj.IntelligentCallback(b)}catch(a){log(a)}},Plugin.prototype.lineCallback=function(b){try{"function"==typeof b&&this.resPluObj.IntelligentCallback(b)}catch(a){log(a)}},Plugin.prototype.regionCallback=function(b){try{"function"==typeof b&&this.resPluObj.IntelligentCallback(b)}catch(a){log(a)}},Plugin.prototype.mousePressAndMoveCallback=function(b){try{"function"==typeof b&&this.resPluObj.MouseMoveCallback(b)}catch(a){log(a)}},
Plugin.prototype.showHighlight=function(b,a){try{this.resPluObj.setHighlightRect(b,a)}catch(d){log(d)}},Plugin.prototype.setOSDSpecialStatus=function(b){try{this.resPluObj.setIllegalStatus(b)}catch(a){log(a)}},Plugin.prototype.setMoveDetState=function(b){try{this.resPluObj.MotionDetection(b)}catch(a){log(a)}},Plugin.prototype.setRectArrLen=function(b){try{this.resPluObj.SetRectArrLen(parseInt(b))}catch(a){log(a)}},Plugin.prototype.showMoveDetInfo=function(b){try{this.resPluObj.addMDRect(b.x,b.y,b.width,
b.height)}catch(a){log(a)}},Plugin.prototype.getMoveDetInfo=function(b){var a={},d=[0,0,0,0];try{this.resPluObj.getMDPos(b,d),a.x=d[0],a.y=d[1],a.width=d[2],a.height=d[3]}catch(c){log(c)}return a},Plugin.prototype.delMoveDetInfo=function(b){try{this.resPluObj.delMDRect(b)}catch(a){log(a)}},Plugin.prototype.setVideoCludeState=function(b){try{this.resPluObj.MDOccludeOn=b}catch(a){log(a)}},Plugin.prototype.showVideoCludeInfo=function(b){try{this.resPluObj.addMDOccludeRect(b.x,b.y,b.width,b.height)}catch(a){log(a)}},
Plugin.prototype.getVideoCludeInfo=function(){var b={},a=[0,0,0,0];try{this.resPluObj.getMDOccludePos(a),b.x=a[0],b.y=a[1],b.width=a[2],b.height=a[3]}catch(d){log(d)}return b},Plugin.prototype.delVideoCludeInfo=function(){try{this.resPluObj.delMDOccludeRect()}catch(b){log(b)}},Plugin.prototype.getVideoCludeLen=function(b){try{return this.resPluObj.MDArrLen}catch(a){log(a)}},Plugin.prototype.stopDigitalZoomState=function(b){try{this.resPluObj.bDigitalZoomOn=b}catch(a){log(a)}},Plugin.prototype.getDigitalZoomInfo=
function(){var b={};try{this.resPluObj.digitalZoomCallback(function(a,c,e,f){b.x=a;b.y=c;b.width=e;b.height=f})}catch(a){log(a)}return b},Plugin.prototype.elecZoomCallback=function(b){try{"function"==typeof b&&this.resPluObj.digitalZoomCallback(b)}catch(a){log(a)}},Plugin.prototype.playback=function(){try{return this.resPluObj.playback()}catch(b){log(b)}},Plugin.prototype.stopPlayback=function(){try{return this.resPluObj.stopPlayback()}catch(b){log(b)}},Plugin.prototype.setPlaybackChn=function(b,
a){try{return this.resPluObj.setPlaybackChn(b,a)}catch(d){log(d)}},Plugin.prototype.setPlayBackInfo=function(b){try{void 0!=b[uciPlayBack.optName.clientId]&&(this.resPluObj.clientId=b[uciPlayBack.optName.clientId]),void 0!=b[uciPlayBack.optName.startTime]&&(this.resPluObj.startTime=b[uciPlayBack.optName.startTime]),void 0!=b[uciPlayBack.optName.eventType]&&(this.resPluObj.eventType=b[uciPlayBack.optName.eventType])}catch(a){log(a)}},Plugin.prototype.setPlaybackSeekScale=function(b,a){try{return void 0==
b&&(b="1/1"),void 0==a&&(a=0),this.resPluObj.setPlaybackSeekScale(b,a)}catch(d){log(d)}},Plugin.prototype.speedPlaybackByDevice=function(){try{return this.resPluObj.speedPlaybackByDevice()}catch(b){log(b)}},Plugin.prototype.pausePlayback=function(b){try{return this.resPluObj.pausePlayback(b)}catch(a){log(a)}},Plugin.prototype.setVideoConnectCallback=function(b){try{return this.resPluObj.setVideoConnectCallback(b)}catch(a){log(a)}},Plugin.prototype.setClientId=function(b){try{this.resPluObj.clientId=
b}catch(a){log(a)}},Plugin.prototype.setNoChn=function(){try{this.resPluObj.availableChnNum=0}catch(b){log(b)}},Plugin.prototype.bShowWeek=function(b){try{this.resPluObj.bShowWeek=b}catch(a){log(a)}},Plugin.prototype.getReplayTime=function(b){return this.resPluObj.getUTCTime(b)},Plugin.prototype.setPlaybackScale=function(b){try{this.resPluObj.setPlaybackScale(b)}catch(a){log(a)}},Plugin.prototype.PlaySingleFrame=function(){try{return this.resPluObj.playSingleFrame()}catch(b){log(b)}},Plugin.prototype.downloadVideo=
function(b,a,d,c,e,f){try{return this.resPluObj.downloadVideo(b,a,d,c,e,f)}catch(h){log(h)}},Plugin.prototype.downloadPicture=function(b,a,d,c,e){try{return this.resPluObj.downloadPicture(b,a,d,c,e)}catch(f){log(f)}},Plugin.prototype.setDevName=function(b){try{this.resPluObj.devname=b}catch(a){log(a)}},Plugin.prototype.downloadPictureWithPlate=function(b,a,d,c,e,f,h,k,l,m){try{return this.resPluObj.downloadPictureWithPlate(b,a,d,c,e,f,h,k,l,m)}catch(n){log(n)}},Plugin.prototype.downloadPictureToBuffer=
function(b,a,d,c,e){try{return this.resPluObj.downloadPictureToBuffer(b,a,d,c,e)}catch(f){log(f)}},Plugin.prototype.getDownloadPic=function(){try{for(var b=0,a="";0==b;)a+=this.resPluObj.downloadPicBase64,b=this.resPluObj.isGetFullBase64;return a}catch(d){log(d)}},Plugin.prototype.setDownloadCallback=function(b){try{return this.resPluObj.setDownloadCallback(b)}catch(a){log(a)}},Plugin.prototype.stopDownloading=function(){try{return this.resPluObj.stopDownloading()}catch(b){log(b)}},Plugin.prototype.isIEProtected=
function(){try{if(!0==this.resPluObj.bIEProtectedMode)return showAlert(errStr.bIEProtectedModeTip),!0}catch(b){log(b)}return!1},Plugin.prototype.setOSDStatus=function(b){try{this.resPluObj.setOSDStatus(b)}catch(a){log(a)}},Plugin.prototype.setMultitrans=function(b){try{this.resPluObj.bMultitrans=b}catch(a){log(a)}});this.init(c)}
function timePicker(){this.timePickerCb=null;this.timeConId="timePickerCon";this.timeTagerObj=this.gTimeEditInputId=null;this.scrollBinded=!1;this.timePickerParent=null;this.timePickerInit=function(c,b){timeTagerObj=id(c);timeTagerObj.callBack=b;timePickerParent=id("confCon")||id("infoCon")||id("toolCon")||document.body;timeTagerObj.onclick=function(a){a=a||window.event;$("body").trigger("click");this.blur();timeTagerObj=this;timePickerCb=this.callBack;showTimePickerCon();stopProp(a)};timeTagerObj.onkeydown=
function(a){a=a||window.event;eventPreventDefault(a)}};this.midifyTimeStr=function(c){10>c&&(c="0"+c);return c};this.timeInputClickHd=function(){gTimeEditInputId=this.id;id(gTimeEditInputId).style.borderColor="#5A92FF"};this.getWheelDelta=function(c){c=c||window.event;return c.wheelDelta?window.opera&&9.5>window.opera.version?-c.wheelDelta:c.wheelDelta:40*-c.detail};this.scrollWheelHd=function(c){if(null!=gTimeEditInputId){var b=id(gTimeEditInputId),a=parseInt(b.value,10),d=0<this.getWheelDelta(c)?
0:1;switch(gTimeEditInputId){case "timeHour":0==d?23==a?b.value="00":(a++,b.value=midifyTimeStr(a)):0==a?b.value="23":(a--,b.value=midifyTimeStr(a));break;case "timeMinute":case "timeSecond":0==d?59==a?b.value="00":(a++,b.value=midifyTimeStr(a)):0==a?b.value="59":(a--,b.value=midifyTimeStr(a))}eventPreventDefault(c)}};this.bindScrollWheel=function(){document.attachEvent?document.body.attachEvent("onmousewheel",function(c){c=c||window.event;scrollWheelHd(c)}):(document.body.addEventListener("mousewheel",
function(c){c=c||window.event;scrollWheelHd(c)},!1),document.body.addEventListener("DOMMouseScroll",function(c){c=c||window.event;scrollWheelHd(c)},!1))};this.createTimePickerCon=function(){var c=document.createElement("div"),b=document.createElement("div"),a=document.createElement("div"),d;c.id="timePickerCon";c.className="timePickerCon";c.onclick=function(a){a=a||window.event;stopProp(a)};b.className="timeEdit";c.appendChild(b);d=document.createElement("input");d.id="timeHour";d.className="timeHour";
d.maxLength="2";d.onclick=timeInputClickHd;d.onblur=function(){gTimeEditInputId=null;id("timeHour").style.borderColor="#CED7E0";var a=this.value;if(0==a.length||!1==checkNum(a))this.value="00";23<parseInt(a,10)&&(this.value="23")};d.onfocus=function(){scrollBinded||(bindScrollWheel(),scrollBinded=!0)};b.appendChild(d);d=document.createElement("label");d.innerHTML=label.hour;b.appendChild(d);d=document.createElement("input");d.id="timeMinute";d.maxLength="2";d.onclick=timeInputClickHd;d.onblur=function(){gTimeEditInputId=
null;id("timeMinute").style.borderColor="#CED7E0";var a=this.value;if(0==a.length||!1==checkNum(a))this.value="00";59<parseInt(a,10)&&(this.value="59")};d.onfocus=function(){scrollBinded||(bindScrollWheel(),scrollBinded=!0)};b.appendChild(d);d=document.createElement("label");d.innerHTML=label.minute;b.appendChild(d);d=document.createElement("input");d.id="timeSecond";d.maxLength="2";d.onclick=timeInputClickHd;d.onblur=function(){gTimeEditInputId=null;id("timeSecond").style.borderColor="#CED7E0";var a=
this.value;if(0==a.length||!1==checkNum(a))this.value="00";59<parseInt(a,10)&&(this.value="59")};d.onfocus=function(){scrollBinded||(bindScrollWheel(),scrollBinded=!0)};b.appendChild(d);d=document.createElement("label");d.innerHTML=label.second;b.appendChild(d);a.className="timeFunc";c.appendChild(a);b=document.createElement("input");b.type="button";b.value=btn.confirmOk;b.onclick=function(){var a=1==id("timeHour").value.length?"0"+id("timeHour").value:id("timeHour").value,b=1==id("timeMinute").value.length?
"0"+id("timeMinute").value:id("timeMinute").value,d=1==id("timeSecond").value.length?"0"+id("timeSecond").value:id("timeSecond").value,a=a+" : "+b+" : "+d;"function"!=typeof timePickerCb?timeTagerObj.value=a:timePickerCb(a);hiddenTimePickerCon()};a.appendChild(b);timePickerParent.appendChild(c);attachEvnt(document.body,"click",function(){"undefined"!=typeof id(timeConId)&&hiddenTimePickerCon()})};this.showTimePickerCon=function(){var c=id(timeConId);void 0==c&&(createTimePickerCon(),c=id(timeConId));
setTimeValue();var b=getoffset(timeTagerObj,timePickerParent);c.style.left=b.left+"px";c.style.top=b.top+timeTagerObj.offsetHeight+4+"px";c.style.display="block"};this.hiddenTimePickerCon=function(){var c=id(this.timeConId);void 0!=c&&(c.style.display="none")};this.setTimeValue=function(){var c=timeTagerObj.value,b,a,d=new Date;if(!0==/^(\d{1,2}\s:\s){2}\d{1,2}$/.test(c)){if(b=c.split(" : "),c=parseInt(b[0],10),a=parseInt(b[1],10),b=parseInt(b[2],10),23<c||59<a||59<b)c=d.getHours(),a=d.getMinutes(),
b=d.getSeconds()}else c=d.getHours(),a=d.getMinutes(),b=d.getSeconds();id("timeHour").value=midifyTimeStr(c);id("timeMinute").value=midifyTimeStr(a);id("timeSecond").value=midifyTimeStr(b)}}
function ReplayTimeCon(c){var b=24,a=86400;this._useVal={scale:1,sepNum:48,totalWidth:0,scrollLeft:0};var d=null,g=null,e;ReplayTimeCon.prototype.init=function(){try{d=id(c.totalId),d.innerHTML="",this._optionsInit(),this.initTimeShaft(),this.initChannel(),this.initCutAreaAndShow(),b!=c.showFullTime&&this.initRowScroll(),"function"==typeof c.callBack&&c.callBack()}catch(a){log(a)}};ReplayTimeCon.prototype._optionsInit=function(){this._useVal.scale=b/c.showFullTime;this._useVal.sepNum=this._useVal.scale*
c.srcSepNum;this._useVal.totalWidth=c.chanWidth*this._useVal.scale;g=this};ReplayTimeCon.prototype.initTimeShaft=function(){var a,b,g;d.style.width=c.chanWidth+c.chanNameWidth+20+"px";a=document.createElement("div");a.className="timeArea";a.id="timeArea";a.style.marginLeft=c.chanNameWidth-20+"px";d.appendChild(a);b=document.createElement("div");b.className="timeShaft";b.id="timeShaft";a.style.width=c.chanWidth+"px";a.appendChild(b);a=document.createElement("div");a.className="trueShaft";a.id="trueShaft";
a.style.width=this._useVal.totalWidth+"px";b.appendChild(a);for(var e=0;e<=this._useVal.sepNum;e++)if(b=document.createElement("span"),b.className="timeLine",b.style.left=e*this._useVal.totalWidth/this._useVal.sepNum+"px",a.appendChild(b),g=document.createElement("span"),g.className="timeValue",g.style.left=parseInt(b.style.left)-20+"px",g.innerHTML=minToHour(1800*e/this._useVal.scale),a.appendChild(g),0==g.innerHTML.length||1==e%2)g.style.display="none",b.className+=" lowSolid"};ReplayTimeCon.prototype.initChannel=
function(){function e(d){var f,h=d.videoList,m=h.length,q=0,v=0,y=-1,q=q=v=0;chanName=document.createElement("label");chanName.className="chanName";chanName.id="chanName"+parseInt(d.channelId);chanName.innerHTML=label.channel+parseInt(d.channelId);l.appendChild(chanName);f=document.createElement("div");f.className="channelLine";f.id="channelLine"+parseInt(d.channelId);f.style.width=c.chanWidth+"px";k.appendChild(f);d=document.createElement("div");d.className="channelVideo";d.style.width=g._useVal.totalWidth+
"px";f.appendChild(d);for(var w=0;w<m;w++)f=document.createElement("span"),f.className="videoObj",v=g._useVal.totalWidth*h[w].start_time/a,q=g._useVal.totalWidth*(h[w].end_time-h[w].start_time)/a,f.setAttribute("value",h[w].end_time),v=Math.round(v),q=Math.round(q),v==y&&(v+=1),w<m-1&&h[w].end_time==h[w+1].start_time&&(q=Math.round(g._useVal.totalWidth*h[w+1].start_time/a),q-=v),f.style.width=1>q?"1px":q+"px",f.style.left=v+"px",y=v,1==parseInt(h[w].event_type)?f.className+=" timingVideo":f.className+=
" moveDetVideo",d.appendChild(f);d.onmouseover=function(d){d=d||window.event;d=getMousePos(d);var g=$("#channel").offset().left,g=d.x-g,e=parseInt($(".channelVideo").css("left"))||0;n.innerHTML=minToHour(a*(g-e)/(c.chanWidth*b/c.showFullTime),!0);n.style.display="inline-block";n.style.top=d.y-24+"px";n.style.left=d.x-30+"px"};d.onmousemove=function(d){d=d||window.event;d=getMousePos(d);var g=$("#channel").offset().left,g=d.x-g,e=parseInt($(".channelVideo").css("left"))||0;n.innerHTML=minToHour(a*
(g-e)/(c.chanWidth*b/c.showFullTime),!0);n.style.top=d.y-24+"px";n.style.left=d.x-30+"px"};d.onmouseout=function(a){n.style.display="none";n.style.top="0px";n.style.left="0px"}}var h,k,l,m=c.channelList.length,n=id("mouseupTime");void 0==n&&(n=document.createElement("span"),n.id="mouseupTime",n.className="mouseupTime",document.body.appendChild(n));h=document.createElement("div");h.className="channelArea";h.id="channelArea";d.appendChild(h);l=document.createElement("div");l.className="channelName";
l.style.width=c.chanNameWidth+"px";h.appendChild(l);k=document.createElement("div");k.className="channel";k.id="channel";k.style.width=c.chanWidth+"px";h.appendChild(k);for(h=0;h<m;h++)e(c.channelList[h]);listScroll=new NiceScroll("channelArea");listScroll.scrollTipOpacity(1);listScroll.scrollTipSet({background:"#898989",minHeight:"15px"});listScroll.scrollBarSet({zIndex:8,mLeft:0,mTop:0});listScroll.init()};ReplayTimeCon.prototype.initCutAreaAndShow=function(){var b,e,k,l,m,n,p,r,u,t=id("channel").offsetHeight;
id("scrollBar");b=document.createElement("div");b.className="cutArea";b.id="cutArea";b.style.left=c.chanNameWidth+"px";b.style.width=c.chanWidth+"px";d.appendChild(b);e=document.createElement("div");e.className="cutObj";e.id="cutObj";e.style.width=g._useVal.totalWidth+"px";b.appendChild(e);k=document.createElement("div");k.className="cutStart cutPoint";k.id="cutStartObj";k.style.left=this._useVal.totalWidth*c.cutStartTime/a+"px";k.style.height=t-6+"px";e.appendChild(k);l=document.createElement("span");
l.className="cutTime";l.innerHTML=minToHour(c.cutStartTime,!0);k.appendChild(l);m=document.createElement("div");m.className="cutEnd cutPoint";m.style.left=this._useVal.totalWidth*c.cutEndTime/a+"px";m.style.height=t-6+"px";e.appendChild(m);n=document.createElement("span");n.className="cutTime";n.innerHTML=minToHour(c.cutEndTime,!0);m.appendChild(n);b=document.createElement("div");b.className="cutCover";b.id="cutCover";b.style.width=this._useVal.totalWidth+"px";id("channel").appendChild(b);p=document.createElement("div");
p.className="trueCover";p.id="trueCover";p.style.left=this._useVal.totalWidth*c.cutStartTime/a+"px";p.style.width=this._useVal.totalWidth*(c.cutEndTime-c.cutStartTime)/a+"px";b.appendChild(p);r=document.createElement("span");r.className="runLine";r.id="runLine";r.style.left=this._useVal.totalWidth*c.runningTime/a+"px";b.appendChild(r);u=document.createElement("span");u.className="playingTime";u.id="playingTime";u.style.left=parseInt(r.style.left)-g._useVal.scrollLeft+20+"px";u.innerHTML=minToHour(c.runningTime,
!0);d.appendChild(u);r.onmousedown=function(b){b=b||window.event;var d=getMousePos(b),f=parseInt(this.style.left);document.onmousemove=function(b){b=getMousePos(b).x-d.x+f;0>=b&&(b=0);b>=e.offsetWidth&&(b=e.offsetWidth);r.style.left=b+"px";c.runningTime=b*a/g._useVal.totalWidth;u.style.left=b-g._useVal.scrollLeft+20+"px";u.innerHTML=minToHour(c.runningTime,!0)};document.onmouseup=function(a){document.onmousemove=null;document.onmouseup=null;"function"==typeof c.setRunTime&&c.setRunTime()};stopProp(b)};
k.onmousedown=function(b){b=b||window.event;var d=getMousePos(b),e=parseInt(this.style.left);document.onmousemove=function(b){b=getMousePos(b).x-d.x+e;0>=b&&(b=0);b>=parseInt(m.style.left)&&(b=parseInt(m.style.left));c.cutStartTime=b*a/g._useVal.totalWidth;l.innerHTML=minToHour(c.cutStartTime,!0);k.style.left=b+"px";p.style.left=b+"px";p.style.width=g._useVal.totalWidth*(c.cutEndTime-c.cutStartTime)/a+"px"};document.onmouseup=function(a){document.onmousemove=null};eventPreventDefault(b)};m.onmousedown=
function(b){b=b||window.event;var d=getMousePos(b),e=parseInt(this.style.left);document.onmousemove=function(b){b=getMousePos(b).x-d.x+e;b>=g._useVal.totalWidth&&(b=g._useVal.totalWidth);b<=parseInt(k.style.left)&&(b=parseInt(k.style.left));c.cutEndTime=b*a/g._useVal.totalWidth;n.innerHTML=minToHour(c.cutEndTime,!0);m.style.left=b+"px";p.style.width=g._useVal.totalWidth*(c.cutEndTime-c.cutStartTime)/a+"px"};document.onmouseup=function(a){document.onmousemove=null};eventPreventDefault(b)}};ReplayTimeCon.prototype.initRowScroll=
function(){var a,b,k,l;a=document.createElement("div");a.className="scrollArea";a.style.paddingLeft=c.chanNameWidth+"px";a.style.width=c.chanWidth+"px";d.appendChild(a);k=document.createElement("div");k.className="leftBar";k.id="leftBar";a.appendChild(k);b=document.createElement("span");b.className="scrollBar";b.id="scrollBar";b.style.width=c.chanWidth/this._useVal.scale+"px";a.appendChild(b);l=document.createElement("div");l.className="rightBar";l.id="rightBar";a.appendChild(l);k.onclick=function(){parseInt($("#scrollBar").css("marginLeft"));
var a=parseFloat($("#scrollBar").css("marginLeft")),d=id("runLine"),e=id("playingTime"),f=b.offsetWidth,k=(g._useVal.totalWidth-c.chanWidth)/(c.chanWidth-f),a=-(c.chanWidth-f)/10+a,d=parseInt(d.style.left);0>=a&&(a=0);a>=c.chanWidth-f&&(a=c.chanWidth-f);b.style.marginLeft=a+"px";g._useVal.scrollLeft=a*k;$("div.channelVideo, #trueShaft, #cutObj, #cutCover").css({left:-(a*k)+"px"});e.style.left=d-g._useVal.scrollLeft+20+"px";this.onmousedown=function(){$("#leftBar").css("background-image","url(../web-static/images/leftBar_pressed.png)");
document.onmouseup=function(){$("#leftBar").css("background-image","url(../web-static/images/leftBar_normal.png)")}}};b.onmousedown=function(a){a=a||window.event;var d=getMousePos(a),f=parseInt($("#scrollBar").css("marginLeft")),k=id("runLine"),l=id("playingTime"),t=this.offsetWidth,q=(g._useVal.totalWidth-c.chanWidth)/(c.chanWidth-t);id("cutCover");document.onmousemove=function(a){e=!0;a=getMousePos(a).x-d.x+f;var m=parseInt(k.style.left);0>=a&&(a=0);a>=c.chanWidth-t&&(a=c.chanWidth-t);b.style.marginLeft=
a+"px";g._useVal.scrollLeft=a*q;$("div.channelVideo, #trueShaft, #cutObj, #cutCover").css({left:-(a*q)+"px"});l.style.left=m-g._useVal.scrollLeft+20+"px"};document.onmouseup=function(a){e=!1;document.onmousemove=null};eventPreventDefault(a)};l.onclick=function(){parseInt($("#scrollBar").css("marginLeft"));var a=parseFloat($("#scrollBar").css("marginLeft")),d=id("runLine"),e=id("playingTime"),f=b.offsetWidth,k=(g._useVal.totalWidth-c.chanWidth)/(c.chanWidth-f),a=(c.chanWidth-f)/10+a,d=parseInt(d.style.left);
0>=a&&(a=0);a>=c.chanWidth-f&&(a=c.chanWidth-f);b.style.marginLeft=a+"px";g._useVal.scrollLeft=a*k;$("div.channelVideo, #trueShaft, #cutObj, #cutCover").css({left:-(a*k)+"px"});e.style.left=d-g._useVal.scrollLeft+20+"px";this.onmousedown=function(){$("#rightBar").css("background-image","url(../web-static/images/rightBar_pressed.png)");document.onmouseup=function(){$("#rightBar").css("background-image","url(../web-static/images/rightBar_normal.png)")}}};timeArea.onmousedown=function(a){a=a||window.event;
timeArea.onselectstart=timeArea.ondrag=function(){return!1};timeArea.style.cursor="pointer";var d=getMousePos(a),f=id("runLine"),k=id("playingTime"),l=b.offsetWidth,t=(g._useVal.totalWidth-c.chanWidth)/(c.chanWidth-l),q=1/t,v=-(parseInt($("#scrollBar").css("marginLeft"))*t);id("cutCover");document.onmousemove=function(a){e=!0;a=getMousePos(a).x-d.x+v;var m=parseInt(f.style.left);0<=a*q&&(a=0);a*q<=l-c.chanWidth&&(a=(l-c.chanWidth)*t);b.style.marginLeft=-(a*q)+"px";g._useVal.scrollLeft=a;$("div.channelVideo, #trueShaft, #cutObj, #cutCover").css({left:a+
"px"});k.style.left=m+g._useVal.scrollLeft+20+"px"};timeArea.onmouseup=function(a){timeArea.style.cursor="default"};document.onmouseup=function(a){e=!1;document.onmousemove=null};eventPreventDefault(a)}};ReplayTimeCon.prototype.timeRun=function(){if(!e){var d=id("runLine"),h=this._useVal.totalWidth*c.runningTime/a,k,l=id("playingTime");null!=d&&(d.style.left=h+"px",l.innerHTML=minToHour(c.runningTime,!0),b!=c.showFullTime&&(d=id("scrollBar"),k=d.offsetWidth,k=(this._useVal.totalWidth-c.chanWidth)/
(c.chanWidth-k),h>=this._useVal.scrollLeft+c.chanWidth-c.chanWidth/100?(this._useVal.scrollLeft=h-c.chanWidth,this._useVal.scrollLeft+=c.chanWidth/3,this._useVal.scrollLeft>=this._useVal.totalWidth-c.chanWidth&&(this._useVal.scrollLeft=this._useVal.totalWidth-c.chanWidth),$("div.channelVideo, #trueShaft, #cutObj, #cutCover").css({left:-this._useVal.scrollLeft+"px"}),d.style.marginLeft=this._useVal.scrollLeft/k+"px"):h<this._useVal.scrollLeft&&(this._useVal.scrollLeft=h-c.chanWidth/2,0>this._useVal.scrollLeft&&
(this._useVal.scrollLeft=0),$("div.channelVideo, #trueShaft, #cutObj, #cutCover").css({left:-this._useVal.scrollLeft+"px"}),d.style.marginLeft=this._useVal.scrollLeft/k+"px")),l.style.left=h-g._useVal.scrollLeft+20+"px")}};ReplayTimeCon.prototype.getScrollScale=function(){};this.init()}
function ReplayTimeConF(c){this._useVal={scale:1,sepNum:48,totalWidth:0,scrollLeft:0};ReplayTimeConF.prototype.init=function(){try{id(c.totalId),this._optionsInit(),this.initChannelCreate(),24!=c.showFullTime&&this.initRowScroll(),"function"==typeof c.callBack&&c.callBack()}catch(b){log(b)}};ReplayTimeConF.prototype._optionsInit=function(){this._useVal.sepNum=this._useVal.scale*c.srcSepNum;this._useVal.totalWidth=c.chanWidth};ReplayTimeConF.prototype.initChannelCreate=function(){var b=id(c.totalId);
if(null!=b&&void 0==id("runLineLeft")){var a=document.createElement("div");a.id="runLineLeft";a.setAttribute("style","border-bottom:1px solid #CED7E0");a.style.backgroundColor="#5A92FF";a.style.height="8px";b.appendChild(a)}};ReplayTimeConF.prototype.timeRun=function(){var b=id("runLineLeft");this._useVal.scale=c.chanWidth/c.showFullTime;var a=this._useVal.scale*(c.runningTime-c.runningTimeOri);null!=b&&(b.style.width=a+"px")};ReplayTimeConF.prototype.getScrollScale=function(){};this.init()}
function TimeChannel(){this.hourToSec=function(c){c=tranTime(c);return 3600*parseInt(c.hour)+60*parseInt(c.min)+parseInt(c.sec)};this.minToHour=function(c,b){0>c&&(c=0);86400<c&&(c%=86400);var a=0,d=0,g=0,a=parseInt(c/3600),a=10>a?"0"+a:a,d=parseInt(parseInt(c)%3600/60),d=10>d?"0"+d:d,g=parseInt(c)%60,g=10>g?"0"+g:g;return!0==b?a+":"+d+":"+g:0==g?a+":"+d:""};this.addZero=function(c){return 10<=c?c:"0"+c};this.tranTime=function(c,b){var a=[label.Sun,label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,
label.Sta],d=new Date,g={};if(void 0==b||"undefined"==b)b="-";d.setTime(1E3*c);g.year=d.getFullYear();g.month=addZero(d.getMonth()+1);g.day=addZero(d.getDate());g.hour=addZero(d.getHours());g.min=addZero(d.getMinutes());g.sec=addZero(d.getSeconds());g.weekDay=a[d.getDay()];g.timeStr=g.year+b+g.month+b+g.day+" "+g.hour+":"+g.min+":"+g.sec;return g}}
function PlanSet(c,b){this.table;this.weekList;this.hourList;this.dateCon=id(c);this.weekIsMouseDown=!1;this.selDate=[0,0,0,0,0,0,0];this.dateArray=[0,0,0,0,0,0,0];this.cellWidth=this.cellHeight=22;this.timingCellCor=this.cellSeColor="#325fe0";this.motionDetectCellCor="#1e9f7f";this.cellPadding=1;this.tableDiv;this.PlanEdit;this.chanCpy;this.cellStruct=[];this.eachCellPix=24;this.maxPix=24*this.eachCellPix;this.eachPixMinu=60/this.eachCellPix;this.timeValArr=[];this.MAX_INTERVAL=6;this.TYPE_NULL=
0;this.TYPE_TIME=1;this.TYPE_MOVE=2;this.curType=this.TYPE_NULL;this.typeClass=["blank","timing","movedet"];this.timeoutFD;void 0==PlanSet.prototype._init&&(PlanSet.prototype.hourStr=label.lHour,PlanSet.prototype.weekDayNum=7,PlanSet.prototype.lineStr="-",PlanSet.prototype.selTag="selTag",PlanSet.prototype.cellBorderWidth=1,PlanSet.prototype.iCellIndex=0,PlanSet.prototype.weekArray=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun],PlanSet.prototype._init=function(a){this._initOptions();
this._dateConInit();this._cruiseInit();this._hourListInit();this._weekListInit();this._dateTableInit();this._timeValArrayInit();this._cellStructInit()},PlanSet.prototype._cruiseInit=function(){var a=document.createElement("div"),b=document.createElement("i");a.className="cruiseDiv";this.dateCon.appendChild(a);b.className="iCruise displayNone";a.appendChild(b);this.cruise=b},PlanSet.prototype._timeValArrayInit=function(){for(var a=this.timeValArr,b=0;b<this.weekArray.length;b++)a[this.weekArray[b]]=
[]},PlanSet.prototype._cellStructInit=function(){for(var a=this.cellStruct,b=0;b<this.weekArray.length;b++){a[this.weekArray[b]]=[];for(var c=0;c<this.maxPix;c++)a[this.weekArray[b]][c]=0}},PlanSet.prototype.setTimeVal=function(a,b){var c;b instanceof Array||(b=b.match(/\d{4}-\d{4}:\d/g));"number"==typeof a&&(a=this.weekArray[a]);for(var e=0;e<b.length;e++)c=b[e],this._addToTVArr(a,c),this._setCellStruct(a,c);this.reRender(a)},PlanSet.prototype._addToTVArr=function(a,b){var c=this.timeValArr[a],e=
[],f=b.split(/[-,:]/,3),h=parseInt(f[0],10),k=parseInt(f[1],10);parseInt(f[2],10);var l,m,f=!1;l=c.length;for(var n=0;n<l;n++)e.push(c[n]);for(n=0;n<c.length;n++)if(m=c[n].split(/[-,:]/,3),e=parseInt(m[0],10),l=parseInt(m[1],10),parseInt(m[2],10),!(h>l)){if(k<e){f=!0;for(h=b;n<c.length;n++)k=c[n],c[n]=h,h=k;c.push(h);break}f=!0;this._mergeInterval(b,c,n);break}!1==f&&(f=!0,c.push(b));for(n=0;n<c.length;n++)k=parseInt(c[n].split(/[-,:]/,3)[2],10),0==k&&(this._removeAt(c,n),n--);return f},PlanSet.prototype._setCellStruct=
function(a,b){var c=b.split(/[-,:]/,3),e=c[0],f=c[1],c=parseInt(c[2],10),h,k,l=this.cellStruct;"number"==typeof a&&(a=this.weekArray[a]);h=this.timToPix(e,"begin");k=this.timToPix(f,"end");parseInt(f,10)-parseInt(e,10)<this.eachPixMinu&&(k=h);for(e=h;e<=k;e++)l[a][e]=c;return[h,k]},PlanSet.prototype.reRender=function(a,b){var c=this.cellStruct,e,f,h,k,l;if(void 0==b){b=[];for(var m=0;24>m;m++)b.push(m)}if("number"==typeof a)e=a,a=this.weekArray[a];else for(e=0;e<this.weekArray.length&&this.weekArray[e]!=
a;e++);e=this.tableDiv.childNodes[e];for(var n=0;n<b.length;n++){f=e.childNodes[n];for(k=f.childNodes;k.length;)f.removeChild(k[0]);h=n*this.eachCellPix;k=h+this.eachCellPix-1;for(m=h;m<=k;m++){for(l=1;m+1<=k&&c[a][m+1]==c[a][m];)m++,l++;h=document.createElement("div");h.className=this.typeClass[c[a][m]];h.style.width=l+"px";f.appendChild(h)}}},PlanSet.prototype._getStringWithoutType=function(a,b){a=a.toString();for(b=b.toString();4>a.length;)a="0"+a;for(;4>b.length;)b="0"+b;return a+"-"+b},PlanSet.prototype._getString=
function(a,b,c){a=a.toString();for(b=b.toString();4>a.length;)a="0"+a;for(;4>b.length;)b="0"+b;c=c.toString();return a+"-"+b+":"+c},PlanSet.prototype._insertAt=function(a,b,c){var e=a.length;if(!(b>=e))for(var f=b;f<e;f++)b=a[f],a[f]=c,c=b;a.push(c)},PlanSet.prototype._removeAt=function(a,b){var c=a.length;if(!(b>=c)){for(var e=b;e<c-1;e++)a[e]=a[e+1];a.pop()}},PlanSet.prototype._mergeInterval=function(a,b,c){var e=a.split(/[-,:]/,3);a=parseInt(e[0],10);var f=parseInt(e[1],10),e=parseInt(e[2],10),
h=b[c].split(/[-,:]/,3),k=parseInt(h[0],10),l=parseInt(h[1],10),h=parseInt(h[2],10),m,n,p,r;if(l>f)k<a?h!=e&&(m=this._getString(k,a,h),b[c]=m,m=this._getString(a,f,e),this._insertAt(b,c+1,m),m=this._getString(f,l,h),this._insertAt(b,c+2,m)):k==a?h!=e&&(m=this._getString(a,f,e),b[c]=m,m=this._getString(f,l,h),this._insertAt(b,c+1,m)):h==e?(m=this._getString(a,l,h),b[c]=m):(m=this._getString(a,f,e),b[c]=m,m=this._getString(f,l,h),this._insertAt(b,c+1,m));else if(l==f){if(n=c,k<a&&h!=e&&(m=this._getString(k,
a,h),b[c]=m,m=this._getString(a,f,e),this._insertAt(b,c+1,m),n++),k==a&&h!=e||k>a)m=this._getString(a,f,e),b[c]=m}else l<f&&(n=c,a<=k&&(m=this._getString(a,f,e),b[c]=m),a>k&&h!=e?(m=this._getString(k,a,h),b[c]=m,m=this._getString(a,f,e),this._insertAt(b,c+1,m),n++):a>k&&(m=this._getString(k,f,h),b[c]=m));void 0!=n&&n<b.length-1&&(p=b[n+1],r=parseInt(p.split(/[-,:]/,3)[0],10));void 0!=p&&f>=r&&(m=b[n],this._removeAt(b,n),this._mergeInterval(m,b,n))},PlanSet.prototype.timToPix=function(a,b){var c=a.match(/\d\d/g),
e=parseInt(c[0],10),c=parseInt(c[1],10),e=e*this.eachCellPix;"end"==b&&e--;return e+=Math.floor(c/this.eachPixMinu)},PlanSet.prototype.setDayToType=function(a,b){var c;void 0==b&&(b=this.TYPE_NULL);c=this._getString("0000","2400",b);"number"==typeof a&&(a=this.weekArray[a]);this.setTimeVal(a,[c])},PlanSet.prototype.setHourToType=function(a,b){var c,e,f;if(!(void 0==a||23<a))for(void 0==b&&(b=this.TYPE_NULL),c=this._getString(a+"00",a+1+"00",b),e=0;e<this.weekArray.length;e++)this._isCellFullOfCurType(e,
a)?(f=this.getTdInfo(e,a),f.leftCellType==this.curType&&f.rightCellType==this.curType&&this.timeValArr[this.weekArray[e]].length>=this.MAX_INTERVAL||this.setTimeVal(this.weekArray[e],[c])):!0==this.legalClick(e,a)&&this.setTimeVal(this.weekArray[e],[c])},PlanSet.prototype.reset=function(){var a,b=this._getString("0000","2400",this.TYPE_NULL);for(a=0;a<this.weekArray.length;a++)this.setTimeVal(this.weekArray[a],[b])},PlanSet.prototype._initOptions=function(){for(var a in b)"undefined"!=typeof this[a]&&
(this[a]=b[a])},PlanSet.prototype.getTimeVal=function(a){void 0!=a&&"number"==typeof a&&(a=this.weekArray[a]);return void 0!=a?this.timeValArr[a]:this.timeValArr},PlanSet.prototype._dateConInit=function(){this.dateCon.style.overflow="hidden"},PlanSet.prototype._isCellFullOfCurType=function(a,b,c){a=this.weekArray[a];var e=this.cellStruct,f=b*this.eachCellPix;b=f+this.eachCellPix-1;var h=!0;for(c=c||this.curType;f<=b;f++)if(e[a][f]!=c){h=!1;break}return h},PlanSet.prototype._isRowFullOfCurType=function(a){a=
this.weekArray[a];var b=this.cellStruct,c;for(c=0;c<this.maxPix;c++)if(b[a][c]!=this.curType)return!1;return!0},PlanSet.prototype._isColFullOfCurType=function(a){var b;for(b=0;b<this.weekArray.length;b++)if(!this._isCellFullOfCurType(b,a))return!1;return!0},PlanSet.prototype._hourListInit=function(){var a=document.createElement("div"),b,c,e=this;a.className="psHourList";for(var f=0;24>=f;f++)b=document.createElement("div"),b.className="psHourLi",c=document.createElement("span"),c.innerHTML=f,b.appendChild(c),
c.onclick=function(a){return function(){e._isColFullOfCurType(a)?e.setHourToType(a,e.TYPE_NULL):e.setHourToType(a,e.curType)}}(f),a.appendChild(b);this.dateCon.appendChild(a);this.hourList=a},PlanSet.prototype._weekListInit=function(){var a=document.createElement("ul"),b,c=this;a.className="psWeekList";for(var e=0,f=this.weekDayNum;e<f;e++)b=document.createElement("li"),0==e&&(b.className="firWeekLi"),b.innerHTML=this.weekArray[e],b.onclick=function(a){return function(){c._isRowFullOfCurType(a)?c.setDayToType(a,
c.TYPE_NULL):c.setDayToType(a,c.curType)}}(e),a.appendChild(b);this.dateCon.appendChild(a);this.weekList=a},PlanSet.prototype.clickTd=function(a,b,c,e){var f=this.weekArray[b],h=this.tableDiv.childNodes[b].childNodes[c];a=a?a:window.event;if("click"==e||!this._hover(a,h))if(a=c+"00",e=c+1+"00",this._isCellFullOfCurType(b,c)){b=this.getTdInfo(b,c);if(b.leftCellType==this.curType&&b.rightCellType==this.curType&&this.timeValArr[f].length>=this.MAX_INTERVAL)return!1;b=this._getString(a,e,this.TYPE_NULL);
this.setTimeVal(f,[b])}else!0==this.legalClick(b,c)&&(b=this._getString(a,e,this.curType),this.setTimeVal(f,[b]))},PlanSet.prototype.legalClick=function(a,b){var c=this.weekArray[a],e,f,h,k;k=this.cellStruct;var l=this.getTdInfo(a,b);e=l.leftCellType;f=l.rightCellType;h=0<l.firValidPix?k[c][l.firValidPix-1]:this.TYPE_NULL;k=l.lastValidPix<this.maxPix-1?k[c][l.lastValidPix+1]:this.TYPE_NULL;return e==this.curType||f==this.curType||1<l.seg||this.timeValArr[c].length<this.MAX_INTERVAL-1||this.timeValArr[c].length<
this.MAX_INTERVAL&&(e==this.TYPE_NULL||e!=f||!this._isCellFullOfCurType(a,b,e))||1==l.seg&&h!=l.tyArr[0]&&k!=l.tyArr[0]?!0:!1},PlanSet.prototype.getTdInfo=function(a,b){for(var c=this.weekArray[a],e=this.cellStruct,f=b*this.eachCellPix,h=f+this.eachCellPix-1,k=0,l=[],m={},n=-1,p=this.maxPix,r=f;r<=h;r++)if(e[c][r]!=this.TYPE_NULL){k++;l.push(e[c][r]);for(n=-1==n?r:n;r+1<=h&&e[c][r+1]==e[c][r];)r++;p=r}m.seg=k;m.tyArr=l;m.firValidPix=n;m.lastValidPix=p;m.leftCellType=0<f?e[c][f-1]:this.TYPE_NULL;m.rightCellType=
h+1<this.maxPix?e[c][h+1]:this.TYPE_NULL;return m},PlanSet.prototype.applyPeRes=function(a){var b,c,e=a.planSetObj;b=void 0!=a.cpyDay?a.cpyDay:0;c=void 0!=a.timeStr?a.timeStr:[];for(a=0;a<e.weekArray.length;a++)b&1<<a&&(e.setDayToType(a,e.TYPE_NULL),e.setTimeVal(a,c))},PlanSet.prototype.editTimeVal=function(a,b){var c;c={timeVal:this.getTimeVal(a),dayName:this.weekArray[a],dayNum:a,okCbk:this.applyPeRes,planSetObj:this};void 0==b&&(b="editDiv");void 0!=this.chanCpy&&void 0!=this.chanCpy._hidePC&&
this.chanCpy._hidePC();void 0!=this.PlanEdit?(this.PlanEdit._showPE(),this.PlanEdit._applyOptions(c)):this.PlanEdit=new PlanEdit(b,c)},PlanSet.prototype.setChanCpy=function(a){this.chanCpy=a},PlanSet.prototype.showEditBtn=function(a,b){var c;c=this.tableDiv.childNodes[b];var e=c.childNodes[24];a=a?a:window.event;if(!this._hover(a,c))for($(e).removeClass("displayNone"),c=0;c<this.weekArray.length;c++)c!=b&&this.hideEditBtn(a,c)},PlanSet.prototype.hideEditBtn=function(a,b){a=a?a:window.event;var c=
this.tableDiv.childNodes[b],e=c.childNodes[24];this._hover(a,c)||$(e).addClass("displayNone")},PlanSet.prototype._dateCellCreate=function(){var a,b,c,e,f,h=this.tableDiv,k=this,l=[];for(f=0;24>f;f++)l.push(f);$.each(this.weekArray,function(f,n){a=document.createElement("div");a.className="trDiv";0==f&&(a.className+=" firTr");h.appendChild(a);a.onmouseover=function(a){!1==k.weekIsMouseDown&&(a=a?a:window.event,k.showEditBtn(a,f))};a.onmouseout=function(a){!1==k.weekIsMouseDown&&(a=a?a:window.event,
k.hideEditBtn(a,f))};$.each(l,function(e,h){b=document.createElement("div");b.className="tdDiv";a.appendChild(b);0==e?b.className+=" firTd":23==e&&(b.className+=" lastTd");c=document.createElement("div");b.appendChild(c);b.onmouseover=function(a){a=a?a:window.event;!0==k.weekIsMouseDown&&k.clickTd(a,f,e)};b.onmousedown=function(a){a=a?a:window.event;k.clickTd(a,f,e,"click")}});e=document.createElement("div");e.className="editBtn displayNone";e.onclick=function(a){a=a?a:window.event;stopProp(a);$(k.cruise).addClass("displayNone");
k.editTimeVal(f)};a.appendChild(e)});f=document.createElement("div");f.id="editDiv";h.appendChild(f)},PlanSet.prototype.getAbsoluteLeft=function(a){for(var b=a.offsetLeft;null!=a.offsetParent;)a=a.offsetParent,b+=a.offsetLeft;return b},PlanSet.prototype._dateCellBind=function(){var a=this;this.tableDiv.onmousedown=function(b){a.weekIsMouseDown=!0;document.onmouseup=function(b){a.weekIsMouseDown=!1;$(a.cruise).addClass("displayNone")}};this.tableDiv.onmouseup=function(b){a.weekIsMouseDown=!1;$(a.cruise).addClass("displayNone")};
this.tableDiv.onmousemove=function(b){0==a.tableLeft&&(a.tableLeft=a.getAbsoluteLeft(a.tableDiv));!0==a.weekIsMouseDown&&($(a.cruise).removeClass("displayNone"),b=getMousePos(b),b=b.x-a.tableLeft+9,0>b&&(b=0),608<b&&(b=608),a.cruise.style.left=b+"px")}},PlanSet.prototype._dateTableCreate=function(){this.tableDiv=document.createElement("div");this.tableDiv.className="tableDiv";this.dateCon.appendChild(this.tableDiv);this.tableLeft=this.getAbsoluteLeft(this.tableDiv)},PlanSet.prototype._dateTableInit=
function(){this._dateTableCreate();this._dateCellCreate();this._dateCellBind()},PlanSet.prototype._contain=function(a,b){return a.contains?a!=b&&a.contains(b):!!(a.compareDocumentPosition(b)&16)},PlanSet.prototype._hover=function(a,b){var c,e;try{return a=a?a:window.event,c="mouseover"==a.type?a.fromElement||a.relatedTarget:a.toElement||a.relatedTarget,e=c.getBoundingClientRect(),0==e.bottom?!0:b===c||this._contain(b,c)}catch(f){return!0}});this._init(b)}
function PlanEdit(c,b){this.peTopDiv;this.peCon;this.peConTips;this.peConDetail;this.peConCpy;this.peConBtn;this.peConTipsTitle;this.peConTipsDay;this.DEF_TIME_STR="0000-0000:1";this.TYPE_NULL=0;this.TYPE_TIME=1;this.TYPE_MOVE=2;this.ST="st";this.ET="et";this.dayName;this.dayNum;this.timeVal;this.maxTimVal=null==$.recordMaxSlotCnt?6:$.recordMaxSlotCnt;this.okCbk;this.planSetObj;this.weekArray=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun];this.maxIntervalNum=void 0==$.moduleSpec.arming_schedule_max_num?
6:$.moduleSpec.arming_schedule_max_num;this.timDivArr=[];this.labelDomArr=[];this.stDomArr=[];this.etDomArr=[];this.stTipArr=[];this.etTipArr=[];this.tySelDomArr=[];this.vadChkDomArr=[];this.cpyCandidateArr=[];this.cpyDisINodeArr=[];this.cpyCandidateLabelArr=[];var a=this;void 0==PlanEdit.prototype.init&&(PlanEdit.prototype.init=function(a){this._initPECon();this._applyOptions(a)},PlanEdit.prototype.validCheckMouseout=function(b){b--;$(a.vadChkDomArr[b]).hasClass("peCboxHover")&&($(a.vadChkDomArr[b]).addClass("peCboxUnchecked"),
$(a.vadChkDomArr[b]).removeClass("peCboxHover"))},PlanEdit.prototype._initPECon=function(){var b,g,e,f,h,k,l,m=this,n=["序号","开始时间","结束时间","类型","设定"];if(void 0!=c&&void 0!=id(c)){this.peTopDiv=id(c);this.peCon=document.createElement("div");$(this.peCon).addClass("peCon");this.peCon.id="peCon";this.peTopDiv.appendChild(this.peCon);this.peConTips=document.createElement("div");this.peConTips.className="peConTips";this.peCon.appendChild(this.peConTips);this.peConTipsDay=document.createElement("label");
this.peConTipsDay.className="peDayName";this.peConTips.appendChild(this.peConTipsDay);this.peConTipsTitle=document.createElement("label");this.peConTipsTitle.innerHTML=btn.edit;this.peConTipsTitle.className="peTitle";this.peConTips.appendChild(this.peConTipsTitle);this.peConDetail=document.createElement("div");this.peConDetail.className="peConDetail";this.peCon.appendChild(this.peConDetail);e=document.createElement("div");e.className="titleRow";this.peConDetail.appendChild(e);for(var p=1;5>=p;p++)f=
"peCol"+p,b=document.createElement("div"),$(b).addClass("peCol"),$(b).addClass(f),b.innerHTML=n[p-1],e.appendChild(b);for(p=0;p<this.maxTimVal;p++)this._createRow(p);$.each(this.stDomArr,function(b,c){c.onblur=function(){a._onBlur(b,m.ST)};c.onfocus=function(){a._onFocus(b,m.ST)}});$.each(this.etDomArr,function(b,c){c.onblur=function(){a._onBlur(b,m.ET)};c.onfocus=function(){a._onFocus(b,m.ET)}});$.each(this.stTipArr,function(b,c){c.onclick=function(){$(a.stDomArr[b]).focus()}});$.each(this.etTipArr,
function(b,c){c.onclick=function(){a.etDomArr[b].focus()}});initCheckInput("validCheck",this.validCheckCbk);this.peConCpy=document.createElement("div");this.peConCpy.className="peConCpy";this.peCon.appendChild(this.peConCpy);g=document.createElement("label");g.innerHTML=label.cpyPlanTo;g.className="peTitle";this.peConCpy.appendChild(g);g=document.createElement("i");g.id="selAll";g.setAttribute("name","selAll");this.peConCpy.appendChild(g);initCheckInput("selAll",this.selAllCbk);g=document.createElement("label");
g.className="peLabel";g.innerHTML=label.chooseAll;this.peConCpy.appendChild(g);g=document.createElement("div");g.className="cpyCandidateDiv";this.peConCpy.appendChild(g);$.each(this.weekArray,function(a,b){h=document.createElement("i");h.id="weekDay"+a;h.setAttribute("name","candidates");g.appendChild(h);m.cpyCandidateArr.push(h);l=document.createElement("i");l.className="invalidCbox";g.appendChild(l);m.cpyDisINodeArr.push(l);k=document.createElement("label");k.className="peLabel";k.innerHTML=b;g.appendChild(k);
m.cpyCandidateLabelArr.push(k)});initCheckInput("candidates",this.selCandiCbk);this.peConBtn=document.createElement("div");this.peConBtn.className="peConBtn";this.peCon.appendChild(this.peConBtn);g=document.createElement("input");g.className="subBtnB btnA";g.id="peCancel";g.type="button";g.value=btn.cancel;this.peConBtn.appendChild(g);g.onclick=function(a){a=a?a:window.event;stopProp(a);m._hidePE()};g=document.createElement("input");g.className="subBtn btnA";g.id="peSave";g.type="button";g.value=
btn.ok;this.peConBtn.appendChild(g);g.onclick=function(a){a=a?a:window.event;stopProp(a);!0==m.checkSettings()&&(a=m.getSettings(),!0==m.checkIntervalNum(a,m.maxIntervalNum)&&(m.okCbk(a),m._hidePE()))};this.peCon.onclick=function(a){a=a?a:window.event;stopProp(a)};attachEvnt(document.body,"click",function(){})}},PlanEdit.prototype._createRow=function(b){var c=this.timDivArr,e,f,h,k=[{str:"定时",value:this.TYPE_TIME},{str:"事件",value:this.TYPE_MOVE}];b++;f=document.createElement("div");f.className="peRowDiv";
c.push(f);this.peConDetail.appendChild(f);e=document.createElement("div");e.className="peCol peCol1";f.appendChild(e);c=document.createElement("label");c.innerHTML=b;c.className="peRowNo";c.id="peRowNo"+b;e.appendChild(c);this.labelDomArr.push(c);e=document.createElement("div");e.className="peCol peCol2";f.appendChild(e);c=document.createElement("input");c.className="text peTextA";c.id="startTime"+b;c.setAttribute("maxLength",5);e.appendChild(c);this.stDomArr.push(c);c=document.createElement("label");
c.className="peEditTip";c.id="peStEditTip"+b;c.value="00:00";e.appendChild(c);this.stTipArr.push(c);e=document.createElement("div");e.className="peCol peCol3";f.appendChild(e);c=document.createElement("input");c.className="text peTextA";c.id="endTime"+b;c.setAttribute("maxLength",5);e.appendChild(c);this.etDomArr.push(c);c=document.createElement("label");c.className="peEditTip";c.id="peEtEditTip"+b;c.value="00:00";e.appendChild(c);this.etTipArr.push(c);e=document.createElement("div");e.className=
"peCol peCol4";f.appendChild(e);h="type"+b;c=document.createElement("span");c.className="select";c.id=h;e.appendChild(c);this.tySelDomArr.push(id(h));e=document.createElement("span");e.className="value hsValueA peSelect";c.appendChild(e);e=document.createElement("i");e.className="arrow";c.appendChild(e);selectInit(h,k,this.TYPE_MOVE);h="check"+b;e=document.createElement("div");e.className="peCol peCol5";f.appendChild(e);c=document.createElement("i");c.id=h;c.setAttribute("value",b);c.setAttribute("name",
"validCheck");e.appendChild(c);c.onmouseover=function(c){a.validCheckHover(b)};c.onmouseout=function(c){a.validCheckMouseout(b)};this.vadChkDomArr.push(id(h))},PlanEdit.prototype._setRow=function(a,b){var c,f,h;void 0==b&&(b=this.DEF_TIME_STR);h=b.split(/[-,:]/,3);c=h[0].substring(0,2)+":"+h[0].substring(2);f=h[1].substring(0,2)+":"+h[1].substring(2);h=h[2];this.labelDomArr[a].innerHTML=a+1;this.stDomArr[a].value=c;this.etDomArr[a].value=f;this.tySelDomArr[a].resetSel(h);c=b==this.DEF_TIME_STR?!1:
!0;changeCheckInput(this.vadChkDomArr[a],c);!0==c?($(this.vadChkDomArr[a]).addClass("peCboxChecked"),$(this.vadChkDomArr[a]).removeClass("peCboxUnchecked")):($(this.vadChkDomArr[a]).addClass("peCboxUnchecked"),$(this.vadChkDomArr[a]).removeClass("peCboxChecked"))},PlanEdit.prototype.selAllCbk=function(b,c){for(var e=0;e<a.weekArray.length;e++)e!=a.dayNum&&changeCheckInput(a.cpyCandidateArr[e],b)},PlanEdit.prototype.validCheckCbk=function(b,c){c--;!0==b?($(a.vadChkDomArr[c]).addClass("peCboxChecked"),
$(a.vadChkDomArr[c]).removeClass("peCboxUnchecked"),$(a.vadChkDomArr[c]).removeClass("peCboxHover")):($(a.vadChkDomArr[c]).addClass("peCboxUnchecked"),$(a.vadChkDomArr[c]).removeClass("peCboxChecked"))},PlanEdit.prototype.validCheckHover=function(b){b--;$(a.vadChkDomArr[b]).hasClass("peCboxUnchecked")&&($(a.vadChkDomArr[b]).removeClass("peCboxUnchecked"),$(a.vadChkDomArr[b]).addClass("peCboxHover"))},PlanEdit.prototype.selCandiCbk=function(b,c){if(!1==b)changeCheckInput("selAll",!1);else{for(var e=
!0,f,h=0;h<a.weekArray.length;h++)if(f=a.cpyCandidateArr[h],h!=a.dayNum&&void 0!=f&&"false"==f.getAttribute("checked")){e=!1;break}e&&changeCheckInput("selAll","true")}},PlanEdit.prototype._applyOptions=function(b){var c;this._cpyOptions(b);this.peConTipsDay.innerHTML=this.dayName;a=this;for(c=0;c<this.maxTimVal;c++)b=this.timeVal[c],this._setRow(c,b);for(c=0;c<a.weekArray.length;c++)changeCheckInput(a.cpyCandidateArr[c],!1),c==this.dayNum?($(this.cpyDisINodeArr[c]).removeClass("displayNone"),$(this.cpyDisINodeArr[c]).addClass("invalidCbox"),
this.cpyCandidateArr[c].style.display="none",this.cpyCandidateLabelArr[c].className="peInvalidNameLabel"):($(this.cpyDisINodeArr[c]).addClass("displayNone"),this.cpyCandidateArr[c].style.display="inline-block",this.cpyCandidateLabelArr[c].className="peLabel");changeCheckInput("selAll",!1)},PlanEdit.prototype._hidePE=function(){closeNoteAll();$("#peCon").addClass("displayNone");$(".peEditTip").addClass("displayNone")},PlanEdit.prototype._showPE=function(){closeNoteAll();$("#peCon").removeClass("displayNone");
$(".peTextA").removeClass("errInput")},PlanEdit.prototype._cpyOptions=function(a){for(var b in a)void 0!=typeof this[b]&&(this[b]=a[b])},PlanEdit.prototype._onBlur=function(a,b){var c,f;$(".peTextA").removeClass("errInput");if(!(a>=this.maxTimVal)){if(b==this.ST)c=this.stDomArr[a],f=this.stTipArr[a];else if(b==this.ET)c=this.etDomArr[a],f=this.etTipArr[a];else return;c&&""==c.value?(f&&$(f).removeClass("displayNone"),f.innerHTML="00:00"):f&&$(f).addClass("displayNone")}},PlanEdit.prototype._onFocus=
function(a,b){var c;if(!(a>=this.maxTimVal)){if(b==this.ST)c=this.stTipArr[a];else if(b==this.ET)c=this.etTipArr[a];else return;c&&$(c).addClass("displayNone")}},PlanEdit.prototype._checkTime=function(){var b=/\d\d:\d\d/,c,e,f,h=!0,k=[],l,m,n;closeNoteAll();$(".peTextA").removeClass("errInput");for(f=0;f<a.maxTimVal;f++){l=m=!0;c=a.stDomArr[f].value;e=a.etDomArr[f].value;5==c.length&&c.match(b)||(h=l=!1,n=0==c.length?errStr.ePlanNull:errStr.ePlanTimeFormatErr,a.stDomArr[f].setAttribute("strError",
n),k.push(a.stDomArr[f]));5==e.length&&e.match(b)||(h=m=!1,n=0==e.length?errStr.ePlanNull:errStr.ePlanTimeFormatErr,a.etDomArr[f].setAttribute("strError",n),k.push(a.etDomArr[f]));if(l){c=c.match(/\d\d/g);if(24<c[0]||60<=c[1]||24==c[0]&&0<c[1])h=l=!1,a.stDomArr[f].setAttribute("strError",errStr.ePlanTimeRangErr),k.push(a.stDomArr[f]);parseInt(c[0],10);parseInt(c[1],10)}if(m){c=e.match(/\d\d/g);if(24<c[0]||60<=c[1]||24==c[0]&&0<c[1])h=m=!1,a.etDomArr[f].setAttribute("strError",errStr.ePlanTimeRangErr),
k.push(a.etDomArr[f]);parseInt(c[0],10);parseInt(c[1],10)}}$.each(k,function(a,b){0==a?($(b).addClass("errInput"),showToast("other",{noteStr:b.getAttribute("strError")}),$.setTimeout(closeToast,1E3)):$(b).addClass("errInput")});return h},PlanEdit.prototype.checkSettings=function(){var a,b,c,f,h,k,l,m=[];closeNoteAll();$(".peTextA").removeClass("errInput");if(!1==this._checkTime())return!1;for(a=0;a<this.maxTimVal;a++)if(l=this.stDomArr[a].value.split(":",2),c=60*parseInt(l[0],10)+parseInt(l[1],10),
l=this.etDomArr[a].value.split(":",2),f=60*parseInt(l[0],10)+parseInt(l[1],10),h=this.tySelDomArr[a].value,"false"!=this.vadChkDomArr[a].getAttribute("checked")){if(c==f)return m.push(this.stDomArr[a].getAttribute("id")),m.push(this.etDomArr[a].getAttribute("id")),$.each(m,function(a,b){$("#"+b).addClass("errInput");showToast("other",{noteStr:errStr.ePlanTimeEqualErr});$.setTimeout(closeToast,1E3)}),!1;if(c>f)return m.push(this.stDomArr[a].getAttribute("id")),m.push(this.etDomArr[a].getAttribute("id")),
$.each(m,function(a,b){$("#"+b).addClass("errInput");showToast("other",{noteStr:errStr.ePlanTimeMinErr});$.setTimeout(closeToast,1E3)}),!1;for(b=a+1;b<this.maxTimVal;b++)if(k=this.tySelDomArr[b].value,h!=k&&(l=this.stDomArr[b].value.split(":",2),k=60*parseInt(l[0],10)+parseInt(l[1],10),l=this.etDomArr[b].value.split(":",2),l=60*parseInt(l[0],10)+parseInt(l[1],10),k!=l&&"false"!=this.vadChkDomArr[b].getAttribute("checked"))){if(k>l)return m.push(this.stDomArr[b].getAttribute("id")),m.push(this.etDomArr[b].getAttribute("id")),
$.each(m,function(a,b){$("#"+b).addClass("errInput");showToast("other",{noteStr:errStr.ePlanTimeMinErr});$.setTimeout(closeToast,1E3)}),!1;if(c<l&&c>=k||k<f&&k>=c)return m.push(this.stDomArr[a].getAttribute("id")),m.push(this.etDomArr[a].getAttribute("id")),m.push(this.stDomArr[b].getAttribute("id")),m.push(this.etDomArr[b].getAttribute("id")),$.each(m,function(a,b){$("#"+b).addClass("errInput");showToast("other",{noteStr:errStr.ePlanTimeCoverErr});$.setTimeout(closeToast,1E3)}),!1}}return!0},PlanEdit.prototype.getSettings=
function(){var a,b,c,f=0,h,k,l={timeStr:[]};l.dayNum=this.dayNum;l.dayName=this.dayName;l.planSetObj=this.planSetObj;for(a=0;a<this.maxTimVal;a++)h=this.stDomArr[a].value.split(":",2),b=60*parseInt(h[0],10)+parseInt(h[1],10),k=this.etDomArr[a].value.split(":",2),c=60*parseInt(k[0],10)+parseInt(k[1],10),b!=c&&"false"!=this.vadChkDomArr[a].getAttribute("checked")&&(b=h[0]+h[1]+"-"+k[0]+k[1]+":"+this.tySelDomArr[a].value,l.timeStr.push(b));f|=1<<this.dayNum;for(a=0;a<this.weekArray.length;a++)"true"==
this.cpyCandidateArr[a].getAttribute("checked")&&(f|=1<<a);l.cpyDay=f;return l},PlanEdit.prototype.checkIntervalNum=function(a,b){var c,f=a.timeStr,h=[];for(c=0;c<f.length;c++)h.push([f[c].substring(0,4),f[c].substring(5,9)]);h.sort(function(a,b){return a[0]-b[0]});for(c=1;c<h.length;c++)h[c][0]<=h[c-1][1]&&h[c][1]>=h[c-1][1]?(h[c-1][1]=h[c][1],h.splice(c,1)):h[c][1]<h[c-1][1]&&h.splice(c,1);return h.length>b?(showToast("other",{noteStr:errStr.ePlanTimeIntervalNumErr1+b.toString()+errStr.ePlanTimeIntervalNumErr2}),
$.setTimeout(closeToast,1E3),!1):!0});this.init(b)}
function PlanCpy(c,b){this.pcTopDiv;this.planCpyCon;this.pcTitleDiv;this.pcDetailDiv;this.pcBtnDiv;this.okCbk;this.curChanId=1;this.cameraInfo;this.maxChannel=gChannelMaxNum;this.validLen=4;this.defIpcName="未设置名称";this.chanCheckArr=[];this.dotBgArr=[];this.chanNoArr=[];this.labelArr=[];this.chanNoNames="通道一 通道二 通道三 通道四 通道五 通道六 通道七 通道八 通道九 通道十 通道十一 通道十二 通道十三 通道十四 通道十五 通道十六".split(" ");this.validChanList={};var a;this.scrollBg="#2e2e2e";this.scrollZIndex=1001;this.scrollMTop=this.scrollMLeft=3;this.pcDetailDivId=
"pcDetailDiv";var d=this;void 0==PlanCpy.prototype.init&&(PlanCpy.prototype.init=function(a){this._initPcCon();this._eventBind();this.applyOptions(a);this.scrollInit()},PlanCpy.prototype._initPcCon=function(){var a,b,d,h,k,l=rightH=totalH=0;if(void 0!=c&&void 0!=id(c)){this.pcTopDiv=id(c);this.planCpyCon=document.createElement("div");this.planCpyCon.className="planCpyCon";this.pcTopDiv.appendChild(this.planCpyCon);this.pcTitleDiv=document.createElement("div");this.planCpyCon.appendChild(this.pcTitleDiv);
a=document.createElement("label");a.className="pcTitle";a.innerHTML=btn.cpyChannel;this.pcTitleDiv.appendChild(a);a=document.createElement("i");a.id="pcSelAll";a.setAttribute("name","pcSelAll");this.pcTitleDiv.appendChild(a);initCheckInput("pcSelAll",this.selAllCbk);a=document.createElement("label");a.className="peLabel";a.innerHTML=label.chooseAll;this.pcTitleDiv.appendChild(a);this.pcDetailDiv=document.createElement("div");this.pcDetailDiv.className="pcDetailDiv";this.pcDetailDiv.id=this.pcDetailDivId;
this.planCpyCon.appendChild(this.pcDetailDiv);d=document.createElement("ul");d.className="leftUl";this.pcDetailDiv.appendChild(d);h=document.createElement("ul");h.className="rightUl";this.pcDetailDiv.appendChild(h);for(b=1;b<=this.maxChannel;b++){k=document.createElement("li");k.className="liRow";a=document.createElement("i");a.setAttribute("name","channelCheck");a.id="chan"+b;if(b==this.curChanId||b>this.validLen)a.style.display="none";k.appendChild(a);this.chanCheckArr.push(a);a=document.createElement("i");
k.appendChild(a);this.dotBgArr.push(a);a=document.createElement("label");a.innerHTML=this.chanNoNames[b-1];k.appendChild(a);this.chanNoArr.push(a);a=document.createElement("label");a.innerHTML=this.defIpcName;k.appendChild(a);this.labelArr.push(a);b==this.curChanId?(this.dotBgArr[b-1].className="dotBg",this.chanNoArr[b-1].className="pcLabel curNoLabel",this.labelArr[b-1].className="pcLabel curNameLabel"):b>this.validLen?(this.dotBgArr[b-1].className="invalidCbox",this.chanNoArr[b-1].className="pcLabel invalidNoLabel",
this.labelArr[b-1].className="pcLabel invalidNameLabel"):($(this.dotBgArr[b-1]).addClass("displayNone"),this.chanNoArr[b-1].className="pcLabel validNoLabel",this.labelArr[b-1].className="pcLabel validNameLabel");b<=this.maxChannel>>1?(d.appendChild(k),l+=40):(h.appendChild(k),rightH+=40)}totalH=l>rightH?l:rightH;this.pcDetailDiv.style.height=totalH+"px";initCheckInput("channelCheck",this.selChannel);this.pcBtnDiv=document.createElement("div");this.pcBtnDiv.className="pcBtnDiv";this.planCpyCon.appendChild(this.pcBtnDiv);
a=document.createElement("input");a.className="subBtn btnA";a.id="pcCancel";a.type="button";a.value=btn.cancel;this.pcBtnDiv.appendChild(a);a=document.createElement("input");a.className="subBtn btnA";a.id="pcSave";a.type="button";a.value=btn.ok;this.pcBtnDiv.appendChild(a)}},PlanCpy.prototype._eventBind=function(){var a=this;id("pcCancel").onclick=function(b){b=b?b:window.event;stopProp(b);a._hidePC()};id("pcSave").onclick=function(b){var c=0,d;b=b?b:window.event;stopProp(b);for(d=1;d<=a.maxChannel;d++)b=
a.chanCheckArr[d-1],void 0!=b&&"true"==b.getAttribute("checked")&&(c|=1<<d);a.okCbk&&a.okCbk(c);a._hidePC()};this.planCpyCon.onclick=function(a){a=a?a:window.event;stopProp(a)};attachEvnt(document.body,"click",function(){})},PlanCpy.prototype.applyOptions=function(a){d=this;if(void 0!=a){var b,c,h=a.cameraInfo;this.cpyOptions(a);if(void 0!=h){this.validLen=h.length;changeCheckInput("pcSelAll","false");for(a=0;a<this.chanCheckArr.length;a++)changeCheckInput(this.chanCheckArr[a],"false");for(a=1;a<=
this.maxChannel;a++)$(this.dotBgArr[a-1]).removeClass("displayNone"),$(this.dotBgArr[a-1]).addClass("invalidCbox"),this.chanCheckArr[a-1].style.display="none",this.chanNoArr[a-1].className="pcLabel invalidNoLabel",this.labelArr[a-1].className="pcLabel invalidNameLabel",this.labelArr[a-1].innerHTML=this.defIpcName;d.validChanList={};for(a=0;a<h.length;a++)c=h[a],b=parseInt(c[SEC_NAME].match(/\d+/),10),void 0!=c.name&&(this.labelArr[b-1].innerHTML=htmlEscape(getStrInMax(c.name,10))),d.validChanList[b]=
b,b==this.curChanId?($(this.dotBgArr[b-1]).removeClass("displayNone"),$(this.dotBgArr[b-1]).removeClass("invalidCbox"),$(this.dotBgArr[b-1]).addClass("dotBg"),this.chanCheckArr[b-1].style.display="none",this.chanNoArr[b-1].className="pcLabel curNoLabel",this.labelArr[b-1].className="pcLabel curNameLabel"):($(this.dotBgArr[b-1]).addClass("displayNone"),this.chanCheckArr[b-1].style.display="inline-block",this.chanNoArr[b-1].className="pcLabel validNoLabel",this.labelArr[b-1].className="pcLabel validNameLabel")}}},
PlanCpy.prototype.scrollInit=function(){a=new NiceScroll(this.pcDetailDivId);a.scrollTipOpacity(1);a.scrollTipSet({background:this.scrollBg});a.scrollBarSet({zIndex:this.scrollZIndex,mLeft:this.scrollMLeft,mTop:this.scrollMTop});a.init()},PlanCpy.prototype.selAllCbk=function(a,b){for(var c=1;c<=d.maxChannel;c++)void 0!=d.validChanList[c]?changeCheckInput(d.chanCheckArr[c-1],a):changeCheckInput(d.chanCheckArr[c-1],"false")},PlanCpy.prototype.selChannel=function(a,b){if(!1==a)changeCheckInput(id("pcSelAll"),
"false");else{var c=!0,h,k;for(k in d.validChanList)if(h=d.chanCheckArr[parseInt(d.validChanList[k],10)-1],k!=d.curChanId&&void 0!=h&&"false"==h.getAttribute("checked")){c=!1;break}c&&changeCheckInput(id("pcSelAll"),"true")}},PlanCpy.prototype.cpyOptions=function(a){for(var b in a)void 0!=typeof this[b]&&(this[b]=a[b])},PlanCpy.prototype._hidePC=function(){$(this.planCpyCon).addClass("displayNone")},PlanCpy.prototype._showPc=function(a){$(this.planCpyCon).removeClass("displayNone");void 0!=a&&this.applyOptions(a)});
this.init(b)}
function createChart(c,b){({canvasId:void 0,chartStyle:c,xyData:[],fontSize:0.017,graphName:void 0,xValuePosition:"center",xyColor:"#606060",lineColor:"#006ACC",barColorFill:"#006ACC",barColorStroke:"#006ACC",dotColor:"#006ACC",xyDataColor:"#909090",dataColor:"#E1E1E1",chartBackColor:"transparent",chartPaddingLeft:0.044,chartPaddingRight:0.022,chartPaddingTop:0.07,chartPaddingBottom:0.101,barWidth:0.8,leftDis:0.5,smallPaddingWithY:0,smallPaddingBetween:0,init:function(a){for(var b in a)void 0!=a[b]&&
(this[b]=a[b]);if("Microsoft Internet Explorer"==navigator.appName)if(a=navigator.appVersion.split(";")[1].replace(/[ ]/g,""),"MSIE6.0"==a||"MSIE7.0"==a||"MSIE8.0"==a)for(a=document.getElementsByTagName("canvas"),b=0;b<a.length;b++)this.canvasId==a[b].id&&(this.can=window.G_vmlCanvasManager.initElement(a[b]));else this.can=document.getElementById(this.canvasId);else this.can=document.getElementById(this.canvasId);this.can.style.display="block";this.canctx=this.can.getContext("2d");this.chartPaddingLeft=
parseInt(this.chartPaddingLeft*this.can.width);this.chartPaddingRight=parseInt(this.chartPaddingRight*this.can.width);this.chartPaddingTop=parseInt(this.chartPaddingTop*this.can.height);this.chartPaddingBottom=parseInt(this.chartPaddingBottom*this.can.height);this.fontWidth=this.fontSize=parseInt(this.fontSize*this.can.width);this.fontHeight=1.2*this.fontSize;this.canctx.font=this.fontSize+"px 微软雅黑";this.canctx.clearRect(0,0,this.can.width,this.can.height);this.drawGraph(this.xyData,this.chartStyle,
this.chartPaddingLeft,this.chartPaddingRight,this.chartPaddingTop,this.chartPaddingBottom,this.barWidth,this.leftDis,this.xValuePosition,this.can)},drawGraph:function(a,c,g,e,f,h,k,l,m,n){var p=this.getXWidth(a,n.width,g,e,k,l),r=this.checkFloatExist(a),u=parseInt(0.07*n.height),t=this.getYInfo(this.getMax(a),n.height,h,f,u,r),r=t.maxY,q=t.perY,t=t.tenTimes;"transparent"!=this.chartBackColor&&(n.style.background=this.chartBackColor);this.drawCoordinate(a,g,e,f,h,k,l,m,n,t,p,u,r,q);void 0!=b.graphName&&
this.drawGraphName(q,n,f,g,e);"lineChart"==c?this.drawLine(a,g,h,p,q,k,l,t):"barChart"==c&&this.drawBar(a,g,h,p,q,k,l,t)},drawCoordinate:function(a,b,c,e,f,h,k,l,m,n,p,r,u,t){r=0;this.canctx.beginPath();this.canctx.lineWidth="1";this.canctx.strokeStyle=this.xyColor;this.canctx.moveTo(b,e);this.canctx.lineTo(b,m.height-f);this.canctx.lineTo(m.width-c,m.height-f);this.canctx.stroke();this.canctx.closePath();this.canctx.beginPath();this.canctx.fillStyle=this.xyDataColor;"right"==l&&(r=p*h/2);for(c=0;c<
a.length;c++){l=a[c].name;l=this.getTotalLength(isNaN(l)?l:l.toString());l=this.getCoordX(b,p,c,k,h)+r-this.fontWidth/4*l;var q=m.height-f+this.fontHeight;this.canctx.fillText(a[c].name,l,q)}for(c=1;10>=c;c++)a=u*c/10,l=this.getTotalLength(a.toString()),l=b-this.fontWidth/2*l-10,q=this.getCoordY(f,t,a)+this.fontHeight/2,this.canctx.fillText(a,l,q);0==r?(l=b-1.2*(this.fontWidth/2)-2,q=this.getCoordY(f,t,0)+this.fontHeight/2):(l=b-this.fontWidth/2,q=m.height-f+this.fontHeight);this.canctx.fillText(0,
l,q);1!=n&&(f="( ×"+n+" )",l=this.getTotalLength(f),l=b-l*(this.fontWidth/2)/2,q=e-this.fontHeight/4,this.canctx.fillText(f,l,q))},drawGraphName:function(a,b,c,e,f){a=this.getTotalLength(this.graphName);b=(b.width-e-f)/2+e-this.fontWidth/2*(a/2);c=c/2+this.fontHeight/2;this.canctx.fillStyle=this.xyDataColor;this.canctx.fillText(this.graphName,b,c)},drawLine:function(a,b,c,e,f,h,k,l){var m=this.getCoordX(b,e,0,k,h),n=this.getCoordY(c,f,a[0].value/l);this.canctx.lineWidth="2";this.canctx.strokeStyle=
this.lineColor;this.canctx.beginPath();this.canctx.moveTo(m,n);for(var p=1;p<a.length;p++)m=this.getCoordX(b,e,p,k,h),n=this.getCoordY(c,f,a[p].value/l),this.canctx.lineTo(m,n);this.canctx.stroke();this.canctx.fillStyle=this.dotColor;for(p=0;p<a.length;p++)m=this.getCoordX(b,e,p,k,h),n=this.getCoordY(c,f,a[p].value/l),this.canctx.beginPath(),this.canctx.arc(m,n,3,0,2*Math.PI,!0),this.canctx.fill();this.canctx.fillStyle=this.dataColor;for(p=0;p<a.length;p++)m=this.getTotalLength(a[p].value.toString()),
m=this.getCoordX(b,e,p,k,h)-this.fontWidth/2*(m/2),n=this.getCoordY(c,f,a[p].value/l),this.canctx.fillText(a[p].value,m,n-this.fontWidth/2)},drawBar:function(a,b,c,e,f,h,k,l){this.canctx.lineWidth="2";this.canctx.fillStyle=this.barColorFill;var m=this.getCoordX(b,e,0,k,h)-e*h/2,n=this.getCoordY(c,f,a[0].value/l);this.canctx.beginPath();this.canctx.rect(m+this.smallPaddingWithY,n,e*h-this.smallPaddingBetween-this.smallPaddingWithY,a[0].value/l*f);this.canctx.fill();for(var p=1;p<a.length;p++)m=this.getCoordX(b,
e,p,k,h)-e*h/2,n=this.getCoordY(c,f,a[p].value/l),this.canctx.beginPath(),this.canctx.rect(m+this.smallPaddingBetween,n,e*h-2*this.smallPaddingBetween,a[p].value/l*f),this.canctx.fill();this.canctx.fillStyle=this.dataColor;for(p=0;p<a.length;p++)m=this.getTotalLength(a[p].value.toString()),m=this.getCoordX(b,e,p,k,h)-this.fontWidth/2*(m/2),n=this.getCoordY(c,f,a[p].value/l),this.canctx.fillText(a[p].value,m,n-this.fontWidth/4)},getTotalLength:function(a){for(var b=0,c=0;c<a.length;c++)b=/[\u4E00-\u9FA5]/g.test(a[c])?
b+2:b+1;return b},checkFloatExist:function(a){for(var b=0;b<a.length;b++)if(a[b].value!=parseInt(a[b].value))return 1;return 0},getXWidth:function(a,b,c,e,f,h){return(b-c-e)/(a.length+h-(1-f)/2)},getCoordX:function(a,b,c,e,f){return a+b*(e+f/2+c)},getCoordY:function(a,b,c){return this.can.height-a-b*c},getYInfo:function(a,b,c,e,f,h){h=1;for(var k=void 0;100<a;)h*=10,a/=10;10>=a?k=10:10<a&&(k=10*(parseInt(a/10)+1));return{perY:(b-c-e-f)/k,maxY:k,tenTimes:h}},getMax:function(a){for(var b=a[0].value,
c=a.length,e=1;e<c;e++)b<a[e].value&&(b=a[e].value);return b}}).init(b)}
function smartLoadPages(){function c(b,a){var c="";switch(parseInt(b)){case ENONE:return!0;case IPCMDNUMERR:c=errStr.IPCRangeOver;break;case IPCMDENERR:c=errStr.IPCParamInvalid;break;case IPCUMGUESTNAUTH:c=errStr.invPermissionDenied;break;case IPCMDSIZEERR:c=errStr.ipcMDSizeErr;break;case IPCNOTIFYRECORDENERR:case IPCNOTIFYEMAILENERR:case IPCNOTIFYALARMENERR:case IPCNOTIFYFTPENERR:case IPCNOTIFCAPTUREENERR:case IPCNOTIFMSGPUSHENERR:c=errStr.IPCHandleInalid;break;default:c=errStr.invRequestFail}closeToast();
showAlert(c,a);return!1}this.getAiEnhanceList=function(b,a){var d=uciAiEnhanceCapability.fileName,g=uciAiEnhanceCapability.secName,e=uciAiEnhanceCapability.optName,f={};f[d]={};f[d][NAME]=g.traditionalEnhance;$.query(f,function(f){if(c(f[ERR_CODE])){var k=f[d][g.traditionalEnhance];f=k[e.peopleEnhanceVer];var l=k[e.vehicleEnhanceVer],k=k[e.nonVehicleEnhanceVer];f&&(b[0]=0!=(parseInt(f)&1<<a)?1:0);l&&(b[1]=0!=(parseInt(l)&1<<a)?1:0);k&&(b[2]=0!=(parseInt(k)&1<<a)?1:0)}},!1)};this.getLinkageCapability=
function(b,a){function d(a,b){return void 0==a?0:parseInt(parseInt(a,2)/Math.pow(2,b-1))%2}var g=uciLinkageCapability.fileName,e=uciLinkageCapability.secName.capability,f=uciLinkageCapability.optName.light_alarm_capability,h=uciLinkageCapability.optName.sound_alarm_capability,k=uciLinkageCapability.optName.msg_push_capability,l=uciLinkageCapability.optName.alarm_out_capability,m=uciLinkageCapability.optName.record_capability,n=uciLinkageCapability.optName.sd_card_pic_capability,p=uciLinkageCapability.optName.capture_capability,
r=uciLinkageCapability.optName.ftp_capability,u=uciLinkageCapability.optName.email_capability,t={};t[g]={};t[g][NAME]=[e];$.query(t,function(q){!0==c(q[ERR_CODE])&&(q=q[g][e],b.lightAlarmCapability=d(q[f],a),b.soundAlarmCapability=d(q[h],a),b.msgPushCapability=d(q[k],a),b.alarmoutCapability=d(q[l],a),b.recordCapability=d(q[m],a),b.sd_card_pic_capability=d(q[n],a),b.capture_capability=d(q[p],a),b.ftp_capability=d(q[r],a),b.email_capability=d(q[u],a))},!1)};this.getAlarmAudioTypeCapability=function(b){var a=
uciAlarmAudioTypeCapability.fileName,d=uciAlarmAudioTypeCapability.secName.capability,g=uciAlarmAudioTypeCapability.optName,e=g.eventSeparateAudioAlarmSupport,f=g.alarmType,h=g.usrDefAudioAlarmSupport,g={};g[a]={};g[a][NAME]=[d];$.query(g,function(g){c(g[ERR_CODE])&&(g=g[a][d],b.eventSeparateAudioAlarmSupport=1==parseInt(g[e])?!0:!1,b.usrDefAudioAlarmSupport=1==parseInt(g[h])?!0:!1,b.soundAlarmTypeRange=g[f])},!1)}}
function zoomInit(c){var b=uciImage.actionName.startFocus,a=uciImage.actionName.stopFocus,d=uciImage.optName.velocity,g=uciImage.fileName,e=uciPTZ.fileName,f=uciPTZ.optName,h=uciPTZ.actionName;$("li.zoomAddIconNormalLPR")[0].onmousedown=function(){if(!1!=c){var a={},b={};a[e]=b;b[h.ptzCtnMove]={};b[h.ptzCtnMove][f.velocityzoom]=(4/7).toFixed(6);$.action(a,function(a){errHandle(a[ERR_CODE])})}};$("li.zoomAddIconNormalLPR")[0].onmouseup=function(){if(!1!=c){var a={},b={};a[e]=b;b[h.ptzStop]={};b[h.ptzStop][f.pan]=
"1";b[h.ptzStop][f.tilt]="1";b[h.ptzStop][f.zoom]="1";$.action(a,function(a){errHandle(a[ERR_CODE])})}};$("li.zoomReduceIconNormalLPR")[0].onmousedown=function(){if(!1!=c){var a={},b={};a[e]=b;b[h.ptzCtnMove]={};b[h.ptzCtnMove][f.velocityzoom]=(-4/7).toFixed(6);$.action(a,function(a){errHandle(a[ERR_CODE])})}};$("li.zoomReduceIconNormalLPR")[0].onmouseup=function(){if(!1!=c){var a={},b={};a[e]=b;b[h.ptzStop]={};b[h.ptzStop][f.pan]="1";b[h.ptzStop][f.tilt]="1";b[h.ptzStop][f.zoom]="1";$.action(a,function(a){errHandle(a[ERR_CODE])})}};
$("li.focusReduceIconNormalLPR")[0].onmousedown=function(){if(!1!=c){var a={};a[g]={};a[g][b]={};a[g][b][d]=(-0.571429).toFixed(6);$.action(a,function(a){errHandle(a[ERR_CODE])})}};$("li.focusReduceIconNormalLPR")[0].onmouseup=function(){if(!1!=c){var b={};b[g]={};b[g][a]=null;$.action(b,function(a){!0==errHandle(a[ERR_CODE])&&showToast("success")})}};$("li.focusAddIconNormalLPR")[0].onmousedown=function(){if(!1!=c){var a={};a[g]={};a[g][b]={};a[g][b][d]=(0.571429).toFixed(6);$.action(a,function(a){errHandle(a[ERR_CODE])})}};
$("li.focusAddIconNormalLPR")[0].onmouseup=function(){if(!1!=c){var b={};b[g]={};b[g][a]=null;$.action(b,function(a){!0==errHandle(a[ERR_CODE])&&showToast("success")})}}}
function transPlateType(c){switch(c){case "all":c=label.sysTypeAll;break;case "large_car":c=label.largeCar1;break;case "small_car":c=label.smallCar1;break;case "large_new_energy":c=label.largeNewEnergy;break;case "small_new_energy":c=label.smallNewEnergy;break;case "HK_Macao_car":c=label.HKMacaoCar;break;case "trailer":c=label.trailer;break;case "embassy_car":c=label.embassyCar;break;case "coach_car":c=label.coachCar;break;case "police_car":c=label.policeCar;break;default:c=label.unknown}return c}
function transDLErrType(c){switch(c){case "1":c=errStr.lpmDownloadMaxErr;break;case "2":c=errStr.lpmDownloadInvalidErr;break;case "3":c=errStr.lpmDownloadExistErr;break;case "4":c=errStr.lpmDownloadTypeErr;break;default:c=label.unknown}return c}
function transType(c){switch(c){case "small-car":c=label.smallCar;break;case "small-truck":c=label.smallTruck;break;case "medium-car":c=label.mediumCar;break;case "large-car":c=label.largeCar;break;case "large-truck":c=label.largeTruck;break;default:c=label.unknown}return c}
function transBrand(c){switch(c){case "1":c=label.volkswagen;break;case "2":c=label.toyota;break;case "3":c=label.goldenDragon;break;case "4":c=label.hyundai;break;case "5":c=label.nissan;break;case "6":c=label.buick;break;case "7":c=label.honda;break;case "8":c=label.ford;break;case "9":c=label.changan;break;case "10":c=label.chervrolet;break;case "11":c=label.audi;break;case "12":c=label.kia;break;case "13":c=label.wuling;break;case "14":c=label.chery;break;case "15":c=label.citroen;break;case "16":c=
label.peugeot;break;case "17":c=label.jac;break;case "18":c=label.mazda;break;case "19":c=label.dongfeng;break;case "20":c=label.benz;break;case "21":c=label.BYD;break;case "22":c=label.skoda;break;case "23":c=label.greatwall;break;case "24":c=label.bmw;break;case "25":c=label.FAW;break;case "26":c=label.haval;break;case "27":c=label.geely;break;case "28":c=label.suzuki;break;case "29":c=label.seahorse;break;case "30":c=label.foton;break;case "31":c=label.yutong;break;case "32":c=label.roewe;break;
case "33":c=label.mitsubishi;break;case "34":c=label.trumpch;break;case "35":c=label.jeep;break;case "36":c=label.baojun;break;case "37":c=label.zhonghua;break;case "38":c=label.kinglong;break;case "39":c=label.baic;break;case "40":c=label.volvo;break;case "41":c=label.subaru;break;case "42":c=label.landrover;break;case "43":c=label.hafei;break;case "44":c=label.southeast;break;case "45":c=label.jinbei;break;case "46":c=label.morrisGarages;break;case "47":c=label.bestune;break;case "48":c=label.zotye;
break;case "49":c=label.lexus;break;default:c=label.unknown}return c}
function transColor(c){switch(c){case "red":c=label.red;break;case "blue":c=label.blue;break;case "orange":c=label.orange;break;case "green":c=label.green;break;case "purple":c=label.purple;break;case "black":c=label.black;break;case "gray":c=label.gray;break;case "pink":c=label.pink;break;case "white":c=label.white;break;case "yellow":c=label.yellow;break;case "brown":c=label.brown;break;case "cyan":c=label.cyan;break;case "silver":c=label.silver;break;case "yellow-green":c=label.yellowGreen;break;
default:c=label.unknown}return c}function findTextOfValue(c){var b="";switch(c){case "yellow_plate":b=label.yellowCar;break;case "yellow_green_plate":b=label.yellowGreenCar;break;case "blue_plate":b=label.blueCar;break;case "green_plate":b=label.greenCar;break;case "black_plate":b=label.blackCar;break;case "white_plate":b=label.whiteCar;break;case "HK_Macao_plate":b=label.HKMCar;break;case "coach_plate":b=label.coachCar;break;default:b="——"}return b}
function findValueOfText(c){var b="";switch(c){case label.policeCar:b="police_car";break;case label.yellowCar:b="yellow_plate";break;case label.yellowGreenCar:b="yellow_green_plate";break;case label.blueCar:b="blue_plate";break;case label.greenCar:b="green_plate";break;case label.blackCar:b="black_plate";break;case label.whiteCar:b="white_plate";break;case label.HKMCar:b="HK_Macao_plate";break;case label.coachCar:b="coach_plate";break;default:b=""}return b}
function InsertTriggerAlarmOut(c){var b=isNaN(parseInt($.moduleSpec.alarm_out_num))?1:parseInt($.moduleSpec.alarm_out_num),a=$("#"+c).parent();a.parent();var d=[];if(1<b){var g=$("<li class='Line lineE'><i name='showInfoAOAll' id='triggerAOAll' class='chObj' value='0'></i><label class='des desA'></label><label class='des desM'></label></li> \t\t\t<li class='Line lineE multiCol'><label class='des desB'>报警端口</label></li>");g.find("label.desA").text(label.triggerAlarmDevice);g.find("label.desM").text(label.triggerAlarmDeviceTips);
g.insertBefore(a);a.addClass("multiCol");a.find("label.desA").text(label.triggerAO+"1");a.find("label.desM").hide();$("#"+c).attr("name","showInfoAO");d.push(c);for(g=2;g<=b;g++){var e=$("<li class='Line lineE multiCol'><i name='showInfoAO' class='chObj'></i><label class='des desA'></label></li>");e.attr("id","alarmOutLine"+g.toString());e.find("i").attr("id",c+g.toString()).attr("value",(100+g).toString());e.find("label.desA").text(label.triggerAO+g.toString());e.insertAfter(a);a=e;d.push(c+g.toString())}$("<li class='clear'></li>").insertAfter(a);
initCheckInput("showInfoAOAll",function(a,b){for(var c=0;c<d.length;c++)changeCheckInput(d[c],a)});initCheckInput("showInfoAO",function(a,b){for(var c=!0,e=0;e<d.length;e++)c=("true"==id(d[e]).getAttribute("checked")?!0:!1)&&c;c?changeCheckInput("triggerAOAll",!0):changeCheckInput("triggerAOAll",!1)})}}
Function.prototype.bind||(Function.prototype.bind=function(c){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),a=this,d=function(){},g=function(){return a.apply(this instanceof d&&c?this:c,b.concat(Array.prototype.slice.call(arguments)))};d.prototype=this.prototype;g.prototype=new d;return g});
document.getElementsByClassName||(document.getElementsByClassName=function(c){for(var b=document.getElementsByTagName("*"),a=[],d=0;d<b.length;d++)for(var g=b[d],e=g.className.split(" "),f=0;f<e.length;f++)if(e[f]==c){a.push(g);break}return a});
(function(){Phone.call(window);Tool.call(window);PageFunc.call(window);Cover.call(window);Explorer.call(window);LocalStorageSD.call(window);HighSet.call(window);Basic.call(window);ShowTips.call(window);Select.call(window);LanDetect.call(window);ProgressBar.call(window);Help.call(window);BlockGrid.call(window);TimeControlSet.call(window);Slp.call(window);ChsInput.call(window);timePicker.call(window);CloudUpgradePush.call(window);CloudCommon.call(window);CloudAction.call(window);TimeChannel.call(window);
smartLoadPages.call(window)})();
