1; /* /bitrix/js/main/session.min.js?16498374162394*/ 2; /* /bitrix/js/main/core/core_window.min.js?176936442376324*/ 3; /* /bitrix/js/main/date/main.date.min.js?176936421921981*/ 4; /* /bitrix/js/main/core/core_date.min.js?178547615326793*/ 5; /* /bitrix/js/main/utils.js?163471336129279*/ 6; /* /bitrix/js/main/core/core_uf.min.js?176936442311652*/ 7 8; /* Start:"a:4:{s:4:"full";s:51:"/bitrix/js/main/core/core_uf.min.js?176936442311652";s:6:"source";s:31:"/bitrix/js/main/core/core_uf.js";s:3:"min";s:35:"/bitrix/js/main/core/core_uf.min.js";s:3:"map";s:35:"/bitrix/js/main/core/core_uf.map.js";}"*/ 9(function(){"use strict";BX.namespace("BX.Main.UF");if(typeof BX.Main.UF.Manager!=="undefined"){return}var e={};BX.Main.UF.Manager=function(){this.mode=this.mode||"";this.ajaxUrl="/bitrix/tools/uf.php"};BX.Main.UF.Manager.getEdit=function(e,t){return BX.Main.UF.EditManager.get(e,t)};BX.Main.UF.Manager.getView=function(e,t){return BX.Main.UF.ViewManager.get(e,t)};BX.Main.UF.Manager.prototype.get=function(e,t){if(!this.mode){this.displayError(["No mode set. Use BX.UF.EditManager or BX.UF.ViewManager"]);return}return this.query(this.mode,{FIELDS:e.FIELDS,FORM:e.FORM||"",CONTEXT:e.CONTEXT||"",MEDIA_TYPE:e.MEDIA_TYPE||""},t)};BX.Main.UF.Manager.prototype.add=function(e,t){if(!this.mode){this.displayError(["No mode set. Use BX.UF.EditManager or BX.UF.ViewManager"]);return}return this.query(this.mode,{action:"add",FIELDS:e.FIELDS,FORM:e.FORM||""},t)};BX.Main.UF.Manager.prototype.update=function(e,t){if(!this.mode){this.displayError(["No mode set. Use BX.UF.EditManager or BX.UF.ViewManager"]);return}return this.query(this.mode,{action:"update",FIELDS:e.FIELDS,FORM:e.FORM||""},t)};BX.Main.UF.Manager.prototype.delete=function(e,t){if(!this.mode){this.displayError(["No mode set. Use BX.UF.EditManager or BX.UF.ViewManager"]);return}return this.query(this.mode,{action:"delete",FIELDS:e.FIELDS,FORM:e.FORM||""},t)};BX.Main.UF.Manager.prototype.query=function(e,t,n){BX.ajax({dataType:"json",url:this.ajaxUrl,method:"POST",data:this.prepareQuery(e,t),onsuccess:this.queryCallback(n)})};BX.Main.UF.Manager.prototype.prepareQuery=function(e,t){var n=t||{};n.mode=e;n.lang=BX.message("LANGUAGE_ID")||"";n.tpl=BX.message("UF_SITE_TPL")||"";n.tpls=BX.message("UF_SITE_TPL_SIGN")||"";n.sessid=BX.bitrix_sessid();return n};BX.Main.UF.Manager.prototype.queryCallback=function(e){var t=BX.proxy(this.processResult,this);return function(n){t(n,e)}};BX.Main.UF.Manager.prototype.processResult=function(e,t){var n="";if(BX.type.isArray(e.ASSET)){n+=e.ASSET.join("\n")}if(!!e.ERROR){this.displayError(e.ERROR)}return BX.html(null,n).then((function(){if(!!t){t(e.FIELD)}}))};BX.Main.UF.Manager.prototype.displayError=function(e){for(var t in e){if(e.hasOwnProperty(t)){console.error(e[t])}}};BX.Main.UF.Manager.prototype.registerField=function(t,n,i){e[t]={FIELD:n,NODE:i}};BX.Main.UF.Manager.prototype.unRegisterField=function(t){if(!!e[t]){delete e[t]}};BX.Main.UF.ViewManager=function(){BX.Main.UF.ViewManager.superclass.constructor.apply(this,arguments);this.mode="main.view"};BX.extend(BX.Main.UF.ViewManager,BX.Main.UF.Manager);BX.Main.UF.EditManager=function(){BX.Main.UF.EditManager.superclass.constructor.apply(this,arguments);this.mode="main.edit"};BX.extend(BX.Main.UF.EditManager,BX.Main.UF.Manager);BX.Main.UF.EditManager.prototype.validate=function(t,n){if(t.length>0){var i=[];for(var a=0;a<t.length;a++){var r=BX.Main.UF.Factory.getValue(t[a]);if(r!==null){i.push({ENTITY_ID:e[t[a]].FIELD.ENTITY_ID,FIELD:e[t[a]].FIELD.FIELD,ENTITY_VALUE_ID:e[t[a]].FIELD.ENTITY_VALUE_ID,VALUE:r})}}return this.query(this.mode,{action:"validate",FIELDS:i},n)}else{this.queryCallback(n)({FIELD:[]})}};BX.Main.UF.BaseType=function(){};BX.Main.UF.BaseType.prototype.addRow=function(e,t){var n=t.parentNode.getElementsByTagName("span");if(n&&n.length>0&&n[0]){var i=n[0].parentNode;var a=this.getClone(n[n.length-1],e);if(i===t.parentNode){i.insertBefore(a,t)}else{i.appendChild(a)}}};BX.Main.UF.BaseType.prototype.addMobileRow=function(e,t){var n=t.parentNode.getElementsByTagName("span");if(n&&n.length&&n[0]){var i=n[0].parentNode;var a=this.getClone(n[n.length-1],e);var r=a.firstElementChild;var o=r.getAttribute("name");var s=/\[(\d)]/;var p=o.replace(s,(function(e,t){t=parseInt(t)+1;return"["+t+"]"}));var l=false;var F=false;var u=null;r.setAttribute("name",p);
9if(r.hasChildNodes()){r.childNodes.forEach((function(e,t,n){if(!F&&e.attributes!==undefined&&e.tagName==="INPUT"){e.setAttribute("name",p);F=e.getAttribute("id");l=F+"_1";u=e.getAttribute("data-user-field-type-name")}if(F&&e.attributes!==undefined&&e.id!==undefined){var i=e.getAttribute("id");if(i!==F){e.setAttribute("id",i.replace(F,l))}else{e.setAttribute("id",l)}}}))}if(i===t.parentNode){i.insertBefore(a,t)}else{i.appendChild(a)}if(l){BX.onCustomEvent("onAddMobileUfField",[l,u])}}};BX.Main.UF.BaseType.prototype.getClone=function(e,t){var n=e.cloneNode(true);var i=this.findInput(n,t);for(var a=0;a<i.length;a++){i[a].value=""}return n};BX.Main.UF.BaseType.prototype.findInput=function(e,t){return BX.findChildren(e,{tagName:/INPUT|TEXTAREA|SELECT/i,attribute:{name:t}},true)};BX.Main.UF.BaseType.prototype.isEmpty=function(t){var n=this.getNode(t),i=t+(e[t].FIELD.MULTIPLE==="Y"?"[]":"");if(!BX.isNodeInDom(n)){console.error("Node for field "+t+" is already removed from DOM")}var a=this.findInput(n,i);if(a.length<=0){console.error("Unable to find field "+t+" in the registered node")}else{for(var r=0;r<a.length;r++){if(a[r].value!==""){return false}}}return true};BX.Main.UF.BaseType.prototype.getValue=function(t){var n=this.getNode(t),i=t+(e[t].FIELD.MULTIPLE==="Y"?"[]":""),a=e[t].FIELD.MULTIPLE==="Y"?[]:"";if(!BX.isNodeInDom(n)){console.error("Node for field "+t+" is already removed from DOM")}var r=this.findInput(n,i);if(r.length<=0){var o=n.children.length?n.children[0]:false;if(!BX.util.in_array(e[t].FIELD.USER_TYPE_ID,["crm","employee"])&&(!o||o.getAttribute("data-has-input")!=="no")){console.error("Unable to find field "+t+" in the registered node")}}else{for(var s=0;s<r.length;s++){if(r[s].tagName==="INPUT"&&(r[s].type==="radio"||r[s].type==="checkbox")&&!r[s].checked){continue}if(!BX.Type.isStringFilled(r[s].value)){continue}if(e[t].FIELD.MULTIPLE==="Y"){a.push(r[s].value)}else{a=r[s].value;break}}}return a};BX.Main.UF.BaseType.prototype.focus=function(t){var n=this.getNode(t),i=t+(e[t].FIELD.MULTIPLE==="Y"?"[]":"");if(!BX.isNodeInDom(n)){console.error("Node for field "+t+" is already removed from DOM")}var a=this.findInput(n,i);if(a.length>0){BX.focus(a[0])}};BX.Main.UF.BaseType.prototype.getNode=function(t){return e[t].NODE};BX.Main.UF.TypeBoolean=function(){};BX.extend(BX.Main.UF.TypeBoolean,BX.Main.UF.BaseType);BX.Main.UF.TypeBoolean.USER_TYPE_ID="boolean";BX.Main.UF.TypeBoolean.prototype.isEmpty=function(e){return false};BX.Main.UF.TypeInteger=function(){};BX.extend(BX.Main.UF.TypeInteger,BX.Main.UF.BaseType);BX.Main.UF.TypeInteger.USER_TYPE_ID="integer";BX.Main.UF.TypeDouble=function(){};BX.extend(BX.Main.UF.TypeDouble,BX.Main.UF.BaseType);BX.Main.UF.TypeDouble.USER_TYPE_ID="double";BX.Main.UF.TypeSting=function(){};BX.extend(BX.Main.UF.TypeSting,BX.Main.UF.BaseType);BX.Main.UF.TypeSting.USER_TYPE_ID="string";BX.Main.UF.TypeUrl=function(){};BX.extend(BX.Main.UF.TypeUrl,BX.Main.UF.BaseType);BX.Main.UF.TypeUrl.USER_TYPE_ID="url";BX.Main.UF.TypeStingFormatted=function(){};BX.extend(BX.Main.UF.TypeStingFormatted,BX.Main.UF.TypeSting);BX.Main.UF.TypeStingFormatted.USER_TYPE_ID="string_formatted";BX.Main.UF.TypeEnumeration=function(){};BX.extend(BX.Main.UF.TypeEnumeration,BX.Main.UF.BaseType);BX.Main.UF.TypeEnumeration.USER_TYPE_ID="enumeration";BX.Main.UF.TypeEnumeration.prototype.findInput=function(e,t){var n=BX.Main.UF.TypeEnumeration.superclass.findInput.apply(this,arguments);if(n.length>0){for(var i=0;i<n.length;i++){if(n[i].tagName==="INPUT"&&n[i].type==="hidden"&&n.length>1){delete n[i];break}}}return BX.util.array_values(n)};BX.Main.UF.TypeEnumeration.prototype.focus=function(t){if(e[t]&&e[t].FIELD.SETTINGS.DISPLAY==="UI"&&BX.type.isElementNode(e[t].NODE)){BX.fireEvent(e[t].NODE,"focus")}else{BX.Main.UF.TypeEnumeration.superclass.focus.apply(this,arguments)}};BX.Main.UF.TypeDate=function(){};BX.extend(BX.Main.UF.TypeDate,BX.Main.UF.BaseType);BX.Main.UF.TypeDate.USER_TYPE_ID="date";BX.Main.UF.TypeDate.prototype.focus=function(t){var n=t+(e[t].FIELD.MULTIPLE==="Y"?"[]":"");var i=this.findInput(this.getNode(t),n);if(i.length>0){BX.fireEvent(i[0],"click")}BX.Main.UF.TypeDate.superclass.focus.apply(this,arguments)};BX.Main.UF.TypeDateTime=function(){};BX.extend(BX.Main.UF.TypeDateTime,BX.Main.UF.TypeDate);BX.Main.UF.TypeDateTime.USER_TYPE_ID="datetime";BX.Main.UF.TypeFile=function(){};BX.extend(BX.Main.UF.TypeFile,BX.Main.UF.BaseType);BX.Main.UF.TypeFile.USER_TYPE_ID="file";BX.Main.UF.TypeFile.prototype.findInput=function(e,t){var n=BX.Main.UF.TypeFile.superclass.findInput.apply(this,arguments);if(n.length<=0){n=BX.findChildren(e,{tagName:/INPUT/i,attribute:{type:"file",name:/^bxu_files/}},true)}return n};BX.Main.UF.TypeFile.prototype.getValue=function(t){var n=BX.Main.UF.TypeFile.superclass.getValue.apply(this,arguments),i=e[t].NODE,a=[],r;if(e[t].FIELD.MULTIPLE==="Y"){var o=t+"_del[]";if(BX.type.isArray(n)&&n.length>0){a=BX.Main.UF.TypeFile.superclass.findInput.apply(this,[i,o]);for(r=0;r<a.length;
9r++){var s=BX.util.array_search(a[r].value,n);if(s>=0){n[s]={old_id:a[r].value,del:"Y",tmp_name:""}}}}return BX.util.array_values(n)}if(n>0){var o=t+"_del";a=BX.Main.UF.TypeFile.superclass.findInput.apply(this,[i,o]);for(r=0;r<a.length;r++){if(n==a[r].value){n={old_id:n,del:"Y",tmp_name:""};break}}return n}return null};BX.Main.UF.Factory=function(){this.defaultTypeHandler=BX.Main.UF.BaseType;this.typeHandlerList={};this.objectCollection={}};BX.Main.UF.Factory.prototype.setTypeHandler=function(e,t){this.typeHandlerList[e]=t;if(typeof this.objectCollection[e]!=="undefined"){delete this.objectCollection[e]}};BX.Main.UF.Factory.prototype.get=function(e){if(typeof this.objectCollection[e]==="undefined"){this.objectCollection[e]=this.getObject(e)}return this.objectCollection[e]};BX.Main.UF.Factory.prototype.getObject=function(e){return new(this.typeHandlerList[e]||this.defaultTypeHandler)};BX.Main.UF.Factory.prototype.getFieldObject=function(t){if(typeof e[t]==="undefined"){console.error("Field "+t+"is not registered. Use BX.Main.UF.Factory.registerField to register");return null}return this.get(e[t]["FIELD"]["USER_TYPE_ID"])};BX.Main.UF.Factory.prototype.isEmpty=function(t){if(typeof e[t]==="undefined"){console.error("Field "+t+"is not registered. Use BX.Main.UF.Factory.registerField to register");return true}return this.get(e[t]["FIELD"]["USER_TYPE_ID"]).isEmpty(t)};BX.Main.UF.Factory.prototype.getValue=function(t){if(typeof e[t]==="undefined"){console.error("Field "+t+"is not registered. Use BX.Main.UF.Factory.registerField to register");return null}return this.get(e[t]["FIELD"]["USER_TYPE_ID"]).getValue(t)};BX.Main.UF.Factory.prototype.focus=function(t){if(typeof e[t]==="undefined"){console.error("Field "+t+"is not registered. Use BX.Main.UF.Factory.registerField to register")}return this.get(e[t]["FIELD"]["USER_TYPE_ID"]).focus(t)};BX.Main.UF.EditManager=new BX.Main.UF.EditManager;BX.Main.UF.ViewManager=new BX.Main.UF.ViewManager;BX.Main.UF.Factory=new BX.Main.UF.Factory;BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeBoolean.USER_TYPE_ID,BX.Main.UF.TypeBoolean);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeInteger.USER_TYPE_ID,BX.Main.UF.TypeInteger);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeDouble.USER_TYPE_ID,BX.Main.UF.TypeDouble);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeSting.USER_TYPE_ID,BX.Main.UF.TypeSting);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeStingFormatted.USER_TYPE_ID,BX.Main.UF.TypeStingFormatted);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeEnumeration.USER_TYPE_ID,BX.Main.UF.TypeEnumeration);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeFile.USER_TYPE_ID,BX.Main.UF.TypeFile);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeDate.USER_TYPE_ID,BX.Main.UF.TypeDate);BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeDateTime.USER_TYPE_ID,BX.Main.UF.TypeDateTime)})(); 10/* End */ 11; 12; /* Start:"a:4:{s:4:"full";s:45:"/bitrix/js/main/session.min.js?16498374162394";s:6:"source";s:26:"/bitrix/js/main/session.js";s:3:"min";s:30:"/bitrix/js/main/session.min.js";s:3:"map";s:30:"/bitrix/js/main/session.map.js";}"*/ 13function CBXSession(){var e=this;this.dateInput=new Date;this.dateCheck=new Date;this.dateHit=new Date;this.notifier=null;this.checkInterval=60;this.checkImmediately=false;this.Expand=function(t){this.key=t;BX.ready(function(){BX.bind(document,"keypress",e.OnUserInput);BX.bind(document.body,"mousemove",e.OnUserInput);BX.bind(document.body,"click",e.OnUserInput);setInterval(e.CheckSession,e.checkInterval*1e3)})};this.OnUserInput=function(){var t=new Date;e.dateInput.setTime(t.valueOf());if((t-e.dateHit)/1e3>e.checkInterval+5&&e.checkImmediately===false){e.checkImmediately=true;e.CheckSession()}};this.CheckSession=function(){var t=new Date;if((t-e.dateCheck)/1e3<e.checkInterval-1&&e.checkImmediately===false){return}e.dateCheck.setTime(t.valueOf());if(e.dateInput>e.dateHit){var i={method:"GET",headers:[{name:"X-Bitrix-Csrf-Token",value:BX.bitrix_sessid()}],dataType:"html",url:"/bitrix/tools/public_session.php?k="+e.key,data:"",onsuccess:function(t){e.CheckResult(t)},lsId:"sess_expand",lsTimeout:e.checkInterval-5};
13BX.ajax(i)}};this.CheckResult=function(t){var i=new Date;e.dateHit.setTime(i.valueOf());e.checkImmediately=false;if(t=="SESSION_EXPIRED"){if(BX.message("SessExpired")){if(!e.notifier){e.notifier=document.body.appendChild(BX.create("DIV",{props:{className:"bx-session-message"},style:{top:"0",backgroundColor:"#FFEB41",border:"1px solid #EDDA3C",width:"630px",fontFamily:"Arial,Helvetica,sans-serif",fontSize:"13px",fontWeight:"bold",textAlign:"center",color:"black",position:"absolute",zIndex:"10000",padding:"10px"},html:'<a class="bx-session-message-close" '+'style="display:block; width:12px; height:12px; background:url(/bitrix/js/main/core/images/close.gif) center no-repeat; float:right;" '+'href="javascript:bxSession.Close()"></a>'+BX.message("SessExpired")}));BX.ZIndexManager.register(e.notifier);BX.ZIndexManager.bringToFront(e.notifier);var s=BX.GetWindowScrollPos();var n=BX.GetWindowInnerSize();e.notifier.style.left=parseInt(s.scrollLeft+n.innerWidth/2-parseInt(e.notifier.clientWidth)/2)+"px";if(BX.browser.IsIE()){e.notifier.style.top=s.scrollTop+"px";BX.bind(window,"scroll",function(){var t=BX.GetWindowScrollPos();e.notifier.style.top=t.scrollTop+"px"})}else{e.notifier.style.position="fixed"}}e.notifier.style.display=""}}};this.Close=function(){this.notifier.style.display="none"}}var bxSession=new CBXSession; 14/* End */ 15; 16; /* Start:"a:4:{s:4:"full";s:55:"/bitrix/js/main/core/core_window.min.js?176936442376324";s:6:"source";s:35:"/bitrix/js/main/core/core_window.js";s:3:"min";s:39:"/bitrix/js/main/core/core_window.min.js";s:3:"map";s:39:"/bitrix/js/main/core/core_window.map.js";}"*/ 17(function(window){if(BX.WindowManager)return;BX.WindowManager={_stack:[],_runtime_resize:{},_delta:2,_delta_start:1e3,currently_loaded:null,settings_category:"BX.WindowManager.9.5",register:function(t){this.currently_loaded=null;t.WM_REG_INDEX=this._stack.length;this._stack.push(t);if(this._stack.length<2){BX.bind(document,"keyup",BX.proxy(this.__checkKeyPress,this))}},unregister:function(t){if(null==t.WM_REG_INDEX)return null;var e;if(this._stack.length>0){while((e=this.__pop_stack())!=t){if(!e){e=null;break}}if(this._stack.length<=0){this.enableKeyCheck()}return e}else{return null}},__pop_stack:function(t){if(this._stack.length>0){var e=this._stack.pop();e.WM_REG_INDEX=null;BX.onCustomEvent(e,"onWindowUnRegister",[t===true]);return e}else return null},clean:function(){while(this.__pop_stack(true)){}this._stack=[];this.disableKeyCheck()},Get:function(){if(this.currently_loaded)return this.currently_loaded;else if(this._stack.length>0)return this._stack[this._stack.length-1];else return null},setStartZIndex:function(t){this._delta_start=t},restoreStartZIndex:function(){this._delta_start=1e3},GetZIndex:function(){var t;return null!=(t=this._stack[this._stack.length-1])?parseInt(t.Get().style.zIndex)+this._delta:this._delta_start},__get_check_url:function(t){var e=t.indexOf("?");return e==-1?t:t.substring(0,e)},saveWindowSize:function(t,e){var i=this.__get_check_url(t);if(BX.userOptions){BX.userOptions.save(this.settings_category,"size_"+i,"width",e.width);BX.userOptions.save(this.settings_category,"size_"+i,"height",e.height)}this._runtime_resize[i]=e},saveWindowOptions:function(t,e){if(BX.userOptions){for(var i in e){if(e.hasOwnProperty(i)){BX.userOptions.save(this.settings_category,"options_"+t,i,e[i])}}}},getRuntimeWindowSize:function(t){return this._runtime_resize[this.__get_check_url(t)]},disableKeyCheck:function(){BX.unbind(document,"keyup",BX.proxy(this.__checkKeyPress,this))},enableKeyCheck:function(){BX.bind(document,"keyup",BX.proxy(this.__checkKeyPress,this))},__checkKeyPress:function(t){if(null==t)t=window.event;if(t.keyCode==27){var e=BX.WindowManager.Get();if(e&&!e.unclosable)e.Close()}}};BX.garbage(BX.WindowManager.clean,BX.WindowManager);BX.CWindowButton=function(t){if(t.btn){this.btn=t.btn;this.parentWindow=t.parentWindow;if(/save|apply/i.test(this.btn.name)){BX.bind(this.btn,"click",BX.delegate(this.disableUntilError,this))}}else{this.title=t.title;this.hint=t.hint;this.id=t.id;this.name=t.name;this.className=t.className;this.action=t.action;this.onclick=t.onclick;if(t.Button&&BX.type.isFunction(t.Button))this.Button=t.Button;this.btn=null}};BX.CWindowButton.prototype.disable=function(){if(this.btn)this.parentWindow.showWait(this.btn)};BX.CWindowButton.prototype.enable=function(){if(this.btn)this.parentWindow.closeWait(this.btn)};BX.CWindowButton.prototype.emulate=function(){if(this.btn&&this.btn.disabled)return;var t=this.action?BX.delegate(this.action,this):this.onclick?this.onclick:this.btn?this.btn.getAttribute("onclick"):"";if(t){setTimeout(t,50);if(this.btn&&/save|apply/i.test(this.btn.name)&&!this.action){this.disableUntilError()}}};BX.CWindowButton.prototype.Button=function(parentWindow){this.parentWindow=parentWindow;var btn={props:{type:"button",name:this.id?this.id:this.name,value:this.title?this.title:this.name,id:this.id}};if(this.hint)btn.props.title=this.hint;if(!!this.className)btn.props.className=this.className;if(this.action){btn.events={click:BX.delegate(this.action,this)}}else if(this.onclick){if(BX.browser.IsIE()){btn.events={click:BX.delegate((function(){eval(this.onclick)}),this)}}else{btn.attrs={onclick:this.onclick}}}this.btn=BX.create("INPUT",btn);return this.btn};BX.CWindowButton.prototype.disableUntilError=function(){this.disable();if(!this.__window_error_handler_set){BX.addCustomEvent(this.parentWindow,"onWindowError",BX.delegate(this.enable,this));this.__window_error_handler_set=true}};BX.CWindow=function(t,e){this.DIV=t||document.createElement("DIV");this.SETTINGS={resizable:false,min_height:0,min_width:0,top:0,left:0,draggable:false,drag_restrict:true,resize_restrict:true};this.ELEMENTS={draggable:[],resizer:[],close:[]};this.type=e=="float"?"float":"dialog";BX.adjust(this.DIV,{props:{className:"bx-core-window"},style:{zIndex:0,position:"absolute",display:"none",top:this.SETTINGS.top+"px",left:this.SETTINGS.left+"px",height:"100px",width:"100px"}});this.isOpen=false;BX.addCustomEvent(this,"onWindowRegister",BX.delegate(this.onRegister,this));BX.addCustomEvent(this,"onWindowUnRegister",BX.delegate(this.onUnRegister,this));this.MOUSEOVER=null;BX.bind(this.DIV,"mouseover",BX.delegate(this.__set_msover,this));BX.bind(this.DIV,"mouseout",BX.delegate(this.__unset_msover,this));BX.ready(BX.delegate((function(){document.body.appendChild(this.DIV);BX.ZIndexManager.register(this.DIV)}),this))};BX.CWindow.prototype.Get=function(){return this.DIV};BX.CWindow.prototype.visible=function(){return this.isOpen};BX.CWindow.prototype.Show=function(t){this.DIV.style.display="block";if(!t){BX.WindowManager.register(this);BX.onCustomEvent(this,"onWindowRegister")}BX.ZIndexManager.bringToFront(this.DIV)};BX.CWindow.prototype.Hide=function(){BX.WindowManager.unregister(this);this.DIV.style.display="none"};
17BX.CWindow.prototype.onRegister=function(){this.isOpen=true};BX.CWindow.prototype.onUnRegister=function(t){this.isOpen=false;if(t||this.PARAMS&&this.PARAMS.content_url){if(t){BX.onCustomEvent(this,"onWindowClose",[this,true])}if(this.DIV.parentNode)this.DIV.parentNode.removeChild(this.DIV)}else{this.DIV.style.display="none"}};BX.CWindow.prototype.CloseDialog=BX.CWindow.prototype.Close=function(t){BX.onCustomEvent(this,"onBeforeWindowClose",[this]);if(t!==true){if(this.denyClose)return false}BX.onCustomEvent(this,"onWindowClose",[this]);if(this.bExpanded){var e=BX.GetDocElement();BX.unbind(window,"resize",BX.proxy(this.__expand_onresize,this));e.style.overflow=this.__expand_settings.overflow}BX.WindowManager.unregister(this);return true};BX.CWindow.prototype.SetResize=function(t){t.style.cursor="se-resize";BX.bind(t,"mousedown",BX.proxy(this.__startResize,this));this.ELEMENTS.resizer.push(t);this.SETTINGS.resizable=true};BX.CWindow.prototype.SetExpand=function(t,e){e=e||"click";BX.bind(t,e,BX.proxy(this.__expand,this))};BX.CWindow.prototype.__expand_onresize=function(){var t=BX.GetWindowInnerSize();this.DIV.style.width=t.innerWidth+"px";this.DIV.style.height=t.innerHeight+"px";BX.onCustomEvent(this,"onWindowResize")};BX.CWindow.prototype.__expand=function(){var t=BX.GetDocElement();if(!this.bExpanded){var e=BX.GetWindowScrollPos(),i=BX.GetWindowInnerSize();this.__expand_settings={resizable:this.SETTINGS.resizable,draggable:this.SETTINGS.draggable,width:this.DIV.style.width,height:this.DIV.style.height,left:this.DIV.style.left,top:this.DIV.style.top,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,overflow:BX.style(t,"overflow")};this.SETTINGS.resizable=false;this.SETTINGS.draggable=false;window.scrollTo(0,0);t.style.overflow="hidden";this.DIV.style.top="0px";this.DIV.style.left="0px";this.DIV.style.width=i.innerWidth+"px";this.DIV.style.height=i.innerHeight+"px";this.bExpanded=true;BX.onCustomEvent(this,"onWindowExpand");BX.onCustomEvent(this,"onWindowResize");BX.bind(window,"resize",BX.proxy(this.__expand_onresize,this))}else{BX.unbind(window,"resize",BX.proxy(this.__expand_onresize,this));this.SETTINGS.resizable=this.__expand_settings.resizable;this.SETTINGS.draggable=this.__expand_settings.draggable;t.style.overflow=this.__expand_settings.overflow;this.DIV.style.top=this.__expand_settings.top;this.DIV.style.left=this.__expand_settings.left;this.DIV.style.width=this.__expand_settings.width;this.DIV.style.height=this.__expand_settings.height;window.scrollTo(this.__expand_settings.scrollLeft,this.__expand_settings.scrollTop);this.bExpanded=false;BX.onCustomEvent(this,"onWindowNarrow");BX.onCustomEvent(this,"onWindowResize")}};BX.CWindow.prototype.Resize=function(t,e){var i=Math.max(t-this.pos.left+this.dx,this.SETTINGS.min_width);var s=Math.max(e-this.pos.top+this.dy,this.SETTINGS.min_height);if(this.SETTINGS.resize_restrict){var o=BX.GetWindowScrollSize();if(this.pos.left+i>o.scrollWidth-this.dw)i=o.scrollWidth-this.pos.left-this.dw}this.DIV.style.width=i+"px";this.DIV.style.height=s+"px";BX.onCustomEvent(this,"onWindowResize")};BX.CWindow.prototype.__startResize=function(t){if(!this.SETTINGS.resizable)return false;if(!t)t=window.event;this.wndSize=BX.GetWindowScrollPos();this.wndSize.innerWidth=BX.GetWindowInnerSize().innerWidth;this.pos=BX.pos(this.DIV);this.x=t.clientX+this.wndSize.scrollLeft;this.y=t.clientY+this.wndSize.scrollTop;this.dx=this.pos.left+this.pos.width-this.x;this.dy=this.pos.top+this.pos.height-this.y;this.dw=this.pos.width-parseInt(this.DIV.style.width);BX.bind(document,"mousemove",BX.proxy(this.__moveResize,this));BX.bind(document,"mouseup",BX.proxy(this.__stopResize,this));if(document.body.setCapture)document.body.setCapture();document.onmousedown=BX.False;var e=document.body;e.ondrag=e.onselectstart=BX.False;e.style.MozUserSelect=this.DIV.style.MozUserSelect="none";e.style.cursor="se-resize";BX.onCustomEvent(this,"onWindowResizeStart");return true};BX.CWindow.prototype.__moveResize=function(t){if(!t)t=window.event;var e=BX.GetWindowScrollPos();var i=t.clientX+e.scrollLeft;var s=t.clientY+e.scrollTop;if(this.x==i&&this.y==s)return;this.Resize(i,s);this.x=i;this.y=s};BX.CWindow.prototype.__stopResize=function(){if(document.body.releaseCapture)document.body.releaseCapture();BX.unbind(document,"mousemove",BX.proxy(this.__moveResize,this));BX.unbind(document,"mouseup",BX.proxy(this.__stopResize,this));document.onmousedown=null;var t=document.body;t.ondrag=t.onselectstart=null;t.style.MozUserSelect=this.DIV.style.MozUserSelect="";t.style.cursor="";BX.onCustomEvent(this,"onWindowResizeFinished")};BX.CWindow.prototype.SetClose=function(t){BX.bind(t,"click",BX.proxy(this.Close,this));this.ELEMENTS.close.push(t)};BX.CWindow.prototype.SetDraggable=function(t){BX.bind(t,"mousedown",BX.proxy(this.__startDrag,this));t.style.cursor="move";this.ELEMENTS.draggable.push(t);this.SETTINGS.draggable=true};BX.CWindow.prototype.Move=function(t,e){var i=1;var s=parseInt(this.DIV.style.left)+t;var o=parseInt(this.DIV.style.top)+e;if(this.SETTINGS.drag_restrict){if(s<0)s=0;var n=BX.GetWindowScrollSize();var r=this.DIV.offsetWidth;var h=this.DIV.offsetHeight;if(s>n.scrollWidth-r-i)s=n.scrollWidth-r-i;var a=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight,n.scrollHeight);if(o>a-h-i)o=a-h-i;if(o<0)o=0}this.DIV.style.left=s+"px";this.DIV.style.top=o+"px"};BX.CWindow.prototype.__startDrag=function(t){if(!this.SETTINGS.draggable)return false;if(!t)t=window.event;this.x=t.clientX+document.body.scrollLeft;this.y=t.clientY+document.body.scrollTop;this.__bWasDragged=false;BX.bind(document,"mousemove",BX.proxy(this.__moveDrag,this));BX.bind(document,"mouseup",BX.proxy(this.__stopDrag,this));if(document.body.setCapture)document.body.setCapture();document.onmousedown=BX.False;var e=document.body;e.ondrag=e.onselectstart=BX.False;e.style.MozUserSelect=this.DIV.style.MozUserSelect="none";e.style.cursor="move";return BX.PreventDefault(t)};BX.CWindow.prototype.__moveDrag=function(t){if(!t)t=window.event;var e=t.clientX+document.body.scrollLeft;var i=t.clientY+document.body.scrollTop;if(this.x==e&&this.y==i)return;this.Move(e-this.x,i-this.y);this.x=e;this.y=i;if(!this.__bWasDragged){BX.onCustomEvent(this,"onWindowDragStart");this.__bWasDragged=true;BX.bind(BX.proxy_context,"click",BX.PreventDefault)}BX.onCustomEvent(this,"onWindowDrag")};BX.CWindow.prototype.__stopDrag=function(t){if(document.body.releaseCapture)document.body.releaseCapture();BX.unbind(document,"mousemove",BX.proxy(this.__moveDrag,this));BX.unbind(document,"mouseup",BX.proxy(this.__stopDrag,this));document.onmousedown=null;var e=document.body;e.ondrag=e.onselectstart=null;e.style.MozUserSelect=this.DIV.style.MozUserSelect="";e.style.cursor="";if(this.__bWasDragged){BX.onCustomEvent(this,"onWindowDragFinished");var i=BX.proxy_context;setTimeout((function(){BX.unbind(i,"click",BX.PreventDefault)}),100);this.__bWasDragged=false}return BX.PreventDefault(t)};BX.CWindow.prototype.DenyClose=function(){this.denyClose=true};BX.CWindow.prototype.AllowClose=function(){this.denyClose=false};BX.CWindow.prototype.ShowError=function(t){BX.onCustomEvent(this,"onWindowError",[t]);if(this._wait)BX.closeWait(this._wait);window.alert(t)};BX.CWindow.prototype.__set_msover=function(){this.MOUSEOVER=true};BX.CWindow.prototype.__unset_msover=function(){this.MOUSEOVER=false};BX.CWindowDialog=function(){var t=arguments;t[1]="dialog";BX.CWindowDialog.superclass.constructor.apply(this,t);this.DIV.style.top="10px";this.OVERLAY=null};BX.extend(BX.CWindowDialog,BX.CWindow);BX.CWindowDialog.prototype.__resizeOverlay=function(){var t=BX.GetWindowScrollSize();this.OVERLAY.style.width=t.scrollWidth+"px"};BX.CWindowDialog.prototype.CreateOverlay=function(t){if(null==this.OVERLAY){var e=BX.GetWindowScrollSize();var i=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight,e.scrollHeight);
17this.OVERLAY=document.body.appendChild(BX.create("DIV",{style:{position:"absolute",top:"0px",left:"0px",zIndex:t||parseInt(this.DIV.style.zIndex)-2,width:e.scrollWidth+"px",height:i+"px"}}));var s=BX.ZIndexManager.getComponent(this.DIV);if(s){s.setOverlay(this.OVERLAY)}}return this.OVERLAY};BX.CWindowDialog.prototype.Show=function(){BX.CWindowDialog.superclass.Show.apply(this,arguments);this.CreateOverlay();this.OVERLAY.style.display="block";BX.unbind(window,"resize",BX.proxy(this.__resizeOverlay,this));BX.bind(window,"resize",BX.proxy(this.__resizeOverlay,this))};BX.CWindowDialog.prototype.onUnRegister=function(t){BX.CWindowDialog.superclass.onUnRegister.apply(this,arguments);if(this.clean){if(this.OVERLAY.parentNode)this.OVERLAY.parentNode.removeChild(this.OVERLAY)}else{this.OVERLAY.style.display="none"}BX.unbind(window,"resize",BX.proxy(this.__resizeOverlay,this))};BX.CDialog=function(t){BX.CDialog.superclass.constructor.apply(this);this._sender="core_window_cdialog";this.PARAMS=t||{};for(var e in this.defaultParams){if(typeof this.PARAMS[e]=="undefined")this.PARAMS[e]=this.defaultParams[e]}this.PARAMS.width=!isNaN(parseInt(this.PARAMS.width))?this.PARAMS.width:this.defaultParams["width"];this.PARAMS.height=!isNaN(parseInt(this.PARAMS.height))?this.PARAMS.height:this.defaultParams["height"];if(this.PARAMS.resize_id||this.PARAMS.content_url){var i=BX.WindowManager.getRuntimeWindowSize(this.PARAMS.resize_id||this.PARAMS.content_url);if(i){this.PARAMS.width=i.width;this.PARAMS.height=i.height}}BX.addClass(this.DIV,"bx-core-adm-dialog");this.DIV.id="bx-admin-prefix";this.PARTS={};this.DIV.style.height=null;this.DIV.style.width=null;this.PARTS.TITLEBAR=this.DIV.appendChild(BX.create("DIV",{props:{className:"bx-core-adm-dialog-head"}}));this.PARTS.TITLE_CONTAINER=this.PARTS.TITLEBAR.appendChild(BX.create("SPAN",{props:{className:"bx-core-adm-dialog-head-inner"},text:this.PARAMS.title}));this.PARTS.TITLEBAR_ICONS=this.PARTS.TITLEBAR.appendChild(BX.create("DIV",{props:{className:"bx-core-adm-dialog-head-icons"},children:this.PARAMS.resizable?[BX.create("SPAN",{props:{className:"bx-core-adm-icon-expand",title:BX.message("JS_CORE_WINDOW_EXPAND")}}),BX.create("SPAN",{props:{className:"bx-core-adm-icon-close",title:BX.message("JS_CORE_WINDOW_CLOSE")}})]:[BX.create("SPAN",{props:{className:"bx-core-adm-icon-close",title:BX.message("JS_CORE_WINDOW_CLOSE")}})]}));this.PARTS.CONTENT=this.DIV.appendChild(BX.create("DIV",{props:{className:"bx-core-adm-dialog-content-wrap adm-workarea"}}));this.PARTS.CONTENT_DATA=this.PARTS.CONTENT.appendChild(BX.create("DIV",{props:{className:"bx-core-adm-dialog-content"},style:{height:this.PARAMS.height+"px",width:this.PARAMS.width+"px"}}));this.PARTS.HEAD=this.PARTS.CONTENT_DATA.appendChild(BX.create("DIV",{props:{className:"bx-core-adm-dialog-head-block"+(this.PARAMS.icon?" "+this.PARAMS.icon:"")}}));this.SetHead(this.PARAMS.head);this.SetContent(this.PARAMS.content);this.SetTitle(this.PARAMS.title);this.SetClose(this.PARTS.TITLEBAR_ICONS.lastChild);if(this.PARAMS.resizable){this.SetExpand(this.PARTS.TITLEBAR_ICONS.firstChild);this.SetExpand(this.PARTS.TITLEBAR,"dblclick");BX.addCustomEvent(this,"onWindowExpand",BX.proxy(this.__onexpand,this));BX.addCustomEvent(this,"onWindowNarrow",BX.proxy(this.__onexpand,this))}this.PARTS.FOOT=this.PARTS.BUTTONS_CONTAINER=this.PARTS.CONTENT.appendChild(BX.create("DIV",{props:{className:"bx-core-adm-dialog-buttons"},children:this.ShowButtons()}));if(this.PARAMS.draggable)this.SetDraggable(this.PARTS.TITLEBAR);if(this.PARAMS.resizable){this.PARTS.RESIZER=this.DIV.appendChild(BX.create("DIV",{props:{className:"bx-core-resizer"}}));this.SetResize(this.PARTS.RESIZER);this.SETTINGS.min_width=this.PARAMS.min_width;this.SETTINGS.min_height=this.PARAMS.min_height}this.auth_callback=BX.delegate((function(){this.PARAMS.content="";this.hideNotify();this.Show()}),this)};BX.extend(BX.CDialog,BX.CWindowDialog);BX.CDialog.prototype.defaultParams={width:700,height:400,min_width:500,min_height:300,resizable:true,draggable:true,title:"",icon:""};BX.CDialog.prototype.showWait=function(t){if(BX.type.isElementNode(t)&&(t.type=="button"||t.type=="submit")){BX.defer((function(){t.disabled=true}))();var e=BX.hasClass(t,"adm-btn-save")||BX.hasClass(t,"adm-btn-save"),i=BX.pos(t,true);t.bxwaiter=this.PARTS.FOOT.appendChild(BX.create("DIV",{props:{className:"adm-btn-load-img"+(e?"-green":"")}
17,style:{top:parseInt((i.bottom+i.top)/2-10)+"px",left:parseInt((i.right+i.left)/2-10)+"px"}}));BX.addClass(t,"adm-btn-load");this.lastWaitElement=t;return t.bxwaiter}return null};BX.CDialog.prototype.closeWait=function(t){t=t||this.lastWaitElement;if(BX.type.isElementNode(t)){if(t.bxwaiter){if(t.bxwaiter.parentNode){t.bxwaiter.parentNode.removeChild(t.bxwaiter)}t.bxwaiter=null}t.disabled=false;BX.removeClass(t,"adm-btn-load");if(this.lastWaitElement==t)this.lastWaitElement=null}};BX.CDialog.prototype.Authorize=function(t){this.bSkipReplaceContent=true;this.ShowError(BX.message("JSADM_AUTH_REQ"));BX.onCustomEvent(this,"onWindowError",[]);BX.closeWait();new BX.CAuthDialog({content_url:this.PARAMS.content_url,auth_result:t,callback:BX.delegate((function(){if(this.auth_callback)this.auth_callback()}),this)}).Show()};BX.CDialog.prototype.ShowError=function(t){BX.onCustomEvent(this,"onWindowError",[t]);this.closeWait();if(this._wait)BX.closeWait(this._wait);this.Notify(t,true)};BX.CDialog.prototype.__expandGetSize=function(){var t=BX.GetDocElement();t.style.overflow="hidden";var e=BX.GetWindowInnerSize();t.scrollTop=0;this.DIV.style.top="-"+this.dxShadow+"px";this.DIV.style.left="-"+this.dxShadow+"px";return{width:e.innerWidth-parseInt(BX.style(this.PARTS.CONTENT,"padding-right"))-parseInt(BX.style(this.PARTS.CONTENT,"padding-left"))+this.dxShadow,height:e.innerHeight-this.PARTS.TITLEBAR.offsetHeight-this.PARTS.FOOT.offsetHeight-parseInt(BX.style(this.PARTS.CONTENT,"padding-top"))-parseInt(BX.style(this.PARTS.CONTENT,"padding-bottom"))+this.dxShadow}};BX.CDialog.prototype.__expand=function(){var t=BX.GetDocElement();this.dxShadow=2;if(!this.bExpanded){var e=BX.GetWindowScrollPos();this.__expand_settings={resizable:this.SETTINGS.resizable,draggable:this.SETTINGS.draggable,width:this.PARTS.CONTENT_DATA.style.width,height:this.PARTS.CONTENT_DATA.style.height,left:this.DIV.style.left,top:this.DIV.style.top,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,overflow:BX.style(t,"overflow")};this.SETTINGS.resizable=false;this.SETTINGS.draggable=false;var i=this.__expandGetSize();this.PARTS.CONTENT_DATA.style.width=i.width+"px";this.PARTS.CONTENT_DATA.style.height=i.height+"px";window.scrollTo(0,0);t.style.overflow="hidden";this.bExpanded=true;BX.onCustomEvent(this,"onWindowExpand");BX.onCustomEvent(this,"onWindowResize");BX.onCustomEvent(this,"onWindowResizeExt",[{width:i.width,height:i.height}]);BX.bind(window,"resize",BX.proxy(this.__expand_onresize,this))}else{BX.unbind(window,"resize",BX.proxy(this.__expand_onresize,this));this.SETTINGS.resizable=this.__expand_settings.resizable;this.SETTINGS.draggable=this.__expand_settings.draggable;t.style.overflow=this.__expand_settings.overflow;this.DIV.style.top=this.__expand_settings.top;this.DIV.style.left=this.__expand_settings.left;this.PARTS.CONTENT_DATA.style.width=this.__expand_settings.width;this.PARTS.CONTENT_DATA.style.height=this.__expand_settings.height;window.scrollTo(this.__expand_settings.scrollLeft,this.__expand_settings.scrollTop);this.bExpanded=false;BX.onCustomEvent(this,"onWindowNarrow");BX.onCustomEvent(this,"onWindowResize");BX.onCustomEvent(this,"onWindowResizeExt",[{width:parseInt(this.__expand_settings.width),height:parseInt(this.__expand_settings.height)}])}};BX.CDialog.prototype.__expand_onresize=function(){var t=this.__expandGetSize();this.PARTS.CONTENT_DATA.style.width=t.width+"px";this.PARTS.CONTENT_DATA.style.height=t.height+"px";BX.onCustomEvent(this,"onWindowResize");BX.onCustomEvent(this,"onWindowResizeExt",[t])};BX.CDialog.prototype.__onexpand=function(){var t=this.PARTS.TITLEBAR_ICONS.firstChild;t.className=BX.toggle(t.className,["bx-core-adm-icon-expand","bx-core-adm-icon-narrow"]);t.title=BX.toggle(t.title,[BX.message("JS_CORE_WINDOW_EXPAND"),BX.message("JS_CORE_WINDOW_NARROW")]);if(this.PARTS.RESIZER){this.PARTS.RESIZER.style.display=this.bExpanded?"none":"block"}};BX.CDialog.prototype.__startResize=function(t){if(!this.SETTINGS.resizable)return false;if(!t)t=window.event;this.wndSize=BX.GetWindowScrollPos();this.wndSize.innerWidth=BX.GetWindowInnerSize().innerWidth;this.pos=BX.pos(this.PARTS.CONTENT_DATA);this.x=t.clientX+this.wndSize.scrollLeft;this.y=t.clientY+this.wndSize.scrollTop;this.dx=this.pos.left+this.pos.width-this.x;this.dy=this.pos.top+this.pos.height-this.y;this.dw=this.pos.width-parseInt(this.PARTS.CONTENT_DATA.style.width)+parseInt(BX.style(this.PARTS.CONTENT,"padding-right"));BX.bind(document,"mousemove",BX.proxy(this.__moveResize,this));BX.bind(document,"mouseup",BX.proxy(this.__stopResize,this));if(document.body.setCapture)document.body.setCapture();document.onmousedown=BX.False;var e=document.body;e.ondrag=e.onselectstart=BX.False;e.style.MozUserSelect=this.DIV.style.MozUserSelect="none";e.style.cursor="se-resize";BX.onCustomEvent(this,"onWindowResizeStart");return true};BX.CDialog.prototype.Resize=function(t,e){var i=Math.max(t-this.pos.left+this.dx,this.SETTINGS.min_width);var s=Math.max(e-this.pos.top+this.dy,this.SETTINGS.min_height);if(this.SETTINGS.resize_restrict){var o=BX.GetWindowScrollSize();if(this.pos.left+i>o.scrollWidth-this.dw)i=o.scrollWidth-this.pos.left-this.dw}this.PARTS.CONTENT_DATA.style.width=i+"px";this.PARTS.CONTENT_DATA.style.height=s+"px";BX.onCustomEvent(this,"onWindowResize");BX.onCustomEvent(this,"onWindowResizeExt",[{height:s,width:i}])};BX.CDialog.prototype.SetSize=function(t){this.PARTS.CONTENT_DATA.style.width=t.width+"px";this.PARTS.CONTENT_DATA.style.height=t.height+"px";BX.onCustomEvent(this,"onWindowResize");BX.onCustomEvent(this,"onWindowResizeExt",[t])};BX.CDialog.prototype.GetParameters=function(t){var e=this.GetForm();if(!e)return"";var i,s="";var o=e.elements.length;var n="";for(i=0;i<o;i++){if(s!="")n="&";var r=e.elements[i];if(r.disabled)continue;switch(r.type.toLowerCase()){case"text":case"textarea":case"password":case"hidden":if(null==t&&r.name.substr(r.name.length-4)=="_alt"&&e.elements[r.name.substr(0,r.name.length-4)])break;s+=n+r.name+"="+BX.util.urlencode(r.value);break;case"radio":if(r.checked)s+=n+r.name+"="+BX.util.urlencode(r.value);break;case"checkbox":s+=n+r.name+"="+BX.util.urlencode(r.checked?"Y":"N");break;case"select-one":var h="";if(null==t&&e.elements[r.name+"_alt"]&&r.selectedIndex==0)h=e.elements[r.name+"_alt"].value;else h=r.value;s+=n+r.name+"="+BX.util.urlencode(h);break;case"select-multiple":var a,l=false;var d=r.options.length;for(a=0;a<d;a++){if(r.options[a].selected){s+=n+r.name+"="+BX.util.urlencode(r.o
17ptions[a].value);l=true}}if(!l)s+=n+r.name+"=";break;default:break}}return s};BX.CDialog.prototype.PostParameters=function(t){var e=this.PARAMS.content_url;if(null==t)t="";t+=(t==""?"":"&")+"bxsender="+this._sender;var i=e.indexOf("?");if(i==-1)e+="?"+t;else e=e.substring(0,i)+"?"+t+"&"+e.substring(i+1);BX.showWait();this.auth_callback=BX.delegate((function(){this.hideNotify();this.PostParameters(t)}),this);BX.ajax.Setup({skipAuthCheck:true},true);BX.ajax.post(e,this.GetParameters(),BX.delegate((function(t){BX.closeWait();if(!this.bSkipReplaceContent){this.ClearButtons();this.SetContent(t);this.Show(true)}this.bSkipReplaceContent=false}),this))};BX.CDialog.prototype.Submit=function(t,e){var i=this.GetForm();if(i){i.onsubmit=null;i.method="POST";if(!i.action||e){e=e||this.PARAMS.content_url;if(null!=t){var s=e.indexOf("?");if(s==-1)e+="?"+t;else e=e.substring(0,s)+"?"+t+"&"+e.substring(s+1)}i.action=e}if(!i._bxsender){i._bxsender=i.appendChild(BX.create("INPUT",{attrs:{type:"hidden",name:"bxsender",value:this._sender}}))}this._wait=BX.showWait();this.auth_callback=BX.delegate((function(){this.hideNotify();this.Submit(t)}),this);BX.ajax.submit(i,BX.delegate((function(){this.closeWait()}),this))}else{window.alert("no form registered!")}};BX.CDialog.prototype.GetForm=function(){if(null==this.__form){var t=this.PARTS.CONTENT_DATA.getElementsByTagName("FORM");this.__form=t[0]?t[0]:null}return this.__form};BX.CDialog.prototype.GetRealForm=function(){if(null==this.__rform){var t=this.PARTS.CONTENT_DATA.getElementsByTagName("FORM");this.__rform=t[1]?t[1]:t[0]?t[0]:null}return this.__rform};BX.CDialog.prototype._checkButton=function(t){var e=["btnSave","btnCancel","btnClose"];for(var i=0;i<e.length;i++){if(this[e[i]]&&t==this[e[i]])return e[i]}return false};BX.CDialog.prototype.ShowButtons=function(){var t=[];if(this.PARAMS.buttons){if(this.PARAMS.buttons.title)this.PARAMS.buttons=[this.PARAMS.buttons];for(var e=0,i=this.PARAMS.buttons.length;e<i;e++){if(BX.type.isNotEmptyString(this.PARAMS.buttons[e])){t.push(this.PARAMS.buttons[e])}else if(BX.type.isElementNode(this.PARAMS.buttons[e])){t.push(this.PARAMS.buttons[e])}else if(this.PARAMS.buttons[e]){if(!BX.is_subclass_of(this.PARAMS.buttons[e],BX.CWindowButton)){var s=this._checkButton(this.PARAMS.buttons[e]);this.PARAMS.buttons[e]=new BX.CWindowButton(this.PARAMS.buttons[e]);if(s)this[s]=this.PARAMS.buttons[e]}t.push(this.PARAMS.buttons[e].Button(this))}}}return t};BX.CDialog.prototype.setAutosave=function(){if(!this.bSetAutosaveDelay){this.bSetAutosaveDelay=true;setTimeout(BX.proxy(this.setAutosave,this),10)}};BX.CDialog.prototype.SetTitle=function(t){this.PARAMS.title=t;BX.cleanNode(this.PARTS.TITLE_CONTAINER).appendChild(document.createTextNode(this.PARAMS.title))};BX.CDialog.prototype.SetHead=function(t){this.PARAMS.head=BX.util.trim(t);this.PARTS.HEAD.innerHTML=this.PARAMS.head||" ";this.PARTS.HEAD.style.display=this.PARAMS.head?"block":"none";this.adjustSize()};BX.CDialog.prototype.Notify=function(t,e,i){if(!this.PARTS.NOTIFY){this.PARTS.NOTIFY=this.DIV.insertBefore(BX.create("DIV",{props:{className:"adm-warning-block"},children:[BX.create("SPAN",{props:{className:"adm-warning-text"}}),BX.create("SPAN",{props:{className:"adm-warning-icon"}}),BX.create("SPAN",{props:{className:"adm-warning-close"},events:{click:BX.proxy(this.hideNotify,this)}})]}),this.DIV.firstChild)}if(e)BX.addClass(this.PARTS.NOTIFY,"adm-warning-block-red");else BX.removeClass(this.PARTS.NOTIFY,"adm-warning-block-red");if(i!==true){t=BX.util.htmlspecialchars(t)}this.PARTS.NOTIFY.firstChild.innerHTML=t||" ";this.PARTS.NOTIFY.firstChild.style.width=this.PARAMS.width-50+"px";BX.removeClass(this.PARTS.NOTIFY,"adm-warning-animate")};BX.CDialog.prototype.hideNotify=function(){BX.addClass(this.PARTS.NOTIFY,"adm-warning-animate")};BX.CDialog.prototype.__adjustHeadToIcon=function(){if(!this.PARTS.HEAD.offsetHeight){setTimeout(BX.delegate(this.__adjustHeadToIcon,this),50)}else{if(this.icon_image&&this.icon_image.height&&this.icon_image.height>this.PARTS.HEAD.offsetHeight-5){this.PARTS.HEAD.style.height=this.icon_image.height+5+"px";this.adjustSize()}this.icon_image.onload=null;this.icon_image=null}};BX.CDialog.prototype.SetIcon=function(t){if(this.PARAMS.icon!=t){if(this.PARAMS.icon)BX.removeClass(this.PARTS.HEAD,this.PARAMS.icon);this.PARAMS.icon=t;if(this.PARAMS.icon){BX.addClass(this.PARTS.HEAD,this.PARAMS.icon);var e=BX.style(this.PARTS.HEAD,"background-image")||BX.style(this.PARTS.HEAD,"backgroundImage");if(BX.type.isNotEmptyString(e)&&e!="none"){var i=e.match(new RegExp("url\\s*\\(\\s*('|\"|)(.+?)(\\1)\\s*\\)"));if(i){e=i[2];if(BX.type.isNotEmptyString(e)){this.icon_image=new Image;this.icon_image.onload=BX.delegate(this.__adjustHeadToIcon,this);this.icon_image.src=e}}}}}this.adjustSize()};BX.CDialog.prototype.SetIconFile=function(t){this.icon_image=new Image;this.icon_image.onload=BX.delegate(this.__adjustHeadToIcon,this);this.icon_image.src=t;BX.adjust(this.PARTS.HEAD,{style:{backgroundImage:"url("+t+")",backgroundPosition:"right 9px"}});this.adjustSize()};BX.CDialog.prototype.SetButtons=function(t){if(BX.type.isString(t)){if(t.length>0){this.PARTS.BUTTONS_CONTAINER.innerHTML+=t;var e=this.PARTS.BUTTONS_CONTAINER.getElementsByTagName("INPUT");if(e.length>0){this.PARAMS.buttons=[];for(var i=0;i<e.length;i++){this.PARAMS.buttons.push(new BX.CWindowButton({btn:e[i],parentWindow:this}))}}}}else{this.PARAMS.buttons=t;BX.adjust(this.PARTS.BUTTONS_CONTAINER,{children:this.ShowButtons()})}this.adjustSize()};BX.CDialog.prototype.ClearButtons=function(){BX.cleanNode(this.PARTS.BUTTONS_CONTAINER);this.adjustSize()};BX.CDialog.prototype.SetContent=function(t){this.__form=null;if(BX.type.isElementNode(t)){if(t.parentNode)t.parentNode.removeChild(t)}else if(BX.type.isString(t)){t=BX.create("DIV",{html:t})}this.PARAMS.content=t;BX.cleanNode(this.PARTS.CONTENT_DATA);BX.adjust(this.PARTS.CONTENT_DATA,{children:[this.PARTS.HEAD,BX.create("DIV",{props:{className:"bx-core-adm-dialog-content-wrap-inner"},children:[this.PARAMS.content]}
17)]});if(this.PARAMS.content_url&&this.GetForm()){this.__form.submitbtn=this.__form.appendChild(BX.create("INPUT",{props:{type:"submit"},style:{display:"none"}}));this.__form.onsubmit=BX.delegate(this.__submit,this)}};BX.CDialog.prototype.__submit=function(t){for(var e=0,i=this.PARAMS.buttons.length;e<i;e++){if(this.PARAMS.buttons[e]&&(this.PARAMS.buttons[e].name&&/save|apply/i.test(this.PARAMS.buttons[e].name)||this.PARAMS.buttons[e].btn&&this.PARAMS.buttons[e].btn.name&&/save|apply/i.test(this.PARAMS.buttons[e].btn.name))){this.PARAMS.buttons[e].emulate();break}}return BX.PreventDefault(t)};BX.CDialog.prototype.SwapContent=function(t){t=BX(t);BX.cleanNode(this.PARTS.CONTENT_DATA);t.parentNode.removeChild(t);this.PARTS.CONTENT_DATA.appendChild(t);t.style.display="block";this.SetContent(t.innerHTML)};BX.CDialog.prototype.adjustSize=function(){};BX.CDialog.prototype.__adjustSize=function(){};BX.CDialog.prototype.adjustSizeEx=function(){BX.defer(this.__adjustSizeEx,this)()};BX.CDialog.prototype.__adjustSizeEx=function(){var t=this.PARTS.CONTENT_DATA.firstChild,e=0,i,s;while(t){if(BX.type.isElementNode(t)){i=parseInt(BX.style(t,"margin-top"),10);if(isNaN(i))i=0;s=parseInt(BX.style(t,"margin-bottom"),10);if(isNaN(s))s=0;e+=t.offsetHeight+i+s}t=BX.nextSibling(t)}if(e)this.PARTS.CONTENT_DATA.style.height=e+"px"};BX.CDialog.prototype.__onResizeFinished=function(){BX.WindowManager.saveWindowSize(this.PARAMS.resize_id||this.PARAMS.content_url,{height:parseInt(this.PARTS.CONTENT_DATA.style.height),width:parseInt(this.PARTS.CONTENT_DATA.style.width)})};BX.CDialog.prototype.Show=function(t){if(!this.PARAMS.content&&this.PARAMS.content_url&&BX.ajax&&!t){var e=BX.showWait();BX.WindowManager.currently_loaded=this;this.CreateOverlay();this.OVERLAY.style.display="block";this.OVERLAY.className="bx-core-dialog-overlay";var i="",s="GET";if(this.PARAMS.content_post){i=this.PARAMS.content_post;s="POST"}var o=this.PARAMS.content_url+(this.PARAMS.content_url.indexOf("?")<0?"?":"&")+"bxsender="+this._sender;this.auth_callback=BX.delegate((function(){this.PARAMS.content="";this.hideNotify();this.Show()}),this);BX.ajax({method:s,dataType:"html",url:o,data:i,skipAuthCheck:true,onsuccess:BX.delegate((function(t){BX.closeWait(null,e);this.SetContent(t||" ");this.Show()}),this)})}else{BX.WindowManager.currently_loaded=null;BX.CDialog.superclass.Show.apply(this,arguments);this.adjustPos();this.OVERLAY.className="bx-core-dialog-overlay";this.__adjustSize();BX.removeCustomEvent(this,"onWindowResize",BX.proxy(this.__adjustSize,this));BX.addCustomEvent(this,"onWindowResize",BX.proxy(this.__adjustSize,this));if(this.PARAMS.resizable&&(this.PARAMS.content_url||this.PARAMS.resize_id)){BX.removeCustomEvent(this,"onWindowResizeFinished",BX.proxy(this.__onResizeFinished,this));BX.addCustomEvent(this,"onWindowResizeFinished",BX.proxy(this.__onResizeFinished,this))}}};BX.CDialog.prototype.GetInnerPos=function(){return{width:parseInt(this.PARTS.CONTENT_DATA.style.width),height:parseInt(this.PARTS.CONTENT_DATA.style.height)}};BX.CDialog.prototype.adjustPos=function(){if(!this.bExpanded){var t=window;var e=BX.PageObject.getRootWindow();if(e.BX.SidePanel&&e.BX.SidePanel.Instance&&e.BX.SidePanel.Instance.getTopSlider()){t=e.BX.SidePanel.Instance.getTopSlider().getWindow()}var i=t.BX.GetWindowInnerSize();var s=t.BX.GetWindowScrollPos();var o={left:parseInt(s.scrollLeft+i.innerWidth/2-parseInt(this.DIV.offsetWidth)/2)+"px",top:Math.max(parseInt(s.scrollTop+i.innerHeight/2-parseInt(this.DIV.offsetHeight)/2),0)+"px"};BX.adjust(this.DIV,{style:o})}};BX.CDialog.prototype.GetContent=function(){return this.PARTS.CONTENT_DATA};BX.CDialog.prototype.btnSave=BX.CDialog.btnSave={title:BX.message("JS_CORE_WINDOW_SAVE"),id:"savebtn",name:"savebtn",className:BX.browser.IsIE()&&BX.browser.IsDoctype()&&!BX.browser.IsIE10()?"":"adm-btn-save",action:function(){this.disableUntilError();this.parentWindow.PostParameters()}};BX.CDialog.prototype.btnCancel=BX.CDialog.btnCancel={title:BX.message("JS_CORE_WINDOW_CANCEL"),id:"cancel",name:"cancel",action:function(){this.parentWindow.Close()}};BX.CDialog.prototype.btnClose=BX.CDialog.btnClose={title:BX.message("JS_CORE_WINDOW_CLOSE"),id:"close",n
17ame:"close",action:function(){this.parentWindow.Close()}};BX.CAdminDialog=function(t){BX.CAdminDialog.superclass.constructor.apply(this,arguments);this._sender="core_window_cadmindialog";BX.addClass(this.DIV,"bx-core-adm-admin-dialog");this.PARTS.CONTENT.insertBefore(this.PARTS.HEAD,this.PARTS.CONTENT.firstChild);this.PARTS.HEAD.className="bx-core-adm-dialog-tabs"};BX.extend(BX.CAdminDialog,BX.CDialog);BX.CAdminDialog.prototype.SetHead=function(){BX.CAdminDialog.superclass.SetHead.apply(this,arguments);if(this.PARTS.HEAD.firstChild&&BX.type.isElementNode(this.PARTS.HEAD.firstChild)){var t=this.PARTS.HEAD.firstChild,e=0,i=0,s=0;while(t){if(BX.type.isElementNode(t)){i=parseInt(BX.style(t,"margin-left"),10);if(isNaN(i))i=0;s=parseInt(BX.style(t,"margin-right"),10);if(isNaN(s))s=0;e+=t.offsetWidth+i+s}t=BX.nextSibling(t)}this.SETTINGS.min_width=Math.max(e,this.SETTINGS.min_width)-2;if(this.PARAMS.width<this.SETTINGS.min_width){BX.adjust(this.PARTS.CONTENT_DATA,{style:{width:this.SETTINGS.min_width+"px"}})}}};BX.CAdminDialog.prototype.SetContent=function(t){this.__form=null;if(BX.type.isElementNode(t)){if(t.parentNode)t.parentNode.removeChild(t)}this.PARAMS.content=t;BX.cleanNode(this.PARTS.CONTENT_DATA);BX.adjust(this.PARTS.CONTENT_DATA,{children:[this.PARAMS.content||" "]});if(this.PARAMS.content_url&&this.GetForm()){this.__form.appendChild(BX.create("INPUT",{props:{type:"submit"},style:{display:"none"}}));this.__form.onsubmit=BX.delegate(this.__submit,this)}};BX.CAdminDialog.prototype.__expandGetSize=function(){var t=BX.CAdminDialog.superclass.__expandGetSize.apply(this,arguments);t.width-=parseInt(BX.style(this.PARTS.CONTENT_DATA,"padding-right"))+parseInt(BX.style(this.PARTS.CONTENT_DATA,"padding-left"));t.height-=parseInt(BX.style(this.PARTS.CONTENT_DATA,"padding-top"))+parseInt(BX.style(this.PARTS.CONTENT_DATA,"padding-bottom"));t.height-=this.PARTS.HEAD.offsetHeight;return t};BX.CAdminDialog.prototype.Submit=function(){var t=this.GetForm();if(t&&!t["bxpublic"]&&!/bxpublic=/.test(t.action)){t.appendChild(BX.create("INPUT",{props:{type:"hidden",name:"bxpublic",value:"Y"}}))}return BX.CAdminDialog.superclass.Submit.apply(this,arguments)};BX.CAdminDialog.prototype.btnSave=BX.CAdminDialog.btnSave={title:BX.message("JS_CORE_WINDOW_SAVE"),id:"savebtn",name:"savebtn",className:"adm-btn-save",action:function(){this.disableUntilError();this.parentWindow.Submit()}};BX.CAdminDialog.btnCancel=BX.CAdminDialog.superclass.btnCancel;BX.CAdminDialog.btnClose=BX.CAdminDialog.superclass.btnClose;BX.CDebugDialog=function(t){BX.CDebugDialog.superclass.constructor.apply(this,arguments)};BX.extend(BX.CDebugDialog,BX.CDialog);BX.CDebugDialog.prototype.ShowDetails=function(t){var e=BX(t);if(e){if(this.div_detail_current)this.div_detail_current.style.display="none";e.style.display="block";this.div_detail_current=e}};BX.CDebugDialog.prototype.SetContent=function(t){if(!t)return;var e=t.split("#DIVIDER#");if(e.length>1){this.PARAMS.content=e[1];this.PARTS.CONTENT_DATA.style.overflow="hidden";BX.CDebugDialog.superclass.SetContent.apply(this,[e[1]]);this.PARTS.CONTENT_INNER=this.PARTS.CONTENT_DATA.firstChild.nextSibling;this.PARTS.CONTENT_TOP=this.PARTS.CONTENT_DATA.insertBefore(BX.create("DIV",{props:{className:"bx-debug-content-top"},html:e[0]}),this.PARTS.CONTENT_INNER);this.PARTS.CONTENT_INNER.style.overflow="auto"}else{BX.CDebugDialog.superclass.SetContent.apply(this,arguments)}};BX.CDebugDialog.prototype.__adjustSize=function(){BX.CDebugDialog.superclass.__adjustSize.apply(this,arguments);if(this.PARTS.CONTENT_TOP){var t=this.PARTS.CONTENT_DATA.offsetHeight-this.PARTS.HEAD.offsetHeight-this.PARTS.CONTENT_TOP.offsetHeight-38;if(t>0){this.PARTS.CONTENT_INNER.style.height=t+"px"}}};BX.CEditorDialog=function(t){BX.CEditorDialog.superclass.constructor.apply(this,arguments);BX.removeClass(this.PARTS.CONTENT,"bx-core-adm-dialog-content-wrap");BX.removeClass(this.PARTS.CONTENT_DATA,"bx-core-adm-dialog-content");BX.removeClass(this.PARTS.CONTENT_DATA.lastChild,"bx-core-adm-dialog-content-wrap-inner");BX.removeClass(this.PARTS.BUTTONS_CONTAINER,"bx-core-adm-dialog-buttons");BX.addClass(this.PARTS.CONTENT,"bx-core-editor-dialog-content-wrap");BX.addClass(this.PARTS.CONTENT_DATA,"bx-core-editor-dialog-content");BX.addClass(this.PARTS.BUTTONS_CONTAINER,"bx-core-editor-dialog-buttons")};BX.extend(BX.CEditorDialog,BX.CDialog);BX.CEditorDialog.prototype.SetContent=function(){BX.CEditorDialog.superclass.SetContent.apply(this,arguments);BX.removeClass(this.PARTS.CONTENT_DATA.lastChild,"bx-core-adm-dialog-content-wrap-inner")};BX.CWizardDialog=function(t){BX.CWizardDialog.superclass.constructor.apply(this,arguments);BX.removeClass(this.PARTS.CONTENT,"bx-core-adm-dialog-content-wrap");BX.removeClass(this.PARTS.CONTENT_DATA,"bx-core-adm-dialog-content");BX.removeClass(this.PARTS.CONTENT_DATA.lastChild,"bx-core-adm-dialog-content-wrap-inner");BX.removeClass(this.PARTS.BUTTONS_CONTAINER,"bx-core-adm-dialog-buttons");BX.addClass(this.PARTS.CONTENT,"bx-core-wizard-dialog-content-wrap")};BX.extend(BX.CWizardDialog,BX.CDialog);BX.CAuthDialog=function(t){t.resizable=false;t.width=350;
17t.height=200;t.buttons=[this.btnSave];BX.CAuthDialog.superclass.constructor.apply(this,arguments);this._sender="core_window_cauthdialog";BX.addClass(this.DIV,"bx-core-auth-dialog");BX.AUTHAGENT=this};BX.extend(BX.CAuthDialog,BX.CDialog);BX.CAuthDialog.prototype.btnSave=BX.CAuthDialog.btnSave={title:BX.message("JS_CORE_WINDOW_AUTH"),id:"savebtn",name:"savebtn",className:"adm-btn-save",action:function(){this.disableUntilError();this.parentWindow.Submit("",this.parentWindow.PARAMS.content_url)}};BX.CAuthDialog.prototype.SetError=function(t){BX.closeWait();if(!!t)this.ShowError(t.MESSAGE||t)};BX.CAuthDialog.prototype.setAuthResult=function(t){BX.closeWait();if(t===false){this.Close();if(this.PARAMS.callback)this.PARAMS.callback()}else{this.SetError(t)}};BX.CWindowFloat=function(t){BX.CWindowFloat.superclass.constructor.apply(this,[t,"float"]);this.SETTINGS.resizable=false};BX.extend(BX.CWindowFloat,BX.CWindow);BX.CWindowFloat.prototype.adjustPos=function(){if(this.PARAMS.parent)this.adjustToNode();else if(this.PARAMS.x&&this.PARAMS.y)this.adjustToPos([this.PARAMS.x,this.PARAMS.y])};BX.CWindowFloat.prototype.adjustToPos=function(t){this.DIV.style.left=parseInt(t[0])+"px";this.DIV.style.top=parseInt(t[1])+"px"};BX.CWindowFloat.prototype.adjustToNodeGetPos=function(){return BX.pos(this.PARAMS.parent)};BX.CWindowFloat.prototype.adjustToNode=function(t){t=t||this.PARAMS.parent;this.PARAMS.parent=BX(t);if(this.PARAMS.parent){var e=this.adjustToNodeGetPos();this.DIV.style.top=e.top+"px";this.DIV.style.left=e.left+"px";this.PARAMS.parent.OPENER=this}};BX.CWindowFloat.prototype.Show=function(){this.adjustToPos([-1e3,-1e3]);BX.CWindowFloat.superclass.Show.apply(this,arguments);this.adjustPos()};BX.COpener=function(t){this.PARAMS=t||{};this.MENU=t.MENU||[];this.DIV=t.DIV;this.ATTACH=t.ATTACH||t.DIV;this.ATTACH_MODE=t.ATTACH_MODE||"bottom";this.ACTIVE_CLASS=t.ACTIVE_CLASS||"";this.PUBLIC_FRAME=t.PUBLIC_FRAME||0;this.LEVEL=t.LEVEL||0;this.CLOSE_ON_CLICK=typeof t.CLOSE_ON_CLICK!="undefined"?!!t.CLOSE_ON_CLICK:true;this.ADJUST_ON_CLICK=typeof t.ADJUST_ON_CLICK!="undefined"?!!t.ADJUST_ON_CLICK:true;this.TYPE=this.PARAMS.TYPE=="hover"?"hover":"click";this._openTimeout=null;if(this.PARAMS.TYPE=="hover"&&t.TIMEOUT!==0)this.TIMEOUT=t.TIMEOUT||1e3;else this.TIMEOUT=0;this.bMenuInit=false;if(!!this.PARAMS.MENU_URL){this.bMenuLoaded=false;this.bMenuLoading=false;this.MENU=[{TEXT:BX.message("JS_CORE_LOADING"),CLOSE_ON_CLICK:false}];if(this.PARAMS.MENU_PRELOAD){BX.defer(this.Load,this)()}}BX.ready(BX.defer(this.Init,this))};BX.COpener.prototype.Init=function(){this.DIV=BX(this.DIV);switch(this.TYPE){case"hover":BX.bind(this.DIV,"mouseover",BX.proxy(this.Open,this));BX.bind(this.DIV,"click",BX.proxy(this.Toggle,this));break;case"click":BX.bind(this.DIV,"click",BX.proxy(this.Toggle,this));break}};BX.COpener.prototype.Load=function(){if(this.PARAMS.MENU_URL&&!this.bMenuLoaded){if(!this.bMenuLoading){var t=this.PARAMS.MENU_URL;if(t.indexOf("sessid=")<=0)t+=(t.indexOf("?")>0?"&":"?")+"sessid="+BX.bitrix_sessid();this.bMenuLoading=true;BX.ajax.loadJSON(t,BX.proxy(this.SetMenu,this),BX.proxy(this.LoadFailed,this))}}};BX.COpener.prototype.SetMenu=function(t){this.bMenuLoaded=true;this.bMenuLoading=false;if(this.bMenuInit){this.MENU.setItems(t)}else{this.MENU=t}};BX.COpener.prototype.LoadFailed=function(t,e){this.bMenuLoading=false;this.SetMenu([{TEXT:BX.message("JS_CORE_NO_DATA"),CLOSE_ON_CLICK:true}]);BX.debug(arguments)};BX.COpener.prototype.checkAdminMenu=function(){if(document.documentElement.id=="bx-admin-prefix")return true;return!!BX.findParent(this.DIV,{property:{id:"bx-admin-prefix"}})};BX.COpener.prototype.Toggle=function(t){this.__clear_timeout();if(!this.bMenuInit||!this.MENU.visible()){var e=this.TIMEOUT;this.TIMEOUT=0;this.Open(t);this.TIMEOUT=e}else{this.MENU.Close()}return!!(t||window.event)&&BX.PreventDefault(t)};BX.COpener.prototype.GetMenu=function(){if(!this.bMenuInit){if(BX.type.isArray(this.MENU)){this.MENU=new BX.CMenu({ITEMS:this.MENU,ATTACH_MODE:this.ATTACH_MODE,SET_ID:this.checkAdminMenu()?"bx-admin-prefix":"",CLOSE_ON_CLICK:!!this.CLOSE_ON_CLICK,ADJUST_ON_CLICK:!!this.ADJUST_ON_CLICK,PUBLIC_FRAME:!!this.PUBLIC_FRAME,LEVEL:this.LEVEL,parent:BX(this.DIV),parent_attach:BX(this.ATTA
17CH)});if(this.LEVEL>0){BX.bind(this.MENU.DIV,"mouseover",BX.proxy(this._on_menu_hover,this));BX.bind(this.MENU.DIV,"mouseout",BX.proxy(this._on_menu_hout,this))}}BX.addCustomEvent(this.MENU,"onMenuOpen",BX.proxy(this.handler_onopen,this));BX.addCustomEvent(this.MENU,"onMenuClose",BX.proxy(this.handler_onclose,this));BX.addCustomEvent("onMenuItemHover",BX.proxy(this.handler_onover,this));this.bMenuInit=true}return this.MENU};BX.COpener.prototype.Open=function(){this.GetMenu();this.bOpen=true;this.__clear_timeout();if(this.TIMEOUT>0){BX.bind(this.DIV,"mouseout",BX.proxy(this.__clear_timeout,this));this._openTimeout=setTimeout(BX.proxy(this.__open,this),this.TIMEOUT)}else{this.__open()}if(!!this.PARAMS.MENU_URL&&!this.bMenuLoaded){this._loadTimeout=setTimeout(BX.proxy(this.Load,this),parseInt(this.TIMEOUT/2))}return true};BX.COpener.prototype.__clear_timeout=function(){if(!!this._openTimeout)clearTimeout(this._openTimeout);if(!!this._loadTimeout)clearTimeout(this._loadTimeout);BX.unbind(this.DIV,"mouseout",BX.proxy(this.__clear_timeout,this))};BX.COpener.prototype._on_menu_hover=function(){this.bMenuHover=true;this.__clear_timeout();if(this.ACTIVE_CLASS)BX.addClass(this.DIV,this.ACTIVE_CLASS)};BX.COpener.prototype._on_menu_hout=function(){this.bMenuHover=false};BX.COpener.prototype.handler_onover=function(t,e){if(this.bMenuHover)return;if(e!=this&&t==this.LEVEL-1&&this.ACTIVE_CLASS){BX.removeClass(this.DIV,this.ACTIVE_CLASS)}if(this.bMenuInit&&t<=this.LEVEL-1&&this.MENU.visible()){if(e!=this){this.__clear_timeout();this._openTimeout=setTimeout(BX.proxy(this.Close,this),this.TIMEOUT)}}};BX.COpener.prototype.handler_onopen=function(){this.bOpen=true;if(this.ACTIVE_CLASS)BX.addClass(this.DIV,this.ACTIVE_CLASS);BX.defer((function(){BX.onCustomEvent(this,"onOpenerMenuOpen")}),this)()};BX.COpener.prototype.handler_onclose=function(){this.bOpen=false;BX.onCustomEvent(this,"onOpenerMenuClose");if(this.ACTIVE_CLASS)BX.removeClass(this.DIV,this.ACTIVE_CLASS)};BX.COpener.prototype.Close=function(){if(!this.bMenuInit)return;if(!!this._openTimeout)clearTimeout(this._openTimeout);this.bOpen=false;this.__close()};BX.COpener.prototype.__open=function(){this.__clear_timeout();if(this.bMenuInit&&this.bOpen&&!this.MENU.visible())this.MENU.Show()};BX.COpener.prototype.__close=function(){if(this.bMenuInit&&!this.bOpen&&this.MENU.visible())this.MENU.Hide()};BX.COpener.prototype.__close_immediately=function(){this.bOpen=false;this.__close()};BX.COpener.prototype.isMenuVisible=function(){return null!=this.MENU.visible&&this.MENU.visible()};BX.CMenu=function(t){BX.CMenu.superclass.constructor.apply(this);this.DIV.style.width="auto";this.DIV.style.height="auto";this.PARAMS=t||{};this.PARTS={};this.PARAMS.ATTACH_MODE=this.PARAMS.ATTACH_MODE||"bottom";this.PARAMS.CLOSE_ON_CLICK=typeof this.PARAMS.CLOSE_ON_CLICK=="undefined"?true:this.PARAMS.CLOSE_ON_CLICK;this.PARAMS.ADJUST_ON_CLICK=typeof this.PARAMS.ADJUST_ON_CLICK=="undefined"?true:this.PARAMS.ADJUST_ON_CLICK;this.PARAMS.PUBLIC_FRAME=typeof this.PARAMS.PUBLIC_FRAME=="undefined"?false:this.PARAMS.PUBLIC_FRAME;this.PARAMS.LEVEL=this.PARAMS.LEVEL||0;this.DIV.className="bx-core-popup-menu bx-core-popup-menu-"+this.PARAMS.ATTACH_MODE+" bx-core-popup-menu-level"+this.PARAMS.LEVEL+(typeof this.PARAMS.ADDITIONAL_CLASS!="undefined"?" "+this.PARAMS.ADDITIONAL_CLASS:"");if(!!this.PARAMS.SET_ID)this.DIV.id=this.PARAMS.SET_ID;if(this.PARAMS.LEVEL==0){this.ARROW=this.DIV.appendChild(BX.create("SPAN",{props:{className:"bx-core-popup-menu-angle"},style:{left:"15px"}}))}if(!!this.PARAMS.CLASS_NAME)this.DIV.className+=" "+this.PARAMS.CLASS_NAME;BX.bind(this.DIV,"click",BX.eventCancelBubble);this.ITEMS=[];this.setItems(this.PARAMS.ITEMS);BX.addCustomEvent("onMenuOpen",BX.proxy(this._onMenuOpen,this));BX.addCustomEvent("onMenuItemSelected",BX.proxy(this.Hide,this))};BX.extend(BX.CMenu,BX.CWindowFloat);BX.CMenu.broadcastCloseEvent=function(){BX.onCustomEvent("onMenuItemSelected")};BX.CMenu._toggleChecked=function(){BX.toggleClass(this,"bx-core-popup-menu-item-checked")};BX.CMenu._itemDblClick=function(){window.location.href=this.href};BX.CMenu.prototype.toggleArrow=function(t){if(!!this.ARROW){if(typeof t=="undefined"){t=this.ARROW.style.visibility=="hidden"}this.ARROW.style.visibility=!!t?"visible":"hidden"}};BX.CMenu.prototype.visible=function(){return this.DIV.style.display!=="none"};BX.CMenu.prototype._onMenuOpen=function(t,e){if(this.visible()){if(e==this.PARAMS.LEVEL&&t!=this){this.Hide()}}};
17BX.CMenu.prototype.onUnRegister=function(){if(!this.visible())return;this.Hide()};BX.CMenu.prototype.setItems=function(t){this.PARAMS.ITEMS=t;BX.cleanNode(this.DIV);if(!!this.ARROW)this.DIV.appendChild(this.ARROW);if(this.PARAMS.ITEMS){this.PARAMS.ITEMS=BX.util.array_values(this.PARAMS.ITEMS);var e=false;var i=0;for(var s=0,o=this.PARAMS.ITEMS.length;s<o;s++){if((s==0||s==o-1)&&this.PARAMS.ITEMS[s].SEPARATOR)continue;i++;if(!e)e=!!this.PARAMS.ITEMS[s].GLOBAL_ICON;this.addItem(this.PARAMS.ITEMS[s],s)}if(i===1)BX.addClass(this.DIV,"bx-core-popup-menu-single-item");else BX.removeClass(this.DIV,"bx-core-popup-menu-single-item");if(!e)BX.addClass(this.DIV,"bx-core-popup-menu-no-icons");else BX.removeClass(this.DIV,"bx-core-popup-menu-no-icons")}};BX.CMenu.prototype.addItem=function(t){this.ITEMS.push(t);if(t.SEPARATOR){t.NODE=BX.create("DIV",{props:{className:"bx-core-popup-menu-separator"}})}else{var e=!!t.MENU&&(BX.type.isArray(t.MENU)&&t.MENU.length>0||t.MENU instanceof BX.CMenu)||!!t.MENU_URL;if(t.DISABLED){t.CLOSE_ON_CLICK=false;t.LINK=null;t.ONCLICK=null;t.ACTION=null}var i={};if(!!t.LINK||BX.browser.IsIE()&&!BX.browser.IsDoctype()){i.href=t.LINK||"javascript:void(0)"}if(this.PARAMS.PUBLIC_FRAME){i.target="_top"}t.NODE=BX.create(!!t.LINK||BX.browser.IsIE()&&!BX.browser.IsDoctype()?"A":"SPAN",{props:{className:"bx-core-popup-menu-item"+(e?" bx-core-popup-menu-item-opener":"")+(!!t.DEFAULT?" bx-core-popup-menu-item-default":"")+(!!t.DISABLED?" bx-core-popup-menu-item-disabled":"")+(!!t.CHECKED?" bx-core-popup-menu-item-checked":""),title:!!BX.message["MENU_ENABLE_TOOLTIP"]||!!t.SHOW_TITLE?t.TITLE||"":"",BXMENULEVEL:this.PARAMS.LEVEL},attrs:i,events:{mouseover:function(){BX.onCustomEvent("onMenuItemHover",[this.BXMENULEVEL,this.OPENER])}},html:'<span class="bx-core-popup-menu-item-icon'+(t.GLOBAL_ICON?" "+t.GLOBAL_ICON:"")+'"></span><span class="bx-core-popup-menu-item-text">'+(t.HTML||(t.TEXT?BX.util.htmlspecialchars(t.TEXT):""))+"</span>"});if(e&&!t.DISABLED){t.NODE.OPENER=new BX.COpener({DIV:t.NODE,ACTIVE_CLASS:"bx-core-popup-menu-item-opened",TYPE:"hover",MENU:t.MENU,MENU_URL:t.MENU_URL,MENU_PRELOAD:!!t.MENU_PRELOAD,LEVEL:this.PARAMS.LEVEL+1,ATTACH_MODE:"right",TIMEOUT:500})}else if(this.PARAMS.CLOSE_ON_CLICK&&(typeof t.CLOSE_ON_CLICK=="undefined"||!!t.CLOSE_ON_CLICK)){BX.bind(t.NODE,"click",BX.CMenu.broadcastCloseEvent)}else if(this.PARAMS.ADJUST_ON_CLICK&&(typeof t.ADJUST_ON_CLICK=="undefined"||!!t.ADJUST_ON_CLICK)){BX.bind(t.NODE,"click",BX.defer(this.adjustPos,this))}if(e&&!!t.LINK){BX.bind(t.NODE,"dblclick",BX.CMenu._itemDblClick)}if(typeof t.CHECKED!="undefined"){BX.bind(t.NODE,"click",BX.CMenu._toggleChecked)}t.ONCLICK=t.ACTION||t.ONCLICK;if(!!t.ONCLICK){if(BX.type.isString(t.ONCLICK)){t.ONCLICK=new Function("event",t.ONCLICK)}BX.bind(t.NODE,"click",t.ONCLICK)}}this.DIV.appendChild(t.NODE)};BX.CMenu.prototype._documentClickBind=function(){this._documentClickUnBind();BX.bind(document,"click",BX.proxy(this._documentClick,this))};BX.CMenu.prototype._documentClickUnBind=function(){BX.unbind(document,"click",BX.proxy(this._documentClick,this))};BX.CMenu.prototype._documentClick=function(t){t=t||window.event;if(!!t&&!(BX.getEventButton(t)&BX.MSLEFT))return;this.Close()};BX.CMenu.prototype.Show=function(){BX.onCustomEvent(this,"onMenuOpen",[this,this.PARAMS.LEVEL]);BX.CMenu.superclass.Show.apply(this,[]);this.bCloseEventFired=false;BX.addCustomEvent(this.PARAMS.parent_attach,"onChangeNodePosition",BX.proxy(this.adjustToNode,this));BX.defer(this._documentClickBind,this)()};BX.CMenu.prototype.Close=BX.CMenu.prototype.Hide=function(){if(!this.visible())return;BX.removeCustomEvent(this.PARAMS.parent_attach,"onChangeNodePosition",BX.proxy(this.adjustToNode,this));this._documentClickUnBind();if(!this.bCloseEventFired){BX.onCustomEvent(this,"onMenuClose",[this,this.PARAMS.LEVEL]);this.bCloseEventFired=true}BX.CMenu.superclass.Hide.apply(this,arguments)};BX.CMenu.prototype.__adjustMenuToNode=function(){var t=BX.pos(this.PARAMS.parent_attach),e=!!BX.findParent(this.PARAMS.parent_attach,BX.is_fixed);if(e)this.DIV.style.position="fixed";else this.DIV.style.position="absolute";if(!t.top){this.DIV.style.top="-1000px";this.DIV.style.left="-1000px"}if(this.bTimeoutSet)return;var i=this.DIV.offsetWidth,s=this.DIV.offsetHeight;if(!i){setTimeout(BX.delegate((function(){this.bTimeoutSet=false;this.__adjustMenuToNode()}),this),100);this.bTimeoutSet=true;return}var o={},n=BX.GetWindowSize();switch(this.PARAMS.ATTACH_MODE){case"bottom":o.top=t.bottom+9;
17o.left=t.left;var r=0;if(!!this.ARROW){if(t.width>i)r=parseInt(i/2-7);else r=parseInt(Math.min(i,t.width)/2-7);if(r<7){o.left-=15;r+=15}}if(o.left>n.scrollWidth-i-10){var h=o.left;o.left=n.scrollWidth-i-10;if(!!this.ARROW)r+=h-o.left}if(e){o.left-=n.scrollLeft}if(!!this.ARROW)this.ARROW.style.left=r+"px";break;case"right":o.top=t.top-1;o.left=t.right;if(o.left>n.scrollWidth-i-10){o.left=t.left-i-1}break}if(e){o.top-=n.scrollTop}if(!!this.ARROW)this.ARROW.className="bx-core-popup-menu-angle";if(o.top+s>n.scrollTop+n.innerHeight||o.top+s>n.scrollHeight){var a=this.PARAMS.ATTACH_MODE=="bottom"?t.top-s-9:t.bottom-s+1;if(a>n.scrollTop||o.top+s>n.scrollHeight){if(o.top+s>n.scrollHeight){o.top=Math.max(0,n.scrollHeight-s);this.toggleArrow(false)}else{o.top=a;if(!!this.ARROW)this.ARROW.className="bx-core-popup-menu-angle-bottom"}}}if(o.top+o.left==0){this.Hide()}else{this.DIV.style.top=o.top+"px";this.DIV.style.left=o.left+"px"}};BX.CMenu.prototype.adjustToNode=function(t){this.PARAMS.parent_attach=BX(t)||this.PARAMS.parent_attach||this.PARAMS.parent;this.__adjustMenuToNode()};BX.CMenuOpener=function(t){BX.CMenuOpener.superclass.constructor.apply(this);this.PARAMS=t||{};this.setParent(this.PARAMS.parent);this.PARTS={};this.SETTINGS.drag_restrict=true;this.defaultAction=null;this.timeout=500;this.DIV.className="bx-component-opener";this.DIV.ondblclick=BX.PreventDefault;if(this.PARAMS.component_id){this.PARAMS.transform=!!this.PARAMS.transform}this.OPENERS=[];this.DIV.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar"+(this.PARAMS.transform?" bx-context-toolbar-vertical-mode":"")}}));this.PARTS.INNER=this.DIV.firstChild.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-inner"},html:'<span class="bx-context-toolbar-drag-icon"></span><span class="bx-context-toolbar-vertical-line"></span><br>'}));this.EXTRA_BUTTONS={};var e=0;for(var i=0,s=this.PARAMS.menu.length;i<s;i++){var o=this.addItem(this.PARAMS.menu[i]);if(null!=o){e++;this.PARTS.INNER.appendChild(o);this.PARTS.INNER.appendChild(BX.create("BR"))}}var n=e>0;this.PARTS.ICONS=this.PARTS.INNER.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-icons"}}));if(this.PARAMS.component_id){this.PARAMS.pin=!!this.PARAMS.pin;if(n)this.PARTS.ICONS.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-separator"}}));this.PARTS.ICON_PIN=this.PARTS.ICONS.appendChild(BX.create("A",{attrs:{href:"javascript:void(0)"},props:{className:this.PARAMS.pin?"bx-context-toolbar-pin-fixed":"bx-context-toolbar-pin"},events:{click:BX.delegate(this.__pin_btn_clicked,this)}}))}if(this.EXTRA_BUTTONS["components2_props"]){var r=this.EXTRA_BUTTONS["components2_props"]||{URL:"javascript:void(0)"};if(null==this.defaultAction){this.defaultAction=r.ONCLICK;this.defaultActionTitle=r.TITLE||r.TEXT}r.URL="javascript:"+BX.util.urlencode(r.ONCLICK);this.ATTACH=this.PARTS.ICONS.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-button bx-context-toolbar-button-settings"},children:[BX.create("SPAN",{props:{className:"bx-context-toolbar-button-inner"},children:[BX.create("A",{attrs:{href:r.URL},events:{mouseover:BX.proxy(this.__msover_text,this),mouseout:BX.proxy(this.__msout_text,this),mousedown:BX.proxy(this.__msdown_text,this)},html:'<span class="bx-context-toolbar-button-icon bx-context-toolbar-settings-icon"></span>'}),BX.create("A",{attrs:{href:"javascript: void(0)"},props:{className:"bx-context-toolbar-button-arrow"},events:{mouseover:BX.proxy(this.__msover_arrow,this),mouseout:BX.proxy(this.__msout_arrow,this),mousedown:BX.proxy(this.__msdown_arrow,this)},html:'<span class="bx-context-toolbar-button-arrow"></span>'})]})]}));this.OPENER=this.ATTACH.firstChild.lastChild;var h=this.attachMenu(this.EXTRA_BUTTONS["components2_submenu"]["MENU"]);BX.addCustomEvent(h,"onOpenerMenuOpen",BX.proxy(this.__menu_open,this));BX.addCustomEvent(h,"onOpenerMenuClose",BX.proxy(this.__menu_close,this))}if(e>1){this.PARTS.ICONS.appendChild(BX.create("span",{props:{className:"bx-context-toolbar-separator bx-context-toolbar-separator-switcher"}}));this.ICON_TRANSFORM=this.PARTS.ICONS.appendChild(BX.create("A",{attrs:{href:"javascript: void(0)"},props:{className:"bx-context-toolbar-switcher"},events:{click:BX.delegate(this.__trf_btn_clicked,this)}}))}if(this.PARAMS.HINT){this.DIV.BXHINT=this.HINT=new BX.CHint({parent:this.DIV,hint:this.PARAMS.HINT.TEXT||"",title:this.PARAMS.HINT.TIT
17LE||"",hide_timeout:this.timeout/2,preventHide:false})}BX.addCustomEvent(this,"onWindowDragFinished",BX.delegate(this.__onMoveFinished,this));BX.addCustomEvent("onDynamicModeChange",BX.delegate(this.__onDynamicModeChange,this));BX.addCustomEvent("onTopPanelCollapse",BX.delegate(this.__onPanelCollapse,this));BX.addCustomEvent("onMenuOpenerMoved",BX.delegate(this.checkPosition,this));BX.addCustomEvent("onMenuOpenerUnhide",BX.delegate(this.checkPosition,this));BX.Event.EventEmitter.incrementMaxListeners("onDynamicModeChange");BX.Event.EventEmitter.incrementMaxListeners("onTopPanelCollapse");BX.Event.EventEmitter.incrementMaxListeners("onMenuOpenerMoved");BX.Event.EventEmitter.incrementMaxListeners("onMenuOpenerUnhide");if(this.OPENERS){for(i=0,s=this.OPENERS.length;i<s;i++){BX.addCustomEvent(this.OPENERS[i],"onOpenerMenuOpen",BX.proxy(this.__hide_hint,this))}}};BX.extend(BX.CMenuOpener,BX.CWindowFloat);BX.CMenuOpener.prototype.setParent=function(t){t=BX(t);if(!t){return}if(t.OPENER&&t.OPENER!=this){t.OPENER.Close();t.OPENER.clearHoverHoutEvents()}if(this.PARAMS.parent&&this.PARAMS.parent!=t){this.clearHoverHoutEvents();this.PARAMS.parent.OPENER=null}this.PARAMS.parent=t;this.PARAMS.parent.OPENER=this};BX.CMenuOpener.prototype.setHoverHoutEvents=function(t,e){if(!this.__opener_events_set){BX.bind(this.Get(),"mouseover",t);BX.bind(this.Get(),"mouseout",e);this.__opener_events_set=true}};BX.CMenuOpener.prototype.clearHoverHoutEvents=function(){if(this.Get()){BX.unbindAll(this.Get());this.__opener_events_set=false}};BX.CMenuOpener.prototype.unclosable=true;BX.CMenuOpener.prototype.__check_intersection=function(t,e){return!(e.right<=t.left||e.left>=t.right||e.bottom<=t.top||e.top>=t.bottom)};BX.CMenuOpener.prototype.__msover_text=function(){this.bx_hover=true;if(!this._menu_open)BX.addClass(this.ATTACH,"bx-context-toolbar-button-text-hover")};BX.CMenuOpener.prototype.__msout_text=function(){this.bx_hover=false;if(!this._menu_open)BX.removeClass(this.ATTACH,"bx-context-toolbar-button-text-hover bx-context-toolbar-button-text-active")};BX.CMenuOpener.prototype.__msover_arrow=function(){this.bx_hover=true;if(!this._menu_open)BX.addClass(this.ATTACH,"bx-context-toolbar-button-arrow-hover")};BX.CMenuOpener.prototype.__msout_arrow=function(){this.bx_hover=false;if(!this._menu_open)BX.removeClass(this.ATTACH,"bx-context-toolbar-button-arrow-hover bx-context-toolbar-button-arrow-active")};BX.CMenuOpener.prototype.__msdown_text=function(){this.bx_active=true;if(!this._menu_open)BX.addClass(this.ATTACH,"bx-context-toolbar-button-text-active")};BX.CMenuOpener.prototype.__msdown_arrow=function(){this.bx_active=true;if(!this._menu_open)BX.addClass(this.ATTACH,"bx-context-toolbar-button-arrow-active")};BX.CMenuOpener.prototype.__menu_close=function(){this._menu_open=false;this.bx_active=false;BX.removeClass(this.ATTACH,"bx-context-toolbar-button-active bx-context-toolbar-button-text-active bx-context-toolbar-button-arrow-active");if(!this.bx_hover){BX.removeClass(this.ATTACH,"bx-context-toolbar-button-hover bx-context-toolbar-button-text-hover bx-context-toolbar-button-arrow-hover");this.bx_hover=false}};BX.CMenuOpener.prototype.__menu_open=function(){this._menu_open=true};BX.CMenuOpener.prototype.checkPosition=function(){if(this.isMenuVisible()||this.DIV.style.display=="none"||this==BX.proxy_context||BX.proxy_context.zIndex>this.zIndex)return;this.correctPosition(BX.proxy_context)};BX.CMenuOpener.prototype.correctPosition=function(t){var e=BX.pos(this.DIV),i=BX.pos(t.Get());if(this.__check_intersection(e,i)){var s=i.top-e.height;if(s<0)s=i.bottom;this.DIV.style.top=s+"px";BX.addCustomEvent(t,"onMenuOpenerHide",BX.proxy(this.restorePosition,this));BX.onCustomEvent(this,"onMenuOpenerMoved")}};BX.CMenuOpener.prototype.restorePosition=function(){if(!this.MOUSEOVER&&!this.isMenuVisible()){if(this.originalPos)this.DIV.style.top=this.originalPos.top+"px";BX.removeCustomEvent(BX.proxy_context,"onMenuOpenerHide",BX.proxy(this.restorePosition,this));if(this.restore_pos_timeout)clearTimeout(this.restore_pos_timeout)}else{this.restore_pos_timeout=setTimeout(BX.proxy(this.restorePosition,this),this.timeout)}};BX.CMenuOpener.prototype.Show=function(){BX.CMenuOpener.superclass.Show.apply(this,arguments);this.SetDraggable(this.PARTS.INNER.firstChild);this.DIV.style.width="auto";this.DIV.style.height="auto";if(!this.PARAMS.pin){this.DIV.style.left="-1000px";this.DIV.style.top="-1000px";this.Hide()}else{this.bPosAdjusted=true;this.bMoved=true;if(this.PARAMS.top)this.DIV.style.top=this.PARAMS.top+"px";if(this.PARAMS.left)this.DIV.style.left=this.PARAMS.left+"px";this.DIV.style.display=!BX.admin.dynamic_mode||BX.admin.dynamic_mode_show_borders?"block":"none";if(this.DIV.style.display=="block"){setTimeout(BX.delegate((function(){BX.onCustomEvent(this,"onMenuOpenerUnhide")}),this),50)}}};BX.CMenuOpener.prototype.executeDefaultAction=function(){if(this.defaultAction){if(BX.type.isFunction(this.defaultAction))this.defaultAction();else if(BX.type.isString(this.defaultAction))BX.evalGlobal(this.defaultAction)}};BX.CMenuOpener.prototype.__onDynamicModeChange=function(t){this.DIV.style.display=t?"block":"none"};BX.CMenuOpener.prototype.__onPanelCollapse=function(t,e){this.DIV.style.top=parseInt(this.DIV.style.top)+e+"px";if(this.PARAMS.pin){this.__savePosition()}};BX.CMenuOpener.prototype.__onMoveFinished=function(){BX.onCustomEvent(this,"onMenuOpenerMoved");this.bMoved=true;if(this.PARAMS.pin)this.__savePosition()};BX.CMenuOpener.prototype.__savePosition=function(){var t={};t.pin=this.PARAMS.pin;if(!this.PARAMS.pin){t.top=false;t.left=false;t.transform=false}else{t.transform=this.PARAMS.transform;if(this.bMoved){t.left=parseInt(this.DIV.style.left);t.top=parseInt(this.DIV.style.top)}}BX.WindowManager.saveWindowOptions(this.PARAMS.component_id,t)};BX.CMenuOpener.prototype.__pin_btn_clicked=function(){this.Pin()};BX.CMenuOpener.prototype.Pin=function(t){if(null==t)this.PARAMS.pin=!this.PARAMS.pin;else this.PARAMS.pin=!!t;this.PARTS.ICON_PIN.className=this.PARAMS.pin?"bx-context-toolbar-pin-fixed":"bx-context-toolbar-pin";this.__savePosition()};BX.CMenuOpener.prototype.__trf_btn_clicked=function(){this.Transform()};BX.CMenuOpener.prototype.Transform=function(t){var e={};if(null==t)this.PARAMS.transform=!this.PARAMS.transform;else this.PARAMS.transform=!!t;if(this.bMoved){e=BX.pos(this.DIV)}if(this.PARAMS.transform)BX.addClass(this.DIV.firstChild,"bx-context-toolbar-vertical-mode");else BX.removeClass(this.DIV.firstChild,"bx-context-toolbar-vertical-mode");if(!this.bMoved){this.adjustPos()}else{this.DIV.style.left=e.right-this.DIV.offsetWidth-(BX.browser.IsIE()&&!BX.browser.IsDoctype()?2:0)+"px"}this.__savePosition()};BX.CMenuOpener.prototype.adjustToNodeGetPos=function(){var t=BX.pos(this.PARAMS.parent);var e=BX.GetWindowScrollSize();var i=this.DIV.offsetWidth;t.left-=BX.admin.__border_dx;t.top-=BX.admin.__border_dx;if(true||!this.PARAMS.transform){t.top-=45}if(t.left>e.scrollWidth-i){t.left=e.scrollWidth-i}return t};BX.CMenuOpener.prototype.addItem=function(t){if(t.TYPE){this.EXTRA_BUTTONS[t.TYPE]=t;return null}else{var e=new BX.CMenuOpenerItem(t);if(null==this.defaultAction){if(e.item.ONCLICK){this.defaultAction=t.ONCLICK}else if(e.item.MENU){this.defaultAction=BX.delegate((function(){this.Open()}),e.item.OPENER)}this.defaultActionTitle=t.TITLE||t.TEXT;BX.addClass(e.Get(),"bx-content-toolbar-default")}
17if(e.item.OPENER)this.OPENERS[this.OPENERS.length]=e.item.OPENER;return e.Get()}};BX.CMenuOpener.prototype.attachMenu=function(t){var e=new BX.COpener({DIV:this.OPENER,ATTACH:this.ATTACH,MENU:t,TYPE:"click"});this.OPENERS[this.OPENERS.length]=e;return e};BX.CMenuOpener.prototype.__hide_hint=function(){if(this.HINT)this.HINT.__hide_immediately()};BX.CMenuOpener.prototype.isMenuVisible=function(){for(var t=0,e=this.OPENERS.length;t<e;t++){if(this.OPENERS[t].isMenuVisible())return true}return false};BX.CMenuOpener.prototype.Hide=function(){if(!this.PARAMS.pin){this.DIV.style.display="none";BX.onCustomEvent(this,"onMenuOpenerHide")}};BX.CMenuOpener.prototype.UnHide=function(){this.DIV.style.display="block";if(!this.bPosAdjusted&&!this.PARAMS.pin){this.adjustPos();this.bPosAdjusted=true}if(null==this.originalPos&&!this.bMoved){this.originalPos=BX.pos(this.DIV)}BX.onCustomEvent(this,"onMenuOpenerUnhide")};BX.CMenuOpenerItem=function(t){this.item=t;if(this.item.ACTION&&!this.item.ONCLICK){this.item.ONCLICK=this.item.ACTION}this.DIV=BX.create("SPAN");this.DIV.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-button-underlay"}}));this.WRAPPER=this.DIV.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-button-wrapper"},children:[BX.create("SPAN",{props:{className:"bx-context-toolbar-button",title:t.TITLE},children:[BX.create("SPAN",{props:{className:"bx-context-toolbar-button-inner"}})]})]}));var e=BX.create("SPAN",{props:{className:"bx-context-toolbar-button-icon"+(this.item.ICON||this.item.ICONCLASS?" "+(this.item.ICON||this.item.ICONCLASS):"")},attrs:!(this.item.ICON||this.item.ICONCLASS)&&(this.item.SRC||this.item.IMAGE)?{style:"background: scroll transparent url("+(this.item.SRC||this.item.IMAGE)+") no-repeat center center !important;"}:{}}),i=BX.create("SPAN",{props:{className:"bx-context-toolbar-button-text"},text:this.item.TEXT});if(this.item.ACTION&&!this.item.ONCLICK){this.item.ONCLICK=this.item.ACTION}this.bHasMenu=!!this.item.MENU;this.bHasAction=!!this.item.ONCLICK;if(this.bHasAction){this.LINK=this.WRAPPER.firstChild.firstChild.appendChild(BX.create("A",{attrs:{href:"javascript: void(0)"},events:{mouseover:this.bHasMenu?BX.proxy(this.__msover_text,this):BX.proxy(this.__msover,this),mouseout:this.bHasMenu?BX.proxy(this.__msout_text,this):BX.proxy(this.__msout,this),mousedown:this.bHasMenu?BX.proxy(this.__msdown_text,this):BX.proxy(this.__msdown,this)},children:[e,i]}));if(this.bHasMenu){this.LINK_MENU=this.WRAPPER.firstChild.firstChild.appendChild(BX.create("A",{props:{className:"bx-context-toolbar-button-arrow"},attrs:{href:"javascript: void(0)"},events:{mouseover:BX.proxy(this.__msover_arrow,this),mouseout:BX.proxy(this.__msout_arrow,this),mousedown:BX.proxy(this.__msdown_arrow,this)},children:[BX.create("SPAN",{props:{className:"bx-context-toolbar-button-arrow"}})]}))}}else if(this.bHasMenu){this.item.ONCLICK=null;this.LINK=this.LINK_MENU=this.WRAPPER.firstChild.firstChild.appendChild(BX.create("A",{attrs:{href:"javascript: void(0)"},events:{mouseover:BX.proxy(this.__msover,this),mouseout:BX.proxy(this.__msout,this),mousedown:BX.proxy(this.__msdown,this)},children:[e,i]}));this.LINK.appendChild(BX.create("SPAN",{props:{className:"bx-context-toolbar-single-button-arrow"}}))}if(this.bHasMenu){this.item.SUBMENU=new BX.CMenu({ATTACH_MODE:"bottom",ITEMS:this.item["MENU"],parent:this.LINK_MENU,parent_attach:this.WRAPPER.firstChild});this.item.OPENER=new BX.COpener({DIV:this.LINK_MENU,TYPE:"click",MENU:this.item.SUBMENU});BX.addCustomEvent(this.item.OPENER,"onOpenerMenuOpen",BX.proxy(this.__menu_open,this));BX.addCustomEvent(this.item.OPENER,"onOpenerMenuClose",BX.proxy(this.__menu_close,this))}if(this.bHasAction){BX.bind(this.LINK,"click",BX.delegate(this.__click,this))}};BX.CMenuOpenerItem.prototype.Get=function(){return this.DIV};BX.CMenuOpenerItem.prototype.__msover=function(){this.bx_hover=true;if(!this._menu_open)BX.addClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-hover")};BX.CMenuOpenerItem.prototype.__msout=function(){this.bx_hover=false;if(!this._menu_open)BX.removeClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-hover bx-context-toolbar-button-active")};BX.CMenuOpenerItem.prototype.__msover_text=function(){this.bx_hover=true;if(!this._menu_open)BX.addClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-text-hover")};BX.CMenuOpenerItem.prototype.__msout_text=function(){this.bx_hover=false;if(!this._menu_open)BX.removeClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-text-hover bx-context-toolbar-button-text-active")};BX.CMenuOpenerItem.prototype.__msover_arrow=function(){this.bx_hover=true;if(!this._menu_open)BX.addClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-arrow-hover")};BX.CMenuOpenerItem.prototype.__msout_arrow=function(){this.bx_hover=false;if(!this._menu_open)BX.removeClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-arrow-hover bx-context-toolbar-button-arrow-active")};BX.CMenuOpenerItem.prototype.__msdown=function(){this.bx_active=true;if(!this._menu_open)BX.addClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-active")};BX.CMenuOpenerItem.prototype.__msdown_text=function(){this.bx_active=true;if(!this._menu_open)BX.addClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-text-active")};BX.CMenuOpenerItem.prototype.__msdown_arrow=function(){this.bx_active=true;if(!this._menu_open)BX.addClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-arrow-active")};BX.CMenuOpenerItem.prototype.__menu_close=function(){this._menu_open=false;this.bx_active=false;BX.removeClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-active bx-context-toolbar-button-text-active bx-context-toolbar-button-arrow-active");if(!this.bx_hover){BX.removeClass(this.LINK.parentNode.parentNode,"bx-context-toolbar-button-hover bx-context-toolbar-button-text-hover bx-context-toolbar-button-arrow-hover");this.bx_hover=false}};BX.CMenuOpenerItem.prototype.__menu_open=function(){this._menu_open=true};BX.CMenuOpenerItem.prototype.__click=function(){BX.evalGlobal(this.item.ONCLICK)};BX.CPageOpener=function(t){BX.CPageOpener.superclass.constructor.apply(this,arguments);this.timeout=505;window.PAGE_EDIT_CONTROL=this};BX.extend(BX.CPageOpener,BX.CMenuOpener);BX.CPageOpener.prototype.checkPosition=function(){if(this==BX.proxy_context)return;this.correctPosition(BX.proxy_context)};BX.CPageOpener.prototype.correctPosition=function(t){if(this.bPosCorrected)return;var e;if(this.DIV.style.display=="none"){e=this.adjustToNodeGetPos();e.bottom=e.top+30;e.right=e.left+300}else{e=BX.pos(this.DIV)}var i=BX.pos(t.Get());if(this.__check_intersection(e,i)){this.DIV.style.display="none";var s=BX.proxy(this.restorePosition,this);BX.removeCustomEvent(t,"onMenuOpenerHide",s);BX.addCustomEvent(t,"onMenuOpenerHide",s);this.bPosCorrected=true}};BX.CPageOpener.prototype.restorePosition=function(){if(BX.proxy_context&&BX.proxy_context.Get().style.display=="none"){this.bPosCorrected=false;if(this.PARAMS.parent.bx_over||this.PARAMS.pin)this.UnHide();BX.removeCustomEvent("onMenuOpenerHide",BX.proxy(this.restorePosition,this))}};BX.CPageOpener.prototype.UnHide=function(){if(!this.bPosCorrected)BX.CPageOpener.superclass.UnHide.apply(this,arguments)};BX.CPageOpener.prototype.Remove=function(){BX.admin.removeComponentBorder(this.PARAMS.parent);BX.userOptions.save("global","settings","page_edit_control_enable","N");this.DIV.style.display="none"};BX.CHintSimple=function(){BX.CHintSimple.superclass.constructor.apply(this,arguments)};BX.extend(BX.CHintSimple,BX.CHint);BX.CHintSimple.prototype.Init=function(){this.DIV=document.body.appendChild(BX.create("DIV",{props:{className:"bx-tooltip-simple"},style:{display:"none"},children:[this.CONTENT=BX.create("DIV")]}));BX.ZIndexManager.register(this.DIV);if(this.HINT_TITLE)this.CONTENT.appendChild(BX.create("B",{text:this.HINT_TITLE}));if(this.HINT)this.CONTENT_TEXT=this.CONTENT.appendChild(BX.create("DIV")).appendChild(BX.create("SPAN",{html:this.HINT}));if(this.PARAMS.preventHide){BX.bind(this.DIV,"mouseout",BX.proxy(this.Hide,this));BX.bind(this.DIV,"mouseover",BX.proxy(this.Show,this))}this.bInited=true};BX.adminInformer={itemsShow:3,Init:function(t){if(t)BX.adminInformer.itemsShow=t;var e=BX("admin-informer");if(e){document.body.appendChild(e);BX.ZIndexManager.register(e)}BX.addCustomEvent("onTopPanelCollapse",BX.proxy(BX.adminInformer.Close,BX.adminInformer))},Toggle:function(t){var e=BX("admin-informer");if(!e)return false;var i=BX.pos(t);e.style.top=parseInt(i.top)+parseInt(i.height)+7+"px";e.style.left=i.left+"px";if(!BX.hasClass(e,"adm-informer-active"))BX.adminInformer.Show(e);else BX.adminInformer.Hide(e);return false},Close:function(){BX.adminInformer.Hide(BX("admin-informer"))},OnInnerClick:function(t){var e=t.target||t.srcElement;if(e.nodeName.toLowerCase()!="a"||BX.hasClass(e,"adm-informer-footer")){return BX.PreventDefault(t)}return true},ToggleExtra:function(){var t=BX("adm-informer-footer");if(BX.hasClass(t,"adm-informer-footer-collapsed"))this.ShowAll();else this.HideExtra();return false},ShowAll:function(){var t=BX("admin-informer");for(var e=0;e<t.children.length;e++)if(BX.hasClass(t.children[e],"adm-informer-item")&&t.children[e].style.display=="none"){t.children[e].style.display="block"}var i=BX("adm-informer-footer");if(i.textContent!==undefined)i.textContent=BX.message("JSADM_AI_HIDE_EXTRA");else i.innerText=BX.message("JSADM_AI_HIDE_EXTRA");BX.removeClass(i,"adm-informer-footer-collapsed");return false},HideExtra:function(){var t=BX("admin-informer");var e=0;for(var i=BX.adminInformer.itemsShow+1;i<t.children.length;i++){if(BX.hasClass(t.children[i],"adm-informer-item")&&t.children[i].style.display=="block"){t.children[i].style.display="none";e++}}var s=BX("adm-informer-footer");var o=BX.message("JSADM_AI_ALL_NOTIF")+" ("+(BX.adminInformer.itemsShow+parseInt(e))+")";if(s.textContent!==undefined)s.textContent=o;else s.innerText=o;BX.addClass(s,"adm-informer-footer-collapsed");return false},Show:function(t){var e=BX("adm-header-notif-block");if(e)BX.addClass(e,"adm-header-notif-block-active");BX.onCustomEvent(t,"onBeforeAdminInformerShow");setTimeout(BX.proxy((function(){BX.bind(document,"click",BX.proxy(BX.adminInformer.Close,BX.adminInformer))}),BX.adminInformer),0);BX.addClass(t,"adm-informer-active");BX.ZIndexManager.bringToFront(t);setTimeout((function(){BX.addClass(t,"adm-informer-animate")}),0)},Hide:function(t){var e=BX("adm-header-notif-block");if(e)BX.removeClass(e,"adm-header-notif-block-active");BX.unbind(document,"click",BX.proxy(BX.adminInformer.Close,BX.adminInformer));BX.removeClass(t,"adm-informer-animate");if(this.IsAnimationSupported())setTimeout((function(){BX.removeClass(t,"adm-informer-active")}),300);else BX.removeClass(t,"adm-informer-active");BX.onCustomEvent(t,"onAdminInformerHide")},IsAnimationSupported:function(){var t=document.body||document.documentElement;
17if(typeof t.style.transition=="string")return true;else if(typeof t.style.MozTransition=="string")return true;else if(typeof t.style.OTransition=="string")return true;else if(typeof t.style.WebkitTransition=="string")return true;else if(typeof t.style.msTransition=="string")return true;return false},SetItemHtml:function(t,e){var i=BX("adm-informer-item-html-"+t);if(!i)return false;i.innerHTML=e;return true},SetItemFooter:function(t,e){var i=BX("adm-informer-item-footer-"+t);if(!i)return false;i.innerHTML=e;if(e)i.style.display="block";else i.style.display="none";return true}}})(window); 18/* End */ 19; 20; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/date/main.date.min.js?176936421921981";s:6:"source";s:33:"/bitrix/js/main/date/main.date.js";s:3:"min";s:37:"/bitrix/js/main/date/main.date.min.js";s:3:"map";s:37:"/bitrix/js/main/date/main.date.map.js";}"*/ 21this.BX=this.BX||{};(function(e,t){"use strict";function r(e){if(!t.Type.isStringFilled(e)){return""}return e.replace("YYYY","Y").replace("MMMM","F").replace("MM","m").replace("M","M").replace("DD","d").replace("G","g").replace(/GG/i,"G").replace("H","h").replace(/HH/i,"H").replace("MI","i").replace("SS","s").replace("TT","A").replace("T","a")}const s=new t.Cache.MemoryCache;function n(e){return s.remember(`main.date.format.${e}`,(()=>{let s=t.Extension.getSettings("main.date").get(`formats.${e}`);if(t.Type.isStringFilled(s)&&(e==="FORMAT_DATE"||e==="FORMAT_DATETIME")){s=r(s)}return s}))}let _=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"isAmPmMode",value:function e(t){if(t===true){return this._getMessage("AMPM_MODE")}return this._getMessage("AMPM_MODE")!==false}},{key:"convertToUTC",value:function e(r){if(!t.Type.isDate(r)){return null}return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()))}},{key:"getNewDate",value:function e(t){return new Date(this.getBrowserTimestamp(t))}},{key:"getBrowserTimestamp",value:function e(t){t=parseInt(t,10);const r=new Date(t*1e3).getTimezoneOffset()*60;return(parseInt(t,10)+parseInt(this._getMessage("SERVER_TZ_OFFSET"))+r)*1e3}},{key:"getServerTimestamp",value:function e(t){t=parseInt(t,10);const r=new Date(t).getTimezoneOffset()*60;return Math.round(t/1e3-(parseInt(this._getMessage("SERVER_TZ_OFFSET"),10)+parseInt(r,10)))}},{key:"formatLastActivityDate",value:function e(t,r,s){const n=this.isAmPmMode(true);const _=n===this.AM_PM_MODE.LOWER?"g:i a":n===this.AM_PM_MODE.UPPER?"g:i A":"H:i";const i=[["tomorrow","#01#"+_],["now","#02#"],["todayFuture","#03#"+_],["yesterday","#04#"+_],["-",this.convertBitrixFormat(this._getMessage("FORMAT_DATETIME")).replace(/:s/g,"")],["s60","sago"],["i60","iago"],["H5","Hago"],["H24","#03#"+_],["d31","dago"],["m12>1","mago"],["m12>0","dago"],["","#05#"]];let a=this.format(i,t,r,s);let o=null;if((o=/^#(\d+)#(.*)/.exec(a))!=null){switch(o[1]){case"01":a=this._getMessage("FD_LAST_SEEN_TOMORROW").replace("#TIME#",o[2]);break;case"02":a=this._getMessage("FD_LAST_SEEN_NOW");break;case"03":a=this._getMessage("FD_LAST_SEEN_TODAY").replace("#TIME#",o[2]);break;case"04":a=this._getMessage("FD_LAST_SEEN_YESTERDAY").replace("#TIME#",o[2]);break;case"05":a=this._getMessage("FD_LAST_SEEN_MORE_YEAR");break;default:a=o[2];break}}return a}},{key:"_getMessage",value:function e(r){return t.Loc.getMessage(r)}},{key:"parse",value:function e(r,s,n,_){if(t.Type.isStringFilled(r)){if(!n){n=this._getMessage("FORMAT_DATE")}if(!_){_=this._getMessage("FORMAT_DATETIME")}let e="";for(let t=1;t<=12;t++){e=e+"|"+this._getMessage("MON_"+t)}const t=new RegExp("([0-9]+|[a-z]+"+e+")","ig");const i=r.match(t);let a=n.match(/(DD|MI|MMMM|MM|M|YYYY)/gi);const o=[];const D=[];const u={};if(!i){return null}if(i.length>a.length){a=_.match(/(DD|MI|MMMM|MM|M|YYYY|HH|H|SS|TT|T|GG|G)/gi)}for(let e=0,t=i.length;e<t;e++){if(i[e].trim()!==""){o[o.length]=i[e]}}for(let e=0,t=a.length;e<t;e++){if(a[e].trim()!==""){D[D.length]=a[e]}}let l=D.findIndex((e=>e==="MMMM"));if(l>0){o[l]=this.getMonthIndex(o[l]);D[l]="MM"}else{l=D.findIndex((e=>e==="M"));if(l>0){o[l]=this.getMonthIndex(o[l]);D[l]="MM"}}for(let e=0,t=D.length;e<t;e++){const t=D[e].toUpperCase();u[t]=t==="T"||t==="TT"?o[e]:parseInt(o[e],10)}if(u["DD"]>0&&u["MM"]>0&&u["YYYY"]>0){const e=new Date;if(s){e.setUTCDate(1);e.setUTCFullYear(u["YYYY"]);e.setUTCMonth(u["MM"]-1);e.setUTCDate(u["DD"]);e.setUTCHours(0,0,0,0)}else{e.setDate(1);e.setFullYear(u["YYYY"]);e.setMonth(u["MM"]-1);e.setDate(u["DD"]);e.setHours(0,0,0,0)}if((!isNaN(u["HH"])||!isNaN(u["GG"])||!isNaN(u["H"])||!isNaN(u["G"]))&&!isNaN(u["MI"])){if(!isNaN(u["H"])||!isNaN(u["G"])){const e=(u["T"]||u["TT"]||"am").toUpperCase()==="PM",t=parseInt(u["H"]||u["G"]||0,10);if(e){u["HH"]=t+(t===12?0:12)}else{u["HH"]=t<12?t:0}}else{u["HH"]=parseInt(u["HH"]||u["GG"]||0,10)}if(isNaN(u["SS"])){u["SS"]=0}if(s){e.setUTCHours(u["HH"],u["MI"],u["SS"])}else{e.setHours(u["HH"],u["MI"],u["SS"])}}return e}}return null}},{key:"getMonthIndex",value:function e(t){const r=t.toUpperCase();const s=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];const n=["january","february","march","april","may","june","july","august","september","october","november","december"];for(let e=1;e<=12;e++){if(r===this._getMessage("MON_"+e).toUpperCase()||r===this._getMessage("MONTH_"+e).toUpperCase()||r===this._getMessage("MONTH_"+e+"_S").toUpperCase()||r===s[e-1].toUpperCase()||r===n[e-1].toUpperCase()){return e}}return t}},{key:"format",value:function e(r,s,n,_){const i=t.Type.isDate(s)?new Date(s.getTime()):t.Type.isNumber(s)?new Date(s*1e3):new Date;const a=t.Type.isDate(n)?new Date(n.getTime()):t.Type.isNumber(n)?new Date(n*1e3):new Date;const o=!!_;const D=this;if(t.Type.isArray(r)){return f(r,i,a,o)}else{if(!t.Type.isStringFilled(r)){return""}}const u=(r.match(/{{([^{}]*)}}/g)||[]).map((e=>(e.match(/[^{}]+/)||[""])[0]));if(u.length>0){u.forEach(((e,t)=>{r=r.replace("{{"+e+"}}","{{"+t+"}}")}))}const l=/\\?(sago|iago|isago|Hago|dago|mago|Yago|sdiff|idiff|Hdiff|ddiff|mdiff|Ydiff|sshort|ishort|Hshort|dshort|mshort|Yshort|yesterday|today|tommorow|tomorrow|.)/gi;const c={d:()=>T(i).toString().padStart(2,"0"),D:()=>this._getMessage("DOW_"+S(i)),j:()=>T(i),l:()=>this._getMessage("DAY_OF_WEEK_"+S(i)),N:()=>S(i)||7,S:()=>
21{if(T(i)%10==1&&T(i)!=11){return"st"}else if(T(i)%10==2&&T(i)!=12){return"nd"}else if(T(i)%10==3&&T(i)!=13){return"rd"}else{return"th"}},w:()=>S(i),z:()=>{const e=new Date(g(i),0,1);const t=new Date(g(i),F(i),T(i));return Math.ceil((t-e)/(24*3600*1e3))},W:()=>{const e=new Date(i.getTime());const t=(S(i)+6)%7;d(e,T(e)-t+3);const r=e.getTime();A(e,0,1);if(S(e)!=4){A(e,0,1+(4-S(e)+7)%7)}const s=1+Math.ceil((r-e)/(7*24*3600*1e3));return s.toString().padStart(2,"0")},F:()=>this._getMessage("MONTH_"+(F(i)+1)+"_S"),f:()=>this._getMessage("MONTH_"+(F(i)+1)),m:()=>(F(i)+1).toString().padStart(2,"0"),M:()=>this._getMessage("MON_"+(F(i)+1)),n:()=>F(i)+1,t:()=>{const e=o?new Date(Date.UTC(g(i),F(i)+1,0)):new Date(g(i),F(i)+1,0);return T(e)},L:()=>{const e=g(i);return e%4==0&&e%100!=0||e%400==0?1:0},o:()=>{const e=new Date(i.getTime());d(e,T(e)-(S(i)+6)%7+3);return g(e)},Y:()=>g(i),y:()=>g(i).toString().slice(2),a:()=>h(i)>11?"pm":"am",A:()=>h(i)>11?"PM":"AM",B:()=>{const e=(i.getUTCHours()+1)%24+i.getUTCMinutes()/60+i.getUTCSeconds()/3600;return Math.floor(e*1e3/24).toString().padStart(3,"0")},g:()=>h(i)%12||12,G:()=>h(i),h:()=>(h(i)%12||12).toString().padStart(2,"0"),H:()=>h(i).toString().padStart(2,"0"),i:()=>E(i).toString().padStart(2,"0"),s:()=>m(i).toString().padStart(2,"0"),u:()=>(R(i)*1e3).toString().padStart(6,"0"),e:()=>{if(o){return"UTC"}return""},I:()=>{if(o){return 0}const e=new Date(g(i),0,1);const t=Date.UTC(g(i),0,1);const r=new Date(g(i),6,0);const s=Date.UTC(g(i),6,0);return 0+(e-t!==r-s)},O:()=>{if(o){return"+0000"}const e=i.getTimezoneOffset();const t=Math.abs(e);return(e>0?"-":"+")+(Math.floor(t/60)*100+t%60).toString().padStart(4,"0")},P:function(){if(o){return"+00:00"}const e=this.O();return e.substr(0,3)+":"+e.substr(3)},Z:()=>{if(o){return 0}return-i.getTimezoneOffset()*60},c:()=>"Y-m-d\\TH:i:sP".replace(l,p),r:()=>"D, d M Y H:i:s O".replace(l,p),U:()=>Math.floor(i.getTime()/1e3),sago:()=>H(U((a-i)/1e3),{0:"FD_SECOND_AGO_0",1:"FD_SECOND_AGO_1","10_20":"FD_SECOND_AGO_10_20",MOD_1:"FD_SECOND_AGO_MOD_1",MOD_2_4:"FD_SECOND_AGO_MOD_2_4",MOD_OTHER:"FD_SECOND_AGO_MOD_OTHER"}),sdiff:()=>H(U((a-i)/1e3),{0:"FD_SECOND_DIFF_0",1:"FD_SECOND_DIFF_1","10_20":"FD_SECOND_DIFF_10_20",MOD_1:"FD_SECOND_DIFF_MOD_1",MOD_2_4:"FD_SECOND_DIFF_MOD_2_4",MOD_OTHER:"FD_SECOND_DIFF_MOD_OTHER"}),sshort:()=>this._getMessage("FD_SECOND_SHORT").replace(/#VALUE#/g,U((a-i)/1e3)),iago:()=>H(U((a-i)/60/1e3),{0:"FD_MINUTE_AGO_0",1:"FD_MINUTE_AGO_1","10_20":"FD_MINUTE_AGO_10_20",MOD_1:"FD_MINUTE_AGO_MOD_1",MOD_2_4:"FD_MINUTE_AGO_MOD_2_4",MOD_OTHER:"FD_MINUTE_AGO_MOD_OTHER"}),idiff:()=>H(U((a-i)/60/1e3),{0:"FD_MINUTE_DIFF_0",1:"FD_MINUTE_DIFF_1","10_20":"FD_MINUTE_DIFF_10_20",MOD_1:"FD_MINUTE_DIFF_MOD_1",MOD_2_4:"FD_MINUTE_DIFF_MOD_2_4",MOD_OTHER:"FD_MINUTE_DIFF_MOD_OTHER"}),isago:()=>{const e=U((a-i)/60/1e3);let t=H(e,{0:"FD_MINUTE_0",1:"FD_MINUTE_1","10_20":"FD_MINUTE_10_20",MOD_1:"FD_MINUTE_MOD_1",MOD_2_4:"FD_MINUTE_MOD_2_4",MOD_OTHER:"FD_MINUTE_MOD_OTHER"});t+=" ";const r=U((a-i)/1e3)-e*60;t+=H(r,{0:"FD_SECOND_AGO_0",1:"FD_SECOND_AGO_1","10_20":"FD_SECOND_AGO_10_20",MOD_1:"FD_SECOND_AGO_MOD_1",MOD_2_4:"FD_SECOND_AGO_MOD_2_4",MOD_OTHER:"FD_SECOND_AGO_MOD_OTHER"});return t},ishort:()=>this._getMessage("FD_MINUTE_SHORT").replace(/#VALUE#/g,U((a-i)/60/1e3)),Hago:()=>H(U((a-i)/60/60/1e3),{0:"FD_HOUR_AGO_0",1:"FD_HOUR_AGO_1","10_20":"FD_HOUR_AGO_10_20",MOD_1:"FD_HOUR_AGO_MOD_1",MOD_2_4:"FD_HOUR_AGO_MOD_2_4",MOD_OTHER:"FD_HOUR_AGO_MOD_OTHER"}),Hdiff:()=>H(U((a-i)/60/60/1e3),{0:"FD_HOUR_DIFF_0",1:"FD_HOUR_DIFF_1","10_20":"FD_HOUR_DIFF_10_20",MOD_1:"FD_HOUR_DIFF_MOD_1",MOD_2_4:"FD_HOUR_DIFF_MOD_2_4",MOD_OTHER:"FD_HOUR_DIFF_MOD_OTHER"}),Hshort:()=>this._getMessage("FD_HOUR_SHORT").replace(/#VALUE#/g,U((a-i)/60/60/1e3)),yesterday:()=>this._getMessage("FD_YESTERDAY"),today:()=>this._getMessage("FD_TODAY"),tommorow:()=>this._getMessage("FD_TOMORROW"),tomorrow:()=>this._getMessage("FD_TOMORROW"),dago:()=>H(U((a-i)/60/60/24/1e3),{0:"FD_DAY_AGO_0",1:"FD_DAY_AGO_1","10_20":"FD_DAY_AGO_10_20",MOD_1:"FD_DAY_AGO_MOD_1",MOD_2_4:"FD_DAY_AGO_MOD_2_4",MOD_OTHER:"FD_DAY_AGO_MOD_OTHER"}),ddiff:()=>H(U((a-i)/60/60/24/1e3),{0:"FD_DAY_DIFF_0",1:"FD_DAY_DIFF_1","10_20":"FD_DAY_DIFF_10_20",MOD_1:"FD_DAY_DIFF_MOD_1",MOD_2_4:"FD_DAY_DIFF_MOD_2_4",MOD_OTHER:"FD_DAY_DIFF_MOD_OTHER"}),dshort:()=>this._getMessage("FD_DAY_SHORT").replace(/#VALUE#/g,U((a-i)/60/60/24/1e3)),mago:()=>H(U((a-i)/60/60/24/31/1e3),{0:"FD_MONTH_AGO_0",1:"FD_MONTH_AGO_1","10_20":"FD_MONTH_AGO_10_20",MOD_1:"FD_MONTH_AGO_MOD_1",MOD_2_4:"FD_MONTH_AGO_MOD_2_4",MOD_OTHER:"FD_MONTH_AGO_MOD_OTHER"}),mdiff:()=>H(U((a-i)/60/60/24/31/1e3),{0:"FD_MONTH_DIFF_0",1:"FD_MONTH_DIFF_1","10_20":"FD_MONTH_DIFF_10_20",MOD_1:"FD_MONTH_DIFF_MOD_1",MOD_2_4:"FD_MONTH_DIFF_MOD_2_4",MOD_OTHER:"FD_MONTH_DIFF_MOD_OTHER"}),mshort:()=>this._getMessage("FD_MONTH_SHORT").replace(/#VALUE#/g,U((a-i)/60/60/24/31/1e3)),Yago:()=>H(U((a-i)/60/60/24/365/1e3),{0:"FD_YEARS_AGO_0",1:"FD_YEARS_AGO_1","10_20":"FD_YEARS_AGO_10_20",MOD_1:"FD_YEARS_AGO_MOD_1",MOD_2_4:"FD_YEARS_AGO_MOD_2_4",MOD_OTHER:"FD_YEARS_AGO_MOD_OTHER"}),Ydiff:()=>H(U((a-i)/60/60/24/365/1e3),{0:"FD_YEARS_DIFF_0",1:"FD_YEARS_DIFF_1","10_20":"FD_YEARS_DIFF_10_20",MOD_1:"FD_YEARS_DIFF_MOD_1",MOD_2_4:"FD_YEARS_DIFF_MOD_2_4",MOD_OTHER:"FD_YEARS_DIFF_MOD_OTHER"}),Yshort:()=>H(U((a-i)/60/60/24/365/1e3),{0:"FD_YEARS_SHORT_0",1:"FD_YEARS_SHORT_1","10_20":"FD_YEARS_SHORT_10_20",MOD_1:"FD_YEARS_SHORT_MOD_1",MOD_2_4:"FD_YEARS_SHORT_MOD_2_4",MOD_OTHER:"FD_YEARS_SHORT_MOD_OTHER"}),x:()=>{const e=this.isAmPmMode(true);const t=e===this.AM_PM_MODE.LOWER?"g:i a":e===this.AM_PM_MODE.UPPER?"g:i A":"H:i";return this.format([["tomorrow","tomorrow, "+t],["-",this.convertBitrixFormat(this._getMessage("FORMAT_DATETIME")).replace(/:s/g,"")],["s","sago"],["i","iago"],["today","today, "+t],["yesterday","yesterday, "+t],["",this.convertBitrixFormat(this._getMessage("FORMAT_DATETIME")).replace(/:s/g,"")]],i,a,o)},X:()=>{const e=this.isAmPmMode(true);const t=e===this.AM_PM_MODE.LOWER?"g:i a":e===this.AM_PM_MODE.UPPER?"g:i A":"H:i";const r=this.format([["tomorrow","tomorrow"],["-",this.convertBitrixFormat(this._getMessage("FORMAT_DATE"))],["today","today"],["yesterday","yesterday"],["",this.convertBitrixFormat(this._getMessage("FORMAT_DATE"))]],i,a,o);const s=this.format([["tomorrow",t],["today",t],["yesterday",t],["",""]],i,a,o);if(s.length>0){return this._getMessage("FD_DAY_AT_TIME").replace(/#DAY#/g,r).replace(/#TIME#/g,s)}else{return r}},Q:()=>{const e=U((a-i)/60/60/24/1e3);if(e==0){return this._getMessage("FD_DAY_DIFF_1").replace(/#VALUE#/g,1)}else{return this.format([["d","ddiff"],["m","mdiff"],["","Ydiff"]],i,a)}}};let M=false;if(r[0]&&r[0]=="^"){M=true;r=r.substr(1)}let O=r.replace(l,p);
21if(M){O=O.replace(/\s*00:00:00\s*/g,"").replace(/(\d\d:\d\d)(:00)/g,"$1").replace(/(\s*00:00\s*)(?!:)/g,"")}if(u.length>0){u.forEach((function(e,t){O=O.replace("{{"+t+"}}",e)}))}return O;function f(e,t,r,s){const n=U((r-t)/1e3);for(let _=0;_<e.length;_++){const i=e[_][0];const a=e[_][1];let o=null;if(i=="s"){if(n<60){return D.format(a,t,r,s)}}else if((o=/^s(\d+)\>?(\d+)?/.exec(i))!=null){if(o[1]&&o[2]){if(n<o[1]&&n>o[2]){return D.format(a,t,r,s)}}else if(n<o[1]){return D.format(a,t,r,s)}}else if(i=="i"){if(n<60*60){return D.format(a,t,r,s)}}else if((o=/^i(\d+)\>?(\d+)?/.exec(i))!=null){if(o[1]&&o[2]){if(n<o[1]*60&&n>o[2]*60){return D.format(a,t,r,s)}}else if(n<o[1]*60){return D.format(a,t,r,s)}}else if(i=="H"){if(n<24*60*60){return D.format(a,t,r,s)}}else if((o=/^H(\d+)\>?(\d+)?/.exec(i))!=null){if(o[1]&&o[2]){if(n<o[1]*60*60&&n>o[2]*60*60){return D.format(a,t,r,s)}}else if(n<o[1]*60*60){return D.format(a,t,r,s)}}else if(i=="d"){if(n<31*24*60*60){return D.format(a,t,r,s)}}else if((o=/^d(\d+)\>?(\d+)?/.exec(i))!=null){if(o[1]&&o[2]){if(n<o[1]*24*60*60&&n>o[2]*24*60*60){return D.format(a,t,r,s)}}else if(n<o[1]*24*60*60){return D.format(a,t,r,s)}}else if(i=="m"){if(n<365*24*60*60){return D.format(a,t,r,s)}}else if((o=/^m(\d+)\>?(\d+)?/.exec(i))!=null){if(o[1]&&o[2]){if(n<o[1]*31*24*60*60&&n>o[2]*31*24*60*60){return D.format(a,t,r,s)}}else if(n<o[1]*31*24*60*60){return D.format(a,t,r,s)}}else if(i=="now"){if(t.getTime()==r.getTime()){return D.format(a,t,r,s)}}else if(i=="today"){const e=g(r);const n=F(r);const _=T(r);const i=s?new Date(Date.UTC(e,n,_,0,0,0,0)):new Date(e,n,_,0,0,0,0);const o=s?new Date(Date.UTC(e,n,_+1,0,0,0,0)):new Date(e,n,_+1,0,0,0,0);if(t>=i&&t<o){return D.format(a,t,r,s)}}else if(i=="todayFuture"){const e=g(r);const n=F(r);const _=T(r);const i=r.getTime();const o=s?new Date(Date.UTC(e,n,_+1,0,0,0,0)):new Date(e,n,_+1,0,0,0,0);if(t>=i&&t<o){return D.format(a,t,r,s)}}else if(i=="yesterday"){const e=g(r);const n=F(r);const _=T(r);const i=s?new Date(Date.UTC(e,n,_-1,0,0,0,0)):new Date(e,n,_-1,0,0,0,0);const o=s?new Date(Date.UTC(e,n,_,0,0,0,0)):new Date(e,n,_,0,0,0,0);if(t>=i&&t<o){return D.format(a,t,r,s)}}else if(i=="tommorow"||i=="tomorrow"){const e=g(r);const n=F(r);const _=T(r);const i=s?new Date(Date.UTC(e,n,_+1,0,0,0,0)):new Date(e,n,_+1,0,0,0,0);const o=s?new Date(Date.UTC(e,n,_+2,0,0,0,0)):new Date(e,n,_+2,0,0,0,0);if(t>=i&&t<o){return D.format(a,t,r,s)}}else if(i=="-"){if(n<0){return D.format(a,t,r,s)}}}return e.length>0?D.format(e[e.length-1][1],t,r,s):""}function g(e){return o?e.getUTCFullYear():e.getFullYear()}function T(e){return o?e.getUTCDate():e.getDate()}function F(e){return o?e.getUTCMonth():e.getMonth()}function h(e){return o?e.getUTCHours():e.getHours()}function E(e){return o?e.getUTCMinutes():e.getMinutes()}function m(e){return o?e.getUTCSeconds():e.getSeconds()}function R(e){return o?e.getUTCMilliseconds():e.getMilliseconds()}function S(e){return o?e.getUTCDay():e.getDay()}function d(e,t){return o?e.setUTCDate(t):e.setDate(t)}function A(e,t,r){return o?e.setUTCMonth(t,r):e.setMonth(t,r)}function H(e,t){const r=e<100?Math.abs(e):Math.abs(e%100);const s=r%10;let n="";if(r==0){n=D._getMessage(t["0"])}else if(r==1){n=D._getMessage(t["1"])}else if(r>=10&&r<=20){n=D._getMessage(t["10_20"])}else if(s==1){n=D._getMessage(t["MOD_1"])}else if(2<=s&&s<=4){n=D._getMessage(t["MOD_2_4"])}else{n=D._getMessage(t["MOD_OTHER"])}return n.replace(/#VALUE#/g,e)}function p(e,t){if(c[e]){return c[e]()}else{return t}}function U(e){return e>=0?Math.floor(e):Math.ceil(e)}}}]);return e}();babelHelpers.defineProperty(_,"AM_PM_MODE",{UPPER:1,LOWER:2,NONE:false});babelHelpers.defineProperty(_,"convertBitrixFormat",r);babelHelpers.defineProperty(_,"getFormat",n);function i(e,t){a(e,t);t.add(e)}function a(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function o(e,t,r){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return r}const D={format:"Y m d H i s",style:"long"};var u=new WeakSet;var l=new WeakSet;var c=new WeakSet;var M=new WeakSet;var O=new WeakSet;var f=new WeakSet;let g=function(){function e(t){babelHelpers.classCallCheck(this,e);i(this,f);i(this,O);i(this,M);i(this,c);i(this,l);i(this,u);this.milliseconds=Math.abs(t)}babelHelpers.createClass(e,[{key:"format",value:function e(r=D){const s={...D,...r};const n=t.Loc.getMessage("FD_UNIT_ORDER").split(" ");const _=o(this,u,T).call(this,s.style);const i=new Set(s.format.split(" "));const a=o(this,l,F).call(this,s.format);return n.filter((e=>i.has(e))).map((e=>o(this,c,h).call(this,e,e!==a,s.style))).filter((e=>e!=="")).join(_)}},{key:"formatClosest",value:function e(t=D){const r={...D,...t};const s=o(this,l,F).call(this,r.format);return o(this,c,h).call(this,s,false,r.style)}
21},{key:"seconds",get:function(){return Math.floor(this.milliseconds/e.getUnitDurations().s)}},{key:"minutes",get:function(){return Math.floor(this.milliseconds/e.getUnitDurations().i)}},{key:"hours",get:function(){return Math.floor(this.milliseconds/e.getUnitDurations().H)}},{key:"days",get:function(){return Math.floor(this.milliseconds/e.getUnitDurations().d)}},{key:"months",get:function(){return Math.floor(this.milliseconds/e.getUnitDurations().m)}},{key:"years",get:function(){return Math.floor(this.milliseconds/e.getUnitDurations().Y)}}],[{key:"createFromSeconds",value:function t(r){return new e(r*e.getUnitDurations().s)}},{key:"createFromMinutes",value:function t(r){return new e(r*e.getUnitDurations().i)}},{key:"getUnitDurations",value:function e(){return{s:1e3,i:6e4,H:36e5,d:864e5,m:26784e5,Y:31536e6}}}]);return e}();function T(e){if(e==="short"){return t.Loc.getMessage("FD_SEPARATOR_SHORT").replaceAll(" "," ")}return t.Loc.getMessage("FD_SEPARATOR").replaceAll(" "," ")}function F(e){const t=new Set(e.split(" "));const r=Object.entries(g.getUnitDurations()).filter((([e])=>t.has(e)));return r.reduce(((e,t)=>{const r=Math.floor(this.milliseconds/t[1])>=1;const s=t[1]>e[1];return r&&s?t:e}),r[0])[0]}function h(e,t,r){const s=t?o(this,M,E).call(this,e):o(this,O,m).call(this,e);if(t&&s===0){return""}const n=Date.now()/1e3;const i=s*o(this,f,R).call(this,e)/1e3;const a=r==="short"?`${e}short`:`${e}diff`;return _.format(a,n-i,n)}function E(e){const t={s:this.seconds%60,i:this.minutes%60,H:this.hours%24,d:this.days%31,m:this.months%12,Y:this.years};return t[e]}function m(e){const t={s:this.seconds,i:this.minutes,H:this.hours,d:this.days,m:this.months,Y:this.years};return t[e]}function R(e){return g.getUnitDurations()[e]}const S=new t.Cache.MemoryCache;const d={get SERVER_TO_UTC(){return S.remember("SERVER_TO_UTC",(()=>t.Text.toInteger(t.Loc.getMessage("SERVER_TZ_OFFSET"))))},get USER_TO_SERVER(){return S.remember("USER_TO_SERVER",(()=>t.Text.toInteger(t.Loc.getMessage("USER_TZ_OFFSET"))))},get BROWSER_TO_UTC(){return S.remember("BROWSER_TO_UTC",(()=>{const e=t.Text.toInteger((new Date).getTimezoneOffset()*60);return-e}))}};Object.freeze(d);function A(e){if(t.Type.isDate(e)){return p(e)}return t.Text.toInteger(e)}function H(e){return new Date(e*1e3)}function p(e){return Math.floor(e.getTime()/1e3)}let U=d;let y=null;function C(){return U}function I(){var e;return(e=y)!==null&&e!==void 0?e:p(new Date)}let N=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getDate",value:function e(r=null){const s=t.Type.isNumber(r)?r:this.getTimestamp();return H(s)}},{key:"toUserDate",value:function e(t){return H(this.toUser(t))}},{key:"toServerDate",value:function e(t){return H(this.toServer(t))}},{key:"toUser",value:function e(t){return this.toServer(t)+C().USER_TO_SERVER}},{key:"toServer",value:function e(t){return A(t)-C().BROWSER_TO_UTC+C().SERVER_TO_UTC}},{key:"getTimestamp",value:function e(){return I()}}]);return e}();let Y=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getDate",value:function e(r=null){if(t.Type.isNumber(r)){const e=C().SERVER_TO_UTC-C().BROWSER_TO_UTC;return H(r+e)}return N.toServerDate(N.getDate())}},{key:"toUserDate",value:function e(t){return H(this.toUser(t))}},{key:"toBrowserDate",value:function e(t){return H(this.toBrowser(t))}},{key:"toUser",value:function e(t){return A(t)+C().USER_TO_SERVER}},{key:"toBrowser",value:function e(t){return A(t)+C().BROWSER_TO_UTC-C().SERVER_TO_UTC}},{key:"getTimestamp",value:function e(){return N.toServer(N.getTimestamp())}}]);return e}();function w(e,t,r){b(e,t);v(r,"get");return k(e,r)}function v(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function b(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function k(e,t){if(t.get){return t.get.call(e)}return t.value}let G=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getDate",value:function r(s=null){if(t.Type.isNumber(s)){return H(s+w(this,e,B))}return H(this.getTimestamp())}},{key:"toBrowserDate",value:function e(t){return H(this.toBrowser(t))}},{key:"toServerDate",value:function e(t){return H(this.toServer(t))}},{key:"toUTCTimestamp",value:function t(r){return A(r)-w(this,e,B)}},{key:"toBrowser",value:function e(t){return A(t)+C().BROWSER_TO_UTC-C().SERVER_TO_UTC-C().USER_TO_SERVER}},{key:"toServer",value:function e(t){return A(t)-C().USER_TO_SERVER}},{key:"getTimestamp",value:function e(){return N.toUser(N.getTimestamp())}}]);return e}();function P(){const e=C().SERVER_TO_UTC+C().USER_TO_SERVER;return e-C().BROWSER_TO_UTC}var B={get:P,set:void 0};const x=Object.freeze({BrowserTime:N,Offset:d,ServerTime:Y,UserTime:G});e.Timezone=x;e.Date=_;e.DateTimeFormat=_;e.DurationFormat=g})(this.BX.Main=this.BX.Main||{},BX); 22/* End */ 23; 24; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/core/core_date.min.js?178547615326793";s:6:"source";s:33:"/bitrix/js/main/core/core_date.js";s:3:"min";
24s:37:"/bitrix/js/main/core/core_date.min.js";s:3:"map";s:37:"/bitrix/js/main/core/core_date.map.js";}"*/ 25(function(){if(BX.date)return;BX.date=BX.Main.Date;var e=null;BX.calendar=function(e){return BX.calendar.get().Show(e)};BX.calendar.get=function(){if(!e)e=new BX.JCCalendar;return e};BX.calendar.InsertDaysBack=function(e,t){if(t!=""){var a=new Date;if(t>0){a.setTime(a.valueOf()-t*864e5)}e.value=BX.date.format(BX.date.convertBitrixFormat(BX.message("FORMAT_DATE")),a,null)}else{e.value=""}};BX.calendar.ValueToString=function(e,t,a){return BX.date.format(BX.date.convertBitrixFormat(BX.message(t?"FORMAT_DATETIME":"FORMAT_DATE")),e,null,!!a)};BX.calendar.ValueToStringFormat=function(e,t,a){return BX.date.format(BX.date.convertBitrixFormat(t),e,null,!!a)};BX.CalendarPeriod={Init:function(e,t,a){if((e.value!=""||t.value!="")&&a.value=="")a.value="interval";a.onchange()},ChangeDirectOpts:function(e,t){var a=BX.findChild(t,{className:"adm-select adm-calendar-direction"},true);if(e=="week"){a.options[0].text=BX.message("JSADM_CALEND_PREV_WEEK");a.options[1].text=BX.message("JSADM_CALEND_CURR_WEEK");a.options[2].text=BX.message("JSADM_CALEND_NEXT_WEEK")}else{a.options[0].text=BX.message("JSADM_CALEND_PREV");a.options[1].text=BX.message("JSADM_CALEND_CURR");a.options[2].text=BX.message("JSADM_CALEND_NEXT")}},SaveAndClearInput:function(e){if(!window.SavedPeriodValues)window.SavedPeriodValues={};window.SavedPeriodValues[e.id]=e.value;e.value=""},RestoreInput:function(e){if(!window.SavedPeriodValues||!window.SavedPeriodValues[e.id])return;e.value=window.SavedPeriodValues[e.id];delete window.SavedPeriodValues[e.id]},OnChangeP:function(e){var t=e.parentNode.parentNode;var a,i,s,n;a=i=s=n=false;var r=BX.findChild(t,{className:"adm-input-wrap adm-calendar-inp adm-calendar-first"});var o=BX.findChild(t,{className:"adm-input-wrap adm-calendar-second"});var l=BX.findChild(t,{className:"adm-select-wrap adm-calendar-direction"});var p=BX.findChild(t,{className:"adm-calendar-separate"});var h=BX.findChild(t,{className:"adm-input adm-calendar-from"},true);var c=BX.findChild(t,{className:"adm-input adm-calendar-to"},true);switch(e.value){case"day":case"week":case"month":case"quarter":case"year":s=true;BX.CalendarPeriod.OnChangeD(l.children[0]);break;case"before":i=true;break;case"after":a=true;break;case"exact":a=true;break;case"interval":a=i=n=true;BX.CalendarPeriod.RestoreInput(h);BX.CalendarPeriod.RestoreInput(c);break;case"":BX.CalendarPeriod.SaveAndClearInput(h);BX.CalendarPeriod.SaveAndClearInput(c);break;default:break}BX.CalendarPeriod.ChangeDirectOpts(e.value,t);r.style.display=a?"inline-block":"none";o.style.display=i?"inline-block":"none";l.style.display=s?"inline-block":"none";p.style.display=n?"inline-block":"none"},OnChangeD:function(e){var t=e.parentNode.parentNode;var a=BX.findChild(t,{className:"adm-input adm-calendar-from"},true);var i=BX.findChild(t,{className:"adm-input adm-calendar-to"},true);var s=BX.findChild(t,{className:"adm-select adm-calendar-period"},true);var n=0;switch(e.value){case"previous":n=-1;break;case"next":n=1;break;case"current":default:break}var r=false;var o=false;var l=new Date;var p=l.getFullYear();var h=l.getMonth();var c=l.getDate();var u=l.getDay();if(u==0)u=7;switch(s.value){case"day":r=new Date(p,h,c+n,0,0,0);o=new Date(p,h,c+n,23,59,59);break;case"week":r=new Date(p,h,c-u+1+n*7,0,0,0);o=new Date(p,h,c+(7-u)+n*7,23,59,59);break;case"month":r=new Date(p,h+n,1,0,0,0);o=new Date(p,h+1+n,0,23,59,59);break;case"quarter":var d=Math.floor(h/3)+n;r=new Date(p,3*d,1,0,0,0);o=new Date(p,3*(d+1),0,23,59,59);break;case"year":r=new Date(p+n,0,1,0,0,0);o=new Date(p+1+n,0,0,23,59,59);break;default:break}var m=window[a.name+"_bTime"]?BX.message("FORMAT_DATETIME"):BX.message("FORMAT_DATE");if(r){a.value=BX.formatDate(r,m);BX.addClass(a,"adm-calendar-inp-setted")}if(o){i.value=BX.formatDate(o,m);BX.addClass(i,"adm-calendar-inp-setted")}}};BX.JCCalendar=function(){this.params={};this.bAmPm=BX.isAmPmMode();this.popup=null;this.popup_month=null;this.popup_year=null;this.month_popup_classname="";this.year_popup_classname="";this.value=null;this._layers={};this._current_layer=null;this.DIV=null;this.PARTS={};this.weekStart=0;this.numRows=6;this._create=function(e){const t={closeByEsc:true,autoHide:false,content:this._get_content(),bindOptions:{forceBindPosition:true},focusTrap:false};if(Boolean(e.fixed)&&e.fixed){t.fixed=e.fixed}this.popup=new BX.PopupWindow("calendar_popup_"+Math.random(),e.node,t);BX.bind(this.popup.popupContainer,"click",(function(e){e.stopPropagation()}))};this._auto_hide_disable=function(){BX.unbind(document,"click",BX.proxy(this._auto_hide,this))};this._auto_hide_enable=function(){BX.bind(document,"click",BX.proxy(this._auto_hide,this))};this._auto_hide=function(e){this._auto_hide_disable();this.popup.close()};this._get_content=function(){var e=BX.delegate((function(e){e=e||window.event;this.SetDate(new Date(parseInt(BX.proxy_context.getAttribute("data-date"))),e.type==="dblclick"||this.params.bCompatibility&&!this.params.bTimeVisibility)}),this);this.DIV=BX.create("DIV",{props:{className:"bx-calendar"},children:[BX.create("DIV",{props:{className:"bx-calendar-header"},children:[BX.create("A",{attrs:{href:"javascript:void(0)"},props:{className:"bx-calendar-left-arrow"},events:{click:BX.proxy(this._prev,this)}}),BX.create("SPAN",{props:{className:"bx-calendar-header-content"},children:[this.PARTS.MONTH=BX.create("A",{attrs:{href:"javascript:void(0)"},props:{className:"bx-calendar-top-month"},events:{click:BX.proxy(this._menu_month,this)}}),this.PARTS.YEAR=BX.create("A",{attrs:{href:"javascript:void(0)"},props:{className:"bx-calendar-top-year"},events:{click:BX.proxy(this._menu_year,this)}})]}),BX.create("A",{attrs:{href:"javascript:void(0)"},props:{className:"bx-calendar-right-arrow"},events:{click:BX.proxy(this._next,this)}})]}),this.PARTS.WEEK=BX.create("DIV",{props:{className:"bx-calendar-name-day-wrap"}}),this.PARTS.LAYERS=BX.create("DIV",{props:{className:"bx-calendar-cell-block"},events:{click:BX.delegateEvent({className:"bx-calendar-cell"},e),dblclick:BX.delegateEvent({className:"bx-calendar-cell"},e)}}),this.PARTS.TIME=BX.create("DIV",{props:{className:"bx-calendar-set-time-wrap"},events:{click:BX.delegateEvent({attr:"data-action"},BX.delegate(this._time_actions,this))},html:'<a href="javascript:void(0)" data-action="time_show" class="bx-calendar-set-time"><i></i>'+BX.message("CAL_TIME_SET")+'</a><div class="bx-calendar-form-block"><span class="bx-calendar-form-text">'+BX.message("CAL_TIME")+'</span><span class="bx-calendar-form"><input type="text" class="bx-calendar-form-input" maxwidth="2" onkeyup="BX.calendar.get()._check_time()" /><span class="bx-calendar-form-separator"></span><input type="text" class="bx-calendar-form-input" maxwidth="2" onkeyup="BX.calendar.get()._check_time()" />'+(this.bAmPm?'<span class="bx-calendar-AM-PM-block"><span class="bx-calendar-AM-PM-text" data-action="time_ampm"></span><span class="bx-calendar-form-arrow-r"><a href="javascript:void(0)" class="bx-calendar-form-arrow-top" data-action="time_ampm_up"><i></i></a><a href="javascript:void(0)" class="bx-calendar-form-arrow-bottom" data-action="time_ampm_down"><i></i></a></span></span>':"")+'</span><a href="javascript:void(0)" data-action="time_hide" class="bx-calendar-form-close"><i></i></a></div>'}),this.PARTS.BUTTONS=BX.create("DIV",{props:{className:"bx-calendar-button-block"},events:{click:BX.delegateEvent({attr:"data-action"},BX.delegate(this._button_actions,this))},html:'<a href="javascript:void(0)" class="bx-calendar-button bx-calendar-button-select" data-action="submit"><span class="bx-calendar-button-left"></span><span class="bx-calendar-button-text">'+BX.message("CAL_BUTTON")+'</span><span class="bx-calendar-button-right"></span></a><a href="javascript:void(0)" class="bx-calendar-button bx-calendar-button-cancel" data-action="cancel"><span class="bx-calendar-button-left"></span><span class="bx-calendar-button-text">'+BX.message("JS_CORE_WINDOW_CLOSE")+'</span><span class="bx-calendar-button-right"></span></a>'})]});this.PARTS.TIME_INPUT_H=BX.findChild(this.PARTS.TIME,{tag:"INPUT"},true);this.PARTS.TIME_INPUT_M=this.PARTS.TIME_INPUT_H.nextSibling.nextSibling;if(this.bAmPm)this.PARTS.TIME_AMPM=this.PARTS.TIME_INPUT_M.nextSibling.firstChild;var t=new BX.JCSpinner({input:this.PARTS.TIME_INPUT_H,callback_change:BX.proxy(this._check_time,this),bSaveValue:false}).Show();t.className="bx-calendar-form-arrow-l";this.PARTS.TIME_INPUT_H.parentNode.insertBefore(t,this.PARTS.TIME_INPUT_H);t=new BX.JCSpinner({input:this.PARTS.TIME_INPUT_M,callback_change:BX.proxy(this._check_time,this),bSaveValue:true}).Show();t.className="bx-calendar-form-arrow-r";if(!this.PARTS.TIME_INPUT_M.nextSibling)this.PARTS.TIME_INPUT_M.parentNode.appendChild(t);else this.PARTS.TIME_INPUT_M.parentNode.insertBefore(t,this.PARTS.TIME_INPUT_M.nextSibling);for(var a=0;a<7;a++){this.PARTS.WEEK.appendChild(BX.create("SPAN",{props:{className:"bx-calendar-name-day"},text:BX.message("DOW_"+(a+this.weekStart)%7)}))}return this.DIV};this._time_actions=function(){switch(BX.proxy_context.getAttribute("data-action")){case"time_show":BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-opened");if(this.params.bCompatibility){BX.removeClass(this.PARTS.BUTTONS,"bx-calendar-buttons-disabled")}this.popup.adjustPosition();break;case"time_hide":BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");if(this.params.bCompatibility){this._saveChoice("hide");BX.addClass(this.PARTS.BUTTONS,"bx-calendar-buttons-disabled")}this.popup.adjustPosition();break;case"time_ampm":this.PARTS.TIME_AMPM.innerHTML=this.PARTS.TIME_AMPM.innerHTML=="AM"?"PM":"AM";break;case"time_ampm_up":this._check_time({bSaveValue:false},null,12);return;break;case"time_ampm_down":this._check_time({bSaveValue:false},null,-12);return;break}this._check_time()};this._button_actions=function(){switch(BX.proxy_context.getAttribute("data-action")){case"submit":if(this.params.bCompatibility){this._saveChoice("show")}this.SaveValue();break;case"cancel":this.Close();break}};this._saveChoice=function(e){if(this.params.bCategoryTimeVisibilityOption){BX.userOptions.save(this.params.bCategoryTimeVisibilityOption,this.params.bNameTimeVisibilityOption,"visibility",e==="show"?"Y":"N")}this._bTimeVisibility=e==="show";this.params.bTimeVisibility=this._bTimeVisibility};this._check_time=function(e,t,a){var i=parseInt(this.PARTS.TIME_INPUT_H.value.substring(0,5),10)||0,s=parseInt(this.PARTS.TIME_INPUT_M.value.substring(0,5),10)||0,n=false;if(!!e&&!e.bSaveValue){this.value.setUTCHours(this.value.getUTCHours()+a)}else if(!isNaN(i)){if(this.bAmPm){if(i!=12&&this.PARTS.TIME_AMPM.innerHTML=="PM"){i+=12}}n=true;this.value.setUTCHours(i%24)}if(!isNaN(s)){n=true;this.value.setUTCMinutes(s%60)}if(n){this.SetValue(this.value)}};this._set_layer=function(){var e=parseInt(this.value.getUTCFullYear()+""+BX.util.str_pad_left(this.value.getUTCMonth()+"",2,"0"));if(!this._layers[e]){this._layers[e]=this._create_layer();this._layers[e].BXLAYERID=e}if(this._current_layer){var t=new Date(this.value.valueOf());t.setUTCHours(0);t.setUTCMinutes(0);var a=BX.findChild(this._layers[e],{tag:"A",className:"bx-calendar-active"},true),i=BX.findChild(this._layers[e],{tag:"A",attr:{"data-date":t.valueOf()+""}},true);if(a){BX.removeClass(a,"bx-calendar-active")}if(i){BX.addClass(i,"bx-calendar-active")}this._replace_layer(this._current_layer,this._layers[e])}else{this.PARTS.LAYERS.appendChild(this._layers[e])}this._current_layer=this._layers[e]};this._replace_layer=function(e,t){if(e!=t){if(!BX.browser.IsIE()||BX.browser.IsDoctype()){var a=e.BXLAYERID>t.BXLAYERID?1:-1;var i=0;var s=-a*e.offsetHeight;e.style.position="relative";e.style.top="0px";e.style.zIndex=5;t.style.position="absolute";t.style.top=s+"px";t.style.zIndex=6;this.PARTS.LAYERS.appendChild(t);var n=15;var r;(r=function(){s+=a*n;i+=a*n;if(a*s<0){e.style.top=i+"px";t.style.top=s+"px";setTimeout(r,10)}else{e.parentNode.removeChild(e);t.style.top="0px";t.style.position="static";t.style.zIndex=0}})()}else{this.PARTS.LAYERS.replaceChild(t,e)}}};this._create_layer=function(){var e=BX.create("DIV",{props:{className:"bx-calendar-layer"}});var t=new Date(this.value);t.setUTCHours(0);t.setUTCMinutes(0);t.setUTCDate(1);if(t.getUTCDay()!=this.weekStart){var a=t.getUTCDay()-this.weekStart;a+=a<0?7:0;t.setUTCDate(t.getUTCDate()-a)}var i=this.value.getUTCMonth(),s=this.value.getUTCDate(),n="";for(var r=0;r<this.numRows;r++){n+='<div class="bx-calendar-range'+(r==this.numRows-1?" bx-calendar-range-noline":"")+'">';
25for(var o=0;o<7;o++){a=t.getUTCDate();var l=t.getUTCDay();var p="bx-calendar-cell";if(i!=t.getUTCMonth())p+=" bx-calendar-date-hidden";else if(s==a)p+=" bx-calendar-active";if(l==0||l==6)p+=" bx-calendar-weekend";n+='<a href="javascript:void(0)" class="'+p+'" data-date="'+t.valueOf()+'">'+a+"</a>";t.setUTCDate(t.getUTCDate()+1)}n+="</div>"}e.innerHTML=n;return e};this._prev=function(){this.SetMonth(this.value.getUTCMonth()-1)};this._next=function(){this.SetMonth(this.value.getUTCMonth()+1)};this._menu_month_content=function(){var e="",t=this.value.getMonth(),a;for(a=0;a<12;a++){e+='<span class="bx-calendar-month'+(a==t?" bx-calendar-month-active":"")+'" data-bx-month="'+a+'">'+BX.message("MONTH_"+(a+1))+"</span>"}return'<div class="bx-calendar-month-popup"><div class="bx-calendar-month-title" data-bx-month="'+this.value.getUTCMonth()+'">'+BX.message("MONTH_"+(this.value.getUTCMonth()+1))+'</div><div class="bx-calendar-month-content">'+e+"</div></div>"};this._menu_month=function(){if(!this.popup_month){this.popup_month=new BX.PopupWindow("calendar_popup_month_"+Math.random(),this.PARTS.MONTH,{content:this._menu_month_content(),closeByEsc:true,autoHide:true,offsetTop:-29,offsetLeft:-1,className:this.month_popup_classname,focusTrap:false,events:{onPopupShow:BX.delegate((function(){if(this.popup_year){this.popup_year.close()}}),this)}});BX.bind(this.popup_month.popupContainer,"click",BX.proxy(this.month_popup_click,this));this.popup_month.BXMONTH=this.value.getUTCMonth()}else if(this.popup_month.BXMONTH!=this.value.getUTCMonth()){this.popup_month.setContent(this._menu_month_content());this.popup_month.BXMONTH=this.value.getUTCMonth()}this.popup_month.show()};this.month_popup_click=function(e){var t=e.target||e.srcElement;if(t&&t.getAttribute&&t.getAttribute("data-bx-month")){this.SetMonth(parseInt(t.getAttribute("data-bx-month")));this.popup_month.close()}};this._menu_year_content=function(){var e='<div class="bx-calendar-year-popup"><div class="bx-calendar-year-title" data-bx-year="'+this.value.getUTCFullYear()+'">'+this.value.getUTCFullYear()+'</div><div class="bx-calendar-year-content" id="bx-calendar-year-content">';for(var t=-3;t<=3;t++){e+='<span class="bx-calendar-year-number'+(t==0?" bx-calendar-year-active":"")+'" data-bx-year="'+(this.value.getUTCFullYear()-t)+'">'+(this.value.getUTCFullYear()-t)+"</span>"}e+='</div><input data-bx-year-input="Y" type="text" class="bx-calendar-year-input" maxlength="4" /></div>';return e};this._menu_year=function(){if(!this.popup_year){this.popup_year=new BX.PopupWindow("calendar_popup_year_"+Math.random(),this.PARTS.YEAR,{content:this._menu_year_content(),closeByEsc:true,autoHide:true,offsetTop:-29,offsetLeft:-1,className:this.year_popup_classname,focusTrap:false,events:{onPopupShow:BX.delegate((function(){if(this.popup_month){this.popup_month.close()}}),this)}});BX.bind(this.popup_year.popupContainer,"click",BX.proxy(this.year_popup_click,this));BX.bind(this.popup_year.popupContainer,"keyup",BX.proxy(this.year_popup_keyup,this));this.popup_year.BXYEAR=this.value.getUTCFullYear()}else if(this.popup_year.BXYEAR!=this.value.getUTCFullYear()){this.popup_year.setContent(this._menu_year_content());this.popup_year.BXYEAR=this.value.getUTCFullYear()}this.popup_year.show()};this.year_popup_click=function(e){var t=e.target||e.srcElement;if(t&&t.getAttribute&&t.getAttribute("data-bx-year")){this.SetYear(parseInt(t.getAttribute("data-bx-year")));this.popup_year.close()}};this.year_popup_keyup=function(e){var t=e.target||e.srcElement;if(t&&t.getAttribute&&t.getAttribute("data-bx-year-input")=="Y"){var a=parseInt(t.value);if(a>=1900&&a<=2100){this.SetYear(a);this.popup_year.close()}}};this._check_date=function(e){var t=e;if(BX.type.isString(e)){t=BX.parseDate(e,true)}if(!BX.type.isDate(t)||isNaN(t.valueOf())){t=BX.date.convertToUTC(new Date);if(this.params.bHideTime){t.setUTCHours(0);t.setUTCMinutes(0)}}t.setUTCMilliseconds(0);t.setUTCSeconds(0);t.BXCHECKED=true;return t}};BX.JCCalendar.prototype.Show=function(e){if(!BX.isReady){BX.ready(BX.delegate((function(){this.Show(e)}),this));return}e.node=e.node||document.body;if(BX.type.isNotEmptyString(e.node)){var t=BX(e.node);
25if(!t){t=document.getElementsByName(e.node);if(t&&t.length>0){t=t[0]}}e.node=t}if(!e.node)return;if(!!e.field){if(BX.type.isString(e.field)){t=BX(e.field);if(!!t){e.field=t}else{if(e.form){if(BX.type.isString(e.form)){e.form=document.forms[e.form]}}if(BX.type.isDomNode(e.form)&&!!e.form[e.field]){e.field=e.form[e.field]}else{t=document.getElementsByName(e.field);if(t&&t.length>0){t=t[0];e.field=t}}}if(BX.type.isString(e.field)){e.field=BX(e.field)}}}var a=!this.popup||!this.popup.isShown()||this.params.node!=e.node;this.params=e;this.params.bCompatibility=typeof this.params.bCompatibility=="undefined"?false:this.params.bCompatibility;this.params.bTimeVisibility=typeof this.params.bTimeVisibility=="undefined"?!this.params.bCompatibility:this.params.bTimeVisibility;if(this.params.bCompatibility){this.params.bCategoryTimeVisibilityOption=this.params.bCategoryTimeVisibilityOption?this.params.bCategoryTimeVisibilityOption:"";this.params.bNameTimeVisibilityOption=this.params.bNameTimeVisibilityOption?this.params.bNameTimeVisibilityOption:"time_visibility";if(typeof this._bTimeVisibility!=="undefined"){this.params.bTimeVisibility=this._bTimeVisibility}}this.params.bTime=typeof this.params.bTime=="undefined"?true:!!this.params.bTime;this.params.bHideTime=typeof this.params.bHideTime=="undefined"?true:!!this.params.bHideTime;this.params.bUseSecond=typeof this.params.bUseSecond=="undefined"?true:!!this.params.bUseSecond;this.weekStart=parseInt(this.params.weekStart||this.params.weekStart||BX.message("WEEK_START"));if(isNaN(this.weekStart))this.weekStart=1;if(!this.popup){this._create(this.params)}else{this.popup.setBindElement(this.params.node)}var i=!!this.params.bHideTime;if(this.params.value){this.SetValue(this.params.value);i=this.value.getUTCHours()<=0&&this.value.getUTCMinutes()<=0}else if(this.params.field){this.SetValue(this.params.field.value);i=this.value.getUTCHours()<=0&&this.value.getUTCMinutes()<=0}else if(!!this.params.currentTime){this.SetValue(this.params.currentTime)}else{this.SetValue()}if(!!this.params.bTime){this.activateTimeStyle(i)}else{this.activateDateStyle(i)}if(a){this._auto_hide_disable();this.popup.show();setTimeout(BX.proxy(this._auto_hide_enable,this),0)}this.params.bSetFocus=typeof this.params.bSetFocus=="undefined"?true:!!this.params.bSetFocus;if(this.params.bSetFocus){e.node.blur()}else{BX.bind(e.node,"keyup",BX.defer((function(){this.SetValue(e.node.value);if(!!this.params.bTime){if(this.value.getUTCHours()<=0&&this.value.getUTCMinutes()<=0)BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");else BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-opened")}}),this))}return this};BX.JCCalendar.prototype.activateDateStyle=function(e){BX.addClass(this.DIV,"bx-calendar-time-disabled");if(!!e)BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");else BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-opened")};BX.JCCalendar.prototype.activateTimeStyle=function(e){if(this.params.bCompatibility&&!this.params.bTimeVisibility){BX.addClass(this.PARTS.BUTTONS,"bx-calendar-buttons-disabled");BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-wrap-simple");BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened")}else{BX.removeClass(this.DIV,"bx-calendar-time-disabled");if(!!e)BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");else BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-opened")}};BX.JCCalendar.prototype.SetDay=function(e){this.value.setUTCDate(e);return this.SetValue(this.value)};BX.JCCalendar.prototype.SetMonth=function(e){if(this.popup_month)this.popup_month.close();this.value.setUTCMonth(e);if(e<0)e+=12;else if(e>=12)e-=12;while(this.value.getUTCMonth()>e){this.value.setUTCDate(this.value.getUTCDate()-1)}return this.SetValue(this.value)};BX.JCCalendar.prototype.SetYear=function(e){if(this.popup_year)this.popup_year.close();this.value.setUTCFullYear(e);return this.SetValue(this.value)};BX.JCCalendar.prototype.SetDate=function(e,t){e=this._check_date(e);e.setUTCHours(this.value.getUTCHours());e.setUTCMinutes(this.value.getUTCMinutes());e.setUTCSeconds(this.value.getUTCSeconds());if(this.params.bTime&&!t){return this.SetValue(e)}else{this.SetValue(e);this.SaveValue()}};BX.JCCalendar.prototype.SetValue=function(e){this.value=e&&e.BXCHECKED?e:this._check_date(e);this.PARTS.MONTH.innerHTML=BX.message("MONTH_"+(this.value.getUTCMonth()+1));this.PARTS.YEAR.innerHTML=this.value.getUTCFullYear();if(!!this.params.bTime){var t=this.value.getUTCHours();if(this.bAmPm){if(t>=12){this.PARTS.TIME_AMPM.innerHTML="PM";if(t!=12)t-=12}else{this.PARTS.TIME_AMPM.innerHTML="AM";if(t==0)t=12}}this.PARTS.TIME_INPUT_H.value=BX.util.str_pad_left(t.toString(),2,"0");this.PARTS.TIME_INPUT_M.value=BX.util.str_pad_left(this.value.getUTCMinutes().toString(),2,"0")}this._set_layer();return this};BX.JCCalendar.prototype.SaveValue=function(){if(this.popup_month)this.popup_month.close();if(this.popup_year)this.popup_year.close();var e=true;if(!!this.params.callback){var t=this.params.callback.apply(this,[new Date(this.value.valueOf()+this.value.getTimezoneOffset()*6e4)]);if(t===false)e=false}if(e){var a=!!this.params.bTime&&BX.hasClass(this.PARTS.TIME,"bx-calendar-set-time-opened");if(this.params.field){var i=BX.message(a?"FORMAT_DATETIME":"FORMAT_DATE");if(a&&!this.params.bUseSecond){i=i.replace(":SS","")}this.params.field.value=BX.calendar.ValueToStringFormat(this.value,i,true);BX.fireEvent(this.params.field,"change")}this.popup.close();if(!!this.params.callback_after){this.params.callback_after.apply(this,[new Date(this.value.valueOf()+this.value.getTimezoneOffset()*6e4),a])}}return this};BX.JCCalendar.prototype.Close=function(){if(!!this.popup)this.popup.close();return this};BX.JCSpinner=function(e){e=e||{};this.params={input:e.input||null,delta:e.delta||1,timeout_start:e.timeout_start||1e3,timeout_cont:e.timeout_cont||150,callback_start:e.callback_start||null,callback_change:e.callback_change||null,callback_finish:e.callback_finish||null,bSaveValue:typeof e.bSaveValue=="undefined"?!!e.input:!!e.bSaveValue};this.mousedown=false;this.direction=1};BX.JCSpinner.prototype.Show=function(){this.node=BX.create("span",{events:{mousedown:BX.delegateEvent({attr:"data-dir"},BX.delegate(this.Start,this))},html:'<a href="javascript:void(0)" class="bx-calendar-form-arrow bx-calendar-form-arrow-top" data-dir="1"><i></i></a><a href="javascript:void(0)" class="bx-calendar-form-arrow bx-calendar-form-arrow-bottom" data-dir="-1"><i></i></a>'});return this.node};BX.JCSpinner.prototype.Start=function(){this.mousedown=true;this.direction=BX.proxy_context.getAttribute("data-dir")>0?1:-1;BX.bind(document,"mouseup",BX.proxy(this.MouseUp,this));this.ChangeValue(true)};BX.JCSpinner.prototype.ChangeValue=function(e){if(!this.mousedown)return;if(this.params.input){var t=parseInt(this.params.input.value,10)+this.params.delta*this.direction;
25if(this.params.bSaveValue)this.params.input.value=t;if(!!e&&this.params.callback_start)this.params.callback_start(this.params,t,this.direction);if(this.params.callback_change)this.params.callback_change(this.params,t,this.direction);setTimeout(BX.proxy(this.ChangeValue,this),!!e?this.params.timeout_start:this.params.timeout_cont)}};BX.JCSpinner.prototype.MouseUp=function(){this.mousedown=false;BX.unbind(document,"mouseup",BX.proxy(this.MouseUp,this));if(this.params.callback_finish)this.params.callback_finish(this.params,this.params.input.value)};window.jsCalendar={Show:function(e,t,a,i,s,n,r,o){return BX.calendar({node:e,field:t,form:r,bTime:!!s,currentTime:n,bHideTimebar:!!o})},ValueToString:BX.calendar.ValueToString};BX.CClockSelector=function(e){this.params=e;this.params.popup_buttons=this.params.popup_buttons||[new BX.PopupWindowButton({text:BX.message("CAL_BUTTON"),className:"popup-window-button-create",events:{click:BX.proxy(this.setValue,this)}})];this.isReady=false;this.WND=new BX.PopupWindow(this.params.popup_id||"clock_selector_popup",this.params.node,this.params.popup_config||{titleBar:BX.message("CAL_TIME"),offsetLeft:-45,offsetTop:-135,autoHide:true,closeIcon:true,closeByEsc:true,focusTrap:false});this.SHOW=false;BX.addCustomEvent(this.WND,"onPopupClose",BX.delegate(this.onPopupClose,this));this.obClocks={};this.CLOCK_ID=this.params.clock_id||"clock_selector"};BX.CClockSelector.prototype.Show=function(){if(!this.isReady){BX.addCustomEvent("onClockRegister",BX.proxy(this.onClockRegister,this));return BX.ajax.get("/bitrix/tools/clock_selector.php",{start_time:this.params.start_time,clock_id:this.CLOCK_ID,sessid:BX.bitrix_sessid()},BX.delegate(this.Ready,this))}this.WND.setButtons(this.params.popup_buttons);this.WND.show();this.SHOW=true;if(window["bxClock_"+this.obClocks[this.CLOCK_ID]]){setTimeout("window['bxClock_"+this.obClocks[this.CLOCK_ID]+"'].CalculateCoordinates()",40)}return true};BX.CClockSelector.prototype.onClockRegister=function(e){if(e[this.CLOCK_ID]){this.obClocks[this.CLOCK_ID]=e[this.CLOCK_ID];BX.removeCustomEvent("onClockRegister",BX.proxy(this.onClockRegister,this))}};BX.CClockSelector.prototype.Ready=function(e){this.content=this.CreateContent(e);this.WND.setContent(this.content);this.isReady=true;setTimeout(BX.proxy(this.Show,this),30)};BX.CClockSelector.prototype.CreateContent=function(e){return BX.create("DIV",{events:{click:BX.PreventDefault},html:'<div class="bx-tm-popup-clock">'+e+"</div>"})};BX.CClockSelector.prototype.setValue=function(e){if(this.params.callback){var t=BX.findChild(this.content,{tagName:"INPUT"},true);this.params.callback.apply(this.params.node,[t.value])}return BX.PreventDefault(e)};BX.CClockSelector.prototype.closeWnd=function(e){this.WND.close();return e||window.event?BX.PreventDefault(e):true};BX.CClockSelector.prototype.setNode=function(e){this.WND.setBindElement(e)};BX.CClockSelector.prototype.setTime=function(e){this.params.start_time=e;if(window["bxClock_"+this.obClocks[this.CLOCK_ID]]){window["bxClock_"+this.obClocks[this.CLOCK_ID]].SetTime(parseInt(e/3600),parseInt(e%3600/60))}};BX.CClockSelector.prototype.setCallback=function(e){this.params.callback=e};BX.CClockSelector.prototype.onPopupClose=function(){this.SHOW=false}})(); 26/* End */ 27; 28; /* Start:"a:4:{s:4:"full";s:40:"/bitrix/js/main/utils.js?163471336129279";s:6:"source";s:24:"/bitrix/js/main/utils.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 29var phpVars; 30if(!phpVars) 31{ 32 phpVars = { 33 ADMIN_THEME_ID: '.default', 34 LANGUAGE_ID: 'en', 35 FORMAT_DATE: 'DD.MM.YYYY', 36 FORMAT_DATETIME: 'DD.MM.YYYY HH:MI:SS', 37 opt_context_ctrl: false, 38 cookiePrefix: 'BITRIX_SM', 39 titlePrefix: '', 40 bitrix_sessid: '', 41 messHideMenu: '', 42 messShowMenu: '', 43 messHideButtons: '', 44 messShowButtons: '', 45 messFilterInactive: '', 46 messFilterActive: '', 47 messFilterLess: '', 48 messLoading: 'Loading...', 49 messMenuLoading: '', 50 messMenuLoadingTitle: '', 51 messNoData: '', 52 messExpandTabs: '', 53 messCollapseTabs: '', 54 messPanelFixOn: '', 55 messPanelFixOff: '', 56 messPanelCollapse: '', 57 messPanelExpand: '' 58 }; 59} 60 61var jsUtils = 62{ 63 arEvents: Array(), 64 65 addEvent: function(el, evname, func, capture) 66 { 67 if(el.attachEvent) // IE 68 el.attachEvent("on" + evname, func); 69 else if(el.addEventListener) // Gecko / W3C 70 el.addEventListener(evname, func, false); 71 else 72 el["on" + evname] = func; 73 this.arEvents[this.arEvents.length] = {'element': el, 'event': evname, 'fn': func}; 74 }, 75 76 removeEvent: function(el, evname, func) 77 { 78 if(el.detachEvent) // IE 79 el.detachEvent("on" + evname, func); 80 else if(el.removeEventListener) // Gecko / W3C 81 el.removeEventListener(evname, func, false); 82 else 83 el["on" + evname] = null; 84 }, 85 86 removeAllEvents: function(el) 87 { 88 var i; 89 for(i=0; i<this.arEvents.length; i++) 90 { 91 if(this.arEvents[i] && (el==false || el==this.arEvents[i].element)) 92 { 93 jsUtils.removeEvent(this.arEvents[i].element, this.arEvents[i].event, this.arEvents[i].fn); 94 this.arEvents[i] = null; 95 } 96 } 97 if(el==false) 98 this.arEvents.length = 0; 99 }, 100 101 IsDoctype: function() 102 { 103 if (document.compatMode) 104 return (document.compatMode == "CSS1Compat"); 105 106 if (document.documentElement && document.documentElement.clientHeight) 107 return true; 108 109 return false;
110 }, 111 112 GetRealPos: function(el) 113 { 114 if(window.BX) 115 return BX.pos(el); 116 117 if(!el || !el.offsetParent) 118 return false; 119 120 var res = Array(); 121 res["left"] = el.offsetLeft; 122 res["top"] = el.offsetTop; 123 var objParent = el.offsetParent; 124 125 while(objParent && objParent.tagName != "BODY") 126 { 127 res["left"] += objParent.offsetLeft; 128 res["top"] += objParent.offsetTop; 129 objParent = objParent.offsetParent; 130 } 131 res["right"] = res["left"] + el.offsetWidth; 132 res["bottom"] = res["top"] + el.offsetHeight; 133 134 return res; 135 }, 136 137 FindChildObject: function(obj, tag_name, class_name, recursive) 138 { 139 if(!obj) 140 return null; 141 var tag = tag_name.toUpperCase(); 142 var cl = (class_name? class_name.toLowerCase() : null); 143 var n = obj.childNodes.length; 144 for(var j=0; j<n; j++) 145 { 146 var child = obj.childNodes[j]; 147 if(child.tagName && child.tagName.toUpperCase() == tag) 148 if(!class_name || child.className.toLowerCase() == cl) 149 return child; 150 if(recursive == true) 151 { 152 var deepChild; 153 if((deepChild = jsUtils.FindChildObject(child, tag_name, class_name, true))) 154 return deepChild; 155 } 156 } 157 return null; 158 }, 159 160 FindParentObject: function(obj, tag_name, class_name) 161 { 162 if(!obj) 163 return null; 164 var o = obj; 165 var tag = tag_name.toUpperCase(); 166 var cl = (class_name? class_name.toLowerCase() : null); 167 while(o.parentNode) 168 { 169 var parent = o.parentNode; 170 if(parent.tagName && parent.tagName.toUpperCase() == tag) 171 if(!class_name || parent.className.toLowerCase() == cl) 172 return parent; 173 o = parent; 174 } 175 return null; 176 }, 177 178 FindNextSibling: function(obj, tag_name) 179 { 180 if(!obj) 181 return null; 182 var o = obj; 183 var tag = tag_name.toUpperCase(); 184 while(o.nextSibling) 185 { 186 var sibling = o.nextSibling; 187 if(sibling.tagName && sibling.tagName.toUpperCase() == tag) 188 return sibling; 189 o = sibling; 190 } 191 return null; 192 }, 193 194 FindPreviousSibling: function(obj, tag_name) 195 { 196 if(!obj) 197 return null; 198 var o = obj; 199 var tag = tag_name.toUpperCase(); 200 while(o.previousSibling) 201 { 202 var sibling = o.previousSibling; 203 if(sibling.tagName && sibling.tagName.toUpperCase() == tag) 204 return sibling; 205 o = sibling; 206 } 207 return null; 208 }, 209 210 bOpera : navigator.userAgent.toLowerCase().indexOf('opera') != -1, 211 bIsIE : document.attachEvent && navigator.userAgent.toLowerCase().indexOf('opera') == -1, 212 213 IsIE: function() 214 { 215 return this.bIsIE; 216 }, 217 218 IsOpera: function() 219 { 220 return this.bOpera; 221 }, 222 223 IsSafari: function() 224 { 225 var userAgent = navigator.userAgent.toLowerCase(); 226 return (/webkit/.test(userAgent)); 227 }, 228 229 IsEditor: function() 230 { 231 var userAgent = navigator.userAgent.toLowerCase(); 232 var version = (userAgent.match( /.+(msie)[\/: ]([\d.]+)/ ) || [])[2]; 233 var safari = /webkit/.test(userAgent); 234 235 if (this.IsOpera() || (document.all && !document.compatMode && version < 6) || safari) 236 return false; 237 238 return true; 239 }, 240 241 ToggleDiv: function(div) 242 { 243 var style = document.getElementById(div).style; 244 if(style.display!="none") 245 style.display = "none"; 246 else 247 style.display = "block"; 248 return (style.display != "none"); 249 }, 250 251 urlencode: function(s) 252 { 253 return escape(s).replace(new RegExp('\\+','g'), '%2B'); 254 }, 255 256 OpenWindow: function(url, width, height) 257 { 258 var w = screen.width, h = screen.height; 259 if(this.IsOpera()) 260 { 261 w = document.body.offsetWidth; 262 h = document.body.offsetHeight; 263 } 264 window.open(url, '', 'status=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',top='+Math.floor((h - height)/2-14)+',left='+Math.floor((w - width)/2-5)); 265 }, 266 267 SetPageTitle: function(s) 268 { 269 document.title = phpVars.titlePrefix+s; 270 var h1 = document.getElementsByTagName("H1"); 271 if(h1) 272 h1[0].innerHTML = s; 273 }, 274 275 LoadPageToDiv: function(url, div_id) 276 { 277 var div = document.getElementById(div_id); 278 if(!div) 279 return; 280 CHttpRequest.Action = function(result) 281 { 282 CloseWaitWindow(); 283 document.getElementById(div_id).innerHTML = result; 284 } 285 ShowWaitWindow(); 286 CHttpRequest.Send(url); 287 }, 288 289 trim: function(s) 290 { 291 if (typeof s == 'string' || typeof s == 'object' && s.constructor == String) 292 { 293 var r, re; 294 295 re = /^[\s\r\n]+/g; 296 r = s.replace(re, ""); 297 re = /[\s\r\n]+$/g; 298 r = r.replace(re, ""); 299 return r; 300 } 301 else 302 return s; 303 }, 304 305 Redirect: function(args, url) 306 { 307 var e = null, bShift = false;
308 if(args && args.length > 0) 309 e = args[0]; 310 if(!e) 311 e = window.event; 312 if(e) 313 bShift = e.shiftKey; 314 315 if(bShift) 316 window.open(url); 317 else 318 { 319 window.location.href=url; 320 } 321 }, 322 323 False: function(){return false;}, 324 325 AlignToPos: function(pos, w, h) 326 { 327 var x = pos["left"], y = pos["bottom"]; 328 329 var scroll = jsUtils.GetWindowScrollPos(); 330 var size = jsUtils.GetWindowInnerSize(); 331 332 if((size.innerWidth + scroll.scrollLeft) - (pos["left"] + w) < 0) 333 { 334 if(pos["right"] - w >= 0 ) 335 x = pos["right"] - w; 336 else 337 x = scroll.scrollLeft; 338 } 339 340 if((size.innerHeight + scroll.scrollTop) - (pos["bottom"] + h) < 0) 341 { 342 if(pos["top"] - h >= 0) 343 y = pos["top"] - h; 344 else 345 y = scroll.scrollTop; 346 } 347 348 return {'left':x, 'top':y}; 349 }, 350 351 // evaluate js string in window scope 352 EvalGlobal: function(script) 353 { 354 try { 355 if (window.execScript) 356 window.execScript(script, 'javascript'); 357 else if (jsUtils.IsSafari()) 358 window.setTimeout(script, 0); 359 else 360 window.eval(script); 361 } catch (e) {/*alert("Error! jsUtils.EvalGlobal");*/} 362 }, 363 364 GetStyleValue: function(el, styleProp) 365 { 366 var res; 367 if(el.currentStyle) 368 res = el.currentStyle[styleProp]; 369 else if(window.getComputedStyle) 370 res = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp); 371 if(!res) 372 res = ''; 373 return res; 374 }, 375 376 GetWindowInnerSize: function(pDoc) 377 { 378 var width, height; 379 if (!pDoc) 380 pDoc = document; 381 382 if (self.innerHeight) // all except Explorer 383 { 384 width = self.innerWidth; 385 height = self.innerHeight; 386 } 387 else if (pDoc.documentElement && (pDoc.documentElement.clientHeight || pDoc.documentElement.clientWidth)) // Explorer 6 Strict Mode 388 { 389 width = pDoc.documentElement.clientWidth; 390 height = pDoc.documentElement.clientHeight; 391 } 392 else if (pDoc.body) // other Explorers 393 { 394 width = pDoc.body.clientWidth; 395 height = pDoc.body.clientHeight; 396 } 397 return {innerWidth : width, innerHeight : height}; 398 }, 399 400 GetWindowScrollPos: function(pDoc) 401 { 402 var left, top; 403 if (!pDoc) 404 pDoc = document; 405 406 if (self.pageYOffset) // all except Explorer 407 { 408 left = self.pageXOffset; 409 top = self.pageYOffset; 410 } 411 else if (pDoc.documentElement && (pDoc.documentElement.scrollTop || pDoc.documentElement.scrollLeft)) // Explorer 6 Strict 412 { 413 left = document.documentElement.scrollLeft; 414 top = document.documentElement.scrollTop; 415 } 416 else if (pDoc.body) // all other Explorers 417 { 418 left = pDoc.body.scrollLeft; 419 top = pDoc.body.scrollTop; 420 } 421 return {scrollLeft : left, scrollTop : top}; 422 }, 423 424 GetWindowScrollSize: function(pDoc) 425 { 426 var width, height; 427 if (!pDoc) 428 pDoc = document; 429 430 if ( (pDoc.compatMode && pDoc.compatMode == "CSS1Compat")) 431 { 432 width = pDoc.documentElement.scrollWidth; 433 height = pDoc.documentElement.scrollHeight; 434 } 435 else 436 { 437 if (pDoc.body.scrollHeight > pDoc.body.offsetHeight) 438 height = pDoc.body.scrollHeight; 439 else 440 height = pDoc.body.offsetHeight; 441 442 if (pDoc.body.scrollWidth > pDoc.body.offsetWidth || 443 (pDoc.compatMode && pDoc.compatMode == "BackCompat") || 444 (pDoc.documentElement && !pDoc.documentElement.clientWidth) 445 ) 446 width = pDoc.body.scrollWidth; 447 else 448 width = pDoc.body.offsetWidth; 449 } 450 return {scrollWidth : width, scrollHeight : height}; 451 }, 452 453 GetWindowSize: function() 454 { 455 var innerSize = jsUtils.GetWindowInnerSize(); 456 var scrollPos = jsUtils.GetWindowScrollPos(); 457 var scrollSize = jsUtils.GetWindowScrollSize(); 458 459 return { 460 innerWidth : innerSize.innerWidth, innerHeight : innerSize.innerHeight, 461 scrollLeft : scrollPos.scrollLeft, scrollTop : scrollPos.scrollTop, 462 scrollWidth : scrollSize.scrollWidth, scrollHeight : scrollSize.scrollHeight 463 }; 464 }, 465 466 467 arCustomEvents: {}, 468 469 addCustomEvent: function(eventName, eventHandler, arParams, handlerContextObject) 470 { 471 if (!this.arCustomEvents[eventName]) 472 this.arCustomEvents[eventName] = []; 473 474 if (!arParams) 475 arParams = []; 476 if (!handlerContextObject) 477 handlerContextObject = false; 478 479 this.arCustomEvents[eventName].push( 480 { 481 handler: eventHandler, 482 arParams: arParams, 483 obj: handlerContextObject 484 } 485 ); 486 }, 487 488 removeCustomEvent: function(eventName, eventHandler) 489 { 490 if (!this.arCustomEvents[eventName]) 491 return; 492 493 var l = this.arCustomEvents[eventName].length; 494 if (l == 1) 495 { 496 delete this.arCustomEvents[eventName]; 497 return; 498 } 499 500 for (var i = 0; i < l; i++) 501 { 502 if (!this.arCustomEvents[eventName][i]) 503 continue; 504 if (this.arCustomEvents[eventName][i].handler == eventHandler) 505 { 506 delete this.arCustomEvents[eventName][i]; 507 return; 508 } 509 } 510 }, 511
512 onCustomEvent: function(eventName, arEventParams) 513 { 514 if (!this.arCustomEvents[eventName]) 515 return; 516 517 if (!arEventParams) 518 arEventParams = []; 519 520 var h; 521 for (var i = 0, l = this.arCustomEvents[eventName].length; i < l; i++) 522 { 523 h = this.arCustomEvents[eventName][i]; 524 if (!h || !h.handler) 525 continue; 526 527 if (h.obj) 528 h.handler.call(h.obj, h.arParams, arEventParams); 529 else 530 h.handler(h.arParams, arEventParams); 531 } 532 }, 533 534 loadJSFile: function(arJs, oCallBack, pDoc) 535 { 536 if (!pDoc) 537 pDoc = document; 538 if (typeof arJs == 'string') 539 arJs = [arJs]; 540 var callback = function() 541 { 542 if (!oCallBack) 543 return; 544 if (typeof oCallBack == 'function') 545 return oCallBack(); 546 if (typeof oCallBack != 'object' || !oCallBack.func) 547 return; 548 var p = oCallBack.params || {}; 549 if (oCallBack.obj) 550 oCallBack.func.apply(oCallBack.obj, p); 551 else 552 oCallBack.func(p); 553 }; 554 var load_js = function(ind) 555 { 556 if (ind >= arJs.length) 557 return callback(); 558 var oSript = pDoc.body.appendChild(pDoc.createElement('script')); 559 oSript.src = arJs[ind]; 560 var bLoaded = false; 561 oSript.onload = oSript.onreadystatechange = function() 562 { 563 if (!bLoaded && (!oSript.readyState || oSript.readyState == "loaded" || oSript.readyState == "complete")) 564 { 565 bLoaded = true; 566 setTimeout(function (){load_js(++ind);}, 50); 567 } 568 }; 569 }; 570 load_js(0); 571 }, 572 573 loadCSSFile: function(arCSS, pDoc, pWin) 574 { 575 if (typeof arCSS == 'string') 576 { 577 var bSingle = true; 578 arCSS = [arCSS]; 579 } 580 var i, l = arCSS.length, pLnk = []; 581 if (l == 0) 582 return; 583 if (!pDoc) 584 pDoc = document; 585 if (!pWin) 586 pWin = window; 587 if (!pWin.bxhead) 588 { 589 var heads = pDoc.getElementsByTagName('HEAD'); 590 pWin.bxhead = heads[0]; 591 } 592 if (!pWin.bxhead) 593 return; 594 for (i = 0; i < l; i++) 595 { 596 var lnk = document.createElement('LINK'); 597 lnk.href = arCSS[i]; 598 lnk.rel = 'stylesheet'; 599 lnk.type = 'text/css'; 600 pWin.bxhead.appendChild(lnk); 601 pLnk.push(lnk); 602 } 603 if (bSingle) 604 return lnk; 605 return pLnk; 606 }, 607 608 appendBXHint : function(node, html) 609 { 610 if (!node || !node.parentNode || !html) 611 return; 612 var oBXHint = new BXHint(html); 613 node.parentNode.insertBefore(oBXHint.oIcon, node); 614 node.parentNode.removeChild(node); 615 oBXHint.oIcon.style.marginLeft = "5px"; 616 }, 617 618 PreventDefault : function(e) 619 { 620 if(!e) e = window.event; 621 if(e.stopPropagation) 622 { 623 e.preventDefault(); 624 e.stopPropagation(); 625 } 626 else 627 { 628 e.cancelBubble = true; 629 e.returnValue = false; 630 } 631 return false; 632 }, 633 634 CreateElement: function(tag, arAttr, arStyles, pDoc) 635 { 636 if (!pDoc) 637 pDoc = document; 638 var pEl = pDoc.createElement(tag), p; 639 if(arAttr) 640 { 641 for(p in arAttr) 642 { 643 if(p == 'className' || p == 'class') 644 { 645 pEl.setAttribute('class', arAttr[p]); 646 if (jsUtils.IsIE()) 647 pEl.setAttribute('className', arAttr[p]); 648 continue; 649 } 650 651 if (arAttr[p] != undefined && arAttr[p] != null) 652 pEl.setAttribute(p, arAttr[p]); 653 } 654 } 655 if(arStyles) 656 { 657 for(p in arStyles) 658 pEl.style[p] = arStyles[p]; 659 } 660 return pEl; 661 }, 662 663 in_array: function(needle, haystack) 664 { 665 for(var i=0; i<haystack.length; i++) 666 { 667 if(haystack[i] == needle) 668 return true; 669 } 670 return false; 671 }, 672 673 htmlspecialchars: function(str) 674 { 675 if(!str.replace) 676 return str; 677 678 return str.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 679 } 680} 681 682/************************************************/ 683 684function JCFloatDiv() 685{ 686 var _this = this; 687 this.floatDiv = null; 688 this.x = this.y = 0; 689 690 this.Create = function(arParams) 691 { 692 var div = document.body.appendChild(document.createElement("DIV")); 693 div.id = arParams.id; 694 div.style.position = 'absolute'; 695 div.style.left = '-10000px'; 696 div.style.top = '-10000px'; 697 if(arParams.className) 698 div.className = arParams.className; 699 if(arParams.zIndex) 700 div.style.zIndex = arParams.zIndex; 701 if(arParams.width) 702 div.style.width = arParams.width+'px'; 703 if(arParams.height) 704 div.style.height = arParams.height+'px'; 705 return div; 706 } 707 708 this.Show = function(div, left, top, dxShadow, restrictDrag) 709 { 710 var component = BX.ZIndexManager.getComponent(div); 711 if (!component) 712 { 713 BX.ZIndexManager.register(div); 714 } 715 716 BX.ZIndexManager.bringToFront(div); 717 718 if (left < 0) 719 left = 0; 720 721 if (top < 0) 722 top = 0; 723 724 div.style.left = parseInt(left) + "px"; 725 div.style.top = parseInt(top) + "px"; 726 727 /*Restrict drag*/ 728 div.restrictDrag = restrictDrag || false; 729 730 /*shadow*/ 731 if(isNaN(dxShadow)) 732 dxShadow = 5; 733
734 div.dxShadow = dxShadow; 735 } 736 737 this.Close = function(div) 738 { 739 if(!div) 740 return; 741 var sh = document.getElementById(div.id+"_shadow"); 742 if(sh) 743 sh.style.visibility = 'hidden'; 744 745 var frame = document.getElementById(div.id+"_frame"); 746 if(frame) 747 frame.style.visibility = 'hidden'; 748 } 749 750 this.Move = function(div, x, y) 751 { 752 if(!div) 753 return; 754 755 var dxShadow = div.dxShadow; 756 var left = parseInt(div.style.left)+x; 757 var top = parseInt(div.style.top)+y; 758 759 if (div.restrictDrag) 760 { 761 //Left side 762 if (left < 0) 763 left = 0; 764 765 //Right side 766 if ( (document.compatMode && document.compatMode == "CSS1Compat")) 767 windowWidth = document.documentElement.scrollWidth; 768 else 769 { 770 if (document.body.scrollWidth > document.body.offsetWidth || 771 (document.compatMode && document.compatMode == "BackCompat") || 772 (document.documentElement && !document.documentElement.clientWidth) 773 ) 774 windowWidth = document.body.scrollWidth; 775 else 776 windowWidth = document.body.offsetWidth; 777 } 778 779 var floatWidth = div.offsetWidth; 780 if (left > (windowWidth - floatWidth - dxShadow)) 781 left = windowWidth - floatWidth - dxShadow; 782 783 //Top side 784 if (top < 0) 785 top = 0; 786 } 787 788 div.style.left = left+'px'; 789 div.style.top = top+'px'; 790 791 this.AdjustShadow(div); 792 } 793 794 this.HideShadow = function(div) 795 { 796 var sh = document.getElementById(div.id + "_shadow"); 797 sh.style.visibility = 'hidden'; 798 } 799 800 this.UnhideShadow = function(div) 801 { 802 var sh = document.getElementById(div.id + "_shadow"); 803 sh.style.visibility = 'visible'; 804 } 805 806 this.AdjustShadow = function(div) 807 { 808 var sh = document.getElementById(div.id + "_shadow"); 809 if(sh && sh.style.visibility != 'hidden') 810 { 811 var dxShadow = div.dxShadow; 812 813 sh.style.width = div.offsetWidth+'px'; 814 sh.style.height = div.offsetHeight+'px'; 815 sh.style.left = parseInt(div.style.left)+dxShadow+'px'; 816 sh.style.top = parseInt(div.style.top)+dxShadow+'px'; 817 } 818 819 var frame = document.getElementById(div.id+"_frame"); 820 if(frame) 821 { 822 frame.style.width = div.offsetWidth + "px"; 823 frame.style.height = div.offsetHeight + "px"; 824 frame.style.left = div.style.left; 825 frame.style.top = div.style.top; 826 } 827 } 828 829 this.StartDrag = function(e, div) 830 { 831 if(!e) 832 e = window.event; 833 this.x = e.clientX + document.body.scrollLeft; 834 this.y = e.clientY + document.body.scrollTop; 835 this.floatDiv = div; 836 837 jsUtils.addEvent(document, "mousemove", this.MoveDrag); 838 document.onmouseup = this.StopDrag; 839 if(document.body.setCapture) 840 document.body.setCapture(); 841 842 document.onmousedown = jsUtils.False; 843 var b = document.body; 844 b.ondrag = jsUtils.False; 845 b.onselectstart = jsUtils.False; 846 b.style.MozUserSelect = _this.floatDiv.style.MozUserSelect = 'none'; 847 b.style.cursor = 'move'; 848 } 849 850 this.StopDrag = function(e) 851 { 852 if(document.body.releaseCapture) 853 document.body.releaseCapture(); 854 855 jsUtils.removeEvent(document, "mousemove", _this.MoveDrag); 856 document.onmouseup = null; 857 858 this.floatDiv = null; 859 860 document.onmousedown = null; 861 var b = document.body; 862 b.ondrag = null; 863 b.onselectstart = null; 864 b.style.MozUserSelect = _this.floatDiv.style.MozUserSelect = ''; 865 b.style.cursor = ''; 866 } 867 868 this.MoveDrag = function(e) 869 { 870 var x = e.clientX + document.body.scrollLeft; 871 var y = e.clientY + document.body.scrollTop; 872 873 if(_this.x == x && _this.y == y) 874 return; 875 876 _this.Move(_this.floatDiv, (x - _this.x), (y - _this.y)); 877 _this.x = x; 878 _this.y = y; 879 } 880} 881var jsFloatDiv = new JCFloatDiv(); 882 883/************************************************/ 884 885var BXHint = function(innerHTML, element, addParams) 886{ 887 this.oDivOver = false; 888 this.timeOutID = null; 889 this.oIcon = null; 890 this.freeze = false; 891 this.x = 0; 892 this.y = 0; 893 this.time = 700; 894 895 if (!innerHTML) 896 innerHTML = ""; 897 this.Create(innerHTML, element, addParams); 898} 899 900BXHint.prototype.Create = function(innerHTML, element, addParams) 901{ 902 var 903 _this = this, 904 width = 0, 905 height = 0, 906 className = null, 907 type = "icon"; 908 this.bWidth = true; 909 910 if (addParams) 911 { 912 if (addParams.width === false) 913 this.bWidth = false; 914 else if (addParams.width) 915 width = addParams.width; 916 917 if (addParams.height) 918 height = addParams.height; 919 920 if (addParams.className) 921 className = addParams.className; 922 923 if (addParams.type && (addParams.type == "link" || addParams.type == "icon")) 924 type = addParams.type; 925 if (addParams.time > 0) 926 this.time = addParams.time; 927 } 928 929 if (element) 930 type = "element";
931 932 if (type == "icon") 933 { 934 var element = document.createElement("IMG"); 935 element.src = (addParams && addParams.iconSrc) ? addParams.iconSrc : "/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/public/popup/hint.gif"; 936 element.ondrag = jsUtils.False; 937 } 938 else if (type == "link") 939 { 940 var element = document.createElement("A"); 941 element.href = ""; 942 element.onclick = function(e){return false;} 943 element.innerHTML = "[?]"; 944 } 945 946 this.element = element; 947 if (type == "element") 948 { 949 if(addParams && addParams.show_on_click) 950 { 951 jsUtils.addEvent( 952 element, 953 "click", 954 function (event) 955 { 956 if (!event) 957 event = window.event; 958 _this.GetMouseXY(event); 959 _this.timeOutID = setTimeout(function () {_this.Show(innerHTML,width,height,className) }, 10); 960 } 961 ); 962 } 963 else 964 { 965 jsUtils.addEvent( 966 element, 967 "mouseover", 968 function (event) 969 { 970 if (!event) 971 event = window.event; 972 _this.GetMouseXY(event); 973 _this.timeOutID = setTimeout(function () {_this.Show(innerHTML,width,height,className) }, 750); 974 } 975 ); 976 } 977 978 jsUtils.addEvent( 979 element, 980 "mouseout", 981 function(event) 982 { 983 if (_this.timeOutID) 984 clearTimeout(_this.timeOutID); 985 _this.SmartHide(_this); 986 } 987 ); 988 } 989 else 990 { 991 this.oIcon = element; 992 element.onmouseover = function(event) {if (!event) event = window.event; _this.GetMouseXY(event); _this.Show(innerHTML,width,height,className)}; 993 element.onmouseout = function() {_this.SmartHide(_this);}; 994 } 995} 996 997BXHint.prototype.IsFrozen = function() 998{ 999 return this.freeze; 1000} 1001 1002BXHint.prototype.Freeze = function() 1003{ 1004 this.freeze = true; 1005 this.Hide(); 1006} 1007 1008BXHint.prototype.UnFreeze = function() 1009{ 1010 this.freeze = false; 1011} 1012 1013BXHint.prototype.GetMouseXY = function(event) 1014{ 1015 if (event.pageX || event.pageY) 1016 { 1017 this.x = event.pageX; 1018 this.y = event.pageY; 1019 } 1020 else if (event.clientX || event.clientY) 1021 { 1022 this.x = event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft; 1023 this.y = event.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop; 1024 } 1025} 1026 1027BXHint.prototype.Show = function(innerHTML, width, height, className) 1028{ 1029 //Delete previous hint 1030 var old = document.getElementById("__BXHint_div"); 1031 if (old) 1032 this.Hide(); 1033 1034 if (this.freeze) 1035 return; 1036 1037 var _this = this; 1038 var oDiv = document.body.appendChild(document.createElement("DIV")); 1039 oDiv.onmouseover = function(){_this.oDivOver = true}; 1040 oDiv.onmouseout = function(){_this.oDivOver = false; _this.SmartHide(_this);} 1041 oDiv.id = "__BXHint_div"; 1042 oDiv.className = (className) ? className : "bxhint"; 1043 oDiv.style.position = 'absolute'; 1044 if (width && this.bWidth) 1045 oDiv.style.width = width + "px"; 1046 1047 if (height) 1048 oDiv.style.height = height + "px"; 1049 oDiv.innerHTML = innerHTML; 1050 1051 var w = oDiv.offsetWidth; 1052 var h = oDiv.offsetHeight; 1053 if (this.bWidth) 1054 { 1055 if (!width && w>200) 1056 w = Math.round(Math.sqrt(1.618*w*h)); 1057 oDiv.style.width = w + "px"; 1058 h = oDiv.offsetHeight; 1059 } 1060 1061 var pos = {left : this.x + 10, right : this.x + w, top : this.y, bottom : this.y + h}; 1062 1063 pos = this.AlignToPos(pos, w, h); 1064 1065 jsFloatDiv.Show(oDiv, pos.left, pos.top,3); 1066 1067// oDiv.ondrag = jsUtils.False; 1068// oDiv.onselectstart = jsUtils.False; 1069// oDiv.style.MozUserSelect = 'none'; 1070 oDiv = null; 1071} 1072 1073BXHint.prototype.AlignToPos = function(pos, w, h) 1074{ 1075 var body = document.body; 1076 if((body.clientWidth + body.scrollLeft) < (pos.left + w)) 1077 pos.left = (pos.left - w >= 0) ? (pos.left - w) : body.scrollLeft; 1078 1079 if((body.clientHeight + body.scrollTop) - (pos["bottom"]) < 0) 1080 pos.top = (pos.top - h >= 0) ? (pos.top - h) : body.scrollTop; 1081 1082 return pos; 1083} 1084 1085BXHint.prototype.Hide = function() 1086{ 1087 var oDiv = document.getElementById("__BXHint_div"); 1088 1089 if (!oDiv) 1090 return; 1091 1092 BX.ZIndexManager.unregister(oDiv); 1093 1094 jsFloatDiv.Close(oDiv); 1095 oDiv.parentNode.removeChild(oDiv); 1096 oDiv = null; 1097} 1098 1099BXHint.prototype.SmartHide = function(_this) 1100{ 1101 setTimeout(function () 1102 { 1103 if (!_this.oDivOver) 1104 _this.Hide(); 1105 }, 100 1106 ); 1107} 1108 1109/************************************************/ 1110 1111function WaitOnKeyPress(e) 1112{ 1113 if(!e) e = window.event 1114 if(!e) return; 1115 if(e.keyCode == 27) 1116 CloseWaitWindow(); 1117} 1118 1119function ShowWaitWindow() 1120{ 1121 CloseWaitWindow(); 1122 1123 var obWndSize = jsUtils.GetWindowSize(); 1124 1125 var div = document.body.appendChild(document.createElement("DIV")); 1126 div.id = "wait_window_div"; 1127 div.innerHTML = phpVars.messLoading; 1128 div.className = "waitwindow"; 1129 //div.style.left = obWndSize.scrollLeft + (obWndSize.innerWidth - div.offsetWidth) - (jsUtils.IsIE() ? 5 : 20) + "px"; 1130 div.style.right = (5 - obWndSize.scrollLeft) + 'px'; 1131 div.style.top = obWndSize.scrollTop + 5 + "px"; 1132
1133 if(jsUtils.IsIE()) 1134 { 1135 var frame = document.createElement("IFRAME"); 1136 frame.src = "javascript:''"; 1137 frame.id = "wait_window_frame"; 1138 frame.className = "waitwindow"; 1139 frame.style.width = div.offsetWidth + "px"; 1140 frame.style.height = div.offsetHeight + "px"; 1141 frame.style.right = div.style.right; 1142 frame.style.top = div.style.top; 1143 document.body.appendChild(frame); 1144 } 1145 jsUtils.addEvent(document, "keypress", WaitOnKeyPress); 1146} 1147 1148function CloseWaitWindow() 1149{ 1150 jsUtils.removeEvent(document, "keypress", WaitOnKeyPress); 1151 1152 var frame = document.getElementById("wait_window_frame"); 1153 if(frame) 1154 frame.parentNode.removeChild(frame); 1155 1156 var div = document.getElementById("wait_window_div"); 1157 if(div) 1158 div.parentNode.removeChild(div); 1159} 1160 1161/************************************************/ 1162 1163var jsSelectUtils = 1164{ 1165 addNewOption: function(select_id, opt_value, opt_name, do_sort, check_unique) 1166 { 1167 var oSelect = (typeof(select_id) == 'string' || select_id instanceof String? document.getElementById(select_id) : select_id); 1168 if(oSelect) 1169 { 1170 var n = oSelect.length; 1171 if(check_unique !== false) 1172 { 1173 for(var i=0;i<n;i++) 1174 if(oSelect[i].value==opt_value) 1175 return; 1176 } 1177 var newoption = new Option(opt_name, opt_value, false, false); 1178 oSelect.options[n]=newoption; 1179 } 1180 if(do_sort === true) 1181 this.sortSelect(select_id); 1182 }, 1183 1184 deleteOption: function(select_id, opt_value) 1185 { 1186 var oSelect = (typeof(select_id) == 'string' || select_id instanceof String? document.getElementById(select_id) : select_id); 1187 if(oSelect) 1188 { 1189 for(var i=0;i<oSelect.length;i++) 1190 if(oSelect[i].value==opt_value) 1191 { 1192 oSelect.remove(i); 1193 break; 1194 } 1195 } 1196 }, 1197 1198 deleteSelectedOptions: function(select_id) 1199 { 1200 var oSelect = (typeof(select_id) == 'string' || select_id instanceof String? document.getElementById(select_id) : select_id); 1201 if(oSelect) 1202 { 1203 var i=0; 1204 while(i<oSelect.length) 1205 if(oSelect[i].selected) 1206 { 1207 oSelect[i].selected=false; 1208 oSelect.remove(i); 1209 } 1210 else 1211 i++; 1212 } 1213 }, 1214 1215 deleteAllOptions: function(oSelect) 1216 { 1217 if(oSelect) 1218 { 1219 for(var i=oSelect.length-1; i>=0; i--) 1220 oSelect.remove(i); 1221 } 1222 }, 1223 1224 optionCompare: function(record1, record2) 1225 { 1226 var value1 = record1.optText.toLowerCase(); 1227 var value2 = record2.optText.toLowerCase(); 1228 if (value1 > value2) return(1); 1229 if (value1 < value2) return(-1); 1230 return(0); 1231 }, 1232 1233 sortSelect: function(select_id) 1234 { 1235 var oSelect = (typeof(select_id) == 'string' || select_id instanceof String? document.getElementById(select_id) : select_id); 1236 if(oSelect) 1237 { 1238 var myOptions = []; 1239 var n = oSelect.options.length; 1240 for (var i=0;i<n;i++) 1241 { 1242 myOptions[i] = { 1243 optText:oSelect[i].text, 1244 optValue:oSelect[i].value 1245 }; 1246 } 1247 myOptions.sort(this.optionCompare); 1248 oSelect.length=0; 1249 n = myOptions.length; 1250 for(var i=0;i<n;i++) 1251 { 1252 var newoption = new Option(myOptions[i].optText, myOptions[i].optValue, false, false); 1253 oSelect[i]=newoption; 1254 } 1255 } 1256 }, 1257 1258 selectAllOptions: function(select_id) 1259 { 1260 var oSelect = (typeof(select_id) == 'string' || select_id instanceof String? document.getElementById(select_id) : select_id); 1261 if(oSelect) 1262 { 1263 var n = oSelect.length; 1264 for(var i=0;i<n;i++) 1265 oSelect[i].selected=true; 1266 } 1267 }, 1268 1269 selectOption: function(select_id, opt_value) 1270 { 1271 var oSelect = (typeof(select_id) == 'string' || select_id instanceof String? document.getElementById(select_id) : select_id); 1272 if(oSelect) 1273 { 1274 var n = oSelect.length; 1275 for(var i=0;i<n;i++) 1276 oSelect[i].selected = (oSelect[i].value == opt_value); 1277 } 1278 }, 1279 1280 addSelectedOptions: function(oSelect, to_select_id, check_unique, do_sort) 1281 { 1282 if(!oSelect) 1283 return; 1284 var n = oSelect.length; 1285 for(var i=0; i<n; i++) 1286 if(oSelect[i].selected) 1287 this.addNewOption(to_select_id, oSelect[i].value, oSelect[i].text, do_sort, check_unique); 1288 }, 1289 1290 moveOptionsUp: function(oSelect) 1291 { 1292 if(!oSelect) 1293 return; 1294 var n = oSelect.length; 1295 for(var i=0; i<n; i++) 1296 { 1297 if(oSelect[i].selected && i>0 && oSelect[i-1].selected == false) 1298 { 1299 var option1 = new Option(oSelect[i].text, oSelect[i].value); 1300 var option2 = new Option(oSelect[i-1].text, oSelect[i-1].value); 1301 oSelect[i] = option2; 1302 oSelect[i].selected = false;
1303 oSelect[i-1] = option1; 1304 oSelect[i-1].selected = true; 1305 } 1306 } 1307 }, 1308 1309 moveOptionsDown: function(oSelect) 1310 { 1311 if(!oSelect) 1312 return; 1313 var n = oSelect.length; 1314 for(var i=n-1; i>=0; i--) 1315 { 1316 if(oSelect[i].selected && i<n-1 && oSelect[i+1].selected == false) 1317 { 1318 var option1 = new Option(oSelect[i].text, oSelect[i].value); 1319 var option2 = new Option(oSelect[i+1].text, oSelect[i+1].value); 1320 oSelect[i] = option2; 1321 oSelect[i].selected = false; 1322 oSelect[i+1] = option1; 1323 oSelect[i+1].selected = true; 1324 } 1325 } 1326 } 1327 1328} 1329 1330/************************************************/ 1331 1332/* End */ 1333; 1334//# sourceMappingURL=kernel_main.map.js
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.