function PtzControl(qa,c,m,h){function t(){}function q(a){closeNoteAll();switch(a){case ENONE:return!0}closeToast();return!1}function C(a){this.name=this.id="";this.value=4;this.lowerBound=1;this.upperBound=7;this.cb="";this.needInput=this.needLabel="y";this.needScale="n";this.scaleNum=3;this.scaleSidePad=5;this.currentValue="";if("function"!=typeof C.prototype.init){var d=function(a,b,d){a<b&&(a=b);a>d&&(a=d);return a};C.prototype.init=function(a){this.paraInit(a);this.create()};C.prototype.paraInit=
function(a){for(var b in a)void 0!=this[b]&&void 0!=a[b]&&(this[b]=a[b])};C.prototype.create=function(){var a=this.id,b=id(a);if(null!=b){this.value=d(this.value,this.lowerBound,this.upperBound);var O=document.createElement("label");O.className="dragLineLabel";O.id=a+"DragLineLabel";O.innerHTML=this.name;"y"==this.needLabel&&b.appendChild(O);var s=document.createElement("i");s.className="dragLineStrip";s.id=a+"DragLineStrip";s.onclick=this.stripOnClick();b.appendChild(s);var N=document.createElement("i");
N.className="dragLineStripLeft";N.id=a+"dragLineStripLeft";s.appendChild(N);var y=document.createElement("i");y.className="dragLinePointer";y.id=a+"DragLinePointer";y.onmousedown=this.dragableBind();s.appendChild(y);var g=document.createElement("label");g.className="dragLineLabel2";g.id=a+"DragLineInput";g.onchange=this.inputBlurHd();g.onkeyup=this.inputValueChange();g.maxLength=this.upperBound.toString().length;1!=ha&&(O.style.width="62px",g.style.marginLeft="23px",s.style.width="120px");"y"==this.needInput&&
b.appendChild(g);if("y"==this.needScale){var l,O=s.offsetWidth;l=this.scaleSidePad;a=0;1<this.scaleNum&&(a=parseFloat((O-2*l-this.scaleNum)/(this.scaleNum-1)),parseInt(a));O=document.createElement("ul");O.className="scaleUl";for(var c=1;c<=this.scaleNum;c++)l=document.createElement("li"),l.className="scaleLi",l.style.marginLeft=1==c?"0px":c==this.scaleNum?a+1+"px":a+"px",O.appendChild(l);b.appendChild(O)}this.dragLineStrip=s;this.dragLineStripLeft=N;this.dragLinePointer=y;this.dragLineInput=g;this.base=
(this.dragLineStrip.offsetWidth-this.dragLinePointer.offsetWidth)/(this.upperBound-this.lowerBound);y.style.left=this.base*(this.value-this.lowerBound)+"px";N.style.width=this.base*(this.value-this.lowerBound)+"px";g.innerHTML=this.value}};C.prototype.setValue=function(a){var b=this.dragLineInput,c=this.dragLinePointer,s=this.dragLineStripLeft;a=parseInt(a,10);if(a<this.lowerBound||a>this.upperBound||!0==isNaN(a))return b.innerHTML=this.currentValue,!1;a=d(a,this.lowerBound,this.upperBound);this.currentValue=
b.innerHTML=a;b=(a-this.lowerBound)*this.base;c.style.left=b+"px";s.style.width=b+"px";return!0};C.prototype.getValue=function(){return this.dragLineInput.innerHTML};C.prototype.inputBlurHd=function(){var a=this;return function(b){this.value!=a.currentValue&&!0==a.setValue(this.value)&&"function"==typeof a.cb&&a.cb(this.value)}};C.prototype.inputValueChange=function(){var a=this;return function(b){b=b||window.event;b=b.keyCode;void 0!=b&&13!=b||!0!=a.setValue(this.value)||"function"!=typeof a.cb||
a.cb(this.value)}};C.prototype.getAbsoluteLeft=function(a){for(var b=a.offsetLeft;null!=a.offsetParent;)a=a.offsetParent,b+=a.offsetLeft;return b};C.prototype.stripOnClick=function(){var a=this;return function(b){b=b?b:window.event;getMousePos(b);var c=b.target||b.srcElement,s=a.dragLineStrip.offsetWidth-a.dragLinePointer.offsetWidth;if(void 0==c||c!=a.dragLinePointer)clickPointX=b.clientX,lineX=a.getAbsoluteLeft(a.dragLineStrip),lineX-=document.body.scrollLeft||document.documentElement.scrollLeft,
b=clickPointX-lineX,b-=a.dragLinePointer.offsetWidth/2,s=b=d(b,0,s),b=Math.floor(b/a.base),b*a.base+a.base/2<s&&b<a.upperBound&&b++,a.dragLinePointer.style.left=a.base*b+"px",a.dragLineStripLeft.style.width=a.dragLinePointer.style.left,a.dragLineInput.innerHTML=b+a.lowerBound,closeNote(a.dragLineInput.id),"function"==typeof a.cb&&a.cb(a.dragLineInput.innerHTML)}};C.prototype.dragableBind=function(){var a=this;return function(b){b=b?b:window.event;a.ponterClickPos=getMousePos(b);a.orginalX=parseInt(a.dragLinePointer.style.left,
10);document.onmousemove=function(b){b=b?b:window.event;var s=getMousePos(b);b=a.dragLineStrip.offsetWidth-a.dragLinePointer.offsetWidth;s=s.x-a.ponterClickPos.x;s<-b&&(s=-b);s>b&&(s=b);s+=a.orginalX;b=s=d(s,0,b);a.dragLinePointer.style.left=b+"px";s=Math.floor(s/a.base);s*a.base+a.base/2<b&&s<a.upperBound&&s++;a.dragLineInput.innerHTML=s+a.lowerBound;closeNote(a.dragLineInput.id);a.dragLineStripLeft.style.width=a.dragLinePointer.style.left;clearSelection()};document.onmouseup=function(b){a.setValue(a.dragLineInput.innerHTML);
"function"==typeof a.cb&&a.cb(a.dragLineInput.innerHTML);clearSelection();document.onmousemove=null;document.onmouseup=null};stopProp(b)}}}this.init(a)}function a(){if(ia){var a=document.getElementById("ptzCentralIconId");$(a).removeClass("ptzCentralIconPress").addClass("ptzCentralIconNormal");ia=!1}}function n(){function a(){ia&&($(l).removeClass("ptzCentralIconPress").addClass("ptzCentralIconNormal"),ia=!1)}var d=document.createElement("li");d.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfL1 ptzUpIconNormal";
d.id="ptzUpIconId";var c=document.createElement("li");c.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfTop ptzDirectionOptConfL1 ptzDownIconNormal";c.id="ptzDownIconId";var ra=document.createElement("li");ra.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfTop ptzLeftIconNormal";ra.id="ptzLeftIconId";var e=document.createElement("li");e.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfTop ptzDirectionOptConfL1 ptzRightIconNormal";e.id="ptzRightIconId";
var s=document.createElement("li");s.className="ptzDirectionIcon ptzDirectionConfOpt ptzLeftUpIconNormal";s.id="ptzLeftUpIconId";var N=document.createElement("li");N.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfL1 ptzRightUpIconNormal";N.id="ptzRightUpIconId";var y=document.createElement("li");y.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfTop ptzLeftDownIconNormal";y.id="ptzLeftDownIconId";var g=document.createElement("li");g.className="ptzDirectionIcon ptzDirectionConfOpt ptzDirectionOptConfTop ptzDirectionOptConfL1 ptzRightDownIconNormal";
g.id="ptzRightDownIconId";var l=document.createElement("li");l.className="ptzDirectionConfOpt ptzDirectionOptConfTop ptzDirectionOptConfL1 ptzCentralIconNormal";l.id="ptzCentralIconId";var n=document.createElement("li");n.className="ptzDirectionConfOpt1";n.id="ptzZoomIconId";var f=document.createElement("li");f.className="ptzDirectionIcon ptzDirectionConfOpt2 zoomAddIconNormal";f.title="调焦+";f.id="ptzZoomAddLiId";var k=document.createElement("li");k.title="调焦-";k.className="ptzDirectionIcon ptzDirectionConfOpt2 zoomReduceIconNormal";
k.id="ptzZoomReduceLiId";var h=document.createElement("li");h.className="ptzDirectionConfOpt1";h.id="ptzFocusIconId";var m=document.createElement("li");m.title="聚焦+";m.className="ptzDirectionIcon ptzDirectionConfOpt2 focusAddIconNormal";m.id="ptzFocusAddLiId";var S=document.createElement("li");S.title="聚焦-";S.className="ptzDirectionIcon ptzDirectionConfOpt2 focusReduceIconNormal";S.id="ptzFocusReduceLiId";var M=document.createElement("li");M.className="ptzDirectionConfOpt1";M.id="ptzApertureIconId";
var Q=document.createElement("li");Q.title="光圈+";Q.className="ptzDirectionIcon ptzDirectionConfOpt2 apertureAddIconNormal";Q.id="ptzApertureAddLiId";var u=document.createElement("li");u.title="光圈-";u.className="ptzDirectionIcon ptzDirectionConfOpt2 apertureReduceIconNormal";u.id="ptzApertureReduceLiId";var v=document.createElement("li");v.className="ptzSpeedConfSet";v.id="ptzSpeedIconId";var x=document.createElement("div");x.className="speedDragLineDiv";x.id="speedDragLine";v.appendChild(x);1!=ha&&
(d.className="ptzDirectionIcon ptzDirectionOpt ptzDirectionOptL1 ptzDirectionOptU ptzUpIconNormal",c.className="ptzDirectionIcon ptzDirectionOpt ptzDirectionOptTop ptzDirectionOptL1 ptzDownIconNormal",ra.className="ptzDirectionIcon ptzDirectionOpt ptzDirectionOptTop ptzLeftIconNormal",e.className="ptzDirectionIcon ptzDirectionOpt ptzDirectionOptTop ptzDirectionOptL1 ptzRightIconNormal",N.className="ptzDirectionIcon ptzDirectionOpt ptzDirectionOptL1 ptzDirectionOptU ptzRightUpIconNormal",g.className=
"ptzDirectionIcon ptzDirectionOpt ptzDirectionOptTop ptzDirectionOptL1 ptzRightDownIconNormal",l.className="ptzDirectionOpt ptzDirectionOptTop ptzDirectionOptL1 ptzCentralIconNormal",s.className="ptzDirectionIcon ptzDirectionOpt ptzLeftUpIconNormal",y.className="ptzDirectionIcon ptzDirectionOpt ptzDirectionOptTop ptzLeftDownIconNormal",n.className="ptzDirectionOpt1 ptzDirectionOptU",h.className="ptzDirectionOpt1",M.className="ptzDirectionOpt1",v.className="ptzSpeedSet",f.className="ptzDirectionIcon ptzDirectionOpt2 zoomAddIconNormal",
k.className="ptzDirectionIcon ptzDirectionOpt2 zoomReduceIconNormal",m.className="ptzDirectionIcon ptzDirectionOpt2 focusAddIconNormal",S.className="ptzDirectionIcon ptzDirectionOpt2 focusReduceIconNormal",Q.className="ptzDirectionIcon ptzDirectionOpt2 apertureAddIconNormal",u.className="ptzDirectionIcon ptzDirectionOpt2 apertureReduceIconNormal");n.appendChild(k);n.appendChild(f);h.appendChild(S);h.appendChild(m);M.appendChild(u);M.appendChild(Q);H.appendChild(s);H.appendChild(d);H.appendChild(N);
H.appendChild(n);H.appendChild(ra);H.appendChild(l);H.appendChild(e);H.appendChild(h);H.appendChild(y);H.appendChild(c);H.appendChild(g);H.appendChild(M);H.appendChild(v);ja.appendChild(H);T.appendChild(ja);E=new C({id:"speedDragLine",name:label.ptzspeed,cb:t});s.onmousedown=function(){var g={},l={},d=E.getValue(),s=d/F,d=-d/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitypan]=d.toFixed(6);l[p.ptzCtnMove][r.velocitytilt]=s.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};
s.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};d.onmousedown=function(){var g={},l={},d=E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitytilt]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};d.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,
function(a){q(a[ERR_CODE])})};N.onmousedown=function(){var g={},l={},d=E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitypan]=d.toFixed(6);l[p.ptzCtnMove][r.velocitytilt]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};N.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};ra.onmousedown=function(){var g={},l={},d=-E.getValue()/F;g[w]=l;
l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitypan]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};ra.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};e.onmousedown=function(){var g={},l={},d=E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitypan]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};e.onmouseup=function(){var a=
{},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};y.onmousedown=function(){var g={},l={},d=-E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitypan]=d.toFixed(6);l[p.ptzCtnMove][r.velocitytilt]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};y.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]=
"1";$.action(a,function(a){q(a[ERR_CODE])})};c.onmousedown=function(){var g={},l={},d=-E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocitytilt]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};c.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};g.onmousedown=function(){var g={},l={},d=E.getValue(),s=d/F,d=-d/F;g[w]=l;l[p.ptzCtnMove]={};
l[p.ptzCtnMove][r.velocitypan]=s.toFixed(6);l[p.ptzCtnMove][r.velocitytilt]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};g.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};l.onclick=function(){if(!0==ia){if(!Aa){ia=!1;var a={},b={};Ja?($(l).removeClass("ptzCentralIconPress").addClass("ptzCentralIconNormal"),a[w]=b,b[p.ptzScanOperate]={},b[p.ptzScanOperate][r.action]=
Ka.stop,b[p.ptzScanOperate][r.type]=Ka.autoScan):(a[w]=b,b[p.ptzStop]={},b[p.ptzStop][r.pan]="1",b[p.ptzStop][r.tilt]="1",b[p.ptzStop][r.zoom]="1");$.action(a,function(a){q(a[ERR_CODE])})}}else if(!Aa){ia=!0;var a={},b={},g=E.getValue()/F;Ja?($(l).removeClass("ptzCentralIconNormal").addClass("ptzCentralIconPress"),a[w]=b,b[p.ptzScanOperate]={},b[p.ptzScanOperate][r.action]=Ka.start,b[p.ptzScanOperate][r.type]=Ka.autoScan):(a[w]=b,b[p.ptzCtnMove]={},b[p.ptzCtnMove][r.velocitypan]=g.toFixed(6));$.action(a,
function(a){!0==q(a[ERR_CODE])&&(z(),A())})}};f.onmousedown=function(){var g={},l={},d=E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocityzoom]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};f.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};k.onmousedown=function(){var g={},l={},d=-E.getValue()/F;g[w]=l;l[p.ptzCtnMove]={};l[p.ptzCtnMove][r.velocityzoom]=
d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};k.onmouseup=function(){var a={},b={};a[w]=b;b[p.ptzStop]={};b[p.ptzStop][r.pan]="1";b[p.ptzStop][r.tilt]="1";b[p.ptzStop][r.zoom]="1";$.action(a,function(a){q(a[ERR_CODE])})};m.onmousedown=function(){var g={},l={},d=E.getValue()/F;g[uciImage.fileName]=l;l[uciImage.actionName.startFocus]={};l[uciImage.actionName.startFocus][uciImage.optName.velocity]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};m.onmouseup=
function(){var a={},b={};a[uciImage.fileName]=b;b[uciImage.actionName.stopFocus]="null";$.action(a,function(a){q(a[ERR_CODE])})};S.onmousedown=function(){var g={},l={},d=-E.getValue()/F;g[uciImage.fileName]=l;l[uciImage.actionName.startFocus]={};l[uciImage.actionName.startFocus][uciImage.optName.velocity]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};S.onmouseup=function(){var a={},b={};a[uciImage.fileName]=b;b[uciImage.actionName.stopFocus]="null";$.action(a,function(a){q(a[ERR_CODE])})};
Q.onmousedown=function(){var g={},l={},d=E.getValue()/F;g[uciImage.fileName]=l;l[uciImage.actionName.startIris]={};l[uciImage.actionName.startIris][uciImage.optName.velocity]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};Q.onmouseup=function(){var a={},b={};a[uciImage.fileName]=b;b[uciImage.actionName.stopIris]="null";$.action(a,function(a){q(a[ERR_CODE])})};u.onmousedown=function(){var g={},l={},d=-E.getValue()/F;g[uciImage.fileName]=l;l[uciImage.actionName.startIris]=
{};l[uciImage.actionName.startIris][uciImage.optName.velocity]=d.toFixed(6);$.action(g,function(g){!0==q(g[ERR_CODE])&&(z(),A(),a())})};u.onmouseup=function(){var a={},b={};a[uciImage.fileName]=b;b[uciImage.actionName.stopIris]="null";$.action(a,function(a){q(a[ERR_CODE])})}}function k(){var b=document.createElement("li");b.title="3D定位";b.className="ptzAuxToolOpt ptz3DIconNormal";b.id="position3D";var d=document.createElement("li");d.title="一键巡航";d.className="ptzDirectionIcon ptzAuxToolOpt1 quickTourIconNormal";
d.id="quickTour";var c=document.createElement("li");c.title="一键守望";c.className="ptzDirectionIcon ptzAuxToolOpt1 quickParkIconNormal";c.id="quickPark";var e=document.createElement("li");e.className="ptzDirectionIcon ptzAuxToolOpt1 wiperIconAutoNormal";e.id="wiper";var n=document.createElement("div");n.className="ptzAuxToolHoverTip";n.id="wiperHover";sa.appendChild(b);sa.appendChild(d);sa.appendChild(c);sa.appendChild(e);Ba.appendChild(sa);Ba.appendChild(n);$(n).hide();T.appendChild(Ba);m.set3DPositionStatus(0);
b.onclick=function(){Aa||(!0==ta?(ta=!1,h(),m.set3DPositionStatus(1),m.getPosition(function(b,d,c,g){var l={},e={};l.ptz={};l.ptz.position3D=e;e.start_position_pan=b.toString();e.start_position_tilt=d.toString();e.end_position_pan=c.toString();e.end_position_tilt=g.toString();$.action(l,function(b){!0==q(b[ERR_CODE])&&(z(),A(),a());showDetailCon()})}),$(b).removeClass("ptz3DIconNormal").addClass("ptz3DIconPress")):(ta=!0,m.set3DPositionStatus(0),$(b).removeClass("ptz3DIconPress").addClass("ptz3DIconNormal")))};
d.onclick=function(){var b={},d={};b[x]=d;d[J.quickTour]=null;$.action(b,function(b){if(!0==q(b[ERR_CODE])){z();A();b=$("#tourScanLi7").find("label");b[0].style.color="#19B68F";b[0].ifSetFlag=!0;b[1].value=!0;b[1].title="停止";var g=id("tourScanLi7");if(0==g.style.background.indexOf("rgb(240, 242, 245)")||0==g.style.background.indexOf("#f0f2f5"))b[1].style.visibility="visible",b[3].style.visibility="visible";$(b[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal");a()}})};c.onclick=function(){var a=
{},b={};a[w]=b;b[p.quickPark]=null;$.action(a,function(a){!0==q(a[ERR_CODE])&&Ya()})};e.onclick=function(){switch(La){case uciWiper.optValue.cycle:var a=0<ka?!0:!1,b=a?"wiperIconTimeNormal":"wiperIconTimePress",d=a?"wiperIconTimePress":"wiperIconTimeNormal";S(a,a?label.wiperStoped:label.wiperStarted);$("#wiper").removeClass(d).addClass(b);break;case uciWiper.optValue.single:S(!1,label.wiperOneTimeDone)}};$("#wiper").hover(function(){var a="",b="",d=108,g=36,l=-77;switch(La){case uciWiper.optValue.cycle:0<
ka?(d=Math.ceil(ka/60),l=Math.floor(d/60),a=label.wiperCurTiming+label.wiperRemainTime1+l.toString()+label.lHour+(d-60*l).toString()+label.minuteT+label.wiperRemainTime2,b=label.wiperStop,d=220,l=-186):(a=label.wiperCurTiming,b=label.wiperStart);break;case uciWiper.optValue.single:a=label.wiperCurManual;b=label.wiperOneTime;break;default:a=label.wiperCurAuto,g=18}a=0<b.length?a+"<br/>"+b:a;$("#wiperHover").html(a);a=getoffset(id("wiper"),$("div.basicConR")[0]);$("#wiperHover").css("left",a.left+l+
"px").css("top",a.top+41+"px").css("width",d+"px").css("height",g+"px");$("#wiperHover").show()},function(){$("#wiperHover").hide()})}function e(){var a={};a[uciWiper.fileName]={};a[uciWiper.fileName][NAME]=[uciWiper.secName.workConfig];$.queryP(a,function(a){La=a[uciWiper.fileName][uciWiper.secName.workConfig][uciWiper.optName.mode];switch(La){case uciWiper.optValue.cycle:ka=f();a=0<ka?"wiperIconTimePress":"wiperIconTimeNormal";var b=0<ka?"wiperIconTimeNormal":"wiperIconTimePress";$("#wiper").removeClass("wiperIconAutoNormal wiperIconManualNormal "+
b).addClass(a);break;case uciWiper.optValue.single:$("#wiper").removeClass("wiperIconTimePress wiperIconTimeNormal wiperIconAutoNormal").addClass("wiperIconManualNormal");break;default:$("#wiper").removeClass("wiperIconTimePress wiperIconTimeNormal wiperIconManualNormal").addClass("wiperIconAutoNormal")}});$.setTimeout(e,1E4)}function f(){var a=0,d={};d[uciWiper.fileName]={};d[uciWiper.fileName][NAME]=[uciWiper.secName.status];$.queryP(d,function(d){a=parseInt(d[uciWiper.fileName][uciWiper.secName.status][uciWiper.optName.remainingTime])},
!1);return a}function S(a,d){var c=a?uciWiper.optValue.stop:uciWiper.optValue.start,e={};e[uciWiper.fileName]={};e[uciWiper.fileName][uciWiper.actionName.manualBrush]={};e[uciWiper.fileName][uciWiper.actionName.manualBrush][uciWiper.optName.action]=c;$.action(e,function(a){ka=f();showToast("success",{noteStr:d})})}function M(a,d){if("prePointLi"==d)for(var c=0;c<a;c++){var e=id(d+c);e.style.background="transparent";e=$(e).find("label");e[2].style.visibility="hidden";e[3].style.visibility="hidden";
e[4].style.visibility="hidden"}else for(c=0;c<a;c++)e=id(d+c),e.style.background="transparent",e=$(e).find("label"),e[1].style.visibility="hidden",e[2].style.visibility="hidden",e[3].style.visibility="hidden"}function pb(){var a=id(Ca.id),d=id(Da.id),c=id(Ea.id);$(a).addClass("ptzControlTitleC");$(d).addClass("ptzControlTitleN");$(c).addClass("ptzControlTitleN");a.onclick=Ya=function(){var a={},b={};a[G]=b;b.get_preset={};b.get_preset.start_id="0";b.get_preset.count=String(Z);b.get_preset.position_info=
"none";$.action(a,function(a){if(a[ERR_CODE]==ENONE){var b=a[G][G][P.id],d=a[G][G][P.name];a=a[G][G][P.readonly];for(var g=0;g<b.length;g++)for(var l=0;l<Z;l++){var c=id("prePointLi"+l),c=$(c).find("label");if(l+1==b[g]){c[0].style.color="#333333";c[1].style.color="#333333";$(c[1]).text(d[g]);c[0].ifSetFlag=!0;c[1].readonly=a[g];break}}}});Fa.style.display="block";ua.style.display="none";va.style.display="none";aa.style.display="none";wa.style.display="none";$(this).removeClass("ptzControlTitleN").addClass("ptzControlTitleC");
$(d).removeClass("ptzControlTitleC").addClass("ptzControlTitleN");$(c).removeClass("ptzControlTitleC").addClass("ptzControlTitleN");M(Z,"prePointLi")};d.onclick=function(){var d={},e={};d[x]=e;e[B.table]=x;$.query(d,function(a){if(a[ERR_CODE]==ENONE){z();a=a[x][x];for(var b=0;b<a.length;b++)for(var d=0;d<la;d++)if(a[b]["tour_"+(d+1)]){var g=$("#tourScanLi"+d).find("label");g[0].style.color="#333333";g[0].ifSetFlag=!0;a[b]["tour_"+(d+1)][B.status]==Ma.touring&&(g[0].style.color="#19B68F",g[1].title=
"停止",g[1].value=!0,$(g[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal"));break}}},!1);$(this).removeClass("ptzControlTitleN").addClass("ptzControlTitleC");$(a).removeClass("ptzControlTitleC").addClass("ptzControlTitleN");$(c).removeClass("ptzControlTitleC").addClass("ptzControlTitleN");Fa.style.display="none";ua.style.display="block";va.style.display="none";aa.style.display="none";wa.style.display="none";M(la,"tourScanLi")};c.onclick=function(){var c={},e={};c[K]=e;e[D.table]=K;$.query(c,
function(a){if(a[ERR_CODE]==ENONE){A();for(var b=0;b<U;b++){var d=id("patternScanLi"+b),d=$(d).find("label");$(d[2]).removeClass("stopRecordIconNormal").addClass("recordIconNormal");d[2].title="记录";d[2].value=!1}a=a[K][K];for(b=0;b<a.length;b++)for(var g=0;g<U;g++)if(d=a[b]["pattern_"+(g+1)]){g=$("#patternScanLi"+g+" label");g[0].style.color="#333333";g[0].ifSetFlag=!0;d[D.status]==ba.scanning?(g[0].style.color="#19B68F",g[1].title="停止",g[1].value=!0,$(g[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal")):
d[D.status]==ba.recording&&(g[2].value=!0,g[2].title="停录",$(g[2]).removeClass("recordIconNormal").addClass("stopRecordIconNormal"));break}}},!1);$(this).removeClass("ptzControlTitleN").addClass("ptzControlTitleC");$(a).removeClass("ptzControlTitleC").addClass("ptzControlTitleN");$(d).removeClass("ptzControlTitleC").addClass("ptzControlTitleN");Fa.style.display="none";ua.style.display="none";va.style.display="block";aa.style.display="none";wa.style.display="none";M(U,"patternScanLi")}}function qb(a,
d){var c=a.replace(/[^\x00-\xff]/g,"**");if(1*c.length<=1*d)return a;for(var c=c.substr(0,d),e=0,n="",n=0;n<c.length;n++)"*"==c.substr(n,1)&&e++;return n=a.substr(0,0==e%2?e/2+(1*d-e):(e-1)/2+(1*d-e))}function rb(){var b;cPrePointScroll.scrollTipOpacity(1);cPrePointScroll.scrollTipSet({background:"#999999"});cPrePointScroll.scrollBarSet({zIndex:1001,mLeft:3,mTop:3});cPrePointScroll.init();for(var d=0;d<Z;d++){b=document.createElement("li");b.className="ptzPrePointSet";b.id="prePointLi"+d;var c=document.createElement("label"),
e=document.createElement("label"),n=document.createElement("input"),s=document.createElement("label"),f=document.createElement("label"),y=document.createElement("label");b.appendChild(c);b.appendChild(e);b.appendChild(n);b.appendChild(s);b.appendChild(f);b.appendChild(y);c.className="ptzPreNum";c.style.paddingLeft="12px";c.innerHTML=d+1;c.ifSetFlag=!1;e.className="ptzPreName";e.innerHTML=label.preset+(d+1);e.readonly=0;1!=ha?(e.style.width="98px",$(n).addClass("text").addClass("textPreset").addClass("disNone")):
$(n).addClass("text").addClass("textPresetConf").addClass("disNone");n.maxLength=Za;s.className="ptzPrePoint pointExportIconNormal";s.title="调用";s.style.visibility="hidden";f.className="ptzPrePoint setIconNormal";f.title="设置";f.style.visibility="hidden";y.className="ptzPrePoint clearIconNormal";y.title="删除";y.style.visibility="hidden";c={};c.str="预置点"+(d+1);c.value=d+1;V.push(c);$a.appendChild(b);b.onclick=function(a){return function(){var b=id("prePointLi"+a);M(d,"prePointLi");b.style.background=
"#F0F2F5";b=$(b).find("label");!0!=b[0].ifSetFlag||"undefined"!=typeof b[1].readonly&&0!=b[1].readonly?!0!=b[0].ifSetFlag||"undefined"!=typeof b[1].readonly&&1!=b[1].readonly?!1==b[0].ifSetFlag&&(b[2].style.visibility="hidden",b[3].style.visibility="visible",b[4].style.visibility="hidden"):(b[2].style.visibility="visible",b[3].style.visibility="hidden",b[4].style.visibility="hidden"):(b[2].style.visibility="visible",b[3].style.visibility="visible",b[4].style.visibility="visible")}}(d);$(e).dblclick(function(a){if(1!=
a.currentTarget.readonly){var b=$(a.currentTarget).text();$(a.currentTarget).addClass("disNone");var d=$(a.currentTarget).next("input").removeClass("disNone").get(0);d.value=b;d.focus();a=id(a.currentTarget.parentNode.id.toString());a=$(a).find("label");a[2].style.display="none";a[4].style.display="none"}});$(n).blur(function(a){var b=$(a.currentTarget).get(0).value;$(a.currentTarget).addClass("disNone");$(a.currentTarget).prev().removeClass("disNone");$(a.currentTarget).prev().text(b);a=id(a.currentTarget.parentNode.id.toString());
a=$(a).find("label");a[2].style.display="inline-block";a[4].style.display="inline-block"});s.onclick=function(b){return function(){var d=id("prePointLi"+b),d=$(d).find("label");a();if("visible"==d[2].style.visibility){var d={},c={};E.getValue();var e=b+1;d[G]=c;c[ca.gotoPreset]={};c[ca.gotoPreset][P.id]=e.toString();$.action(d,function(a){q(a[ERR_CODE])})}}}(d);f.onclick=function(a){return function(){var b=id("prePointLi"+a),d=$(b).find("label");if("visible"==d[3].style.visibility){var c={},e={},
n=a+1,b=$(b).find("input"),f=b.get(0).value,s=$(d[1]);b.addClass("disNone");s.removeClass("disNone");f.length&&0<f.length&&s.text(qb(f,Za));c[G]=e;e[ca.setPreset]={};e[ca.setPreset][P.id]=n.toString();e[ca.setPreset][P.name]=s.text();e[ca.setPreset][P.saveptz]=(1).toString();$.action(c,function(a){a[ERR_CODE]==ENONE&&(d[0].style.color="#333333",d[1].style.color="#333333",d[0].ifSetFlag=!0,d[2].style.visibility="visible",d[4].style.visibility="visible")})}}}(d);y.onclick=function(a){return function(){var b=
id("prePointLi"+a),d=$(b).find("label"),c=$(b).find("input");if("visible"==d[4].style.visibility){var b={},e={},n=a+1,f=[];f[0]=n.toString();b[G]=e;e[ca.removePreset]={};e[ca.removePreset][P.id]=f;$.action(b,function(a){a[ERR_CODE]==ENONE&&(d[0].style.color="#999999",d[1].style.color="#999999",d[2].style.visibility="hidden",d[4].style.visibility="hidden",d[0].ifSetFlag=!1,d[1].innerHTML=label.preset+n,c.get(0).value=label.preset+n)})}}}(d)}V.splice(32,13);V.splice(81,11);b={};e={};b[G]=e;e.get_preset=
{};e.get_preset.start_id="0";e.get_preset.count=String(Z);e.get_preset.position_info="none";$.action(b,function(a){if(a[ERR_CODE]==ENONE){var b=a[G][G][P.id],d=a[G][G][P.name];a=a[G][G][P.readonly];for(var c=0;c<b.length;c++)for(var e=0;e<Z;e++){var n=id("prePointLi"+e),n=$(n).find("label");if(e+1==b[c]){n[0].style.color="#333333";n[1].style.color="#333333";$(n[1]).text(d[c]);n[0].ifSetFlag=!0;n[1].readonly=a[c];break}}}});da.appendChild($a);L.appendChild(da);T.appendChild(L)}function Q(){$(aa).empty();
Ga=I=0;u=1}function z(){for(var a=0;a<la;a++){var d=id("tourScanLi"+a),d=$(d).find("label");$(d[1]).removeClass("stopPlayIconNormal").addClass("playIconNormal");d[1].value&&(d[0].style.color="#333333");d[1].title="运行";d[1].value=!1}}function sb(){var a=id(ma.id),d=$(a).find("label"),c=d[0].innerHTML.substring(4),e="tour_"+c;if(a.isNewTour&&1==a.isNewTour){var a={},n={};a[x]=n;n[B.table]=x;n[B.name]=e;n[B.para]={};n[B.para][B.name]=d[0].innerHTML;$.add(a,function(a){})}for(var f=$(aa).find("li.tourPathLi"),
e=[],a=[],n=[],k=0;k<f.length;k++){var y=id(k+1+"prePointAddLi"),g=$(y).find("input"),y=$(y).find("select")[0].value,l=isNaN(parseInt(g[0].value))?W:parseInt(g[0].value),l=1>l?1:l>ea?ea:l,l=l/ea,g=isNaN(parseInt(g[1].value))?xa:parseInt(g[1].value),g=g<W?W:g>fa?fa:g;e[k]=y.toString();a[k]=String(g*ya);n[k]=l.toFixed(6)}f={};k={};f[x]=k;k[J.modifyTour]={};k[J.modifyTour][R.id]=c;k[J.modifyTour][R.name]=d[0].innerHTML;k[J.modifyTour][R.spot]={};k[J.modifyTour][R.spot][R.id]=e;k[J.modifyTour][R.spot][R.spotstaytime]=
a;k[J.modifyTour][R.spot][R.spotspeedpan]=n;k[J.modifyTour][R.spot][R.spotspeedtilt]=n;$.action(f,function(a){var b=$("#tourScanLi"+(c-1)).find("label");a[ERR_CODE]==ENONE&&(b[0].style.color="#333333",b[1].value&&(b[0].style.color="#19B68F"),b[0].ifSetFlag=!0,b[1].style.visibility="visible",b[2].style.visibility="visible",b[3].style.visibility="visible")})}function tb(a){$(id(ma.id)).find("label")[0].innerHTML=label.tourpath+a;var d={},c={},e="tour_"+a;a=[];a[0]=e;d[x]=c;c[B.name]=a;$.query(d,function(a){if(a[ERR_CODE]==
ENONE){var b=a[x][e][B.spotid],d=a[x][e][B.spotstaytime];a=a[x][e][B.spotspeedpan];for(var c=0;c<b.length;c++){I++;Ga++;var g=document.createElement("li");g.className="tourPathLi";g.id=I+"prePointAddLi";var l=document.createElement("select");l.className="selectCon";l.id="prePointAdd"+Ga;var n=document.createElement("input");n.className="text tourPathTip22";n.maxLength=2;n.value=String(parseFloat(a[c])*ea);var f=document.createElement("input");f.className="text tourPathTip22";f.maxLength=4;f.value=
String(parseInt(parseInt(d[c])/ya));g.appendChild(l);g.appendChild(n);g.appendChild(f);ga.appendChild(g);for(var k=0;k<V.length;k++)ab(l,V[k].str,V[k].value);l.value=parseInt(b[c]);l.addEventListener&&l.addEventListener("DOMMouseScroll",Na,!1);l.onmousewheel=Na;1==I&&(u=1,g.style.background="#F0F2F5");$(g).click(function(a){for(var b=1;b<=I;b++)id(b+"prePointAddLi").style.background="transparent";u=parseInt(a.currentTarget.id);a.currentTarget.style.background="#F0F2F5"});$(n).blur(function(a){var b=
$(a.currentTarget).get(0).value;checkNum(b)?(1>parseInt(b)&&($(a.currentTarget).get(0).value=1),parseInt(b)>ea&&($(a.currentTarget).get(0).value=ea)):$(a.currentTarget).get(0).value=Pa});$(f).blur(function(a){var b=$(a.currentTarget).get(0).value;checkNum(b)?(parseInt(b)<W&&($(a.currentTarget).get(0).value=W),parseInt(b)>fa&&($(a.currentTarget).get(0).value=fa)):$(a.currentTarget).get(0).value=xa})}id(ma.id).isNewTour=0}else id(ma.id).isNewTour=1});wa.style.display="block";aa.style.display="block"}
function Na(a){a=a||window.event;stopProp(a)}function ab(a,d,c){var e=document.createElement("option");e.appendChild(document.createTextNode(d));3==arguments.length&&e.setAttribute("value",c);a.appendChild(e)}function ub(){if(!(I>=Qa)){I++;Ga++;var a=document.createElement("li");a.className="tourPathLi";a.id=I+"prePointAddLi";var d=document.createElement("select");d.className="selectCon";d.id="prePointAdd"+Ga;var c=document.createElement("input");c.className="text tourPathTip22";c.value=Pa;c.maxLength=
2;var e=document.createElement("input");e.className="text tourPathTip22";e.value=xa;e.maxLength=4;1==I&&(a.style.background="#F0F2F5");a.appendChild(d);a.appendChild(c);a.appendChild(e);ga.appendChild(a);for(var n=0;n<V.length;n++)ab(d,V[n].str,V[n].value);d.addEventListener&&d.addEventListener("DOMMouseScroll",Na,!1);d.onmousewheel=Na;a.onclick=function(){for(var d=1;d<=I;d++)id(d+"prePointAddLi").style.background="transparent";u=parseInt(a.id);a.style.background="#F0F2F5"};$(c).blur(function(a){var b=
$(a.currentTarget).get(0).value;checkNum(b)?(1>parseInt(b)&&($(a.currentTarget).get(0).value=1),parseInt(b)>ea&&($(a.currentTarget).get(0).value=ea)):$(a.currentTarget).get(0).value=Pa});$(e).blur(function(a){var b=$(a.currentTarget).get(0).value;checkNum(b)?(parseInt(b)<W&&($(a.currentTarget).get(0).value=W),parseInt(b)>fa&&($(a.currentTarget).get(0).value=fa)):$(a.currentTarget).get(0).value=xa})}}function vb(){var a=document.createElement("li");a.className="tourPathTile";var d=document.createElement("label");
d.className="ptzScanSetName";d.innerHTML=label.tourpath;d.style.color="#666666";a.appendChild(d);ma.appendChild(a);Ra.appendChild(ma);document.createElement("li").className="tourPathTile";var d=document.createElement("label"),c=document.createElement("label"),e=document.createElement("label"),n=document.createElement("label");d.className="tourPathTip1 tourPathAddIconNormal";d.title="添加";c.className="tourPathTip1 tourPathDelIconNormal";c.title="删除";e.className="tourPathTip1 tourPathUpIconNormal";e.title=
"上移";n.className="tourPathTip1 tourPathDownIconNormal";n.title="下移";a.appendChild(d);a.appendChild(c);a.appendChild(e);a.appendChild(n);a=document.createElement("li");a.className="tourPathTile2";var f=document.createElement("label"),k=document.createElement("label"),h=document.createElement("label");f.className="tourPathTip21";f.innerHTML=label.preset;k.className="text tourPathTip22";k.innerHTML=label.tourspeed;h.className="text tourPathTip23";h.innerHTML=label.tourtime;a.appendChild(f);a.appendChild(k);
a.appendChild(h);bb.appendChild(a);Sa.appendChild(bb);cTourPathScroll.scrollTipOpacity(1);cTourPathScroll.scrollTipSet({background:"#999999"});cTourPathScroll.scrollBarSet({zIndex:1001,mLeft:3,mTop:3});cTourPathScroll.init();a=document.createElement("li");a.className="tourPathBtn";f=document.createElement("input");k=document.createElement("input");k.value=btn.confirmOk;k.type="button";k.className="btnA subBtn";k.style.marginLeft="12px";k.style.marginBottom="4px";f.value=btn.gridCancel;f.type="button";
f.className="btnA subBtnB";f.style.marginBottom="4px";a.appendChild(f);a.appendChild(k);cb.appendChild(a);Ta.appendChild(cb);X.appendChild(Ra);X.appendChild(Sa);X.appendChild(ga);X.appendChild(Ta);L.appendChild(X);T.appendChild(L);k.onclick=function(){sb();db();Q()};f.onclick=function(){db();Q()};d.onclick=function(){ub()};c.onclick=function(){if(!(1>u||1>I)){var a=id(u+"prePointAddLi");$(a).remove();if(I>u)for(a=u+1;a<=I;a++)id(a+"prePointAddLi").id=a-1+"prePointAddLi";else I==u&&u--;I--;0<u&&(id(u+
"prePointAddLi").style.background="#F0F2F5")}};e.onclick=function(){if(1!=u){var a=id(u+"prePointAddLi"),b=id(u-1+"prePointAddLi");$(b).next().after($(b));a.id=u-1+"prePointAddLi";b.id=u+"prePointAddLi";u--}};n.onclick=function(){if(u!=I){var a=id(u+"prePointAddLi"),b=id(u+1+"prePointAddLi");$(a).next().after($(a));a.id=u+1+"prePointAddLi";b.id=u+"prePointAddLi";u++}}}function wb(){var b;cTourScanScroll.scrollTipOpacity(1);cTourScanScroll.scrollTipSet({background:"#999999"});cTourScanScroll.scrollBarSet({zIndex:1001,
mLeft:3,mTop:3});cTourScanScroll.init();for(var d=0;d<la;d++){b=document.createElement("li");b.className="ptzPrePointSet";b.id="tourScanLi"+d;var c=document.createElement("label"),e=document.createElement("label"),n=document.createElement("label"),f=document.createElement("label");b.appendChild(c);b.appendChild(e);b.appendChild(n);b.appendChild(f);c.className="ptzScanName";c.innerHTML=label.tourpath+(d+1);c.name="tour_"+(d+1);c.ifSetFlag=!1;e.className="ptzPrePoint playIconNormal";e.title="运行";e.style.visibility=
"hidden";e.value=!1;n.className="ptzPrePoint setIconNormal";n.title="设置";n.style.visibility="hidden";f.className="ptzPrePoint clearIconNormal";f.title="删除";f.style.visibility="hidden";eb.appendChild(b);b.onclick=function(a){return function(){var b=id("tourScanLi"+a);M(d,"tourScanLi");b.style.background="#F0F2F5";b=$(b).find("label");!0==b[0].ifSetFlag&&(b[1].style.visibility="visible",b[3].style.visibility="visible");b[2].style.visibility="visible"}}(d);e.onclick=function(b){return function(){var d=
id("tourScanLi"+b),c=$(d).find("label");if("visible"==c[1].style.visibility)if(!0==c[1].value){var d={},e={};d[x]=e;e[J.tourOperate]={};e[J.tourOperate][B.id]=String(b+1);e[J.tourOperate][B.action]=Ma.stop;$.action(d,function(a){!0==q(a[ERR_CODE])&&(c[0].style.color="#333333",c[1].value=!1,c[1].title="运行",$(c[1]).removeClass("stopPlayIconNormal").addClass("playIconNormal"))})}else d={},e={},d[x]=e,e[J.tourOperate]={},e[J.tourOperate][B.id]=String(b+1),e[J.tourOperate][B.action]=Ma.start,$.action(d,
function(b){!0==q(b[ERR_CODE])&&(z(),c[0].style.color="#19B68F",c[1].value=!0,c[1].title="停止",$(c[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal"),a())})}}(d);n.onclick=function(a){return function(){var b=id("tourScanLi"+a);"visible"==$(b).find("label")[2].style.visibility&&(Fa.style.display="none",ua.style.display="none",va.style.display="none",tb(a+1),Q())}}(d);f.onclick=function(a){return function(){var b=$("#tourScanLi"+a+" label");if("visible"==b[3].style.visibility){var d={},
c={},e=[],e=b[0].name;d[x]=c;c[B.name]=e;$.del(d,function(a){a[ERR_CODE]==ENONE&&(b[1].style.visibility="hidden",b[2].style.visibility="visible",b[3].style.visibility="hidden",b[0].ifSetFlag=!1,b[1].value&&z(),b[0].style.color="#999999")})}}}(d)}b={};c={};b[x]=c;c[B.table]=x;$.query(b,function(a){if(a[ERR_CODE]==ENONE){z();a=a[x][x];for(var b=0;b<a.length;b++)for(var d=0;d<la;d++)if(a[b]["tour_"+(d+1)]){var c=$("#tourScanLi"+d).find("label");c[0].style.color="#333333";c[0].ifSetFlag=!0;a[b]["tour_"+
(d+1)][B.status]==Ma.touring&&(c[0].style.color="#19B68F",c[1].value=!0,c[1].title="停止",$(c[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal"));break}}});na.appendChild(eb);L.appendChild(na);T.appendChild(L)}function A(){for(var a=0;a<U;a++){var d=id("patternScanLi"+a),d=$(d).find("label");$(d[1]).removeClass("stopPlayIconNormal").addClass("playIconNormal");d[1].value&&(d[0].style.color="#333333");d[1].title="运行";d[1].value=!1}}function xb(){var b;cPatternScanScroll.scrollTipOpacity(1);
cPatternScanScroll.scrollTipSet({background:"#999999"});cPatternScanScroll.scrollBarSet({zIndex:1001,mLeft:3,mTop:3});cPatternScanScroll.init();for(var d=0;d<U;d++){b=document.createElement("li");b.className="ptzPrePointSet";b.id="patternScanLi"+d;var c=document.createElement("label"),e=document.createElement("label"),n=document.createElement("label"),f=document.createElement("label");b.appendChild(c);b.appendChild(e);b.appendChild(n);b.appendChild(f);c.className="ptzScanName";c.innerHTML=label.patternpath+
(d+1);c.name="pattern_"+(d+1);c.ifSetFlag=!1;e.className="ptzPrePoint playIconNormal";e.title="运行";e.style.visibility="hidden";e.value=!1;n.className="ptzPrePoint recordIconNormal";n.title="记录";n.style.visibility="hidden";n.value=!1;f.className="ptzPrePoint clearIconNormal";f.title="删除";f.style.visibility="hidden";fb.appendChild(b);b.onclick=function(a){return function(){var b=id("patternScanLi"+a);M(d,"patternScanLi");b.style.background="#F0F2F5";b=$(b).find("label");!0==b[0].ifSetFlag&&(b[1].style.visibility=
"visible",b[3].style.visibility="visible");b[2].style.visibility="visible"}}(d);e.onclick=function(b){return function(){var d=id("patternScanLi"+b),c=$(d).find("label");if("visible"==c[1].style.visibility)if(!0==c[1].value){var d={},e={},n=b+1;d[K]=e;e[Y.patternOperate]={};e[Y.patternOperate][D.id]=n.toString();e[Y.patternOperate][D.action]=ba.stop;$.action(d,function(a){a[ERR_CODE]==ENONE&&(c[0].style.color="#333333",c[1].value=!1,c[1].title="运行",$(c[1]).removeClass("stopPlayIconNormal").addClass("playIconNormal"))})}else d=
{},e={},n=b+1,d[K]=e,e[Y.patternOperate]={},e[Y.patternOperate][D.id]=n.toString(),e[Y.patternOperate][D.action]=ba.start,$.action(d,function(b){b[ERR_CODE]==ENONE&&(A(),c[0].style.color="#19B68F",c[1].value=!0,c[1].title="停止",$(c[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal"),a())})}}(d);var k=function(b,d){if(!("number"!=typeof b||1>b||b>U||"string"!=typeof d)){var c={},e={};c[K]=e;e[Y.patternOperate]={};e[Y.patternOperate][D.id]=b.toString();e[Y.patternOperate][D.action]="start"==
d?ba.startrecord:ba.stoprecord;var n="start"==d?"stopRecordIconNormal":"recordIconNormal",f="start"==d?!0:!1;$.action(c,function(d){var c=$("#patternScanLi"+(b-1)+" label");d[ERR_CODE]==ENONE&&(c[2].value=f,A(),a(),ta||(ta=!0,m.set3DPositionStatus(0),d=document.getElementById("position3D"),$(d).removeClass("ptz3DIconPress").addClass("ptz3DIconNormal")),f?(Aa=!0,c[2].title="停录",$(c[2]).removeClass("recordIconNormal").addClass(n)):(Aa=!1,c[2].title="记录",$(c[2]).removeClass("stopRecordIconNormal").addClass(n)))})}};
n.onclick=function(a){return function(){var b=$("#patternScanLi"+a+" label"),d=a+1;if("visible"==b[1].style.visibility)!0==b[2].value?k(d,"end"):k(d,"start");else{var c={},e={};c[K]=e;e[D.table]=K;e[D.name]=b[0].name;e[D.para]={};e[D.para][D.name]=b[0].innerHTML;$.add(c,function(a){a[ERR_CODE]==ENONE&&(k(d,"start"),b[1].style.visibility="visible",b[3].style.visibility="visible",b[0].ifSetFlag=!0,b[0].style.color="#333333")})}}}(d);f.onclick=function(a){return function(){var b=id("patternScanLi"+a),
d=$(b).find("label");if("visible"==d[3].style.visibility){var b={},c={};b[K]=c;c[D.name]=d[0].name;$.del(b,function(a){a[ERR_CODE]==ENONE&&(d[1].style.visibility="hidden",d[2].style.visibility="visible",d[3].style.visibility="hidden",d[0].ifSetFlag=!1,d[0].style.color="#999999")})}}}(d)}b={};c={};b[K]=c;c[D.table]=K;$.query(b,function(a){if(a[ERR_CODE]==ENONE){A();a=a[K][K];for(var b=0;b<a.length;b++)for(var d=0;d<U;d++){var c=a[b]["pattern_"+(d+1)];if(c){d=$("#patternScanLi"+d+" label");d[0].style.color=
"#333333";d[0].ifSetFlag=!0;c[D.status]==ba.scanning?(d[0].style.color="#19B68F",d[1].value=!0,d[1].title="停止",$(d[1]).removeClass("playIconNormal").addClass("stopPlayIconNormal")):c[D.status]==ba.recording&&(d[2].value=!0,d[2].title="停录",$(d[2]).removeClass("recordIconNormal").addClass("stopRecordIconNormal"));break}}}});oa.appendChild(fb);L.appendChild(oa);T.appendChild(L)}function yb(){var a={};a[x]={};a[x][KEY_NAME]=gb.tourConf;$.query(a,function(a){a[ERR_CODE]==ENONE&&(a=a[x][gb.tourConf])&&
(xa=isNaN(parseInt(a[B.starytimedef]/ya))?xa:parseInt(a[B.starytimedef]/ya))})}function zb(){var a={};a[w]={};a[w][KEY_NAME]=hb.capability;$.query(a,function(a){if(a[ERR_CODE]==ENONE){if(a=a[w][hb.capability]){Z=isNaN(parseInt(a[r.presetNumMax]))?Z:parseInt(a[r.presetNumMax]);la=isNaN(parseInt(a[r.tourNumMax]))?la:parseInt(a[r.tourNumMax]);U=isNaN(parseInt(a[r.patternNumMax]))?U:parseInt(a[r.patternNumMax]);Qa=isNaN(parseInt(a[r.tourSpotsNumMax]))?Qa:parseInt(a[r.tourSpotsNumMax]);a[r.tourStayTimeRange].sort(function(a,
b){return parseInt(a)<parseInt(a)?-1:parseInt(a)>parseInt(a)?1:0});var b=parseInt(a[r.tourStayTimeRange][0]/ya);W=isNaN(b)?W:b;b=parseInt(a[r.tourStayTimeRange][1]/ya);fa=isNaN(b)?fa:b;Ha=1==parseInt(a.position_pan_range[1])?!0:!1;Oa=1==parseInt(a.position_tilt_range[1])?!0:!1;ib=a.position_zoom_range&&1==parseInt(a.position_zoom_range[1])?!0:!1;Ja=1==parseInt(a.scan_supported)?!0:!1;Ua=1==parseInt(a.preset_supported)?!0:!1;Va=1==parseInt(a.tour_supported)?!0:!1;Wa=1==parseInt(a.pattern_supported)?
!0:!1;jb=1==parseInt(a.position3D_unsupported)?!1:!0;kb=1==parseInt(a.quick_tour_unsupported)?!1:!0;lb=1==parseInt(a.quick_park_unsupported)?!1:!0;$.imageCapability&&$.imageCapability[uciFunction.optValue.imglist_focus]&&(mb=1==parseInt($.imageCapability[uciFunction.optValue.imglist_focus][uciImageCapability.optName.focusSupported])?!0:!1);$.moduleSpec&&(nb=1==parseInt($.moduleSpec[uciFunction.optName.irisFirst])?!0:!1,ob=1==parseInt($.moduleSpec.wiper_capability)?!0:!1);Ha||(v.push("ptzLeftIconId"),
v.push("ptzRightIconId"));Oa||(v.push("ptzUpIconId"),v.push("ptzDownIconId"));Ha&&Oa||(v.push("ptzLeftUpIconId"),v.push("ptzRightUpIconId"),v.push("ptzLeftDownIconId"),v.push("ptzRightDownIconId"));Ha||Oa||v.push("speedDragLine");ib||v.push("ptzZoomIconId");mb||v.push("ptzFocusIconId");nb||v.push("ptzApertureIconId");Ja||Ha||v.push("ptzCentralIconId");Ua||v.push("prePointTitle");Va||v.push("tourScanTitle");Wa||v.push("patternScanTitle");jb||v.push("position3D");kb||v.push("quickTour");lb||v.push("quickPark");
ob||v.push("wiper");Ua||Va||Wa||v.push("ptzControlAreaDiv");Ab();ha||0<=$.inArray("wiper",v)?($(".ptzControlAuxTool").addClass("threeTool"),$("#wiper").hide()):e()}rb();wb();ua.style.display="none";xb();va.style.display="none";vb();wa.style.display="none";aa.style.display="none"}})}function Ab(){for(var a=0;a<v.length;a++){var d=v[a];$("#"+d).css("pointer-events","none").removeAttr("onclick").addClass("forbidden");"speedDragLine"==d&&($("#speedDragLineDragLineStrip").removeAttr("onclick"),$("#speedDragLinedragLineStripLeft").addClass("forbidden"),
$("#speedDragLineDragLinePointer").removeAttr("onclick").addClass("forbidden"))}}function db(){Fa.style.display="none";ua.style.display="block";va.style.display="none";Bb.style.display="block";aa.style.display="none";wa.style.display="none"}if(void 0!=qa){var Z=300,la=8,U=4,Za=20,Qa=32,W=15,fa=3600,xa=15,ya=1E3,F=7,ea=40,Pa=30,ha=void 0==c?0:c,T=id(qa),za=document.createElement("div");document.body.appendChild(za);za.className="ptzNameCon";var L=document.createElement("div");document.body.appendChild(L);
L.className="ptzControlAreaConfCon";L.id="ptzControlAreaDiv";var pa=document.createElement("div");document.body.appendChild(pa);pa.id="ptztitleDiv";var Bb=id(pa.id),Ia=document.createElement("ul");Ia.className="ptzControlTitle";var da=document.createElement("div");da.className="ptzBorderConfCon1";da.id="prePointDiv";document.body.appendChild(da);var Fa=id(da.id),$a=document.createElement("ul"),na=document.createElement("div");na.className="ptzBorderCon1";na.id="tourScanDiv";document.body.appendChild(na);
var ua=id(na.id),eb=document.createElement("ul"),oa=document.createElement("div");oa.className="ptzBorderCon1";oa.id="patternScanDiv";document.body.appendChild(oa);var va=id(oa.id),fb=document.createElement("ul"),X=document.createElement("div");X.className="ptzBorderCon1";document.body.appendChild(X);X.id="tourPathConf";var wa=id(X.id),Ra=document.createElement("div");document.body.appendChild(Ra);var ma=document.createElement("ul");ma.id="tourPathTitleUl";document.createElement("div");document.createElement("ul");
var Sa=document.createElement("div");document.body.appendChild(Sa);var bb=document.createElement("ul"),ga=document.createElement("div");ga.className="tourPathSetCon";ga.id="tourPathShowDiv";document.body.appendChild(ga);var aa=id(ga.id);document.createElement("ul");var Ta=document.createElement("div");document.body.appendChild(Ta);var cb=document.createElement("ul"),I=0,Ga=0,u=1,V=[],ja=document.createElement("div");document.body.appendChild(ja);ja.className="ptzControlToolConfDiv";ja.id="ptzControlToolDiv";
id(ja.id);var H=document.createElement("ul");H.className="ptzControlToolConfCon";var Ba=document.createElement("div");Ba.id="ptzAuxToolDiv";id(Ba.id);var sa=document.createElement("ul");sa.className="ptzControlAuxTool";var ta=!0,La=uciWiper.optValue.auto,ka=0,w=uciPTZ.fileName,hb=uciPTZ.secName,r=uciPTZ.optName,Ka=uciPTZ.optValue,p=uciPTZ.actionName,G=uciPreset.fileName,P=uciPreset.optName,ca=uciPreset.actionName,x=uciTourControl.fileName,gb=uciTourControl.secName,B=uciTourControl.optName,R=uciTourControl.actOptName,
Ma=uciTourControl.optValue,J=uciTourControl.actionName,K=uciPattern.fileName,D=uciPattern.optName,ba=uciPattern.optValue,Y=uciPattern.actionName;cPrePointScroll=new NiceScroll(da.id);cTourPathScroll=new NiceScroll(ga.id);cTourScanScroll=new NiceScroll(na.id);cPatternScanScroll=new NiceScroll(oa.id);var E,ia=!1,Aa=!1,Xa=document.createElement("label");Xa.className="ptzNameLabel";Xa.innerHTML="云台";za.appendChild(Xa);T.appendChild(za);za.style.display="none";var Ya=null,Ha=!1,Oa=!1,ib=!1,mb=!1,nb=!1,
Ja=!1,Ua=!1,Va=!1,Wa=!1,jb=!1,kb=!1,lb=!1,ob=!1,v=[];if(void 0==h||"function"==typeof h){PtzControl.prototype.setBorderHeight=function(a){var d=document.getElementById("prePointDiv"),c=document.getElementById("tourScanDiv"),e=document.getElementById("patternScanDiv"),n=document.getElementById("tourPathShowDiv"),f=document.getElementById("tourPathConf"),k=document.getElementById("ptzControlAreaDiv");254<a&&(T.style.height=a+48+"px",k.style.height=a-254+"px",a=parseInt(k.style.height),1!=ha&&(d.style.height=
a-32+"px",c.style.height=a-32+"px",e.style.height=a-32+"px",f.style.height=a-32+"px",n.style.height=a-158+"px"))};PtzControl.prototype.update3DStatus=function(){ta=!0;m.set3DPositionStatus(0);var a=document.getElementById("position3D");$(a).removeClass("ptz3DIconPress").addClass("ptz3DIconNormal")};n();1!=ha&&k();var Ca=document.createElement("li");Ca.className="ptzControlTitle";Ca.id="prePointTitle";Ca.innerHTML=label.preset;var Da=document.createElement("li");Da.className="ptzControlTitleM";Da.id=
"tourScanTitle";Da.innerHTML=label.tour;var Ea=document.createElement("li");Ea.className="ptzControlTitle";Ea.id="patternScanTitle";Ea.innerHTML=label.pattern;Ia.appendChild(Ca);Ia.appendChild(Da);Ia.appendChild(Ea);pa.appendChild(Ia);L.appendChild(pa);T.appendChild(L);pa.style.display="none";1!=ha&&(da.className="ptzBorderCon1",L.className="ptzControlAreaCon",ja.className="ptzControlToolDiv",H.className="ptzControlToolCon",za.style.display="block",pa.style.display="block",pb());yb();zb()}}}
function PTZPlanActItems(qa){this.maxItemCnt=qa;this.actionArray;this.newActObj=null;this.newWeekday=-1;this.operatingActObj=null;this.operatingWeekday=-1;this.opStretchFixedPoint="start";this.operateType="none";void 0==PTZPlanActItems.prototype._init&&(PTZPlanActItems.prototype.MINONEHOUR=60,PTZPlanActItems.prototype.HOURONEDAY=24,PTZPlanActItems.prototype.weekArray=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun],PTZPlanActItems.prototype.PTZtypeArr=[label.cronjobClose,label.autoScan,
label.frameScan,label.randomScan,label.tourScan,label.pattenScan,label.presentPoint,label.panoramicScan,label.vertScan,label.ballCamReboot,label.ballCamVerify,label.assistOutput],PTZPlanActItems.prototype.opTypeArray=["none","new","move","stretch","error"],PTZPlanActItems.prototype.accuracy=5,PTZPlanActItems.prototype._init=function(){this._dataInit()},PTZPlanActItems.prototype._dataInit=function(){this.actionArray=[];for(var c=0;c<this.weekArray.length;c++)this.actionArray.push([])},PTZPlanActItems.prototype.eachActItems=
function(c,m){for(var h=0;h<this.actionArray[c].length;h++)"function"==typeof m&&m(c,this.actionArray[c][h])},PTZPlanActItems.prototype._getValidTime=function(c){return 0>c?0:c>this.MINONEHOUR*this.HOURONEDAY?this.MINONEHOUR*this.HOURONEDAY:c},PTZPlanActItems.prototype.checkTime=function(c,m,h){h=this.actionArray[h];for(var t=!1,q=0;q<h.length;q++)if(c>h[q].startTime&&c<h[q].endTime||m>h[q].startTime&&m<h[q].endTime||c<=h[q].startTime&&m>=h[q].endTime||c>=h[q].startTime&&m<=h[q].endTime){t=!0;break}return t},
PTZPlanActItems.prototype.getItemInfo=function(c,m){var h=this.actionArray[c];m=this._getValidTime(m);for(var t=0;t<h.length;t++)if(m>=h[t].startTime&&m<=h[t].endTime)return this._deepCyItem(h[t]);return-1},PTZPlanActItems.prototype.selectActItem=function(c,m){if(null!=this.operatingActObj&&this.operatingWeekday==c&&m>=this.operatingActObj.startTime&&m<=this.operatingActObj.endTime)this.operatingActObj.endTime>this.operatingActObj.startTime&&this.actionArray[this.operatingWeekday].push(this.operatingActObj),
this.operatingActObj=null,this.operatingWeekday=-1;else{var h=this.actionArray[c];m=this._getValidTime(m);for(var t=0;t<h.length;t++)if(m>=h[t].startTime&&m<=h[t].endTime){null!=this.operatingActObj&&this.operatingActObj.endTime>this.operatingActObj.startTime&&this.actionArray[this.operatingWeekday].push(this.operatingActObj);this.operatingActObj=h.splice(t,1)[0];this.operatingWeekday=c;break}}},PTZPlanActItems.prototype.unSelectActItem=function(){null!=this.operatingActObj&&(this.operatingActObj.endTime>
this.operatingActObj.startTime&&this.actionArray[this.operatingWeekday].push(this.operatingActObj),this.operatingActObj=null,this.operatingWeekday=-1)},PTZPlanActItems.prototype.startOperation=function(c,m,h){c=this._getValidTime(c);"none"==this.operateType&&null!=this.operatingActObj&&this.operatingWeekday==m&&(c>=this.operatingActObj.startTime-this.accuracy&&c<=this.operatingActObj.startTime+this.accuracy?(this.opStretchFixedPoint="start",this.operateType="stretch"):c>=this.operatingActObj.endTime-
this.accuracy&&c<=this.operatingActObj.endTime+this.accuracy?(this.opStretchFixedPoint="end",this.operateType="stretch"):c>this.operatingActObj.startTime+this.accuracy&&c<this.operatingActObj.endTime-this.accuracy&&(this.operateType="move"));var t=this.actionArray[m].length+(null!=this.operatingActObj&&this.operatingWeekday==m?1:0);"none"==this.operateType&&null==this.newActObj&&t<this.maxItemCnt&&!this.checkTime(c,c,m)&&(this.operateType="new",this.newActObj={startTime:c,endTime:c,actType:h,actId:1},
this.newWeekday=m);return this.operateType},PTZPlanActItems.prototype.opNewItem=function(c){if(null!=this.newActObj&&"new"==this.operateType){var m=this.actionArray[this.newWeekday];c=this._getValidTime(c);c=c<this.newActObj.startTime?this.newActObj.startTime:c;for(var h=0;h<m.length;h++)m[h].startTime>this.newActObj.startTime&&(c=c>m[h].startTime?m[h].startTime:c);this.newActObj.endTime=c}},PTZPlanActItems.prototype.opStretchItem=function(c){if(null!=this.operatingActObj&&"stretch"==this.operateType){var m=
this.actionArray[this.operatingWeekday];c=this._getValidTime(c);if("end"==this.opStretchFixedPoint){for(var h=0;h<m.length;h++)m[h].startTime>this.operatingActObj.startTime&&(c=c>m[h].startTime?m[h].startTime:c);this.operatingActObj.endTime=c<=this.operatingActObj.startTime?this.operatingActObj.startTime+1:c}else if("start"==this.opStretchFixedPoint){for(h=0;h<m.length;h++)m[h].endTime<this.operatingActObj.endTime&&(c=c<m[h].endTime?m[h].endTime:c);this.operatingActObj.startTime=c>=this.operatingActObj.endTime?
this.operatingActObj.endTime-1:c}}},PTZPlanActItems.prototype.opMoveItem=function(c){if(null!=this.operatingActObj&&"move"==this.operateType){var m=this.actionArray[this.operatingWeekday],h=this.operatingActObj.endTime-this.operatingActObj.startTime;if(0>c){c=0>this.operatingActObj.startTime+c?-this.operatingActObj.startTime:c;c=this.operatingActObj.startTime+c;for(var t=0;t<m.length;t++)m[t].endTime<this.operatingActObj.endTime&&(c=m[t].endTime>c?m[t].endTime:c);var q=c+h}else{c=this.operatingActObj.endTime+
c>this.MINONEHOUR*this.HOURONEDAY?this.MINONEHOUR*this.HOURONEDAY-this.operatingActObj.endTime:c;q=this.operatingActObj.endTime+c;for(t=0;t<m.length;t++)m[t].startTime>this.operatingActObj.startTime&&(q=m[t].startTime<q?m[t].startTime:q);c=q-h}this.operatingActObj.startTime=c;this.operatingActObj.endTime=q}},PTZPlanActItems.prototype.endOperation=function(){this.newActObj&&(this.newActObj.endTime>this.newActObj.startTime&&this.actionArray[this.newWeekday].push(this.newActObj),this.newActObj=null,
this.newWeekday=-1);this.operateType="none"},PTZPlanActItems.prototype.cloneActItems=function(c){for(var m=[],h=0;h<this.actionArray[c].length;h++)m.push(this._deepCyItem(this.actionArray[c][h]));null!=this.operatingActObj&&this.operatingWeekday==c&&this.operatingActObj.endTime>this.operatingActObj.startTime&&(h=this._deepCyItem(this.operatingActObj),h.flag="operating",m.push(h));null!=this.newActObj&&this.newWeekday==c&&this.newActObj.endTime>this.newActObj.startTime&&(c=this._deepCyItem(this.newActObj),
c.flag="new",m.push(c));m.sort(function(c,h){return c.startTime<h.startTime?-1:c.startTime>h.startTime?1:0});return m},PTZPlanActItems.prototype.setWeekItems=function(c,m){null!=this.operatingActObj&&this.operatingWeekday==c&&(this.operatingActObj=null,this.operatingWeekday=-1);this.actionArray[c]=[];for(var h=0;h<m.length;h++)h<this.maxItemCnt&&this.actionArray[c].push(this._deepCyItem(m[h]))},PTZPlanActItems.prototype._deepCyItem=function(c){return{startTime:c.startTime,endTime:c.endTime,actType:c.actType,
actId:c.actId}},PTZPlanActItems.prototype.cyActItems=function(c,m){for(var h=[],t=0;t<this.actionArray[c].length;t++)h.push(this._deepCyItem(this.actionArray[c][t]));null!=this.operatingActObj&&this.operatingWeekday==c&&this.operatingActObj.endTime>this.operatingActObj.startTime?h.push(this._deepCyItem(this.operatingActObj)):null!=this.operatingActObj&&this.operatingWeekday==m&&(this.operatingActObj=null,this.operatingWeekday=-1);this.actionArray[m]=h},PTZPlanActItems.prototype.delActItem=function(c,
m){if(null!=this.operatingActObj&&this.operatingWeekday==m&&this.operatingActObj.endTime>=c&&c>=this.operatingActObj.startTime)this.operatingActObj=null,this.operatingWeekday=-1;else for(var h=0;h<this.actionArray[m].length;h++){var t=this.actionArray[m][h];if(t.endTime>=c&&c>=t.startTime){this.actionArray[m].splice(h,1);break}}});this._init()}
function PTZPlanSet(qa,c){this.maxItemCntEachDay=10;this.tableDisabled=!1;this.curPTZType=-1;this.curWeekday;this.curMouseStat="none";this.oldMousePosX=0;this.PTZPlanData;this.eventTarget=null;this.eventPageX=0;this.errMsg=null;this.dateCon=id(qa);this.tableDiv;if(void 0==PTZPlanSet.prototype._init){PTZPlanSet.prototype.CHARCODEOFA=65;PTZPlanSet.prototype.MINONEHOUR=60;PTZPlanSet.prototype.HOURONEDAY=24;PTZPlanSet.prototype.PTZtypeArr=[];for(var m=[label.cronjobClose,label.tourScan,label.presentPoint,
label.autoScan,label.frameScan,label.randomScan,label.pattenScan,label.panoramicScan,label.vertScan,label.ballCamReboot,label.ballCamVerify],h="disable tour preset auto_scan frame_scan random_scan pattern panorama_scan tilt_scan reboot adjust".split(" "),t=c.plan_support_type,q=0;q<h.length;q++)for(var C=0;C<t.length;C++)h[q]==t[C]&&PTZPlanSet.prototype.PTZtypeArr.push(m[q]);PTZPlanSet.prototype.weekArray=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun];PTZPlanSet.prototype.mouseStatArray=
["none","new","move","stretch","error"];PTZPlanSet.prototype.tblCellWidth=24;PTZPlanSet.prototype.tblCellBorderWidth=1;PTZPlanSet.prototype._init=function(a){this._initOptions();this.PTZPlanData=new PTZPlanActItems(this.maxItemCntEachDay);this._typeListInit();this._hourListInit();this._weekListInit();this._dateTableInit();this._editDlgInit();this._dateTblEventBind()};PTZPlanSet.prototype._initOptions=function(){for(var a in c)"undefined"!=typeof this[a]&&(this[a]=c[a])};PTZPlanSet.prototype._typeListInit=
function(){var a,c,k,e,f;a=document.createElement("ul");a.id="typeList";a.className="line overflowH typeUl";this.dateCon.appendChild(a);for(var h=0,m=this.PTZtypeArr.length;h<m;h++){c=document.createElement("li");c.className="typeLi";if(5==h||11==h)c.className="typeLi right";f="CJType"+String.fromCharCode(this.CHARCODEOFA+h);k=document.createElement("i");k.id=f;k.setAttribute("name","actTypeChk");k.setAttribute("value",h);e=document.createElement("label");e.className="des desH1";e.setAttribute("for",
f);e.innerHTML=this.PTZtypeArr[h];c.appendChild(k);c.appendChild(e);a.appendChild(c)}var q=this;$("i[name=actTypeChk]").addClass("rdObj").attr("checked","false").removeClass("rdObjCheck");$("i[name=actTypeChk]").parent().click(function(){var a=$("i[name=actTypeChk]");a.attr("checked","false").removeClass("rdObjCheck");a.parent().removeClass("checked");a=$(this).addClass("checked").find("i[name=actTypeChk]").addClass("rdObjCheck").attr("checked","true");q.curPTZType=parseInt(a.attr("value"))});$.each($("[name = actTypeChk]"),
function(a,c){$(c).addClass("clor"+String.fromCharCode(q.CHARCODEOFA+a))})};PTZPlanSet.prototype._hourListInit=function(){var a=document.createElement("div"),c,k,e=this;a.className="psHourList";for(var f=0;24>=f;f++)c=document.createElement("div"),c.className="psHourLi",k=document.createElement("span"),k.innerHTML=f,c.appendChild(k),k.onclick=function(a){return function(){e.tableDisabled||(e._isColFullOfCurType(a)?e.setHourToType(a,e.TYPE_NULL):e.setHourToType(a,e.curType))}}(f),a.appendChild(c);
this.dateCon.appendChild(a);this.hourList=a};PTZPlanSet.prototype._weekListInit=function(){var a=document.createElement("ul"),c;a.className="psWeekList2";for(var k=0,e=this.weekArray.length;k<e;k++)c=document.createElement("li"),0==k&&(c.className="firWeekLi"),c.innerHTML=this.weekArray[k],c.onclick=function(a){return function(){}}(k),a.appendChild(c);this.dateCon.appendChild(a);this.weekList=a};PTZPlanSet.prototype._dateTableInit=function(){this.tableDiv=document.createElement("div");this.tableDiv.className=
"tableDiv";this.dateCon.appendChild(this.tableDiv);this._copyDlgCreate();this._dateCellCreate();this._infoBoxCreate()};PTZPlanSet.prototype._infoBoxCreate=function(){var a=$("<div id='infoBox'></div>").appendTo($(this.tableDiv)).addClass("disNone");$("<ul><li id='ibTypeLi'></li><li id='ibTimeLi'></li></ul>").appendTo(a);$("<div class='triangle'></div>").appendTo(a)};PTZPlanSet.prototype._copyDlgCreate=function(){var a=this,c=$("<div id='cyDivF'></div>").appendTo($(this.tableDiv)).addClass("disNone"),
k=$("<div class='cyDiv'></div>");k.append("<div class='cyDivTitle'><label>"+label.cpyPlan+"</label><label id='cpyTitle'>"+this.weekArray[0]+"</label></div>");k.append("<div class='cpDivH'><span>"+label.cpyPlanTo+"</span><span class='floatRight'><i id='cpSelAll' name='cpToAll'></i><label>"+label.chooseAll+"</label></span></div>");var e=$("<iframe frameborder='0' class='bgIfm' allowTransparency='true'></iframe>");c.append(k).append(e);initCheckInput("cpToAll",function(a,c){$("#cyDivF i[name=cpTo]").each(function(c){$(this).hasClass("invalidCbox")||
changeCheckInput(this.id,a)})});c=$("<div class='cpDivCon'></div>").appendTo(k);for(index=0;index<this.weekArray.length;index++)e="cpToW"+index,index<this.weekArray.length-1?c.append("<i id='"+e+"' name='cpTo'></i><label>"+this.weekArray[index]+"</label>"):c.append("<i id='"+e+"' name='cpTo'></i><label class='lastChild'>"+this.weekArray[index]+"</label>");initCheckInput("cpTo",function(){var a=$("#cyDivF i[name=cpTo]").not(".invalidCbox").not(".chObjCheck").length;changeCheckInput("cpSelAll",0==a)});
k=$("<div class='btnDiv'></div>").appendTo(k);$("<input class='subBtnB btnA' id='cyCancel' type='button' value='"+btn.cancel+"'>").appendTo(k).click(function(){$("#cyDivF").addClass("disNone")});$("<input class='subBtn btnA' id='cyOk' type='button' value='"+btn.ok+"'>").appendTo(k).click(function(){var c=$("#cyDivF i[name=cpTo]").index($(".invalidCbox"));$("#cyDivF i[name=cpTo]").each(function(e){$(this).hasClass("chObjCheck")&&(a.PTZPlanData.cyActItems(c,e),a._editDlgShow(),a._render(e))});$("#cyDivF").addClass("disNone")})};
PTZPlanSet.prototype._dateCellCreate=function(){for(var a,c=this.tableDiv,k=this,e=[],f=0;24>f;f++)e.push(f);for(e=0;e<this.weekArray.length;e++)f=$("<div></div>").appendTo($(c)).get(0),a=document.createElement("div"),a.className="cjTrDiv",0==e&&(a.className+=" firTr"),f.appendChild(a),a=$(a).offset(),$("<div class='cjTrBkDiv'></div>").appendTo($(f)).offset({top:a.top,left:a.left}),a=document.createElement("div"),a.className="cyBtn disNone",f.appendChild(a);$("div.tableDiv div.cyBtn").click(function(a){$("#cyDivF").removeClass("disNone");
$("#cyDivF .bgIfm").width($("body").width()).height($("body").height());changeCheckInput("cpSelAll",!1);$("#cyDivF i[name=cpTo]").each(function(a){$("#"+this.id).attr("disabled",!1).removeClass("invalidCbox");changeCheckInput(this.id,!1)});$("#cyDivF label").removeClass("curNoLabel");a=$("div.tableDiv div.cyBtn").index(a.currentTarget);$("#cpToW"+a).attr("disabled",!0).addClass("invalidCbox");$("#cpToW"+a+"+label").addClass("curNoLabel");$("#cyDivF #cpyTitle").text(k.weekArray[a])})};PTZPlanSet.prototype._editDlgInit=
function(){var a=this,c=$("<div id='editDiv' class='cjEdDiv'></div>"),k=$("<ul class='cjEdUl'></ul>");c.append(k).append($("<div class='triangle'></div>")).addClass("disNone").appendTo($(this.dateCon));for(var e=[],f=0;f<this.PTZtypeArr.length;f++)e.push({str:this.PTZtypeArr[f],value:f});e=[{liId:"typeLi",label:label.type,selConId:"typeSel",visible:!0,options:e,value:1,callback:function(e){var f=c.outerHeight();e==$.inArray(label.presentPoint,a.PTZtypeArr)?($("#presentIdLi").removeClass("disNone"),
$("#tourIdLi").addClass("disNone"),$("#patternIdLi").addClass("disNone"),c.addClass("cjEdDivEx")):e==$.inArray(label.tourScan,a.PTZtypeArr)?($("#presentIdLi").addClass("disNone"),$("#tourIdLi").removeClass("disNone"),$("#patternIdLi").addClass("disNone"),c.addClass("cjEdDivEx")):e==$.inArray(label.pattenScan,a.PTZtypeArr)?($("#presentIdLi").addClass("disNone"),$("#tourIdLi").addClass("disNone"),$("#patternIdLi").removeClass("disNone"),c.addClass("cjEdDivEx")):($("#presentIdLi").addClass("disNone"),
$("#tourIdLi").addClass("disNone"),$("#patternIdLi").addClass("disNone"),c.removeClass("cjEdDivEx"));e=c.outerHeight();f!=e&&(c.css("top",parseInt(c.css("top"))+f-c.outerHeight()+"px"),$("#editDiv div.triangle").css("top",e+"px"))}},{liId:"presentIdLi",label:label.actId,selConId:"presentIdSel",visible:!1,options:[{str:"预置点1",value:1},{str:"预置点2",value:2},{str:"预置点3",value:3},{str:"预置点4",value:4},{str:"预置点5",value:5},{str:"预置点6",value:6},{str:"预置点7",value:7},{str:"预置点8",value:8}],value:1,callback:null},
{liId:"tourIdLi",label:label.actId,selConId:"tourIdSel",visible:!1,options:[{str:"巡航路径1",value:1},{str:"巡航路径2",value:2},{str:"巡航路径3",value:3},{str:"巡航路径4",value:4},{str:"巡航路径5",value:5},{str:"巡航路径6",value:6},{str:"巡航路径7",value:7},{str:"巡航路径8",value:8}],value:1,callback:null},{liId:"patternIdLi",label:label.actId,selConId:"patternIdSel",visible:!1,options:[{str:"花样路径1",value:1},{str:"花样路径2",value:2},{str:"花样路径3",value:3},{str:"花样路径4",value:4}],value:1,callback:null}];for(f=0;f<e.length;f++){var h=
e[f],m=$("<span class='selCon'><span id='"+h.selConId+"' class='select'><span class='value hsValueA'></span><i class='arrow'></i></span></span>"),m=$("<li class='line lineD' id='"+h.liId+"'></li>").append(m).appendTo(k);h.visible||m.addClass("disNone");selectInit(h.selConId,h.options,h.value,h.callback)}$("<li class='cjeTimeTbl'></li>").appendTo(k).append($("<div><input class='text peTextA' id='cjeSHour' maxlength='2' value='00'></div>")).append($("<label> : </label>")).append($("<div><input class='text peTextA' id='cjeSMin' maxlength='2' value='00'></div>")).append($("<label> - </label>")).append($("<div><input class='text peTextA' id='cjeEHour' maxlength='2' value='00'></div>")).append($("<label> : </label>")).append($("<div><input class='text peTextA' id='cjeEMin' maxlength='2' value='00'></div>"));
$("<li class='ejeTips'><label></label></li>").appendTo(k);k=$("<div class='btnDiv'></div>").appendTo(k);$("<input class='subBtnB btnA3' id='cjeCancel' type='button' value='"+btn.cancel+"'>").appendTo(k).click(function(){a._editDlgHide(this.value)});$("<input class='subBtn btnA3' id='cjeOk' type='button' value='"+btn.ok+"'>").appendTo(k).click(function(){a._editDlgHide(this.value)})};PTZPlanSet.prototype._editDlgShow=function(){for(var a=$("#editDiv"),c=$("#editDiv div.triangle"),k=0;k<this.weekArray.length;k++)for(var e=
$("div.cjTrDiv:eq("+k+") div.cjTdDiv"),f=0;f<e.length;f++)if($(e[f]).hasClass("TdSelect")){$(e[f]).removeClass("TdSelect");var h=parseFloat($(e[f]).get(0).style.width);$(e[f]).get(0).style.width=h+"px";break}if(this.PTZPlanData.operatingActObj){e=$("div.cjTrDiv:eq("+this.PTZPlanData.operatingWeekday+") div.cjTdDiv");for(f=0;f<e.length;f++)if(k=$(e[f]),h=this._pos2TimeInt(k.width()/2+k.offset().left),h>=this.PTZPlanData.operatingActObj.startTime&&h<=this.PTZPlanData.operatingActObj.endTime){h=parseFloat(k.get(0).style.width);
k.get(0).style.width=h+"px";k.addClass("TdSelect");break}$("div.tableDiv #infoBox").addClass("disNone");a.removeClass("disNone");f=a.css("left","0").css("top","0").offset();e=(this._timeInt2Pos(this.PTZPlanData.operatingActObj.startTime)+this._timeInt2Pos(this.PTZPlanData.operatingActObj.endTime)-a.outerWidth())/2-f.left;f=$("div.tableDiv div.cjTrDiv:eq("+this.PTZPlanData.operatingWeekday+")").offset().top-a.outerHeight()-10-f.top;a.css("top",f+"px").css("left",e+"px");f=a.outerHeight();e=(a.outerWidth()-
14)/2;c.css("top",f+"px").css("left",e+"px");$("#typeSel").get(0).changeSel(this.PTZPlanData.operatingActObj.actType);this.PTZPlanData.operatingActObj.actType==$.inArray(label.presentPoint,this.PTZtypeArr)?$("#editDiv #presentIdSel").get(0).changeSel(this.PTZPlanData.operatingActObj.actId):this.PTZPlanData.operatingActObj.actType==$.inArray(label.tourScan,this.PTZtypeArr)?$("#editDiv #tourIdSel").get(0).changeSel(this.PTZPlanData.operatingActObj.actId):this.PTZPlanData.operatingActObj.actType==$.inArray(label.pattenScan,
this.PTZtypeArr)&&$("#editDiv #patternIdSel").get(0).changeSel(this.PTZPlanData.operatingActObj.actId);a=this._timeInt2Str(this.PTZPlanData.operatingActObj.startTime);$("#editDiv #cjeSHour").removeClass("errInput").get(0).value=a[0];$("#editDiv #cjeSMin").removeClass("errInput").get(0).value=a[1];a=this._timeInt2Str(this.PTZPlanData.operatingActObj.endTime);$("#editDiv #cjeEHour").removeClass("errInput").get(0).value=a[0];$("#editDiv #cjeEMin").removeClass("errInput").get(0).value=a[1];$("#editDiv li.ejeTips label").text("")}else a.addClass("disNone")};
PTZPlanSet.prototype._editDlgHide=function(a){if("undefined"!=typeof a)if(a==btn.ok&&null!=this.PTZPlanData.operatingActObj){a=this.PTZPlanData.operatingWeekday;var c=this._checkTimeStr(a);0<=c[0]&&0<=c[1]?(this.PTZPlanData.operatingActObj.startTime=c[0],this.PTZPlanData.operatingActObj.endTime=c[1],this.PTZPlanData.operatingActObj.actType=$("#editDiv #typeSel").get(0).value,this.PTZPlanData.operatingActObj.actType==$.inArray(label.presentPoint,this.PTZtypeArr)?this.PTZPlanData.operatingActObj.actId=
$("#editDiv #presentIdSel").get(0).value:this.PTZPlanData.operatingActObj.actType==$.inArray(label.tourScan,this.PTZtypeArr)?this.PTZPlanData.operatingActObj.actId=$("#editDiv #tourIdSel").get(0).value:this.PTZPlanData.operatingActObj.actType==$.inArray(label.pattenScan,this.PTZtypeArr)?this.PTZPlanData.operatingActObj.actId=$("#editDiv #patternIdSel").get(0).value:this.PTZPlanData.operatingActObj.actId=0,this.PTZPlanData.unSelectActItem(),this._render(a),$("#editDiv").addClass("disNone")):$("#editDiv li.ejeTips label").text(this.errMsg)}else{if(a==
btn.cancel)for(a=this.PTZPlanData.operatingWeekday,this.PTZPlanData.unSelectActItem(),$("#editDiv").addClass("disNone"),a=$("div.cjTrDiv:eq("+a+") div.cjTdDiv"),c=0;c<a.length;c++)if($(a[c]).hasClass("TdSelect")){$(a[c]).removeClass("TdSelect");var k=parseFloat($(a[c]).get(0).style.width);$(a[c]).get(0).style.width=k+"px";break}}else $("#editDiv").addClass("disNone")};PTZPlanSet.prototype._timeInt2Pos=function(a){var c=$("div.tableDiv div.cjTrDiv:eq(0)").offset().left,k=parseInt(a/this.MINONEHOUR);
return c+(this.tblCellBorderWidth+this.tblCellWidth)*k+a%this.MINONEHOUR*this.tblCellWidth/this.MINONEHOUR};PTZPlanSet.prototype._timeInt2RelPos=function(a){var c=parseInt(a/this.MINONEHOUR);return(this.tblCellWidth+this.tblCellBorderWidth)*c+a%this.MINONEHOUR*this.tblCellWidth/this.MINONEHOUR};PTZPlanSet.prototype._pos2TimeInt=function(a){var c=this.tblCellWidth+this.tblCellBorderWidth,k=$("div.tableDiv div.cjTrDiv:eq(0)").offset().left,e=parseInt((a-k)/c);a=parseInt(e*this.MINONEHOUR+(a-k)%c*this.MINONEHOUR/
this.tblCellWidth);return a=0>a?0:a>this.MINONEHOUR*this.HOURONEDAY?this.MINONEHOUR*this.HOURONEDAY:a};PTZPlanSet.prototype._timeStr2Int=function(a,c){var k=2==a.length&&a.match(/\d\d/)||1==a.length&&a.match(/\d/),e=2==c.length&&c.match(/\d\d/)||1==c.length&&c.match(/\d/);if(k&&e)return k=parseInt(a,10),e=parseInt(c,10),24<k||60<=e||24==k&&0<e?(null==this.errMsg&&(this.errMsg=errStr.ePlanTimeRangErr),-1):k*this.MINONEHOUR+e;null==this.errMsg&&(this.errMsg=0==a.length||0==c.length?errStr.ePlanNull:
errStr.ePlanTimeFormatErr);return-1};PTZPlanSet.prototype._timeInt2Str=function(a){var c=parseInt(a/this.MINONEHOUR);a%=this.MINONEHOUR;return[10>c?"0"+c:String(c),10>a?"0"+a:String(a)]};PTZPlanSet.prototype._checkTimeStr=function(a){this.errMsg=null;var c=$("#editDiv #cjeSHour").removeClass("errInput"),k=$("#editDiv #cjeSMin").removeClass("errInput"),e=$("#editDiv #cjeEHour").removeClass("errInput"),f=$("#editDiv #cjeEMin").removeClass("errInput"),h=this._timeStr2Int(c.get(0).value,k.get(0).value),
m=this._timeStr2Int(e.get(0).value,f.get(0).value);0>h||0>m?(0>h&&(c.addClass("errInput"),k.addClass("errInput")),0>m&&(e.addClass("errInput"),f.addClass("errInput"))):h>=m?(c.addClass("errInput"),k.addClass("errInput"),e.addClass("errInput"),f.addClass("errInput"),this.errMsg=errStr.ePlanTimeMinErr):this.PTZPlanData.checkTime(h,m,a)&&(c.addClass("errInput"),k.addClass("errInput"),e.addClass("errInput"),f.addClass("errInput"),this.errMsg=errStr.ePlanTimeCoverErr);return null!=this.errMsg?[-1,-1]:
[h,m]};PTZPlanSet.prototype._delDivCreate=function(a){var c=this,k=c._pos2TimeInt(a.offset().left+a.width()/2),e=$("div.cjTrDiv").index(a.parent());a=$("<div class='delDiv'></div>").addClass("disNone");$("<i class='delBtn'></i>").appendTo(a).click(function(a){c.PTZPlanData.delActItem(k,e);$("div.tableDiv #infoBox").addClass("disNone");c._editDlgShow();c._render(e);c.RemoveCursor();a.stopPropagation()}).mouseup(function(a){a.stopPropagation()}).mousedown(function(a){a.stopPropagation()}).mousemove(function(a){a.stopPropagation()});
return a};PTZPlanSet.prototype._ClearRender=function(){for(var a=0;a<this.weekArray.length;a++)$("div.tableDiv div.cjTrDiv:eq("+a+")").empty()};PTZPlanSet.prototype._render=function(a){var c=this;if(!(0>a||a>this.weekArray.length))for(var k=this.PTZPlanData.cloneActItems(a),e=$("div.tableDiv div.cjTrDiv:eq("+a+")").empty(),f=0,h=0;h<k.length;h++){var m=$("<div class='cjTdDiv cursorPointer'></div>");m.addClass("clor"+String.fromCharCode(this.CHARCODEOFA+k[h].actType)).appendTo(e);"operating"==k[h].flag&&
m.addClass("TdSelect");var q=this._timeInt2RelPos(k[h].startTime),t=this._timeInt2RelPos(k[h].endTime),t=t>e.width()?e.width():t,C=1>t-q?1:t-q,f=q-f,q=this.tblCellWidth-k[h].startTime%this.MINONEHOUR*this.tblCellWidth/this.MINONEHOUR;1>q&&(q=1);m.get(0).style.width=C+"px";m.get(0).style.marginLeft=f+"px";m.get(0).style.backgroundPosition=q+"px 0px";f=t;this._delDivCreate(m).appendTo(m);"undefined"!=typeof k[h].flag&&"new"==k[h].flag||m.hover(function(){var e=$(this).find("div.delDiv").removeClass("disNone"),
f=$(this).offset();e.offset({left:f.left+$(this).width()-e.width()/2,top:f.top-e.height()/2});e=c._pos2TimeInt(f.left+$(this).width()/2);e=c.PTZPlanData.getItemInfo(a,e);if(-1!=e){var h=$("div.tableDiv #infoBox").removeClass("disNone"),k=f.left+($(this).width()-h.outerWidth())/2,f=f.top-h.outerHeight()-8-2;h.offset({left:k,top:f});$("div.tableDiv #infoBox div.triangle").offset({left:k+h.outerWidth()/2-7,top:f+h.outerHeight()});f=c.PTZtypeArr[e.actType];c.PTZtypeArr[e.actType]==label.tourScan?f=f+
" : 巡航路径"+e.actId:c.PTZtypeArr[e.actType]==label.presentPoint?f=f+" : 预置点"+e.actId:c.PTZtypeArr[e.actType]==label.pattenScan&&(f=f+" : 花样路径"+e.actId);$("div.tableDiv #infoBox #ibTypeLi").text(f);f=c._timeInt2Str(e.startTime);e=c._timeInt2Str(e.endTime);e=f[0]+":"+f[1]+" - "+e[0]+":"+e[1];$("div.tableDiv #infoBox #ibTimeLi").text(e)}},function(){$(this).find("div.delDiv").addClass("disNone");$("div.tableDiv #infoBox").addClass("disNone")})}};PTZPlanSet.prototype.SetCursorMove=function(){$("div.PTZPlanSetDiv div.cjTdDiv").removeClass("cursorPointer").removeClass("cursorEResize").addClass("cursorMove");
$(document).removeClass("cursorEResize").addClass("cursorMove");$("div.PTZPlanSetDiv").removeClass("cursorEResize").addClass("cursorMove")};PTZPlanSet.prototype.SetCursorResize=function(){$("div.PTZPlanSetDiv div.cjTdDiv").removeClass("cursorPointer").removeClass("cursorMove").addClass("cursorEResize");$(document).removeClass("cursorMove").addClass("cursorEResize");$("div.PTZPlanSetDiv").removeClass("cursorMove").addClass("cursorEResize")};PTZPlanSet.prototype.RemoveCursor=function(){$(document).removeClass("cursorMove").removeClass("cursorEResize");
$("div.PTZPlanSetDiv div.cjTdDiv").removeClass("cursorMove").removeClass("cursorEResize").addClass("cursorPointer");$("div.PTZPlanSetDiv").removeClass("cursorMove").removeClass("cursorEResize")};PTZPlanSet.prototype._dateTblEventBind=function(){$(this.tableDiv);var a=this;ACCURACY=5;var c=function(c){var f=a._pos2TimeInt(c.pageX);a.RemoveCursor();if(c.pageX==a.eventPageX)a.PTZPlanData.endOperation(),a._editDlgShow(),a.curWeekday=-1,a.oldMousePosX=0;else{switch(a.curMouseStat){case "new":a.PTZPlanData.opNewItem(f);
a.PTZPlanData.endOperation();a._render(a.curWeekday);break;case "move":a.PTZPlanData.opMoveItem(f-a._pos2TimeInt(a.oldMousePosX));a.PTZPlanData.endOperation();a._render(a.curWeekday);a._editDlgShow();break;case "stretch":a.PTZPlanData.opStretchItem(f),a.PTZPlanData.endOperation(),a._render(a.curWeekday),a._editDlgShow()}a.curWeekday=-1;a.oldMousePosX=0;a.curMouseStat="none"}$(document).off("mousemove").off("mouseout").off("mouseup")},h=function(c){var f=a._pos2TimeInt(c.pageX);if(c.pageX!=a.eventPageX){switch(a.curMouseStat){case "new":a.PTZPlanData.opNewItem(f);
a._render(a.curWeekday);break;case "move":a.PTZPlanData.opMoveItem(f-a._pos2TimeInt(a.oldMousePosX));a._render(a.curWeekday);a._editDlgHide();break;case "stretch":a.PTZPlanData.opStretchItem(f),a._render(a.curWeekday),a._editDlgHide()}a.oldMousePosX=c.pageX;"stretch"==a.curMouseStat?a.SetCursorResize():"move"==a.curMouseStat&&a.SetCursorMove()}};$("div.tableDiv div.cjTrDiv",$(this.dateCon)).on({mousedown:function(e){if(!0!=a.tableDisabled){a.curWeekday=$("div.tableDiv").find("div.cjTrDiv").index(e.currentTarget);
var f=a._pos2TimeInt(e.pageX);a.curMouseStat=a.PTZPlanData.startOperation(f,a.curWeekday,a.curPTZType);"new"==a.curMouseStat&&-1==a.curPTZType?(a.PTZPlanData.endOperation(),showAlert(errStr.needAtcType)):"none"!=a.curMouseStat&&(a.oldMousePosX=e.pageX,$(document).on({mouseup:c,mousemove:h}),"stretch"==a.curMouseStat?a.SetCursorResize():"move"==a.curMouseStat&&a.SetCursorMove());a.eventTarget=e.currentTarget;a.eventPageX=e.pageX}},mouseup:function(c){!0!=a.tableDisabled&&null!=a.eventTarget&&a.eventPageX==
c.pageX&&(a.PTZPlanData.selectActItem(a.curWeekday,a._pos2TimeInt(c.pageX)),a._editDlgShow())},mousemove:function(c){var f=$("div.tableDiv div.cjTrDiv").index($(c.currentTarget));a.PTZPlanData.operatingActObj&&a.PTZPlanData.operatingWeekday==f&&"stretch"!=a.curMouseStat&&"move"!=a.curMouseStat&&(c=a._pos2TimeInt(c.pageX),c>=a.PTZPlanData.operatingActObj.startTime-ACCURACY&&c<=a.PTZPlanData.operatingActObj.startTime+ACCURACY||c>=a.PTZPlanData.operatingActObj.endTime-ACCURACY&&c<=a.PTZPlanData.operatingActObj.endTime+
ACCURACY?a.SetCursorResize():c>=a.PTZPlanData.operatingActObj.startTime+ACCURACY&&c<=a.PTZPlanData.operatingActObj.endTime-ACCURACY?a.SetCursorMove():a.RemoveCursor())},mouseleave:function(c){a.PTZPlanData.operatingActObj&&"stretch"!=a.curMouseStat&&"move"!=a.curMouseStat&&a.RemoveCursor()}});$("div.tableDiv > div").hover(function(c){!0!=a.tableDisabled&&$(c.currentTarget).find("div.cyBtn").removeClass("disNone")},function(c){!0!=a.tableDisabled&&$(c.currentTarget).find("div.cyBtn").addClass("disNone")})};
PTZPlanSet.prototype.setWeekData=function(a,c){this.PTZPlanData.operatingWeekday&&this.PTZPlanData.operatingWeekday==a&&this._editDlgHide();this.PTZPlanData.setWeekItems(a,c);this._render(a)};PTZPlanSet.prototype.getWeekData=function(a){return this.PTZPlanData.cloneActItems(a)};PTZPlanSet.prototype.enablePTZPlan=function(a){(this.tableDisabled=!Boolean(a))?($("div.PTZPlanSetDiv i[name=actTypeChk]").attr("disabled",!0),this._editDlgHide()):($("div.PTZPlanSetDiv i[name=actTypeChk]").attr("disabled",
!1),this._editDlgShow())}}this._init(c)};
