Your IP : 18.117.11.25


Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/main/core/
Upload File :
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/main/core/core_popup.min.js

(function(t){"use strict";if(BX.PopupWindowManager){return}BX.PopupWindowManager={_popups:[],_currentPopup:null,create:function(t,e,i){var n=-1;if((n=this._getPopupIndex(t))!==-1){return this._popups[n]}var o=new BX.PopupWindow(t,e,i);BX.addCustomEvent(o,"onPopupShow",BX.delegate(this.onPopupShow,this));BX.addCustomEvent(o,"onPopupClose",BX.delegate(this.onPopupClose,this));return o},onPopupWindowIsInitialized:function(t,e){BX.addCustomEvent(e,"onPopupDestroy",BX.delegate(this.onPopupDestroy,this));this._popups.push(e)},onPopupShow:function(t){if(this._currentPopup!==null){this._currentPopup.close()}this._currentPopup=t},onPopupClose:function(t){this._currentPopup=null},onPopupDestroy:function(t){var e;if((e=this._getPopupIndex(t.uniquePopupId))!==-1){this._popups=BX.util.deleteFromArray(this._popups,e)}},getCurrentPopup:function(){return this._currentPopup},isPopupExists:function(t){return this._getPopupIndex(t)!==-1},isAnyPopupShown:function(){for(var t=0,e=this._popups.length;t<e;t++){if(this._popups[t].isShown()){return true}}return false},_getPopupIndex:function(t){var e=-1;for(var i=0;i<this._popups.length;i++){if(this._popups[i].uniquePopupId===t){return i}}return e},getMaxZIndex:function(){var t=0,e;for(e=0;e<this._popups.length;e++){t=Math.max(t,this._popups[e].params.zIndex)}return t}};BX.addCustomEvent("onPopupWindowIsInitialized",BX.proxy(BX.PopupWindowManager.onPopupWindowIsInitialized,BX.PopupWindowManager));BX.PopupWindow=function(e,i,n){n=n||{};this.params=n;BX.onCustomEvent("onPopupWindowInit",[e,i,n]);this.uniquePopupId=e;this.params.zIndex=BX.type.isNumber(n.zIndex)?parseInt(n.zIndex):0;this.params.zIndexAbsolute=BX.type.isNumber(n.zIndexAbsolute)?parseInt(n.zIndexAbsolute):0;this.buttons=n.buttons&&BX.type.isArray(n.buttons)?n.buttons:[];this.offsetTop=BX.PopupWindow.getOption("offsetTop");this.offsetLeft=BX.PopupWindow.getOption("offsetLeft");this.firstShow=false;this.bordersWidth=20;this.bindElementPos=null;this.closeIcon=null;this.resizeIcon=null;this.angle=null;this.overlay=null;this.titleBar=null;this.bindOptions=typeof n.bindOptions==="object"?n.bindOptions:{};this.animationOptions=typeof n.animationOptions==="object"?n.animationOptions:{};this.autoHide=n.autoHide===true;this.autoHideHandler=BX.type.isFunction(n.autoHideHandler)?n.autoHideHandler:null;this.handleAutoHide=this.handleAutoHide.bind(this);this.handleOverlayClick=this.handleOverlayClick.bind(this);this.isAutoHideBinded=false;this.closeByEsc=n.closeByEsc===true;this.isCloseByEscBinded=false;this.width=null;this.height=null;this.minWidth=null;this.minHeight=null;this.maxWidth=null;this.maxHeight=null;if(n.parentPopup instanceof BX.PopupWindow){this.parentPopup=n.parentPopup;this.appendContainer=n.parentPopup.contentContainer;n.offsetTop=(n.offsetTop?n.offsetTop:0)-(BX.PopupWindow.fullscreenStatus?0:this.parentPopup.popupContainer.offsetTop);n.offsetLeft=(n.offsetLeft?n.offsetLeft:0)-(BX.PopupWindow.fullscreenStatus?0:this.parentPopup.popupContainer.offsetLeft)}else{this.parentPopup=null;this.appendContainer=document.body}this.dragOptions={cursor:"",callback:BX.DoNothing,eventName:""};this.dragged=false;this.dragPageX=0;this.dragPageY=0;this.animationShowClassName="";this.animationCloseClassName="";this.animationCloseEventType=false;if(typeof this.animationOptions.show==="object"){this.animationShowClassName="";if(BX.type.isNotEmptyString(this.animationOptions.show.className)){this.animationShowClassName=this.animationOptions.show.className}else if(BX.type.isNotEmptyString(this.animationOptions.show.type)){switch(this.animationOptions.show.type){case"opacity-transform":this.animationShowClassName="popup-window-show-animation-opacity-transform";break;case"opacity":this.animationShowClassName="popup-window-show-animation-opacity";break;default:this.animationShowClassName="popup-window-show-animation-opacity"}}}if(typeof this.animationOptions.close==="object"){this.animationCloseClassName="";this.animationCloseEventType="";if(BX.type.isNotEmptyString(this.animationOptions.close.className)){this.animationCloseClassName=this.animationOptions.close.className;if(BX.type.isNotEmptyString(this.animationOptions.close.eventType)||BX.util.in_array(this.animationOptions.close.eventType,["animation","transition"])){this.animationCloseEventType=this.animationOptions.close.eventType}}else if(BX.type.isNotEmptyString(this.animationOptions.close.type)){switch(this.animationOptions.close.type){case"opacity-transform":this.animationCloseClassName="popup-window-close-animation-opacity-transform";this.animationCloseEventType="animation";break;case"opacity":this.animationCloseClassName="popup-window-close-animation-opacity";this.animationCloseEventType="animation";break;default:this.animationCloseClassName="";this.animationCloseEventType=""}}}if(n.events){for(var o in n.events){BX.addCustomEvent(this,o,n.events[o])}}var s="popup-window";if(n.contentColor&&BX.type.isNotEmptyString(n.contentColor)){s+=" popup-window-content-"+n.contentColor}if(n.contentNoPaddings){s+=" popup-window-content-no-paddings"}if(n.noAllPaddings){s+=" popup-window-no-paddings"}if(n.titleBar){s+=" popup-window-with-titlebar"}if(n.className&&BX.type.isNotEmptyString(n.className)){s+=" "+n.className}if(n.darkMode){s+=" popup-window-dark"}this.popupContainer=document.createElement("div");var p="popup-window-titlebar-"+e;if(n.titleBar){this.titleBar=BX.create("div",{props:{className:"popup-window-titlebar",id:p}})}if(n.closeIcon){this.closeIcon=BX.create("span",{props:{className:"popup-window-close-icon"+(n.titleBar?" popup-window-titlebar-close-icon":"")},style:typeof n.closeIcon==="object"?n.closeIcon:{},events:{click:BX.proxy(this._onCloseIconClick,this)}});if(BX.browser.IsIE()){BX.adjust(this.closeIcon,{attrs:{hidefocus:"true"}})}}this.contentContainer=BX.create("div",{props:{id:"popup-window-content-"+e,className:"popup-window-content"}});BX.adjust(this.popupContainer,{props:{id:e,className:s},style:{zIndex:this.getZindex(),position:"absolute",display:"none",top:"0px",left:"0px"},children:[this.titleBar,this.contentContainer,this.closeIcon]});this.appendContainer.appendChild(this.popupContainer);this.buttonsContainer=null;if(n.angle){this.setAngle(n.angle)}if(n.overlay){this.setOverlay(n.overlay)}this.setOffset(n);this.setBindElement(i);this.setTitleBar(n.titleBar);this.setContent(n.content);this.setButtons(n.buttons);this.setWidth(n.width);this.setHeight(n.height);this.setMinWidth(n.minWidth);this.setMinHeight(n.minHeight);this.setMaxWidth(n.maxWidth);this.setMaxHeight(n.maxHeight);this.setResizeMode(n.resizable);if(n.bindOnResize!==false){BX.bind(t,"resize",BX.proxy(this._onResizeWindow,this))}BX.onCustomEvent("onPopupWindowIsInitialized",[e,this])};BX.PopupWindow.prototype.setContent=function(t){if(!this.contentContainer||!t){return}if(BX.type.isElementNode(t)){BX.cleanNode(this.contentContainer);this.contentContainer.appendChild(t.parentNode?t.parentNode.removeChild(t):t);t.style.display="block"}else if(BX.type.isString(t)){this.contentContainer.innerHTML=t}else{this.contentContainer.innerHTML="&nbsp;"}};BX.PopupWindow.prototype.setButtons=function(t){this.buttons=t&&BX.type.isArray(t)?t:[];if(this.buttonsContainer){BX.remove(this.buttonsContainer)}if(this.buttons.length>0&&this.contentContainer){var e=[];for(var i=0;i<this.buttons.length;i++){var n=this.buttons[i];if(n===null||!BX.is_subclass_of(n,BX.PopupWindowButton)){continue}n.popupWindow=this;e.push(n.render())}this.buttonsContainer=this.contentContainer.parentNode.appendChild(BX.create("div",{props:{className:"popup-window-buttons"},children:e}))}};BX.PopupWindow.prototype.getButtons=function(){return this.buttons};BX.PopupWindow.prototype.getButton=function(t){for(var e=0;e<this.buttons.length;e++){var i=this.buttons[e];if(i.getId()===t){return i}}return null};BX.PopupWindow.prototype.setBindElement=function(t){if(!t||typeof t!=="object"){return}if(BX.type.isDomNode(t)||BX.type.isNumber(t.top)&&BX.type.isNumber(t.left)){this.bindElement=t}else if(BX.type.isNumber(t.clientX)&&BX.type.isNumber(t.clientY)){BX.fixEventPageXY(t);this.bindElement={left:t.pageX,top:t.pageY,bottom:t.pageY}}};BX.PopupWindow.prototype.getBindElementPos=function(t){if(BX.type.isDomNode(t)){return BX.pos(t,false)}else if(t&&typeof t==="object"){if(!BX.type.isNumber(t.bottom)){t.bottom=t.top}return t}else{var e=BX.GetWindowInnerSize();var i=BX.GetWindowScrollPos();var n=this.popupContainer.offsetWidth;var o=this.popupContainer.offsetHeight;this.bindOptions.forceTop=true;return{left:e.innerWidth/2-n/2+i.scrollLeft,top:e.innerHeight/2-o/2+i.scrollTop,bottom:e.innerHeight/2-o/2+i.scrollTop,windowSize:e,windowScroll:i,popupWidth:n,popupHeight:o}}};BX.PopupWindow.prototype.setAngle=function(t){if(t===false&&this.angle!==null){BX.remove(this.angle.element);this.angle=null;return}var e="popup-window-angly";if(this.angle===null){var i=this.bindOptions.position&&this.bindOptions.position==="top"?"bottom":"top";var n=BX.PopupWindow.getOption(i==="top"?"angleMinTop":"angleMinBottom");var o=BX.type.isNumber(t.offset)?t.offset:0;var s=BX.PopupWindow.getOption("angleLeftOffset",null);if(o>0&&BX.type.isNumber(s)){o+=s-BX.PopupWindow.defaultOptions.angleLeftOffset}this.angle={element:BX.create("div",{props:{className:e+" "+e+"-"+i}}),position:i,offset:0,defaultOffset:Math.max(o,n)};this.popupContainer.appendChild(this.angle.element)}if(typeof t==="object"&&t.position&&BX.util.in_array(t.position,["top","right","bottom","left","hide"])){BX.removeClass(this.angle.element,e+"-"+this.angle.position);BX.addClass(this.angle.element,e+"-"+t.position);this.angle.position=t.position}if(typeof t==="object"&&BX.type.isNumber(t.offset)){var p=t.offset;var u,a;if(this.angle.position==="top"){u=BX.PopupWindow.getOption("angleMinTop");a=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxTop");a=a<u?Math.max(u,p):a;this.angle.offset=Math.min(Math.max(u,p),a);this.angle.element.style.left=this.angle.offset+"px";this.angle.element.style.marginLeft=0}else if(this.angle.position==="bottom"){u=BX.PopupWindow.getOption("angleMinBottom");a=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxBottom");a=a<u?Math.max(u,p):a;this.angle.offset=Math.min(Math.max(u,p),a);this.angle.element.style.marginLeft=this.angle.offset+"px";this.angle.element.style.left=0}else if(this.angle.position==="right"){u=BX.PopupWindow.getOption("angleMinRight");a=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxRight");a=a<u?Math.max(u,p):a;this.angle.offset=Math.min(Math.max(u,p),a);this.angle.element.style.top=this.angle.offset+"px"}else if(this.angle.position==="left"){u=BX.PopupWindow.getOption("angleMinLeft");a=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxLeft");a=a<u?Math.max(u,p):a;this.angle.offset=Math.min(Math.max(u,p),a);this.angle.element.style.top=this.angle.offset+"px"}}};BX.PopupWindow.prototype.getWidth=function(){return this.width};BX.PopupWindow.prototype.setWidth=function(t){this.setWidthProperty("width",t)};BX.PopupWindow.prototype.getHeight=function(){return this.height};BX.PopupWindow.prototype.setHeight=function(t){this.setHeightProperty("height",t)};BX.PopupWindow.prototype.getMinWidth=function(){return this.minWidth};BX.PopupWindow.prototype.setMinWidth=function(t){this.setWidthProperty("minWidth",t)};BX.PopupWindow.prototype.getMinHeight=function(){return this.minHeight};BX.PopupWindow.prototype.setMinHeight=function(t){this.setHeightProperty("minHeight",t)};BX.PopupWindow.prototype.getMaxWidth=function(){return this.maxWidth};BX.PopupWindow.prototype.setMaxWidth=function(t){this.setWidthProperty("maxWidth",t)};BX.PopupWindow.prototype.getMaxHeight=function(){return this.maxHeight};BX.PopupWindow.prototype.setMaxHeight=function(t){this.setHeightProperty("maxHeight",t)};BX.PopupWindow.prototype.setWidthProperty=function(t,e){var i=["width","minWidth","maxWidth"];if(i.indexOf(t)===-1){return}if(BX.type.isNumber(e)&&e>=0){this[t]=e;this.contentContainer.style[t]=e+"px";this.contentContainer.style.overflowX="auto";this.getPopupContainer().classList.add("popup-window-fixed-width");if(this.titleBar){this.titleBar.style[t]=e+"px"}}else if(e===null||e===false){this[t]=null;this.contentContainer.style.removeProperty(BX.util.getCssName(t));var n=i.some(function(t){return this.contentContainer.style.getPropertyValue(BX.util.getCssName(t))!==""},this);if(!n){this.contentContainer.style.removeProperty("overflow-x");this.getPopupContainer().classList.remove("popup-window-fixed-width")}if(this.titleBar){this.titleBar.style.removeProperty(BX.util.getCssName(t))}}};BX.PopupWindow.prototype.setHeightProperty=function(t,e){var i=["height","minHeight","maxHeight"];if(i.indexOf(t)===-1){return}if(BX.type.isNumber(e)&&e>=0){this[t]=e;this.contentContainer.style[t]=e+"px";this.contentContainer.style.overflowY="auto";this.getPopupContainer().classList.add("popup-window-fixed-height")}else if(e===null||e===false){this[t]=null;this.contentContainer.style.removeProperty(BX.util.getCssName(t));var n=i.some(function(t){return this.contentContainer.style.getPropertyValue(BX.util.getCssName(t))!==""},this);if(!n){this.contentContainer.style.removeProperty("overflow-y");this.getPopupContainer().classList.remove("popup-window-fixed-height")}}};BX.PopupWindow.prototype.setResizeMode=function(t){if(t===true||BX.type.isPlainObject(t)){if(!this.resizeIcon){this.resizeIcon=BX.create("div",{props:{className:"popup-window-resize"},events:{mousedown:BX.proxy(this.onResizeMouseDown,this)}});this.popupContainer.appendChild(this.resizeIcon)}this.setMinWidth(t.minWidth);this.setMinHeight(t.minHeight)}else if(t===false&&this.resizeIcon){BX.remove(this.resizeIcon);this.resizeIcon=null}};BX.PopupWindow.prototype.getPopupContainer=function(){return this.popupContainer};BX.PopupWindow.prototype.onTitleMouseDown=function(t){this._startDrag(t,{cursor:"move",callback:BX.proxy(this.move,this),eventName:"Drag"})};BX.PopupWindow.prototype.onResizeMouseDown=function(t){this._startDrag(t,{cursor:"nwse-resize",eventName:"Resize",callback:BX.proxy(this._resize,this)});this.resizeContentPos=BX.pos(this.contentContainer);this.resizeContentOffset=this.resizeContentPos.left-BX.pos(this.popupContainer).left};BX.PopupWindow.prototype._resize=function(t,e,i,n){var o=i-this.resizeContentPos.left;var s=n-this.resizeContentPos.top;var p=BX.GetWindowScrollSize().scrollWidth;if(this.resizeContentPos.left+o+this.resizeContentOffset>=p){o=p-this.resizeContentPos.left-this.resizeContentOffset}o=Math.max(o,this.getMinWidth());s=Math.max(s,this.getMinHeight());if(this.getMaxWidth()!==null){o=Math.min(o,this.getMaxWidth())}if(this.getMaxHeight()!==null){s=Math.min(s,this.getMaxHeight())}this.setWidth(o);this.setHeight(s)};BX.PopupWindow.prototype.isTopAngle=function(){return this.angle!==null&&this.angle.position==="top"};BX.PopupWindow.prototype.isBottomAngle=function(){return this.angle!==null&&this.angle.position==="bottom"};BX.PopupWindow.prototype.isTopOrBottomAngle=function(){return this.angle!==null&&BX.util.in_array(this.angle.position,["top","bottom"])};BX.PopupWindow.prototype.getAngleHeight=function(){return this.isTopOrBottomAngle()?BX.PopupWindow.getOption("angleTopOffset"):0};BX.PopupWindow.prototype.setOffset=function(t){if(!BX.type.isPlainObject(t)){return}if(BX.type.isNumber(t.offsetLeft)){this.offsetLeft=t.offsetLeft+BX.PopupWindow.getOption("offsetLeft")}if(BX.type.isNumber(t.offsetTop)){this.offsetTop=t.offsetTop+BX.PopupWindow.getOption("offsetTop")}};BX.PopupWindow.prototype.setTitleBar=function(t){if(!this.titleBar){return}if(typeof t==="object"&&BX.type.isDomNode(t.content)){this.titleBar.innerHTML="";this.titleBar.appendChild(t.content)}else if(typeof t==="string"){this.titleBar.innerHTML="";this.titleBar.appendChild(BX.create("span",{props:{className:"popup-window-titlebar-text"},text:t}))}if(this.params.draggable){this.titleBar.style.cursor="move";BX.bind(this.titleBar,"mousedown",BX.proxy(this.onTitleMouseDown,this))}};BX.PopupWindow.prototype.setClosingByEsc=function(t){t=BX.type.isBoolean(t)?t:true;if(t){this.closeByEsc=true;if(!this.isCloseByEscBinded){BX.bind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=true}}else{this.closeByEsc=false;if(this.isCloseByEscBinded){BX.unbind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=false}}};BX.PopupWindow.prototype.setAutoHide=function(t){t=BX.type.isBoolean(t)?t:true;if(t){this.autoHide=true;if(this.isShown()){this.bindAutoHide()}}else{this.autoHide=false;this.unbindAutoHide()}};BX.PopupWindow.prototype.bindAutoHide=function(){if(!this.isAutoHideBinded){this.isAutoHideBinded=true;BX.bind(this.popupContainer,"click",this.cancelBubble);if(this.overlay&&this.overlay.element){BX.bind(this.overlay.element,"click",this.handleOverlayClick)}else{BX.bind(document,"click",this.handleAutoHide)}}};BX.PopupWindow.prototype.unbindAutoHide=function(){if(this.isAutoHideBinded){this.isAutoHideBinded=false;BX.unbind(this.popupContainer,"click",this.cancelBubble);if(this.overlay&&this.overlay.element){BX.unbind(this.overlay.element,"click",this.handleOverlayClick)}else{BX.unbind(document,"click",this.handleAutoHide)}}};BX.PopupWindow.prototype.handleAutoHide=function(t){if(this.autoHideHandler!==null){if(this.autoHideHandler(t)){this.close(t)}}else{this.close(t)}};BX.PopupWindow.prototype.handleOverlayClick=function(t){this.close(t);t.stopPropagation()};BX.PopupWindow.prototype.setOverlay=function(t){if(this.overlay===null){this.overlay={element:BX.create("div",{props:{className:"popup-window-overlay",id:"popup-window-overlay-"+this.uniquePopupId}})};this.adjustOverlayZindex();this.resizeOverlay();this.appendContainer.appendChild(this.overlay.element)}if(t&&t.hasOwnProperty("opacity")&&BX.type.isNumber(t.opacity)&&t.opacity>=0&&t.opacity<=100){if(BX.browser.IsIE()&&!BX.browser.IsIE9()){this.overlay.element.style.filter="alpha(opacity="+t.opacity+")"}else{this.overlay.element.style.filter="none";this.overlay.element.style.opacity=parseFloat(t.opacity/100).toPrecision(3)}}if(t&&t.backgroundColor){this.overlay.element.style.backgroundColor=t.backgroundColor}};BX.PopupWindow.prototype.removeOverlay=function(){if(this.overlay!==null&&this.overlay.element!==null){BX.remove(this.overlay.element)}if(this.overlayTimeout){clearInterval(this.overlayTimeout);this.overlayTimeout=null}this.overlay=null};BX.PopupWindow.prototype.hideOverlay=function(){if(this.overlay!==null&&this.overlay.element!==null){if(this.overlayTimeout){clearInterval(this.overlayTimeout);this.overlayTimeout=null}this.overlay.element.style.display="none"}};BX.PopupWindow.prototype.showOverlay=function(){if(this.overlay!==null&&this.overlay.element!==null){this.overlay.element.style.display="block";var t=this.popupContainer.offsetHeight;this.overlayTimeout=setInterval(function(){if(t!==this.popupContainer.offsetHeight){this.resizeOverlay();t=this.popupContainer.offsetHeight}}.bind(this),1e3)}};BX.PopupWindow.prototype.resizeOverlay=function(){if(this.overlay!==null&&this.overlay.element!==null){if(this.parentPopup){this.overlay.element.style.width=this.parentPopup.popupContainer.offsetWidth+"px";this.overlay.element.style.height=this.parentPopup.popupContainer.offsetHeight+"px"}else{var t=BX.GetWindowScrollSize();var e=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight);this.overlay.element.style.width=t.scrollWidth+"px";this.overlay.element.style.height=e+"px"}}};BX.PopupWindow.prototype.getZindex=function(){if(this.overlay!==null){return this.params.zIndexAbsolute>0?this.params.zIndexAbsolute:BX.PopupWindow.getOption("popupOverlayZindex")+this.params.zIndex}else{return this.params.zIndexAbsolute>0?this.params.zIndexAbsolute:BX.PopupWindow.getOption("popupZindex")+this.params.zIndex}};BX.PopupWindow.prototype.adjustOverlayZindex=function(){if(this.overlay!==null&&this.overlay.element!==null){this.overlay.element.style.zIndex=parseInt(this.popupContainer.style.zIndex)-1}};BX.PopupWindow.prototype.show=function(){if(!this.firstShow){BX.onCustomEvent(this,"onPopupFirstShow",[this]);this.firstShow=true}BX.onCustomEvent(this,"onPopupShow",[this]);this.showOverlay();this.popupContainer.style.display="block";this.showAnimation();this.adjustPosition();BX.onCustomEvent(this,"onAfterPopupShow",[this]);if(this.closeByEsc&&!this.isCloseByEscBinded){BX.bind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=true}if(this.autoHide&&!this.isAutoHideBinded){setTimeout(BX.proxy(function(){if(this.isShown()){this.bindAutoHide()}},this),100)}};BX.PopupWindow.prototype.showAnimation=function(){if(BX.type.isNotEmptyString(this.animationCloseClassName)){BX.removeClass(this.popupContainer,this.animationCloseClassName)}if(BX.type.isNotEmptyString(this.animationShowClassName)){BX.addClass(this.popupContainer,this.animationShowClassName)}};BX.PopupWindow.prototype.closeAnimation=function(){if(BX.type.isNotEmptyString(this.animationShowClassName)){BX.removeClass(this.popupContainer,this.animationShowClassName)}if(BX.type.isNotEmptyString(this.animationCloseClassName)){BX.addClass(this.popupContainer,this.animationCloseClassName)}};BX.PopupWindow.prototype.isShown=function(){return this.popupContainer.style.display==="block"};BX.PopupWindow.prototype.cancelBubble=function(e){e=e||t.event;if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}};BX.PopupWindow.prototype.close=function(t){if(!this.isShown()){return}if(t&&!(BX.getEventButton(t)&BX.MSLEFT)){return}BX.onCustomEvent(this,"onPopupClose",[this,t]);this.hideOverlay();this.closeAnimation();var e=BX.proxy(function(){this.popupContainer.style.display="none";if(this.animationCloseEventType==="animation"){BX.unbind(this.popupContainer,"animationend",e);BX.unbind(this.popupContainer,"webkitAnimationEnd",e);BX.unbind(this.popupContainer,"oanimationend",e);BX.unbind(this.popupContainer,"oAnimationEnd",e);BX.unbind(this.popupContainer,"MSAnimationEnd",e)}else if(this.animationCloseEventType==="transition"){BX.unbind(this.popupContainer,"transitionend",e);BX.unbind(this.popupContainer,"webkitTransitionEnd",e);BX.unbind(this.popupContainer,"otransitionend",e);BX.unbind(this.popupContainer,"oTransitionEnd",e);BX.unbind(this.popupContainer,"MSTransitionEnd",e)}},this);if(BX.type.isNotEmptyString(this.animationCloseEventType)){if(this.animationCloseEventType==="animation"){BX.bind(this.popupContainer,"animationend",e);BX.bind(this.popupContainer,"webkitAnimationEnd",e);BX.bind(this.popupContainer,"oanimationend",e);BX.bind(this.popupContainer,"oAnimationEnd",e);BX.bind(this.popupContainer,"MSAnimationEnd",e)}else if(this.animationCloseEventType==="transition"){BX.bind(this.popupContainer,"transitionend",e);BX.bind(this.popupContainer,"webkitTransitionEnd",e);BX.bind(this.popupContainer,"otransitionend",e);BX.bind(this.popupContainer,"oTransitionEnd",e);BX.bind(this.popupContainer,"MSTransitionEnd",e)}}else{e()}if(this.isCloseByEscBinded){BX.unbind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=false}setTimeout(BX.proxy(this._close,this),0)};BX.PopupWindow.prototype._close=function(){if(this.autoHide){this.unbindAutoHide()}};BX.PopupWindow.prototype._onCloseIconClick=function(e){e=e||t.event;this.close(e);BX.PreventDefault(e)};BX.PopupWindow.prototype._onKeyUp=function(e){e=e||t.event;if(e.keyCode===27){n(this.getZindex(),BX.proxy(this.close,this))}};BX.PopupWindow.prototype.destroy=function(){BX.onCustomEvent(this,"onPopupDestroy",[this]);BX.unbindAll(this);BX.unbind(document,"keyup",BX.proxy(this._onKeyUp,this));BX.unbind(document,"click",BX.proxy(this.close,this));BX.unbind(document,"mousemove",BX.proxy(this._moveDrag,this));BX.unbind(document,"mouseup",BX.proxy(this._stopDrag,this));BX.unbind(t,"resize",BX.proxy(this._onResizeWindow,this));BX.remove(this.popupContainer);this.removeOverlay()};BX.PopupWindow.prototype.enterFullScreen=function(){if(BX.PopupWindow.fullscreenStatus){if(document.cancelFullScreen){document.cancelFullScreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}}else{if(BX.browser.IsChrome()||BX.browser.IsSafari()){this.contentContainer.webkitRequestFullScreen(this.contentContainer.ALLOW_KEYBOARD_INPUT);BX.bind(t,"webkitfullscreenchange",this.fullscreenBind=BX.proxy(this.eventFullScreen,this))}else if(BX.browser.IsFirefox()){this.contentContainer.mozRequestFullScreen(this.contentContainer.ALLOW_KEYBOARD_INPUT);BX.bind(t,"mozfullscreenchange",this.fullscreenBind=BX.proxy(this.eventFullScreen,this))}}};BX.PopupWindow.prototype.eventFullScreen=function(e){if(BX.PopupWindow.fullscreenStatus){if(BX.browser.IsChrome()||BX.browser.IsSafari()){BX.unbind(t,"webkitfullscreenchange",this.fullscreenBind)}else if(BX.browser.IsFirefox()){BX.unbind(t,"mozfullscreenchange",this.fullscreenBind)}BX.removeClass(this.contentContainer,"popup-window-fullscreen",[this.contentContainer]);BX.PopupWindow.fullscreenStatus=false;BX.onCustomEvent(this,"onPopupFullscreenLeave");this.adjustPosition()}else{BX.addClass(this.contentContainer,"popup-window-fullscreen");BX.PopupWindow.fullscreenStatus=true;BX.onCustomEvent(this,"onPopupFullscreenEnter",[this.contentContainer]);this.adjustPosition()}};BX.PopupWindow.prototype.adjustPosition=function(t){if(t&&typeof t==="object"){this.bindOptions=t}var e=this.getBindElementPos(this.bindElement);if(!this.bindOptions.forceBindPosition&&this.bindElementPos!==null&&e.top===this.bindElementPos.top&&e.left===this.bindElementPos.left){return}this.bindElementPos=e;var i=e.windowSize?e.windowSize:BX.GetWindowInnerSize();var n=e.windowScroll?e.windowScroll:BX.GetWindowScrollPos();var o=e.popupWidth?e.popupWidth:this.popupContainer.offsetWidth;var s=e.popupHeight?e.popupHeight:this.popupContainer.offsetHeight;var p=BX.PopupWindow.getOption("angleTopOffset");var u=this.bindElementPos.left+this.offsetLeft-(this.isTopOrBottomAngle()?BX.PopupWindow.getOption("angleLeftOffset"):0);if(!this.bindOptions.forceLeft&&u+o+this.bordersWidth>=i.innerWidth+n.scrollLeft&&i.innerWidth+n.scrollLeft-o-this.bordersWidth>0){var a=u;u=i.innerWidth+n.scrollLeft-o-this.bordersWidth;if(this.isTopOrBottomAngle()){this.setAngle({offset:a-u+this.angle.defaultOffset})}}else if(this.isTopOrBottomAngle()){this.setAngle({offset:this.angle.defaultOffset+(u<0?u:0)})}if(u<0){u=0}var r=0;if(this.bindOptions.position&&this.bindOptions.position==="top"){r=this.bindElementPos.top-s-this.offsetTop-(this.isBottomAngle()?p:0);if(r<0||!this.bindOptions.forceTop&&r<n.scrollTop){r=this.bindElementPos.bottom+this.offsetTop;if(this.angle!==null){r+=p;this.setAngle({position:"top"})}}else if(this.isTopAngle()){r=r-p+BX.PopupWindow.getOption("positionTopXOffset");this.setAngle({position:"bottom"})}else{r+=BX.PopupWindow.getOption("positionTopXOffset")}}else{r=this.bindElementPos.bottom+this.offsetTop+this.getAngleHeight();if(!this.bindOptions.forceTop&&r+s>i.innerHeight+n.scrollTop&&this.bindElementPos.top-s-this.getAngleHeight()>=0){r=this.bindElementPos.top-s;if(this.isTopOrBottomAngle()){r-=p;this.setAngle({position:"bottom"})}r+=BX.PopupWindow.getOption("positionTopXOffset")}else if(this.isBottomAngle()){r+=p;this.setAngle({position:"top"})}}if(!this.parentPopup&&r<0){r=0}BX.adjust(this.popupContainer,{style:{top:r+"px",left:u+"px",zIndex:this.getZindex()}});this.adjustOverlayZindex()};BX.PopupWindow.prototype._onResizeWindow=function(t){if(this.isShown()){this.adjustPosition();if(this.overlay!==null){this.resizeOverlay()}}};BX.PopupWindow.prototype.move=function(t,e,i,n){var o=parseInt(this.popupContainer.style.left)+t;var s=parseInt(this.popupContainer.style.top)+e;if(typeof this.params.draggable==="object"&&this.params.draggable.restrict){if(!this.parentPopup&&o<0){o=0}var p=BX.GetWindowScrollSize();var u=this.popupContainer.offsetWidth;var a=this.popupContainer.offsetHeight;if(o>p.scrollWidth-u){o=p.scrollWidth-u}if(s>p.scrollHeight-a){s=p.scrollHeight-a}if(!this.parentPopup&&s<0){s=0}}this.popupContainer.style.left=o+"px";this.popupContainer.style.top=s+"px"};BX.PopupWindow.prototype._startDrag=function(e,i){e=e||t.event;BX.fixEventPageXY(e);i=i||{};if(BX.type.isNotEmptyString(i.cursor)){this.dragOptions.cursor=i.cursor}if(BX.type.isNotEmptyString(i.eventName)){this.dragOptions.eventName=i.eventName}if(BX.type.isFunction(i.callback)){this.dragOptions.callback=i.callback}this.dragPageX=e.pageX;this.dragPageY=e.pageY;this.dragged=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.body.ondrag=BX.False;document.body.onselectstart=BX.False;document.body.style.cursor=this.dragOptions.cursor;document.body.style.MozUserSelect="none";this.popupContainer.style.MozUserSelect="none";return BX.PreventDefault(e)};BX.PopupWindow.prototype._moveDrag=function(e){e=e||t.event;BX.fixEventPageXY(e);if(this.dragPageX===e.pageX&&this.dragPageY===e.pageY){return}this.dragOptions.callback(e.pageX-this.dragPageX,e.pageY-this.dragPageY,e.pageX,e.pageY);this.dragPageX=e.pageX;this.dragPageY=e.pageY;if(!this.dragged){BX.onCustomEvent(this,"onPopup"+this.dragOptions.eventName+"Start",[this]);this.dragged=true}BX.onCustomEvent(this,"onPopup"+this.dragOptions.eventName,[this])};BX.PopupWindow.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.body.ondrag=null;document.body.onselectstart=null;document.body.style.cursor="";document.body.style.MozUserSelect="";this.popupContainer.style.MozUserSelect="";BX.onCustomEvent(this,"onPopup"+this.dragOptions.eventName+"End",[this]);this.dragged=false;return BX.PreventDefault(t)};BX.PopupWindow.options={};BX.PopupWindow.defaultOptions={angleLeftOffset:40,positionTopXOffset:-11,angleTopOffset:10,popupZindex:1e3,popupOverlayZindex:1100,angleMinLeft:10,angleMaxLeft:10,angleMinRight:10,angleMaxRight:10,angleMinBottom:23,angleMaxBottom:25,angleMinTop:23,angleMaxTop:25,offsetLeft:0,offsetTop:0};BX.PopupWindow.setOptions=function(t){if(!t||typeof t!=="object"){return}for(var e in t){BX.PopupWindow.options[e]=t[e]}};BX.PopupWindow.getOption=function(t,e){if(typeof BX.PopupWindow.options[t]!=="undefined"){return BX.PopupWindow.options[t]}else if(typeof e!=="undefined"){return e}else{return BX.PopupWindow.defaultOptions[t]}};BX.PopupWindowButton=function(t){this.popupWindow=null;this.params=t||{};this.text=this.params.text||"";this.id=this.params.id||"";this.className=this.params.className||"";this.events=this.params.events||{};this.contextEvents={};for(var e in this.events){this.contextEvents[e]=BX.proxy(this.events[e],this)}this.buttonNode=BX.create("span",{props:{className:"popup-window-button"+(this.className.length>0?" "+this.className:""),id:this.id},events:this.contextEvents,text:this.text})};BX.PopupWindowButton.prototype.render=function(){return this.buttonNode};BX.PopupWindowButton.prototype.getId=function(){return this.id};BX.PopupWindowButton.prototype.getName=function(){return this.name};BX.PopupWindowButton.prototype.getContainer=function(){return this.buttonNode};BX.PopupWindowButton.prototype.setName=function(t){this.text=t||"";if(this.buttonNode){BX.cleanNode(this.buttonNode);BX.adjust(this.buttonNode,{text:this.text})}};BX.PopupWindowButton.prototype.setClassName=function(t){if(this.buttonNode){if(BX.type.isString(this.className)&&this.className!==""){BX.removeClass(this.buttonNode,this.className)}BX.addClass(this.buttonNode,t)}this.className=t};BX.PopupWindowButton.prototype.addClassName=function(t){if(this.buttonNode){BX.addClass(this.buttonNode,t);this.className=this.buttonNode.className}};BX.PopupWindowButton.prototype.removeClassName=function(t){if(this.buttonNode){BX.removeClass(this.buttonNode,t);this.className=this.buttonNode.className}};BX.PopupWindowButtonLink=function(t){BX.PopupWindowButtonLink.superclass.constructor.apply(this,arguments);this.buttonNode=BX.create("span",{props:{className:"popup-window-button popup-window-button-link"+(this.className.length>0?" "+this.className:""),id:this.id},text:this.text,events:this.contextEvents})};BX.extend(BX.PopupWindowButtonLink,BX.PopupWindowButton);BX.PopupWindowCustomButton=function(t){BX.PopupWindowCustomButton.superclass.constructor.apply(this,arguments);this.buttonNode=BX.create("span",{props:{className:this.className.length>0?" "+this.className:"",id:this.id},events:this.contextEvents,text:this.text})};BX.extend(BX.PopupWindowCustomButton,BX.PopupWindowButton);BX.PopupMenu={Data:{},currentItem:null,show:function(t,e,i,n){if(this.currentItem!==null){this.currentItem.popupWindow.close()}this.currentItem=this.create(t,e,i,n);this.currentItem.popupWindow.show()},create:function(t,e,i,n){if(!this.Data[t]){this.Data[t]=new BX.PopupMenuWindow(t,e,i,n);BX.addCustomEvent(this.Data[t],"onPopupMenuDestroy",this.onPopupDestroy.bind(this))}return this.Data[t]},getCurrentMenu:function(){return this.currentItem},getMenuById:function(t){return this.Data[t]?this.Data[t]:null},onPopupDestroy:function(t){this.destroy(t.id)},destroy:function(t){var e=this.getMenuById(t);if(e){if(this.currentItem===e){this.currentItem=null}e.popupWindow.destroy();delete this.Data[t]}}};BX.PopupMenuWindow=function(t,e,i,n){this.id=t;this.bindElement=e;this.menuItems=[];this.itemsContainer=null;this.params=n&&typeof n==="object"?n:{};this.parentMenuWindow=null;this.parentMenuItem=null;if(i&&BX.type.isArray(i)){for(var o=0;o<i.length;o++){this.addMenuItemInternal(i[o],null)}}this.layout={menuContainer:null,itemsContainer:null};this.popupWindow=this.__createPopup()};BX.PopupMenuWindow.prototype.__createPopup=function(){var t=[];for(var e=0;e<this.menuItems.length;e++){var i=this.menuItems[e];var n=i.getLayout();t.push(n.item)}var o={closeByEsc:false,angle:false,autoHide:true,offsetTop:1,offsetLeft:0};var s=BX.mergeEx(o,this.params);s.noAllPaddings=true;s.darkMode=false;s.autoHideHandler=this.handleAutoHide.bind(this);s.content=this.layout.menuContainer=BX.create("div",{props:{className:"menu-popup"},children:[this.layout.itemsContainer=this.itemsContainer=BX.create("div",{props:{className:"menu-popup-items"},children:t})]});s.events={onPopupClose:this.onMenuWindowClose.bind(this),onPopupDestroy:this.onMenuWindowDestroy.bind(this)};var p=new BX.PopupWindow("menu-popup-"+this.id,this.bindElement,s);if(this.params&&this.params.events){for(var u in this.params.events){if(this.params.events.hasOwnProperty(u)){BX.addCustomEvent(p,u,this.params.events[u])}}}return p};BX.PopupMenuWindow.prototype.getPopupWindow=function(){return this.popupWindow};BX.PopupMenuWindow.prototype.show=function(){this.popupWindow.show()};BX.PopupMenuWindow.prototype.close=function(){this.popupWindow.close()};BX.PopupMenuWindow.prototype.destroy=function(){BX.onCustomEvent(this,"onPopupMenuDestroy",[this]);this.popupWindow.destroy()};BX.PopupMenuWindow.prototype.onMenuWindowClose=function(){for(var t=0;t<this.menuItems.length;t++){var e=this.menuItems[t];e.closeSubMenu()}};BX.PopupMenuWindow.prototype.onMenuWindowDestroy=function(){for(var t=0;t<this.menuItems.length;t++){var e=this.menuItems[t];e.destroySubMenu()}};BX.PopupMenuWindow.prototype.handleAutoHide=function(t){return!this.containsTarget(t.target)};BX.PopupMenuWindow.prototype.containsTarget=function(t){var e=this.getPopupWindow().getPopupContainer();if(this.getPopupWindow().isShown()&&(t===e||e.contains(t))){return true}return this.getMenuItems().some(function(e){return e.getSubMenu()&&e.getSubMenu().containsTarget(t)})};BX.PopupMenuWindow.prototype.setParentMenuWindow=function(t){if(t instanceof BX.PopupMenuWindow){this.parentMenuWindow=t}};BX.PopupMenuWindow.prototype.getParentMenuWindow=function(){return this.parentMenuWindow};BX.PopupMenuWindow.prototype.getRootMenuWindow=function(){var t=null;var e=this.getParentMenuWindow();while(e!==null){t=e;e=e.getParentMenuWindow()}return t};BX.PopupMenuWindow.prototype.setParentMenuItem=function(t){if(t instanceof BX.PopupMenuItem){this.parentMenuItem=t}};BX.PopupMenuWindow.prototype.getParentMenuItem=function(){return this.parentMenuItem};BX.PopupMenuWindow.prototype.addMenuItem=function(t,e){var i=this.addMenuItemInternal(t,e);if(!i){return null}var n=i.getLayout();var o=this.getMenuItem(e);if(o!==null){var s=o.getLayout();this.itemsContainer.insertBefore(n.item,s.item)}else{this.itemsContainer.appendChild(n.item)}return i};BX.PopupMenuWindow.prototype.addMenuItemInternal=function(t,e){if(!t||!t.delimiter&&!BX.type.isNotEmptyString(t.text)||t.id&&this.getMenuItem(t.id)!==null){return null}if(BX.type.isNumber(this.params.menuShowDelay)){t.menuShowDelay=this.params.menuShowDelay}var i=new BX.PopupMenuItem(t);i.setMenuWindow(this);var n=this.getMenuItemPosition(e);if(n>=0){this.menuItems=BX.util.insertIntoArray(this.menuItems,n,i)}else{this.menuItems.push(i)}return i};BX.PopupMenuWindow.prototype.removeMenuItem=function(t){var e=this.getMenuItem(t);if(!e){return}for(var i=0;i<this.menuItems.length;i++){if(this.menuItems[i]===e){e.destroySubMenu();this.menuItems=BX.util.deleteFromArray(this.menuItems,i);break}}if(!this.menuItems.length){var n=e.getMenuWindow();if(n){var o=n.getParentMenuItem();if(o){o.destroySubMenu()}else{n.destroy()}}}e.layout.item.parentNode.removeChild(e.layout.item);e.layout={item:null,text:null}};BX.PopupMenuWindow.prototype.getMenuItem=function(t){for(var e=0;e<this.menuItems.length;e++){if(this.menuItems[e].id&&this.menuItems[e].id===t){return this.menuItems[e]}}return null};BX.PopupMenuWindow.prototype.getMenuItems=function(){return this.menuItems};BX.PopupMenuWindow.prototype.getMenuItemPosition=function(t){if(t){for(var e=0;e<this.menuItems.length;e++){if(this.menuItems[e].id&&this.menuItems[e].id===t){return e}}}return-1};BX.PopupMenuItem=function(t){t=t||{};this.options=t;this.id=t.id||BX.util.getRandomString().toLowerCase();this.text=BX.type.isNotEmptyString(t.text)?t.text:"";this.title=BX.type.isNotEmptyString(t.title)?t.title:"";this.delimiter=t.delimiter===true;this.href=BX.type.isNotEmptyString(t.href)?t.href:null;this.target=BX.type.isNotEmptyString(t.target)?t.target:null;this.dataset=BX.type.isPlainObject(t.dataset)?t.dataset:null;this.className=BX.type.isNotEmptyString(t.className)?t.className:null;this.menuShowDelay=BX.type.isNumber(t.menuShowDelay)?t.menuShowDelay:300;this.subMenuOffsetX=BX.type.isNumber(t.subMenuOffsetX)?t.subMenuOffsetX:4;this._items=BX.type.isArray(t.items)?t.items:[];this.disabled=t.disabled===true;this.onclick=BX.type.isNotEmptyString(t.onclick)||BX.type.isFunction(t.onclick)?t.onclick:null;if(BX.type.isPlainObject(t.events)){for(var e in t.events){BX.addCustomEvent(this,e,t.events[e])}}this.menuWindow=null;this.subMenuWindow=null;this.layout={item:null,text:null};this.getLayout();this.events={};this.items=[];for(var i in t){if(t.hasOwnProperty(i)&&typeof this[i]==="undefined"){this[i]=t[i]}}};BX.PopupMenuItem.prototype={getLayout:function(){if(this.layout.item){return this.layout}if(this.delimiter){if(BX.type.isNotEmptyString(this.text)){this.layout.item=BX.create("span",{props:{className:"popup-window-delimiter-section"},children:[this.layout.text=BX.create("span",{props:{className:"popup-window-delimiter-text"},html:this.text})]})}else{this.layout.item=BX.create("span",{props:{className:"popup-window-delimiter"}})}}else{this.layout.item=BX.create(this.href?"a":"span",{props:{className:["menu-popup-item",this.className?this.className:"menu-popup-no-icon",this.hasSubMenu()?"menu-popup-item-submenu":""].join(" ")},attrs:{title:this.title,onclick:BX.type.isString(this.onclick)?this.onclick:"",target:this.target?this.target:""},dataset:this.dataset,events:BX.type.isFunction(this.onclick)?{click:BX.delegate(this.onItemClick,this)}:null,children:[BX.create("span",{props:{className:"menu-popup-item-icon"}}),this.layout.text=BX.create("span",{props:{className:"menu-popup-item-text"},html:this.text})]});if(this.href){this.layout.item.href=this.href}if(this.isDisabled()){this.disable()}BX.bind(this.layout.item,"mouseenter",this.onItemMouseEnter.bind(this));BX.bind(this.layout.item,"mouseleave",this.onItemMouseLeave.bind(this))}return this.layout},getContainer:function(){return this.getLayout().item},getTextContainer:function(){return this.getLayout().text},onItemClick:function(t){this.onclick.call(this.menuWindow,t,this)},onItemMouseEnter:function(t){if(this.isDisabled()){return}BX.onCustomEvent(this,"onMouseEnter");if(this.subMenuTimeout){clearTimeout(this.subMenuTimeout)}if(this.hasSubMenu()){this.subMenuTimeout=setTimeout(function(){this.showSubMenu()}.bind(this),this.menuShowDelay)}else{this.subMenuTimeout=setTimeout(function(){this.closeSiblings()}.bind(this),this.menuShowDelay)}},onItemMouseLeave:function(t){if(this.isDisabled()){return}BX.onCustomEvent(this,"onMouseLeave");if(this.subMenuTimeout){clearTimeout(this.subMenuTimeout)}},hasSubMenu:function(){return this.subMenuWindow!==null||this._items.length},showSubMenu:function(){this.addSubMenu(this._items);if(this.subMenuWindow){BX.addClass(this.layout.item,"menu-popup-item-open");this.closeSiblings();this.closeChildren();var t=this.subMenuWindow.getPopupWindow();if(!t.isShown()){BX.onCustomEvent(this,"onSubMenuShow");t.show()}this.adjustSubMenu()}},addSubMenu:function(t){if(this.subMenuWindow!==null||!BX.type.isArray(t)||!t.length){return}var e=this.getMenuWindow().getRootMenuWindow()||this.getMenuWindow();var i=e.params;i.autoHide=false;i.menuShowDelay=this.menuShowDelay;i.zIndexAbsolute=this.getMenuWindow().getPopupWindow().getZindex()+2;i.bindOptions={forceTop:true,forceLeft:true,forceBindPosition:true};delete i.zIndex;delete i.events;delete i.angle;delete i.overlay;this.subMenuWindow=new BX.PopupMenuWindow("popup-submenu-"+this.id,this.layout.item,t,i);this.subMenuWindow.setParentMenuWindow(this.getMenuWindow());this.subMenuWindow.setParentMenuItem(this);BX.addClass(this.layout.item,"menu-popup-item-submenu")},closeSubMenu:function(){if(this.subMenuWindow){BX.removeClass(this.layout.item,"menu-popup-item-open");this.closeChildren();var t=this.subMenuWindow.getPopupWindow();if(t.isShown()){BX.onCustomEvent(this,"onSubMenuClose")}this.subMenuWindow.close()}},closeSiblings:function(){var t=this.menuWindow.getMenuItems();for(var e=0;e<t.length;e++){if(t[e]!==this){t[e].closeSubMenu()}}},closeChildren:function(){if(this.subMenuWindow){var t=this.subMenuWindow.getMenuItems();for(var e=0;e<t.length;e++){t[e].closeSubMenu()}}},destroySubMenu:function(){if(this.subMenuWindow){BX.removeClass(this.layout.item,"menu-popup-item-open menu-popup-item-submenu");this.destroyChildren();this.subMenuWindow.destroy();this.subMenuWindow=null;this._items=[]}},destroyChildren:function(){if(this.subMenuWindow){var t=this.subMenuWindow.getMenuItems();for(var e=0;e<t.length;e++){t[e].destroySubMenu()}}},adjustSubMenu:function(){if(!this.subMenuWindow||!this.layout.item){return}var t=this.subMenuWindow.getPopupWindow();var e=this.layout.item.getBoundingClientRect();var i=e.width+this.subMenuOffsetX;var n=e.height+this.getPopupPadding();var o=e.height/2-this.getPopupPadding();var s="left";var p=t.getPopupContainer().offsetWidth;var u=t.getPopupContainer().offsetHeight;var a=e.top+u;var r=document.documentElement.clientWidth;var h=document.documentElement.clientHeight;var l=a-h;if(l>0){var d=Math.ceil(l/e.height)*e.height;if(d>e.top){d-=Math.ceil((d-e.top)/e.height)*e.height}if(e.bottom>a-d){d-=e.bottom-(a-d)+this.getPopupPadding()}n+=d;o+=d}if(e.left+i+p>r){var f=e.left-p-this.subMenuOffsetX;if(f>0){i=-p-this.subMenuOffsetX;s="right"}}t.setBindElement(this.layout.item);t.setOffset({offsetLeft:i,offsetTop:-n});t.setAngle({position:s,offset:o});t.adjustPosition()},getPopupPadding:function(){if(!BX.type.isNumber(this.popupPadding)){if(this.subMenuWindow){var t=this.subMenuWindow.layout.menuContainer;this.popupPadding=parseInt(BX.style(t,"paddingTop"),10)}else{this.popupPadding=0}}return this.popupPadding},getSubMenu:function(){return this.subMenuWindow},getId:function(){return this.id},setMenuWindow:function(t){this.menuWindow=t},getMenuWindow:function(){return this.menuWindow},getMenuShowDelay:function(){return this.menuShowDelay},enable:function(){this.disabled=false;this.getContainer().classList.remove("menu-popup-item-disabled")},disable:function(){this.disabled=true;this.closeSubMenu();this.getContainer().classList.add("menu-popup-item-disabled")},isDisabled:function(){return this.disabled}};t.BXInputPopup=function(t){this.id=t.id||"bx-inp-popup-"+Math.round(Math.random()*1e6);this.handler=t.handler||false;this.values=t.values||false;this.pInput=t.input;this.bValues=!!this.values;this.defaultValue=t.defaultValue||"";this.openTitle=t.openTitle||"";this.className=t.className||"";this.noMRclassName=t.noMRclassName||"ec-no-rm";this.emptyClassName=t.noMRclassName||"ec-label";var e=this;this.curInd=false;if(this.bValues){this.pInput.onfocus=this.pInput.onclick=function(t){if(this.value==e.defaultValue){this.value="";this.className=e.className}e.ShowPopup();return BX.PreventDefault(t)};this.pInput.onblur=function(){if(e.bShowed)setTimeout(function(){e.ClosePopup(true)},200);e.OnChange()}}else{this.pInput.className=this.noMRclassName;this.pInput.onblur=BX.proxy(this.OnChange,this)}};BXInputPopup.prototype={ShowPopup:function(){if(this.bShowed)return;var t=this;if(!this.oPopup){var e,i=BX.create("DIV",{props:{className:"bxecpl-loc-popup "+this.className}});for(var n=0,o=this.values.length;n<o;n++){e=i.appendChild(BX.create("DIV",{props:{id:"bxecmr_"+n},text:this.values[n].NAME,events:{mouseover:function(){BX.addClass(this,"bxecplloc-over")},mouseout:function(){BX.removeClass(this,"bxecplloc-over")},click:function(){var e=this.id.substr("bxecmr_".length);t.pInput.value=t.values[e].NAME;t.curInd=e;t.OnChange();t.ClosePopup(true)}}}));if(this.values[n].DESCRIPTION)e.title=this.values[n].DESCRIPTION;if(this.values[n].CLASS_NAME)BX.addClass(e,this.values[n].CLASS_NAME);if(this.values[n].URL)e.appendChild(BX.create("A",{props:{href:this.values[n].URL,className:"bxecplloc-view",target:"_blank",title:this.openTitle}}))}this.oPopup=new BX.PopupWindow(this.id,this.pInput,{autoHide:true,offsetTop:1,offsetLeft:0,lightShadow:true,closeByEsc:true,content:i});BX.addCustomEvent(this.oPopup,"onPopupClose",BX.proxy(this.ClosePopup,this))}this.oPopup.show();this.pInput.select();this.bShowed=true;BX.onCustomEvent(this,"onInputPopupShow",[this])},ClosePopup:function(t){this.bShowed=false;if(this.pInput.value=="")this.OnChange();BX.onCustomEvent(this,"onInputPopupClose",[this]);if(t===true)this.oPopup.close()},OnChange:function(){var t=this.pInput.value;if(this.bValues){if(this.pInput.value==""||this.pInput.value==this.defaultValue){this.pInput.value=this.defaultValue;this.pInput.className=this.emptyClassName;t=""}else{this.pInput.className=""}}if(isNaN(parseInt(this.curInd))||this.curInd!==false&&t!=this.values[this.curInd].NAME)this.curInd=false;else this.curInd=parseInt(this.curInd);BX.onCustomEvent(this,"onInputPopupChanged",[this,this.curInd,t]);if(this.handler&&typeof this.handler=="function")this.handler({ind:this.curInd,value:t})},Set:function(t,e,i){this.curInd=t;if(this.curInd!==false)this.pInput.value=this.values[this.curInd].NAME;else this.pInput.value=e;if(i!==false)this.OnChange()},Get:function(t){var e=false;if(typeof t=="undefined")t=this.curInd;if(t!==false&&this.values[t])e=this.values[t].ID;return e},GetIndex:function(t){for(var e=0,i=this.values.length;e<i;e++)if(this.values[e].ID==t)return e;return false},Deactivate:function(t){if(this.pInput.value==""||this.pInput.value==this.defaultValue){if(t){this.pInput.value="";this.pInput.className=this.noMRclassName}else if(this.oEC.bUseMR){this.pInput.value=this.defaultValue;this.pInput.className=this.emptyClassName}}this.pInput.disabled=t}};var e=-1,i=null;function n(t,o){if(t===false){if(i&&i.length>0){for(var s=0;s<i.length;s++){i[s]()}i=null;e=-1}}else{if(i===null){i=[];e=-1;BX.defer(n)(false)}if(t>e){e=t;i=[o]}else if(t==e){i.push(o)}}}})(window);