1; /* /bitrix/js/main/core/core_window.min.js?149879921375204*/ 2; /* /bitrix/js/main/core/core_popup.min.js?149879915439932*/ 3; /* /bitrix/js/main/core/core_date.min.js?149879649334241*/ 4; /* /bitrix/js/main/utils.min.js?145803104219858*/ 5; /* /bitrix/js/main/core/core_ajax.min.js?149879921321435*/ 6; /* /bitrix/js/main/json/json2.min.js?14580310403467*/ 7; /* /bitrix/js/main/core/core_ls.min.js?14580310417365*/ 8; /* /bitrix/js/main/session.min.js?14580310402511*/ 9; /* /bitrix/js/main/core/core_ajax.min.js?149879921321435*/ 10; /* /bitrix/js/main/json/json2.min.js?14580310403467*/ 11; /* /bitrix/js/main/core/core_ls.min.js?14580310417365*/ 12; /* /bitrix/js/main/session.min.js?14580310402511*/ 13; /* /bitrix/js/main/core/core_window.min.js?149879921375204*/ 14; /* /bitrix/js/main/core/core_popup.min.js?149879915439932*/ 15; /* /bitrix/js/main/core/core_date.min.js?149879649334241*/ 16; /* /bitrix/js/main/utils.min.js?145803104219858*/ 17; /* /bitrix/js/main/core/core_ajax.min.js?149879921321435*/ 18; /* /bitrix/js/main/json/json2.min.js?14580310403467*/ 19; /* /bitrix/js/main/core/core_ls.min.js?14580310417365*/ 20; /* /bitrix/js/main/session.min.js?14580310402511*/ 21; /* /bitrix/js/main/core/core.js?1729256155118107*/ 22 23; /* Start:"a:4:{s:4:"full";s:45:"/bitrix/js/main/core/core.js?1729256155118107";s:6:"source";s:28:"/bitrix/js/main/core/core.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 24/**********************************************************************/ 25/*********** Bitrix JS Core library ver 0.9.7 beta ********************/ 26/**********************************************************************/ 27 28;(function(window){ 29 30if (!!window.BX && !!window.BX.extend) 31 return; 32 33var _bxtmp; 34if (!!window.BX) 35{ 36 _bxtmp = window.BX; 37} 38 39window.BX = function(node, bCache) 40{ 41 if (BX.type.isNotEmptyString(node)) 42 { 43 var ob; 44 45 if (!!bCache && null != NODECACHE[node]) 46 ob = NODECACHE[node]; 47 ob = ob || document.getElementById(node); 48 if (!!bCache) 49 NODECACHE[node] = ob; 50 51 return ob; 52 } 53 else if (BX.type.isDomNode(node)) 54 return node; 55 else if (BX.type.isFunction(node)) 56 return BX.ready(node); 57 58 return null; 59}; 60 61BX.debugEnableFlag = true; 62 63// language utility 64BX.message = function(mess) 65{ 66 if (BX.type.isString(mess)) 67 { 68 if (typeof BX.message[mess] == "undefined") 69 { 70 BX.onCustomEvent("onBXMessageNotFound", [mess]); 71 if (typeof BX.message[mess] == "undefined") 72 { 73 BX.debug("message undefined: " + mess); 74 BX.message[mess] = ""; 75 } 76 77 } 78 79 return BX.message[mess]; 80 } 81 else 82 { 83 for (var i in mess) 84 { 85 if (mess.hasOwnProperty(i)) 86 { 87 BX.message[i] = mess[i]; 88 } 89 } 90 return true; 91 } 92}; 93 94if(!!_bxtmp) 95{ 96 for(var i in _bxtmp) 97 { 98 if(_bxtmp.hasOwnProperty(i)) 99 { 100 if(!BX[i]) 101 { 102 BX[i]=_bxtmp[i]; 103 } 104 else if(i=='message') 105 { 106 for(var j in _bxtmp[i]) 107 { 108 if(_bxtmp[i].hasOwnProperty(j)) 109 { 110 BX.message[j]=_bxtmp[i][j]; 111 } 112 } 113 } 114 } 115 } 116 117 _bxtmp = null; 118} 119 120var 121 122/* ready */ 123__readyHandler = null, 124readyBound = false, 125readyList = [], 126 127/* list of registered proxy functions */ 128proxySalt = Math.random(), 129proxyId = 1, 130proxyList = [], 131 132/* getElementById cache */ 133NODECACHE = {}, 134 135/* List of denied event handlers */ 136deniedEvents = [], 137 138/* list of registered event handlers */ 139eventsList = [], 140 141/* list of registered custom events */ 142customEvents = {}, 143 144/* list of external garbage collectors */ 145garbageCollectors = [], 146 147/* list of loaded CSS files */ 148cssList = [], 149cssInit = false, 150 151/* list of loaded JS files */ 152jsList = [], 153jsInit = false, 154 155 156/* browser detection */ 157bSafari = navigator.userAgent.toLowerCase().indexOf('webkit') != -1, 158bOpera = navigator.userAgent.toLowerCase().indexOf('opera') != -1, 159bFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') != -1, 160bChrome = navigator.userAgent.toLowerCase().indexOf('chrome') != -1, 161bIE = document.attachEvent && !bOpera, 162 163/* regexps */ 164r = { 165 script: /<script([^>]*)>/ig, 166 script_end: /<\/script>/ig, 167 script_src: /src=["\']([^"\']+)["\']/i, 168 script_type: /type=["\']([^"\']+)["\']/i, 169 space: /\s+/, 170 ltrim: /^[\s\r\n]+/g, 171 rtrim: /[\s\r\n]+$/g, 172 style: /<link.*?(rel="stylesheet"|type="text\/css")[^>
172]*>/i, 173 style_href: /href=["\']([^"\']+)["\']/i 174}, 175 176eventTypes = { 177 click: 'MouseEvent', 178 dblclick: 'MouseEvent', 179 mousedown: 'MouseEvent', 180 mousemove: 'MouseEvent', 181 mouseout: 'MouseEvent', 182 mouseover: 'MouseEvent', 183 mouseup: 'MouseEvent', 184 focus: 'MouseEvent', 185 blur: 'MouseEvent' 186}, 187 188lastWait = [], 189 190CHECK_FORM_ELEMENTS = {tagName: /^INPUT|SELECT|TEXTAREA|BUTTON$/i}, 191 192PRELOADING = 1, PRELOADED = 2, LOADING = 3, LOADED = 4, 193assets = {}, 194isAsync = null; 195 196BX.MSLEFT = 1; 197BX.MSMIDDLE = 2; 198BX.MSRIGHT = 4; 199 200BX.ext = function(ob) 201{ 202 for (var i in ob) 203 { 204 if(ob.hasOwnProperty(i)) 205 { 206 this[i] = ob[i]; 207 } 208 } 209}; 210 211/* OO emulation utility */ 212BX.extend = function(child, parent) 213{ 214 var f = function() {}; 215 f.prototype = parent.prototype; 216 217 child.prototype = new f(); 218 child.prototype.constructor = child; 219 220 child.superclass = parent.prototype; 221 if(parent.prototype.constructor == Object.prototype.constructor) 222 { 223 parent.prototype.constructor = parent; 224 } 225}; 226 227BX.namespace = function(namespace) 228{ 229 var parts = namespace.split("."); 230 var parent = BX; 231 232 if (parts[0] === "BX") 233 { 234 parts = parts.slice(1); 235 } 236 237 for (var i = 0; i < parts.length; i++) { 238 239 if (typeof parent[parts[i]] === "undefined") 240 { 241 parent[parts[i]] = {}; 242 } 243 parent = parent[parts[i]]; 244 } 245 246 return parent; 247}; 248 249BX.debug = function() 250{ 251 if (BX.debugStatus()) 252 { 253 if (window.console && window.console.log) 254 window.console.log('BX.debug: ', arguments.length > 0 ? arguments : arguments[0]); 255 if (window.console && window.console.trace) 256 console.trace(); 257 } 258}; 259 260BX.debugEnable = function(flag) 261{ 262 flag = typeof (flag) == 'boolean'? flag: true; 263 BX.debugEnableFlag = flag; 264}; 265 266BX.debugStatus = function() 267{ 268 return BX.debugEnableFlag || true; 269}; 270 271BX.is_subclass_of = function(ob, parent_class) 272{ 273 if (ob instanceof parent_class) 274 return true; 275 276 if (parent_class.superclass) 277 return BX.is_subclass_of(ob, parent_class.superclass); 278 279 return false; 280}; 281 282BX.clearNodeCache = function() 283{ 284 NODECACHE = {}; 285 return false; 286}; 287 288BX.bitrix_sessid = function() {return BX.message("bitrix_sessid"); }; 289 290/* DOM manipulation */ 291/** 292 * Creates the specified HTML element 293 * @param {String} tag 294 * @param {Object} [data] 295 * @param {Document} [context] 296 * @returns {Element} 297 */ 298BX.create = function(tag, data, context) 299{ 300 context = context || document; 301 302 if (null == data && typeof tag == 'object' && tag.constructor !== String) 303 { 304 data = tag; tag = tag.tag; 305 } 306 307 var elem; 308 if (BX.browser.IsIE() && !BX.browser.IsIE9() && null != data && null != data.props && (data.props.name || data.props.id)) 309 { 310 elem = context.createElement('<' + tag + (data.props.name ? ' name="' + data.props.name + '"' : '') + (data.props.id ? ' id="' + data.props.id + '"' : '') + '>'); 311 } 312 else 313 { 314 elem = context.createElement(tag); 315 } 316 317 return data ? BX.adjust(elem, data) : elem; 318}; 319 320BX.adjust = function(elem, data) 321{ 322 var j,len; 323 324 if (!elem.nodeType) 325 return null; 326 327 if (elem.nodeType == 9) 328 elem = elem.body; 329 330 if (data.attrs) 331 { 332 for (j in data.attrs) 333 { 334 if(data.attrs.hasOwnProperty(j)) 335 { 336 if (j == 'class' || j == 'className') 337 elem.className = data.attrs[j]; 338 else if (j == 'for') 339 elem.htmlFor = data.attrs[j]; 340 else if(data.attrs[j] == "") 341 elem.removeAttribute(j); 342 else 343 elem.setAttribute(j, data.attrs[j]); 344 } 345 } 346 } 347 348 if (data.style) 349 { 350 for (j in data.style) 351 { 352 if(data.style.hasOwnProperty(j)) 353 { 354 elem.style[j] = data.style[j]; 355 } 356 } 357 } 358 359 if (data.props) 360 { 361 for (j in data.props) 362 { 363 if(data.props.hasOwnProperty(j)) 364 { 365 elem[j] = data.props[j]; 366 } 367 } 368 } 369 370 if (data.events) 371 { 372 for (j in data.events) 373 { 374 if(data.events.hasOwnProperty(j)) 375 { 376 BX.bind(elem, j, data.events[j]); 377 } 378 } 379 } 380 381 if (data.dataset) 382 { 383 for (j in data.dataset) 384 { 385 if(data.dataset.hasOwnProperty(j)) 386 { 387 elem.dataset[j] = data.dataset[j] 388 } 389 } 390 } 391 392 if (data.children && data.children.length > 0) 393 { 394 for (j=0,len=data.children.length; j<len; j++) 395 { 396 if (BX.type.isNotEmptyString(data.children[j])) 397 elem.innerHTML += data.children[j]; 398 else if (BX.type.isElementNode(data.children[j])) 399 elem.appendChild(data.children[j]); 400 } 401 } 402 else if (data.text) 403 { 404 BX.cleanNode(elem); 405 elem.appendChild((elem.ownerDocument || document).createTextNode(data.text)); 406 } 407 else if (typeof data.html !== 'undefined') 408 { 409 elem.innerHTML = data.html; 410 } 411 412 return elem; 413}; 414 415BX.remove = function(ob) 416{ 417 if (ob && null != ob.parentNode) 418 ob.parentNode.removeChild(ob); 419 ob = null; 420 return null; 421}; 422 423BX.cleanNode = function(node, bSuicide) 424{
425 node = BX(node); 426 bSuicide = !!bSuicide; 427 428 if (node && node.childNodes) 429 { 430 while(node.childNodes.length > 0) 431 node.removeChild(node.firstChild); 432 } 433 434 if (node && bSuicide) 435 { 436 node = BX.remove(node); 437 } 438 439 return node; 440}; 441 442BX.html = function(node, html, parameters) 443{ 444 if(typeof html == 'undefined') 445 return node.innerHTML; 446 447 if(typeof parameters == 'undefined') 448 parameters = {}; 449 450 html = BX.processHTML(html.toString()); 451 452 var assets = []; 453 var inlineJS = []; 454 455 if(typeof html.STYLE != 'undefined' && html.STYLE.length > 0) 456 { 457 for(var k in html.STYLE) 458 assets.push(html.STYLE[k]); 459 } 460 461 if(typeof html.SCRIPT != 'undefined' && html.SCRIPT.length > 0) 462 { 463 for(var k in html.SCRIPT) 464 { 465 if(html.SCRIPT[k].isInternal) 466 inlineJS.push(html.SCRIPT[k].JS); 467 else 468 assets.push(html.SCRIPT[k].JS); 469 } 470 } 471 472 if(parameters.htmlFirst && typeof html.HTML != 'undefined' && node) 473 { 474 node.innerHTML = html.HTML; 475 } 476 477 var p = new BX.Promise(); 478 479 var afterAsstes = function(){ 480 if(!parameters.htmlFirst && typeof html.HTML != 'undefined' && node) 481 { 482 node.innerHTML = html.HTML; 483 } 484 485 for(var k in inlineJS) 486 { 487 BX.evalGlobal(inlineJS[k]); 488 } 489 490 if(BX.type.isFunction(parameters.callback)) 491 { 492 parameters.callback(); 493 } 494 495 p.fulfill(); 496 }; 497 498 if(assets.length > 0) 499 { 500 BX.load(assets, afterAsstes); 501 } 502 else 503 { 504 afterAsstes(); 505 } 506 507 return p; 508}; 509 510BX.insertAfter = function(node, dstNode) 511{ 512 dstNode.parentNode.insertBefore(node, dstNode.nextSibling); 513}; 514 515BX.prepend = function(node, dstNode) 516{ 517 dstNode.insertBefore(node, dstNode.firstChild); 518}; 519 520BX.append = function(node, dstNode) 521{ 522 dstNode.appendChild(node); 523}; 524 525BX.addClass = function(ob, value) 526{ 527 var classNames; 528 ob = BX(ob); 529 530 value = BX.util.trim(value); 531 if (value == '') 532 return ob; 533 534 if (ob) 535 { 536 if (!ob.className) 537 { 538 ob.className = value 539 } 540 else if (!!ob.classList && value.indexOf(' ') < 0) 541 { 542 ob.classList.add(value); 543 } 544 else 545 { 546 classNames = (value || "").split(r.space); 547 548 var className = " " + ob.className + " "; 549 for (var j = 0, cl = classNames.length; j < cl; j++) 550 { 551 if (className.indexOf(" " + classNames[j] + " ") < 0) 552 { 553 ob.className += " " + classNames[j]; 554 } 555 } 556 } 557 } 558 559 return ob; 560}; 561 562BX.removeClass = function(ob, value) 563{ 564 ob = BX(ob); 565 if (ob) 566 { 567 if (ob.className && !!value) 568 { 569 if (BX.type.isString(value)) 570 { 571 if (!!ob.classList && value.indexOf(' ') < 0) 572 { 573 ob.classList.remove(value); 574 } 575 else 576 { 577 var classNames = value.split(r.space), className = " " + ob.className + " "; 578 for (var j = 0, cl = classNames.length; j < cl; j++) 579 { 580 className = className.replace(" " + classNames[j] + " ", " "); 581 } 582 583 ob.className = BX.util.trim(className); 584 } 585 } 586 else 587 { 588 ob.className = ""; 589 } 590 } 591 } 592 593 return ob; 594}; 595 596BX.toggleClass = function(ob, value) 597{ 598 var className; 599 ob = BX(ob); 600 601 if (BX.type.isArray(value)) 602 { 603 className = ' ' + ob.className + ' '; 604 for (var j = 0, len = value.length; j < len; j++) 605 { 606 if (BX.hasClass(ob, value[j])) 607 { 608 className = (' ' + className + ' ').replace(' ' + value[j] + ' ', ' '); 609 className += ' ' + value[j >= len-1 ? 0 : j+1]; 610 611 j--; 612 break; 613 } 614 } 615 616 if (j == len) 617 ob.className += ' ' + value[0]; 618 else 619 ob.className = className; 620 621 ob.className = BX.util.trim(ob.className); 622 } 623 else if (BX.type.isNotEmptyString(value)) 624 { 625 if (!!ob.classList) 626 { 627 ob.classList.toggle(value); 628 } 629 else 630 { 631 className = ob.className; 632 if (BX.hasClass(ob, value)) 633 { 634 className = (' ' + className + ' ').replace(' ' + value + ' ', ' '); 635 } 636 else 637 { 638 className += ' ' + value; 639 } 640 641 ob.className = BX.util.trim(className); 642 } 643 } 644 645 return ob; 646}; 647 648BX.hasClass = function(el, className) 649{ 650 el = BX(el);
651 if (!el || !BX.type.isDomNode(el)) 652 { 653 BX.debug(el); 654 return false; 655 } 656 657 if (!el.className || !className) 658 { 659 return false; 660 } 661 662 if (!!el.classList && !!className && className.indexOf(' ') < 0) 663 { 664 return el.classList.contains(BX.util.trim(className)); 665 } 666 else 667 return ((" " + el.className + " ").indexOf(" " + className + " ")) >= 0; 668}; 669 670BX.setOpacity = function(ob, percentage) 671{ 672 if (ob.style.filter != null) 673 { 674 //IE 675 ob.style.zoom = "100%"; 676 677 if (percentage == 100) 678 { 679 ob.style.filter = ""; 680 } 681 else 682 { 683 ob.style.filter = 'alpha(opacity=' + percentage.toString() + ')'; 684 } 685 } 686 else if (ob.style.opacity != null) 687 { 688 // W3C 689 ob.style.opacity = (percentage / 100).toString(); 690 } 691 else if (ob.style.MozOpacity != null) 692 { 693 // Mozilla 694 ob.style.MozOpacity = (percentage / 100).toString(); 695 } 696}; 697 698BX.hoverEvents = function(el) 699{ 700 if (el) 701 return BX.adjust(el, {events: BX.hoverEvents()}); 702 else 703 return {mouseover: BX.hoverEventsHover, mouseout: BX.hoverEventsHout}; 704}; 705 706BX.hoverEventsHover = function(){BX.addClass(this,'bx-hover');this.BXHOVER=true;}; 707BX.hoverEventsHout = function(){BX.removeClass(this,'bx-hover');this.BXHOVER=false;}; 708 709BX.focusEvents = function(el) 710{ 711 if (el) 712 return BX.adjust(el, {events: BX.focusEvents()}); 713 else 714 return {mouseover: BX.focusEventsFocus, mouseout: BX.focusEventsBlur}; 715}; 716 717BX.focusEventsFocus = function(){BX.addClass(this,'bx-focus');this.BXFOCUS=true;}; 718BX.focusEventsBlur = function(){BX.removeClass(this,'bx-focus');this.BXFOCUS=false;}; 719 720BX.setUnselectable = function(node) 721{ 722 node.style.userSelect = node.style.MozUserSelect = node.style.WebkitUserSelect = node.style.KhtmlUserSelect = node.style = 'none'; 723 node.setAttribute('unSelectable', 'on'); 724}; 725 726BX.setSelectable = function(node) 727{ 728 node.style.userSelect = node.style.MozUserSelect = node.style.WebkitUserSelect = node.style.KhtmlUserSelect = node.style = ''; 729 node.removeAttribute('unSelectable'); 730}; 731 732BX.styleIEPropertyName = function(name) 733{ 734 if (name == 'float') 735 name = BX.browser.IsIE() ? 'styleFloat' : 'cssFloat'; 736 else 737 { 738 var res = BX.browser.isPropertySupported(name); 739 if (res) 740 { 741 name = res; 742 } 743 else 744 { 745 var reg = /(\-([a-z]){1})/g; 746 if (reg.test(name)) 747 { 748 name = name.replace(reg, function () {return arguments[2].toUpperCase();}); 749 } 750 } 751 } 752 return name; 753}; 754 755/* CSS-notation should be used here */ 756BX.style = function(el, property, value) 757{ 758 if (!BX.type.isElementNode(el)) 759 return null; 760 761 if (value == null) 762 { 763 var res; 764 765 if(el.currentStyle) 766 res = el.currentStyle[BX.styleIEPropertyName(property)]; 767 else if(window.getComputedStyle) 768 { 769 var q = BX.browser.isPropertySupported(property, true); 770 if (!!q) 771 property = q; 772 773 res = BX.GetContext(el).getComputedStyle(el, null).getPropertyValue(property); 774 } 775 776 if(!res) 777 res = ''; 778 return res; 779 } 780 else 781 { 782 el.style[BX.styleIEPropertyName(property)] = value; 783 return el; 784 } 785}; 786 787BX.focus = function(el) 788{ 789 try 790 { 791 el.focus(); 792 return true; 793 } 794 catch (e) 795 { 796 return false; 797 } 798}; 799 800BX.firstChild = function(el) 801{ 802 var e = el.firstChild; 803 while (e && !BX.type.isElementNode(e)) 804 { 805 e = e.nextSibling; 806 } 807 808 return e; 809}; 810 811BX.lastChild = function(el) 812{ 813 var e = el.lastChild; 814 while (e && !BX.type.isElementNode(e)) 815 { 816 e = e.previousSibling; 817 } 818 819 return e; 820}; 821 822BX.previousSibling = function(el) 823{ 824 var e = el.previousSibling; 825 while (e && !BX.type.isElementNode(e)) 826 { 827 e = e.previousSibling; 828 } 829 830 return e; 831}; 832 833BX.nextSibling = function(el) 834{ 835 var e = el.nextSibling; 836 while (e && !BX.type.isElementNode(e)) 837 { 838 e = e.nextSibling; 839 } 840 841 return e; 842}; 843 844/* 845 params: { 846 obj : html node 847 className : className value 848 recursive : used only for older browsers to optimize the tree traversal, in new browsers the search is always recursively, default - true 849 } 850 851 Search all nodes with className 852*/ 853BX.findChildrenByClassName = function(obj, className, recursive) 854{ 855 if(!obj || !obj.childNodes) return null; 856 857 var result = []; 858 if (typeof(obj.getElementsByClassName) == 'undefined') 859 { 860 recursive = recursive !== false; 861 result = BX.findChildren(obj, {className : className}, recursive); 862 } 863 else 864 { 865 var col = obj.getElementsByClassName(className); 866 for (i=0,l=col.length;i<l;i++) 867 { 868 result[i] = col[i]; 869 } 870 } 871 return result; 872}; 873 874/* 875 params: { 876 obj : html node 877 className : className value 878 recursive : used only for older browsers to optimize the tree traversal, in new browsers the search is always re
878cursively, default - true 879 } 880 881 Search first node with className 882*/ 883BX.findChildByClassName = function(obj, className, recursive) 884{ 885 if(!obj || !obj.childNodes) return null; 886 887 var result = null; 888 if (typeof(obj.getElementsByClassName) == 'undefined') 889 { 890 recursive = recursive !== false; 891 result = BX.findChild(obj, {className : className}, recursive); 892 } 893 else 894 { 895 var col = obj.getElementsByClassName(className); 896 if (col && typeof(col[0]) != 'undefined') 897 { 898 result = col[0]; 899 } 900 else 901 { 902 result = null; 903 } 904 } 905 return result; 906}; 907 908/* 909 params: { 910 tagName|tag : 'tagName', 911 className|class : 'className', 912 attribute : {attribute : value, attribute : value} | attribute | [attribute, attribute....], 913 property : {prop: value, prop: value} | prop | [prop, prop] 914 } 915 916 all values can be RegExps or strings 917*/ 918BX.findChildren = function(obj, params, recursive) 919{ 920 return BX.findChild(obj, params, recursive, true); 921}; 922 923BX.findChild = function(obj, params, recursive, get_all) 924{ 925 if(!obj || !obj.childNodes) return null; 926 927 recursive = !!recursive; get_all = !!get_all; 928 929 var n = obj.childNodes.length, result = []; 930 931 for (var j=0; j<n; j++) 932 { 933 var child = obj.childNodes[j]; 934 935 if (_checkNode(child, params)) 936 { 937 if (get_all) 938 result.push(child); 939 else 940 return child; 941 } 942 943 if(recursive == true) 944 { 945 var res = BX.findChild(child, params, recursive, get_all); 946 if (res) 947 { 948 if (get_all) 949 result = BX.util.array_merge(result, res); 950 else 951 return res; 952 } 953 } 954 } 955 956 if (get_all || result.length > 0) 957 return result; 958 else 959 return null; 960}; 961 962BX.findParent = function(obj, params, maxParent) 963{ 964 if(!obj) 965 return null; 966 967 var o = obj; 968 while(o.parentNode) 969 { 970 var parent = o.parentNode; 971 972 if (_checkNode(parent, params)) 973 return parent; 974 975 o = parent; 976 977 if (!!maxParent && 978 (BX.type.isFunction(maxParent) 979 || typeof maxParent == 'object')) 980 { 981 if (BX.type.isElementNode(maxParent)) 982 { 983 if (o == maxParent) 984 break; 985 } 986 else 987 { 988 if (_checkNode(o, maxParent)) 989 break; 990 } 991 } 992 } 993 return null; 994}; 995 996BX.findNextSibling = function(obj, params) 997{ 998 if(!obj) 999 return null; 1000 var o = obj; 1001 while(o.nextSibling) 1002 { 1003 var sibling = o.nextSibling; 1004 if (_checkNode(sibling, params)) 1005 return sibling; 1006 o = sibling; 1007 } 1008 return null; 1009}; 1010 1011BX.findPreviousSibling = function(obj, params) 1012{ 1013 if(!obj) 1014 return null; 1015 1016 var o = obj; 1017 while(o.previousSibling) 1018 { 1019 var sibling = o.previousSibling; 1020 if(_checkNode(sibling, params)) 1021 return sibling; 1022 o = sibling; 1023 } 1024 return null; 1025}; 1026 1027BX.checkNode = function(obj, params) 1028{ 1029 return _checkNode(obj, params); 1030}; 1031 1032BX.findFormElements = function(form) 1033{ 1034 if (BX.type.isString(form)) 1035 form = document.forms[form]||BX(form); 1036 1037 var res = []; 1038 1039 if (BX.type.isElementNode(form)) 1040 { 1041 if (form.tagName.toUpperCase() == 'FORM') 1042 { 1043 res = form.elements; 1044 } 1045 else 1046 { 1047 res = BX.findChildren(form, CHECK_FORM_ELEMENTS, true); 1048 } 1049 } 1050 1051 return res; 1052}; 1053 1054BX.isParentForNode = function(whichNode, forNode) 1055{ 1056 1057 if(!BX.type.isDomNode(whichNode) || !BX.type.isDomNode(forNode)) 1058 return false; 1059 1060 while(true){ 1061 1062 if(whichNode == forNode) 1063 return true; 1064 1065 if(forNode && forNode.parentNode) 1066 forNode = forNode.parentNode; 1067 else 1068 break; 1069 } 1070 1071 return false; 1072}; 1073 1074BX.clone = function(obj, bCopyObj) 1075{ 1076 var _obj, i, l;
1077 if (bCopyObj !== false) 1078 bCopyObj = true; 1079 1080 if (obj === null) 1081 return null; 1082 1083 if (BX.type.isDomNode(obj)) 1084 { 1085 _obj = obj.cloneNode(bCopyObj); 1086 } 1087 else if (typeof obj == 'object') 1088 { 1089 if (BX.type.isArray(obj)) 1090 { 1091 _obj = []; 1092 for (i=0,l=obj.length;i<l;i++) 1093 { 1094 if (typeof obj[i] == "object" && bCopyObj) 1095 _obj[i] = BX.clone(obj[i], bCopyObj); 1096 else 1097 _obj[i] = obj[i]; 1098 } 1099 } 1100 else 1101 { 1102 _obj = {}; 1103 if (obj.constructor) 1104 { 1105 if (BX.type.isDate(obj)) 1106 _obj = new Date(obj); 1107 else 1108 _obj = new obj.constructor(); 1109 } 1110 1111 for (i in obj) 1112 { 1113 if (typeof obj[i] == "object" && bCopyObj) 1114 _obj[i] = BX.clone(obj[i], bCopyObj); 1115 else 1116 _obj[i] = obj[i]; 1117 } 1118 } 1119 1120 } 1121 else 1122 { 1123 _obj = obj; 1124 } 1125 1126 return _obj; 1127}; 1128 1129// access private. use BX.mergeEx instead. 1130// todo: refactor BX.merge, make it work through BX.mergeEx 1131BX.merge = function(){ 1132 var arg = Array.prototype.slice.call(arguments); 1133 1134 if(arg.length < 2) 1135 return {}; 1136 1137 var result = arg.shift(); 1138 1139 for(var i = 0; i < arg.length; i++) 1140 { 1141 for(var k in arg[i]){ 1142 1143 if(typeof arg[i] == 'undefined' || arg[i] == null) 1144 continue; 1145 1146 if(arg[i].hasOwnProperty(k)){ 1147 1148 if(typeof arg[i][k] == 'undefined' || arg[i][k] == null) 1149 continue; 1150 1151 if(typeof arg[i][k] == 'object' && !BX.type.isDomNode(arg[i][k]) && (typeof arg[i][k]['isUIWidget'] == 'undefined')){ 1152 1153 // go deeper 1154 1155 var isArray = 'length' in arg[i][k]; 1156 1157 if(typeof result[k] != 'object') 1158 result[k] = isArray ? [] : {}; 1159 1160 if(isArray) 1161 BX.util.array_merge(result[k], arg[i][k]); 1162 else 1163 BX.merge(result[k], arg[i][k]); 1164 1165 }else 1166 result[k] = arg[i][k]; 1167 } 1168 } 1169 } 1170 1171 return result; 1172}; 1173 1174BX.mergeEx = function() 1175{ 1176 var arg = Array.prototype.slice.call(arguments); 1177 if(arg.length < 2) 1178 { 1179 return {}; 1180 } 1181 1182 var result = arg.shift(); 1183 for (var i = 0; i < arg.length; i++) 1184 { 1185 for (var k in arg[i]) 1186 { 1187 if (typeof arg[i] == "undefined" || arg[i] == null || !arg[i].hasOwnProperty(k)) 1188 { 1189 continue; 1190 } 1191 1192 if (BX.type.isPlainObject(arg[i][k]) && BX.type.isPlainObject(result[k])) 1193 { 1194 BX.mergeEx(result[k], arg[i][k]); 1195 } 1196 else 1197 { 1198 result[k] = BX.type.isPlainObject(arg[i][k]) ? BX.clone(arg[i][k]) : arg[i][k]; 1199 } 1200 } 1201 } 1202 1203 return result; 1204}; 1205 1206/* events */ 1207BX.bind = function(el, evname, func) 1208{ 1209 if (!el) 1210 { 1211 return; 1212 } 1213 1214 if (evname === 'mousewheel') 1215 { 1216 BX.bind(el, 'DOMMouseScroll', func); 1217 } 1218 else if (evname === 'transitionend') 1219 { 1220 BX.bind(el, 'webkitTransitionEnd', func); 1221 BX.bind(el, 'msTransitionEnd', func); 1222 BX.bind(el, 'oTransitionEnd', func); 1223 // IE8-9 doesn't support this feature! 1224 } 1225 else if (evname === 'bxchange') 1226 { 1227 BX.bind(el, "change", func); 1228 BX.bind(el, "cut", func); 1229 BX.bind(el, "paste", func); 1230 BX.bind(el, "drop", func); 1231 BX.bind(el, "keyup", func); 1232 1233 return; 1234 } 1235 else if (evname === 'fullscreenchange') 1236 { 1237 if (document.cancelFullScreen) 1238 BX.bind(el, "fullscreenchange", func); 1239 else if (document.mozCancelFullScreen) 1240 BX.bind(el, "mozfullscreenchange", func); 1241 else if (document.webkitCancelFullScreen) 1242 BX.bind(el, "webkitfullscreenchange", func); 1243 } 1244 1245 if (el.addEventListener) // Gecko / W3C 1246 { 1247 el.addEventListener(evname, func, false); 1248 } 1249 else if (el.attachEvent) // IE 1250 { 1251 el.attachEvent("on" + evname, BX.proxy(func, el)); 1252 } 1253 else 1254 { 1255 try 1256 { 1257 el["on" + evname] = func; 1258 } 1259 catch(e) 1260 { 1261 BX.debug(e) 1262 } 1263 } 1264 1265 eventsList[eventsList.length] = {'element': el, 'event': evname, 'fn': func}; 1266}; 1267 1268BX.unbind = function(el, evname, func) 1269{ 1270 if (!el) 1271 { 1272 return; 1273 } 1274 1275 if (evname === 'mousewheel') 1276 { 1277 BX.unbind(el, 'DOMMouseScroll', func); 1278 } 1279 else if (evname === 'transitionend') 1280 { 1281 BX.unbind(el, 'webkitTransitionEnd', func); 1282 BX.unbind(el, 'msTransitionEnd', func); 1283 BX.unbind(el, 'oTransitionEnd', func); 1284 } 1285 else if (evname === 'bxchange') 1286 { 1287 BX.unbind(el, "change", func); 1288 BX.unbind(el, "cut", func); 1289 BX.unbind(el, "paste", func); 1290 BX.unbind(el, "drop", func); 1291 BX.unbind(el, "keyup", func); 1292 1293 return; 1294 } 1295 1296 if(el.removeEventListener) // Gecko / W3C 1297 { 1298 el.removeEventListener(evname, func, false); 1299 } 1300 else if(el.detachEvent) // IE 1301 { 1302 el.detachEvent("on" + evname, BX.proxy(func, el)); 1303 } 1304 else 1305 { 1306 el["on" + evname] = null; 1307 } 1308}; 1309 1310BX.getEventButton = function(e) 1311{ 1312 e = e || window.event; 1313 1314 var flags = 0; 1315 1316 if (typeof e.which != 'undefined') 1317 { 1318 switch (e.which) 1319 { 1320 case 1: flags = flags|BX.MSLEFT; break; 1321 case 2: flags = flags|BX.MSMIDDLE; break; 1322 case 3: flags = flags|BX.MSRIGHT; break; 1323 } 1324 } 1325 else if (typeof e.button != 'undefined') 1326 { 1327 flags = event.button; 1328 } 1329 1330 return flags || BX.MSLEFT; 1331}; 1332 1333BX.unbindAll = function(el) 1334{ 1335 if (!el) 1336 return; 1337 1338 for (var i=0,len=eventsList.length; i<len; i++) 1339 { 1340 try 1341 { 1342 if (eventsList[i] && (null==el || el==eventsList[i].element)) 1343 { 1344 BX.unbind(eventsList[i].element, eventsList[i].event, eventsList[i].fn); 1345 eventsList[i] = null; 1346 } 1347 } 1348 catch(e){} 1349 } 1350 1351 if (null==el) 1352 { 1353 eventsList = []; 1354 } 1355}; 1356 1357var captured_events = null, _bind = null; 1358BX.CaptureEvents = function(el_c, evname_c) 1359{ 1360 if (_bind) 1361 return; 1362 1363 _bind = BX.bind; 1364 captured_events = []; 1365 1366 BX.bind = function(el, evname, func) 1367 { 1368 if (el === el_c && evname === evname_c) 1369 captured_events.push(func); 1370 1371 _bind.apply(this, arguments); 1372 } 1373}; 1374 1375BX.CaptureEventsGet = function() 1376{ 1377 if (_bind) 1378 { 1379 BX.bind = _bind; 1380 1381 var captured = captured_events; 1382 1383 _bind = null; 1384 captured_events = null; 1385 return captured; 1386 } 1387 return null; 1388}; 1389 1390// Don't even try to use it for submit event! 1391BX.fireEvent = function(ob,ev) 1392{ 1393 var result = false, e = null; 1394 if (BX.type.isDomNode(ob)) 1395 { 1396 result = true; 1397 if (document.createEventObject) 1398 { 1399 // IE 1400 if (eventTypes[ev] != 'MouseEvent') 1401 { 1402 e = document.createEventObject(); 1403 e.type = ev; 1404 result = ob.fireEvent('on' + ev, e); 1405 } 1406 1407 if (ob[ev]) 1408 { 1409 ob[ev](); 1410 } 1411 } 1412 else 1413 { 1414 // non-IE 1415 e = null; 1416 1417 switch (eventTypes[ev]) 1418 { 1419 case 'MouseEvent': 1420 e = document.createEvent('MouseEvent'); 1421 try 1422 { 1423 e.initMouseEvent(ev, true, true, top, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); 1424 } 1425 catch (initException) 1426 { 1427 e.initMouseEvent(ev, true, true, window, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); 1428 } 1429 1430 break; 1431 default: 1432 e = document.createEvent('Event'); 1433 e.initEvent(ev, true, true); 1434 } 1435 1436 result = ob.dispatchEvent(e); 1437 } 1438 } 1439 1440 return result; 1441}; 1442 1443BX.getWheelData = function(e) 1444{ 1445 e = e || window.event; 1446 e.wheelData = e.detail ? e.detail * -1 : e.wheelDelta / 40; 1447 return e.wheelData; 1448}; 1449 1450BX.proxy_context = null; 1451 1452BX.delegate = function (func, thisObject) 1453{ 1454 if (!func || !thisObject) 1455 return func; 1456 1457 return function() { 1458 var cur = BX.proxy_context; 1459 BX.proxy_context = this; 1460 var res = func.apply(thisObject, arguments); 1461 BX.proxy_context = cur; 1462 return res; 1463 } 1464}; 1465 1466BX.delegateLater = function (func_name, thisObject, contextObject) 1467{ 1468 return function() 1469 { 1470 if (thisObject[func_name]) 1471 { 1472 var cur = BX.proxy_context; 1473 BX.proxy_context = this; 1474 var res = thisObject[func_name].apply(contextObject||thisObject, arguments); 1475 BX.proxy_context = cur; 1476 return res; 1477 } 1478 return null; 1479 } 1480}; 1481 1482BX._initObjectProxy = function(thisObject) 1483{ 1484 if (typeof thisObject['__proxy_id_' + proxySalt] == 'undefined') 1485 { 1486 thisObject['__proxy_id_' + proxySalt] = proxyList.length; 1487 proxyList[thisObject['__proxy_id_' + proxySalt]] = {}; 1488 } 1489}; 1490 1491BX.proxy = function(func, thisObject) 1492{ 1493 if (!func || !thisObject) 1494 return func; 1495 1496 BX._initObjectProxy(thisObject); 1497 1498 if (typeof func['__proxy_id_' + proxySalt] == 'undefined') 1499 func['__proxy_id_' + proxySalt] = proxyId++; 1500 1501 if (!proxyList[thisObject['__proxy_id_' + proxySalt]][func['__proxy_id_' + proxySalt]]) 1502 proxyList[thisObject['__proxy_id_' + proxySalt]][func['__proxy_id_' + proxySalt]] = BX.delegate(func, thisObject); 1503 1504 return proxyList[thisObject['__proxy_id_' + proxySalt]][func['__proxy_id_' + proxySalt]]; 1505}; 1506 1507BX.defer = function(func, thisObject) 1508{ 1509 if (!!thisObject) 1510 return BX.defer_proxy(func, thisObject); 1511 else 1512 return function() { 1513 var arg = arguments; 1514 setTimeout(function(){func.apply(this,arg)}, 10); 1515 }; 1516}; 1517 1518BX.defer_proxy = function(func, thisObject) 1519{ 1520 if (!func || !thisObject) 1521 return func; 1522 1523 BX.proxy(func, thisObject); 1524 1525 this._initObjectProxy(thisObject); 1526 1527 if (typeof func['__defer_id_' + proxySalt] == 'undefined') 1528 func['__defer_id_' + proxySalt] = proxyId++; 1529 1530 if (!proxyList[thisObject['__proxy_id_' + proxySalt]][func['__defer_id_' + proxySalt]]) 1531 { 1532 proxyList[thisObject['__proxy_id_' + proxySalt]][func['__defer_id_' + proxySalt]] = BX.defer(
1532BX.delegate(func, thisObject)); 1533 } 1534 1535 return proxyList[thisObject['__proxy_id_' + proxySalt]][func['__defer_id_' + proxySalt]]; 1536}; 1537 1538BX.once = function(el, evname, func) 1539{ 1540 if (typeof func['__once_id_' + evname + '_' + proxySalt] == 'undefined') 1541 { 1542 func['__once_id_' + evname + '_' + proxySalt] = proxyId++; 1543 } 1544 1545 this._initObjectProxy(el); 1546 1547 if (!proxyList[el['__proxy_id_' + proxySalt]][func['__once_id_' + evname + '_' + proxySalt]]) 1548 { 1549 var g = function() 1550 { 1551 BX.unbind(el, evname, g); 1552 func.apply(this, arguments); 1553 }; 1554 1555 proxyList[el['__proxy_id_' + proxySalt]][func['__once_id_' + evname + '_' + proxySalt]] = g; 1556 } 1557 1558 return proxyList[el['__proxy_id_' + proxySalt]][func['__once_id_' + evname + '_' + proxySalt]]; 1559}; 1560 1561BX.bindDelegate = function (elem, eventName, isTarget, handler) 1562{ 1563 var h = BX.delegateEvent(isTarget, handler); 1564 BX.bind(elem, eventName, h); 1565 return h; 1566}; 1567 1568BX.delegateEvent = function(isTarget, handler) 1569{ 1570 return function(e) 1571 { 1572 e = e || window.event; 1573 var target = e.target || e.srcElement; 1574 1575 while (target != this) 1576 { 1577 if (_checkNode(target, isTarget)) 1578 { 1579 return handler.call(target, e); 1580 } 1581 if (target && target.parentNode) 1582 target = target.parentNode; 1583 else 1584 break; 1585 } 1586 return null; 1587 } 1588}; 1589 1590BX.False = function() {return false;}; 1591BX.DoNothing = function() {}; 1592 1593// TODO: also check event handlers set via BX.bind() 1594BX.denyEvent = function(el, ev) 1595{ 1596 deniedEvents.push([el, ev, el['on' + ev]]); 1597 el['on' + ev] = BX.DoNothing; 1598}; 1599 1600BX.allowEvent = function(el, ev) 1601{ 1602 for(var i=0, len=deniedEvents.length; i<len; i++) 1603 { 1604 if (deniedEvents[i][0] == el && deniedEvents[i][1] == ev) 1605 { 1606 el['on' + ev] = deniedEvents[i][2]; 1607 BX.util.deleteFromArray(deniedEvents, i); 1608 return; 1609 } 1610 } 1611}; 1612 1613BX.fixEventPageXY = function(event) 1614{ 1615 BX.fixEventPageX(event); 1616 BX.fixEventPageY(event); 1617 return event; 1618}; 1619 1620BX.fixEventPageX = function(event) 1621{ 1622 if (event.pageX == null && event.clientX != null) 1623 { 1624 event.pageX = 1625 event.clientX + 1626 (document.documentElement && document.documentElement.scrollLeft || document.body && document.body.scrollLeft || 0) - 1627 (document.documentElement.clientLeft || 0); 1628 } 1629 1630 return event; 1631}; 1632 1633BX.fixEventPageY = function(event) 1634{ 1635 if (event.pageY == null && event.clientY != null) 1636 { 1637 event.pageY = 1638 event.clientY + 1639 (document.documentElement && document.documentElement.scrollTop || document.body && document.body.scrollTop || 0) - 1640 (document.documentElement.clientTop || 0); 1641 } 1642 1643 return event; 1644}; 1645 1646/** 1647 * @deprecated 1648 * @see e.preventDefault() 1649 */ 1650BX.PreventDefault = function(e) 1651{ 1652 if(!e) e = window.event; 1653 if(e.stopPropagation) 1654 { 1655 e.preventDefault(); 1656 e.stopPropagation(); 1657 } 1658 else 1659 { 1660 e.cancelBubble = true; 1661 e.returnValue = false; 1662 } 1663 return false; 1664}; 1665 1666BX.eventReturnFalse = function(e) 1667{ 1668 e=e||window.event; 1669 if (e && e.preventDefault) e.preventDefault(); 1670 else e.returnValue = false; 1671 return false; 1672}; 1673 1674BX.eventCancelBubble = function(e) 1675{ 1676 e=e||window.event; 1677 if(e && e.stopPropagation) 1678 e.stopPropagation(); 1679 else 1680 e.cancelBubble = true; 1681}; 1682 1683/* custom events */ 1684/* 1685 BX.addCustomEvent(eventObject, eventName, eventHandler) - set custom event handler for particular object 1686 BX.addCustomEvent(eventName, eventHandler) - set custom event handler for all objects 1687*/ 1688BX.addCustomEvent = function(eventObject, eventName, eventHandler) 1689{ 1690 /* shift parameters for short version */ 1691 if (BX.type.isString(eventObject)) 1692 { 1693 eventHandler = eventName; 1694 eventName = eventObject; 1695 eventObject = window; 1696 } 1697 1698 eventName = eventName.toUpperCase(); 1699 1700 if (!customEvents[eventName]) 1701 customEvents[eventName] = []; 1702 1703 customEvents[eventName].push( 1704 { 1705 handler: eventHandler, 1706 obj: eventObject 1707 } 1708 ); 1709}; 1710 1711BX.removeCustomEvent = function(eventObject, eventName, eventHandler) 1712{ 1713 /* shift parameters for short version */ 1714 if (BX.type.isString(eventObject)) 1715 { 1716 eventHandler = eventName; 1717 eventName = eventObject; 1718 eventObject = window; 1719 } 1720 1721 eventName = eventName.toUpperCase(); 1722 1723 if (!customEvents[eventName]) 1724 return; 1725 1726 for (var i = 0, l = customEvents[eventName].length; i < l; i++) 1727 { 1728 if (!customEvents[eventName][i]) 1729 continue; 1730 if (customEvents[eventName][i].handler == eventHandler && customEvents[eventName][i].obj == eventObject) 1731 { 1732 delete customEvents[eventName][i]; 1733 return; 1734 } 1735 } 1736}; 1737 1738// Warning! Don't use secureParams with DOM nodes in arEventParam
1738s 1739BX.onCustomEvent = function(eventObject, eventName, arEventParams, secureParams) 1740{ 1741 /* shift parameters for short version */ 1742 if (BX.type.isString(eventObject)) 1743 { 1744 secureParams = arEventParams; 1745 arEventParams = eventName; 1746 eventName = eventObject; 1747 eventObject = window; 1748 } 1749 1750 eventName = eventName.toUpperCase(); 1751 1752 if (!customEvents[eventName]) 1753 return; 1754 1755 if (!arEventParams) 1756 arEventParams = []; 1757 1758 var h; 1759 for (var i = 0, l = customEvents[eventName].length; i < l; i++) 1760 { 1761 h = customEvents[eventName][i]; 1762 if (!h || !h.handler) 1763 continue; 1764 1765 if (h.obj == window || /*eventObject == window || */h.obj == eventObject) //- only global event handlers will be called 1766 { 1767 h.handler.apply(eventObject, !!secureParams ? BX.clone(arEventParams) : arEventParams); 1768 } 1769 } 1770}; 1771 1772BX.bindDebouncedChange = function(node, fn, fnInstant, timeout, ctx) 1773{ 1774 ctx = ctx || window; 1775 timeout = timeout || 300; 1776 1777 var dataTag = 'bx-dc-previous-value'; 1778 BX.data(node, dataTag, node.value); 1779 1780 var act = function(fn, val){ 1781 1782 var pVal = BX.data(node, dataTag); 1783 1784 if(typeof pVal == 'undefined' || pVal != val){ 1785 if(typeof ctx != 'object') 1786 fn(val); 1787 else 1788 fn.apply(ctx, [val]); 1789 } 1790 }; 1791 1792 var actD = BX.debounce(function(){ 1793 var val = node.value; 1794 act(fn, val); 1795 BX.data(node, dataTag, val); 1796 }, timeout); 1797 1798 BX.bind(node, 'keyup', actD); 1799 BX.bind(node, 'change', actD); 1800 BX.bind(node, 'input', actD); 1801 1802 if(BX.type.isFunction(fnInstant)){ 1803 1804 var actI = function(){ 1805 act(fnInstant, node.value); 1806 }; 1807 1808 BX.bind(node, 'keyup', actI); 1809 BX.bind(node, 'change', actI); 1810 BX.bind(node, 'input', actI); 1811 } 1812}; 1813 1814BX.parseJSON = function(data, context) 1815{ 1816 var result = null; 1817 if (BX.type.isString(data)) 1818 { 1819 try { 1820 if (data.indexOf("\n") >= 0) 1821 eval('result = ' + data); 1822 else 1823 result = (new Function("return " + data))(); 1824 } catch(e) { 1825 BX.onCustomEvent(context, 'onParseJSONFailure', [data, context]) 1826 } 1827 } 1828 else if(BX.type.isPlainObject(data)) 1829 { 1830 return data; 1831 } 1832 1833 return result; 1834}; 1835 1836/* ready */ 1837BX.isReady = false; 1838BX.ready = function(handler) 1839{ 1840 bindReady(); 1841 1842 if (!BX.type.isFunction(handler)) 1843 { 1844 BX.debug('READY: not a function! ', handler); 1845 } 1846 else 1847 { 1848 if (BX.isReady) 1849 handler.call(document); 1850 else if (readyList) 1851 readyList.push(handler); 1852 } 1853}; 1854 1855BX.submit = function(obForm, action_name, action_value, onAfterSubmit) 1856{ 1857 action_name = action_name || 'save'; 1858 if (!obForm['BXFormSubmit_' + action_name]) 1859 { 1860 obForm['BXFormSubmit_' + action_name] = obForm.appendChild(BX.create('INPUT', { 1861 'props': { 1862 'type': 'submit', 1863 'name': action_name, 1864 'value': action_value || 'Y' 1865 }, 1866 'style': { 1867 'display': 'none' 1868 } 1869 })); 1870 } 1871 1872 if (obForm.sessid) 1873 obForm.sessid.value = BX.bitrix_sessid(); 1874 1875 setTimeout(BX.delegate(function() {BX.fireEvent(this, 'click'); if (onAfterSubmit) onAfterSubmit();}, obForm['BXFormSubmit_' + action_name]), 10); 1876}; 1877 1878// returns function which runs fn in timeout ms after returned function is finished being called 1879BX.debounce = function(fn, timeout, ctx) 1880{ 1881 var timer = 0; 1882 1883 return function() 1884 { 1885 ctx = ctx || this; 1886 var args = arguments; 1887 1888 clearTimeout(timer); 1889 1890 timer = setTimeout(function() 1891 { 1892 fn.apply(ctx, args); 1893 }, timeout); 1894 } 1895}; 1896 1897// returns function which runs fn and repeats every timeout ms while returned function is being called 1898BX.throttle = function(fn, timeout, ctx) 1899{ 1900 1901 var timer = 0, 1902 args = null, 1903 invoke; 1904 1905 return function() 1906 { 1907 ctx = ctx || this; 1908 args = arguments; 1909 invoke = true; 1910 1911 if(!timer) 1912 { 1913 var q = function() 1914 { 1915 if(invoke) 1916 { 1917 fn.apply(ctx, args); 1918 invoke = false; 1919 timer = setTimeout(q, timeout); 1920 } 1921 else 1922 { 1923 timer = null; 1924 } 1925 }; 1926 q(); 1927 } 1928 }; 1929}; 1930 1931/* browser detection */ 1932BX.browser = { 1933 1934 IsIE: function() 1935 { 1936 return bIE; 1937 }, 1938 1939 IsIE6: function() 1940 { 1941 return (/MSIE 6/i.test(navigator.userAgent)); 1942 }, 1943 1944 IsIE7: function() 1945 { 1946 return (/MSIE 7/i.test(navigator.userAgent)); 1947 }, 1948 1949 IsIE8: function() 1950 { 1951 return (/MSIE 8/i.test(navigator.userAgent)); 1952 }, 1953 1954 IsIE9: function() 1955 { 1956 return !!document.documentMode && document.documentMode >= 9; 1957 }, 1958 1959 IsIE10: function() 1960 { 1961 return !!document.documentMode && document.documentMode >= 10; 1962 }, 1963 1964 IsIE11: function() 1965 { 1966 return BX.browser.DetectIeVersion() >= 11; 1967 }, 1968 1969 IsOpera: function() 1970 { 1971 return bOpera; 1972 }, 1973 1974 IsSafari: function() 1975 { 1976 return bSafari; 1977 }, 1978 1979 IsFirefox: function() 1980 { 1981 return bFirefox; 1982 }, 1983 1984 IsChrome: function() 1985 { 1986 return bChrome; 1987 }, 1988 1989 IsMac: function() 1990 { 1991 return (/Macintosh/i.test(navigator.userAgent)); 1992 }, 1993 1994 IsAndroid: function() 1995 { 1996 return (/Android/i.test(navigator.userAgent)); 1997 }, 1998 1999 IsIOS: function() 2000 { 2001 return (/(iPad;)|(iPhone;)/i.test(navigator.userAgent)); 2002 }, 2003 2004 IsMobile: function() 2005 { 2006 return (/(ipad|iphone|android|mobile|touch)/i.test(navigator.userAgent)); 2007 }, 2008 2009 DetectIeVersion: function() 2010 { 2011 if(BX.browser.IsOpera() || BX.browser.IsSafari() || BX.browser.IsFirefox() || BX.browser.IsChrome()) 2012 { 2013 return -1; 2014 } 2015 2016 var rv = -1; 2017 if (!!(window.MSStream) && !(window.ActiveXObject) && ("ActiveXObject" in window)) 2018 { 2019 //Primary check for IE 11 based on ActiveXObject behaviour (please see http://msdn.microsoft.com/en-us
2019/library/ie/dn423948%28v=vs.85%29.aspx) 2020 rv = 11; 2021 } 2022 else if (BX.browser.IsIE10()) 2023 { 2024 rv = 10; 2025 } 2026 else if (BX.browser.IsIE9()) 2027 { 2028 rv = 9; 2029 } 2030 else if (BX.browser.IsIE()) 2031 { 2032 rv = 8; 2033 } 2034 2035 if (rv == -1 || rv == 8) 2036 { 2037 var re; 2038 if (navigator.appName == "Microsoft Internet Explorer") 2039 { 2040 re = new RegExp("MSIE ([0-9]+[\.0-9]*)"); 2041 if (re.exec(navigator.userAgent) != null) 2042 rv = parseFloat( RegExp.$1 ); 2043 } 2044 else if (navigator.appName == "Netscape") 2045 { 2046 //Alternative check for IE 11 2047 rv = 11; 2048 re = new RegExp("Trident/.*rv:([0-9]+[\.0-9]*)"); 2049 if (re.exec(navigator.userAgent) != null) 2050 rv = parseFloat( RegExp.$1 ); 2051 } 2052 } 2053 2054 return rv; 2055 }, 2056 2057 IsDoctype: function(pDoc) 2058 { 2059 pDoc = pDoc || document; 2060 2061 if (pDoc.compatMode) 2062 return (pDoc.compatMode == "CSS1Compat"); 2063 2064 return (pDoc.documentElement && pDoc.documentElement.clientHeight); 2065 }, 2066 2067 SupportLocalStorage: function() 2068 { 2069 return !!BX.localStorage && !!BX.localStorage.checkBrowser() 2070 }, 2071 2072 addGlobalClass: function() { 2073 2074 var globalClass = "bx-core"; 2075 if (BX.hasClass(document.documentElement, globalClass)) 2076 { 2077 return; 2078 } 2079 2080 //Mobile 2081 if (BX.browser.IsIOS()) 2082 { 2083 globalClass += " bx-ios"; 2084 } 2085 else if (BX.browser.IsMac()) 2086 { 2087 globalClass += " bx-mac"; 2088 } 2089 else if (BX.browser.IsAndroid()) 2090 { 2091 globalClass += " bx-android"; 2092 } 2093 2094 globalClass += (BX.browser.IsMobile() ? " bx-touch" : " bx-no-touch"); 2095 globalClass += (BX.browser.isRetina() ? " bx-retina" : " bx-no-retina"); 2096 2097 //Desktop 2098 var ieVersion = -1; 2099 if (/AppleWebKit/.test(navigator.userAgent)) 2100 { 2101 globalClass += " bx-chrome"; 2102 } 2103 else if ((ieVersion = BX.browser.DetectIeVersion()) > 0) 2104 { 2105 globalClass += " bx-ie bx-ie" + ieVersion; 2106 if (ieVersion > 7 && ieVersion < 10 && !BX.browser.IsDoctype()) 2107 { 2108 // it seems IE10 doesn't have any specific bugs like others event in quirks mode 2109 globalClass += " bx-quirks"; 2110 } 2111 } 2112 else if (/Opera/.test(navigator.userAgent)) 2113 { 2114 globalClass += " bx-opera"; 2115 } 2116 else if (/Gecko/.test(navigator.userAgent)) 2117 { 2118 globalClass += " bx-firefox"; 2119 } 2120 2121 BX.addClass(document.documentElement, globalClass); 2122 }, 2123 2124 isPropertySupported: function(jsProperty, bReturnCSSName) 2125 { 2126 if (!BX.type.isNotEmptyString(jsProperty)) 2127 return false; 2128 2129 var property = jsProperty.indexOf("-") > -1 ? getJsName(jsProperty) : jsProperty; 2130 bReturnCSSName = !!bReturnCSSName; 2131 2132 var ucProperty = property.charAt(0).toUpperCase() + property.slice(1); 2133 var properties = (property + ' ' + ["Webkit", "Moz", "O", "ms"].join(ucProperty + " ") + ucProperty).split(" "); 2134 var obj = document.body || document.documentElement; 2135 2136 for (var i = 0; i < properties.length; i++) 2137 { 2138 var prop = properties[i]; 2139 if (obj.style[prop] !== undefined) 2140 { 2141 var prefix = prop == property 2142 ? "" 2143 : "-" + prop.substr(0, prop.length - property.length).toLowerCase() + "-"; 2144 return bReturnCSSName ? prefix + getCssName(property) : prop; 2145 } 2146 } 2147 2148 function getCssName(propertyName) 2149 { 2150 return propertyName.replace(/([A-Z])/g, function() { return "-" + arguments[1].toLowerCase(); } ) 2151 } 2152 2153 function getJsName(cssName) 2154 { 2155 var reg = /(\-([a-z]){1})/g; 2156 if (reg.test(cssName)) 2157 return cssName.replace(reg, function () {return arguments[2].toUpperCase();}); 2158 else 2159 return cssName; 2160 } 2161 2162 return false; 2163 }, 2164 2165 addGlobalFeatures : function(features, prefix) 2166 { 2167 if (!BX.type.isArray(features)) 2168 return; 2169 2170 var classNames = []; 2171 for (var i = 0; i < features.length; i++) 2172 { 2173 var support = !!BX.browser.isPropertySupported(features[i]); 2174 classNames.push( "bx-" + (support ? "" : "no-") + features[i].toLowerCase()); 2175 } 2176 BX.addClass(document.documentElement, classNames.join(" ")); 2177 }, 2178 2179 isRetina : function() 2180 { 2181 return window.devicePixelRatio && window.devicePixelRatio >= 2; 2182 } 2183}; 2184 2185/* low-level fx funcitons*/ 2186BX.show = function(ob, displayType) 2187{ 2188 if (ob.BXDISPLAY || !_checkDisplay(ob, displayType)) 2189 { 2190 ob.style.display = ob.BXDISPLAY; 2191 } 2192}; 2193 2194BX.hide = function(ob, displayType) 2195{ 2196 if (!ob.BXDISPLAY) 2197 _checkDisplay(ob, displayType); 2198 2199 ob.style.display = 'none'; 2200}; 2201 2202BX.toggle = function(ob, values) 2203{ 2204 if (!values && BX.type.isElementNode(ob)) 2205 { 2206 var bShow = true; 2207 if (ob.BXDISPLAY) 2208 bShow = !_checkDisplay(ob); 2209 else 2210 bShow = ob.style.display == 'none'; 2211 2212 if (bShow) 2213 BX.show(ob); 2214 else 2215 BX.hide(ob); 2216 } 2217 else if (BX.type.isArray(values)) 2218 { 2219 for (var i=0,len=values.length; i<len; i++) 2220 { 2221 if (ob == values[i]) 2222 { 2223 ob = values[i==len-1 ? 0 : i+1]; 2224 break; 2225 } 2226 } 2227 if (i==len) 2228 ob = values[0]; 2229 } 2230 2231 return ob; 2232}; 2233 2234/* some useful util functions */ 2235 2236BX.util = { 2237 array_values: function(ar) 2238 { 2239 if (!BX.type.isArray(ar)) 2240 return BX.util._array_values_ob(ar); 2241 var arv = []; 2242 for(var i=0,l=ar.length;i<l;i++)
2243 if (ar[i] !== null && typeof ar[i] != 'undefined') 2244 arv.push(ar[i]); 2245 return arv; 2246 }, 2247 2248 _array_values_ob: function(ar) 2249 { 2250 var arv = []; 2251 for(var i in ar) 2252 if (ar[i] !== null && typeof ar[i] != 'undefined') 2253 arv.push(ar[i]); 2254 return arv; 2255 }, 2256 2257 array_keys: function(ar) 2258 { 2259 if (!BX.type.isArray(ar)) 2260 return BX.util._array_keys_ob(ar); 2261 var arv = []; 2262 for(var i=0,l=ar.length;i<l;i++) 2263 if (ar[i] !== null && typeof ar[i] != 'undefined') 2264 arv.push(i); 2265 return arv; 2266 }, 2267 2268 _array_keys_ob: function(ar) 2269 { 2270 var arv = []; 2271 for(var i in ar) 2272 if (ar[i] !== null && typeof ar[i] != 'undefined') 2273 arv.push(i); 2274 return arv; 2275 }, 2276 2277 object_keys: function(obj) 2278 { 2279 var arv = []; 2280 for(var k in obj) 2281 { 2282 if(obj.hasOwnProperty(k)) 2283 { 2284 arv.push(k); 2285 } 2286 } 2287 return arv; 2288 }, 2289 2290 array_merge: function(first, second) 2291 { 2292 if (!BX.type.isArray(first)) first = []; 2293 if (!BX.type.isArray(second)) second = []; 2294 2295 var i = first.length, j = 0; 2296 2297 if (typeof second.length === "number") 2298 { 2299 for (var l = second.length; j < l; j++) 2300 { 2301 first[i++] = second[j]; 2302 } 2303 } 2304 else 2305 { 2306 while (second[j] !== undefined) 2307 { 2308 first[i++] = second[j++]; 2309 } 2310 } 2311 2312 first.length = i; 2313 2314 return first; 2315 }, 2316 2317 array_flip: function ( object ) 2318 { 2319 var newObject = {}; 2320 2321 for (var key in object) 2322 { 2323 newObject[object[key]] = key; 2324 } 2325 2326 return newObject; 2327 }, 2328 2329 array_unique: function(ar) 2330 { 2331 var i=0,j,len=ar.length; 2332 if(len<2) return ar; 2333 2334 for (; i<len-1;i++) 2335 { 2336 for (j=i+1; j<len;j++) 2337 { 2338 if (ar[i]==ar[j]) 2339 { 2340 ar.splice(j--,1); len--; 2341 } 2342 } 2343 } 2344 2345 return ar; 2346 }, 2347 2348 in_array: function(needle, haystack) 2349 { 2350 for(var i=0; i<haystack.length; i++) 2351 { 2352 if(haystack[i] == needle) 2353 return true; 2354 } 2355 return false; 2356 }, 2357 2358 array_search: function(needle, haystack) 2359 { 2360 for(var i=0; i<haystack.length; i++) 2361 { 2362 if(haystack[i] == needle) 2363 return i; 2364 } 2365 return -1; 2366 }, 2367 2368 object_search_key: function(needle, haystack) 2369 { 2370 if (typeof haystack[needle] != 'undefined') 2371 return haystack[needle]; 2372 2373 for(var i in haystack) 2374 { 2375 if (typeof haystack[i] == "object") 2376 { 2377 var result = BX.util.object_search_key(needle, haystack[i]); 2378 if (result !== false) 2379 return result; 2380 } 2381 } 2382 return false; 2383 }, 2384 2385 trim: function(s) 2386 { 2387 if (BX.type.isString(s)) 2388 return s.replace(r.ltrim, '').replace(r.rtrim, ''); 2389 else 2390 return s; 2391 }, 2392 2393 urlencode: function(s){return encodeURIComponent(s);}, 2394 2395 // it may also be useful. via sVD. 2396 deleteFromArray: function(ar, ind) {return ar.slice(0, ind).concat(ar.slice(ind + 1));}, 2397 insertIntoArray: function(ar, ind, el) {return ar.slice(0, ind).concat([el]).concat(ar.slice(ind));}, 2398 2399 htmlspecialchars: function(str) 2400 { 2401 if(!str.replace) return str; 2402 2403 return str.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 2404 }, 2405 2406 htmlspecialcharsback: function(str) 2407 { 2408 if(!str.replace) return str; 2409 2410 return str.replace(/\"/g, '"').replace(/'/g, "'").replace(/\</g, '<').replace(/\>/g, '>').replace(/\&/g, '&'); 2411 }, 2412 2413 // Quote regular expression characters plus an optional character 2414 preg_quote: function(str, delimiter) 2415 { 2416 if(!str.replace) 2417 return str; 2418 return str.replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&'); 2419 }, 2420 2421 jsencode: function(str) 2422 { 2423 if (!str || !str.replace) 2424 return str; 2425 2426 var escapes = 2427 [ 2428 { c: "\\\\", r: "\\\\" }, // should be first 2429 { c: "\\t", r: "\\t" }, 2430 { c: "\\n", r: "\\n" }, 2431 { c: "\\r", r: "\\r" }, 2432 { c: "\"", r: "\\\"" }, 2433 { c: "'", r: "\\'" }, 2434 { c: "<", r: "\\x3C" }, 2435 { c: ">", r: "\\x3E" }, 2436 { c: "\\u2028", r: "\\u2028" }, 2437 { c: "\\u2029", r: "\\u2029" } 2438 ]; 2439 for (var i = 0; i < escapes.length; i++) 2440 str = str.replace(new RegExp(escapes[i].c, 'g'), escapes[i].r); 2441 return str; 2442 }, 2443 2444 nl2br: function(str) 2445 { 2446 if (!str || !str.replace) 2447 return str; 2448 2449 return str.replace(/([^>])\n/g, '$1<br/>'); 2450 }, 2451 2452 str_pad: function(input, pad_length, pad_string, pad_type) 2453 { 2454 pad_string = pad_string || ' '; 2455 pad_type = pad_type || 'right'; 2456 input = input.toString(); 2457 2458 if (pad_type == 'left') 2459 return BX.util.str_pad_left(input, pad_length, pad_string); 2460 else 2461 return BX.util.str_pad_right(input, pad_length, pad_string); 2462 2463 }, 2464 2465 str_pad_left: function(input, pad_length, pad_string) 2466 { 2467 var i = input.length, q=pad_string.length; 2468 if (i >= pad_length) return input; 2469 2470 for(;i<pad_length;i+=q) 2471 input = pad_string + input; 2472 2473 return input; 2474 }, 2475 2476 str_pad_right: function(input, pad_length, pad_string) 2477 { 2478 var i = input.length, q=pad_string.length; 2479 if (i >= pad_length) return input; 2480 2481 for(;i<pad_length;i+=q) 2482 input += pad_string; 2483 2484 return input; 2485 }, 2486 2487 strip_tags: function(str) 2488 { 2489 return str.split(/<[^>]+>/g).join(''); 2490 }, 2491 2492 strip_php_tags: function(str) 2493 { 2494 return str.replace(/<\?(.|[\r\n])*?\?>/g, ''); 2495 }, 2496 2497 popup: function(url, width, height) 2498 { 2499 var w, h; 2500 if(BX.browser.IsOpera()) 2501 { 2502 w = document.body.offsetWidth; 2503 h = document.body.offsetHeight; 2504 } 2505 else 2506 { 2507 w = screen.width; 2508 h = screen.height; 2509 } 2510 return 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)); 2511 }, 2512 2513 shuffle: function(array) 2514 { 2515 var temporaryValue, randomIndex; 2516 var currentIndex = array.length; 2517 2518 while (0 !== currentIndex) 2519 { 2520 randomIndex = Math.floor(Math.random() * currentIndex); 2521 currentIndex -= 1; 2522 2523 temporaryValue = array[currentIndex]; 2524 array[currentIndex] = array[randomIndex]; 2525 array[randomIndex] = temporaryValue; 2526 } 2527 2528 return array; 2529 }, 2530 2531 // BX.util.objectSort(object, sortBy, sortDir) - Sort object by property 2532 // function params: 1 - object for sort, 2 - sort by property, 3 - sort direction (asc/desc) 2533 // return: sort array [[objectElement], [objectElement]] in sortDir direction 2534 2535 // example: BX.util.objectSort({'L1': {'name': 'Last'}, 'F1': {'name': 'First'}}, 'name', 'asc'); 2536 // return: [{'name' : 'First'}, {'name' : 'Last'}] 2537 objectSort: function(object, sortBy, sortDir) 2538 { 2539 sortDir = sortDir == 'asc'? 'asc': 'desc'; 2540 2541 var arItems = [], i; 2542 for (i in object) 2543 { 2544 if (object.hasOwnProperty(i) && object[i][sortBy]) 2545 { 2546 arItems.push([i, object[i][sortBy]]); 2547 } 2548 } 2549 2550 if (sortDir == 'asc') 2551 { 2552 arItems.sort(function(i, ii) { 2553 var s1, s2; 2554 if (!isNaN(i[1]) && !isNaN(ii[1])) 2555 { 2556 s1 = parseInt(i[1]); 2557 s2 = parseInt(ii[1]); 2558 } 2559 else 2560 { 2561 s1 = i[1].toString().toLowerCase(); 2562 s2 = ii[1].toString().toLowerCase(); 2563 } 2564 2565 if (s1 > s2) 2566 return 1; 2567 else if (s1 < s2) 2568 return -1; 2569 else 2570 return 0; 2571 }); 2572 } 2573 else 2574 { 2575 arItems.sort(function(i, ii) { 2576 var s1, s2; 2577 if (!isNaN(i[1]) && !isNaN(ii[1])) 2578 { 2579 s1 = parseInt(i[1]); 2580 s2 = parseInt(ii[1]); 2581 } 2582 else 2583 { 2584 s1 = i[1].toString().toLowerCase(); 2585 s2 = ii[1].toString().toLowerCase(); 2586 } 2587 if (s1 < s2) 2588 return 1; 2589 else if (s1 > s2) 2590 return -1; 2591 else 2592 return 0; 2593 }); 2594 } 2595 2596 var arReturnArray = Array(); 2597 for (i = 0; i < arItems.length; i++) 2598 { 2599 arReturnArray.push(object[arItems[i][0]]); 2600 } 2601 2602 return arReturnArray; 2603 }, 2604 2605 // #fdf9e5 => {r=253, g=249, b=229} 2606 hex2rgb: function(color) 2607 { 2608 var rgb = color.replace(/[# ]/g,"").replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3').match(/.{2}/g); 2609 for (var i=0; i<3; i++) 2610 { 2611 rgb[i] = parseInt(rgb[i], 16); 2612 } 2613 return {'r':rgb[0],'g':rgb[1],'b':rgb[2]}; 2614 }, 2615 2616 remove_url_param: function(url, param) 2617 { 2618 if (BX.type.isArray(param)) 2619 { 2620 for (var i=0; i<param.length; i++) 2621 { 2622 url = BX.util.remove_url_param(url, param[i]); 2623 } 2624 } 2625 else 2626 { 2627 var pos, params; 2628 if((pos = url.indexOf('?')) >= 0 && pos != url.length-1) 2629 { 2630 params = url.substr(pos + 1); 2631 url = url.substr(0, pos + 1); 2632 2633 params = params.replace(new RegExp('(^|&)'+param+'=[^&#]*', 'i'), ''); 2634 params = params.replace(/^&/, ''); 2635 2636 if(BX.type.isNotEmptyString(params)) 2637 { 2638 url = url + params; 2639 } 2640 else 2641 { 2642 //remove trailing question character 2643 url = url.substr(0, url.length - 1); 2644 } 2645 } 2646 } 2647 return url; 2648 }, 2649 2650 /* 2651 {'param1': 'value1', 'param2': 'value2'} 2652 */ 2653 add_url_param: function(url, params) 2654 { 2655 var param; 2656 var additional = ''; 2657 var hash = ''; 2658 var pos; 2659 2660 for(param in params) 2661 { 2662 url = this.remove_url_param(url, param); 2663 additional += (additional != ''? '&':'') + param + '=' + params[param]; 2664 } 2665 2666 if((pos = url.indexOf('#')) >= 0) 2667 { 2668 hash = url.substr(pos); 2669 url = url.substr(0, pos); 2670 } 2671 2672 if((pos = url.indexOf('?')) >= 0) 2673 { 2674 url = url + (pos != url.length-1? '&' : '') + additional + hash; 2675 } 2676 else 2677 { 2678 url = url + '?' + additional + hash; 2679 } 2680 2681 return url; 2682 }, 2683 2684 even: function(digit) 2685 { 2686 return (parseInt(digit) % 2 == 0); 2687 }, 2688 2689 hashCode: function(str) 2690 { 2691 if(!BX.type.isNotEmptyString(str)) 2692 { 2693 return 0; 2694 } 2695 2696 var hash = 0; 2697 for (var i = 0; i < str.length; i++) 2698 { 2699 var c = str.charCodeAt(i); 2700 hash = ((hash << 5) - hash) + c; 2701 hash = hash & hash; 2702 } 2703 return hash; 2704 }, 2705 2706 getRandomString: function (length) 2707 { 2708 var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; 2709 var charQty = chars.length; 2710 2711 length = parseInt(length); 2712 if(isNaN(length) || length <= 0) 2713 { 2714 length = 8; 2715 } 2716 2717 var result = ""; 2718 for (var i = 0; i < length; i++) 2719 { 2720 result += chars.charAt(Math.floor(Math.random() * charQty)); 2721 } 2722 return result; 2723 }, 2724 2725 number_format: function(number, decimals, dec_point, thousands_sep) 2726 { 2727 var i, j, kw, kd, km, sign = ''; 2728 decimals = Math.abs(decimals); 2729 if (isNaN(decimals) || decimals < 0) 2730 { 2731 decimals = 2; 2732 } 2733 dec_point = dec_point || ','; 2734 if (typeof thousands_sep === 'undefined') 2735 thousands_sep = '.'; 2736 2737 number = (+number || 0).toFixed(decimals); 2738 if (number < 0) 2739 { 2740 sign = '-'; 2741 number = -number; 2742 } 2743 2744 i = parseInt(number, 10) + ''; 2745 j = (i.length > 3 ? i.length % 3 : 0); 2746 2747 km = (j ? i.substr(0, j) + thousands_sep : ''); 2748 kw = i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands_sep); 2749 kd = (decimals ? dec_point + Math.abs(number - i).toFixed(decimals).replace(/-/, '0').slice(2) : ''); 2750 2751 return sign + km + kw + kd; 2752 }, 2753 2754 getExtension: function (url) 2755 { 2756 url = url || ""; 2757 var items = url.split("?")[0].split("."); 2758 return items[items.length-1].toLowerCase(); 2759 }, 2760 addObjectToForm: function(object, form, prefix) 2761 { 2762 if(!BX.type.isString(prefix)) 2763 { 2764 prefix = ""; 2765 } 2766 2767 for(var key in object) 2768 { 2769 if(!object.hasOwnProperty(key)) 2770 { 2771 continue; 2772 } 2773 2774 var value = object[key]; 2775 var name = prefix !== "" ? (prefix + "[" + key + "]") : key; 2776 if(BX.type.isArray(value)) 2777 { 2778 for(var i = 0; i < value.length; i++) 2779 { 2780 BX.util.addObjectToForm(value[i], form, (name + "[" + i.toString() + "]")); 2781 } 2782 } 2783 else if(BX.type.isPlainObject(value)) 2784 { 2785 BX.util.addObjectToForm(value, form, name); 2786 } 2787 else 2788 {
2789 value = BX.type.isFunction(value.toString) ? value.toString() : ""; 2790 if(value !== "") 2791 { 2792 form.appendChild(BX.create("INPUT", { attrs: { type: "hidden", name: name, value: value } })); 2793 } 2794 } 2795 } 2796 }, 2797 2798 observe: function(object, enable) 2799 { 2800 if (!BX.browser.IsChrome() || typeof(object) != 'object') 2801 return false; 2802 2803 enable = enable !== false; 2804 2805 var observer = function(options) 2806 { 2807 options.forEach(function(option){ 2808 var groupName = option.name + ' changed'; 2809 console.groupCollapsed(groupName); 2810 console.log('Old value: ', option.oldValue); 2811 console.log('New value: ', option.object[option.name]); 2812 console.groupEnd(groupName); 2813 }); 2814 } 2815 if (enable) 2816 { 2817 Object.observe(object, observer); 2818 } 2819 else 2820 { 2821 Object.unobserve(object, observer); 2822 } 2823 2824 return enable; 2825 }, 2826 2827 escapeRegExp: function(str) 2828 { 2829 return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 2830 } 2831}; 2832 2833BX.type = { 2834 isString: function(item) { 2835 return item === '' ? true : (item ? (typeof (item) == "string" || item instanceof String) : false); 2836 }, 2837 isNotEmptyString: function(item) { 2838 return BX.type.isString(item) ? item.length > 0 : false; 2839 }, 2840 isBoolean: function(item) { 2841 return item === true || item === false; 2842 }, 2843 isNumber: function(item) { 2844 return item === 0 ? true : (item ? (typeof (item) == "number" || item instanceof Number) : false); 2845 }, 2846 isFunction: function(item) { 2847 return item === null ? false : (typeof (item) == "function" || item instanceof Function); 2848 }, 2849 isElementNode: function(item) { 2850 //document.body.ELEMENT_NODE; 2851 return item && typeof (item) == "object" && "nodeType" in item && item.nodeType == 1 && item.tagName && item.tagName.toUpperCase() != 'SCRIPT' && item.tagName.toUpperCase() != 'STYLE' && item.tagName.toUpperCase() != 'LINK'; 2852 }, 2853 isDomNode: function(item) { 2854 return item && typeof (item) == "object" && "nodeType" in item; 2855 }, 2856 isArray: function(item) { 2857 return item && Object.prototype.toString.call(item) == "[object Array]"; 2858 }, 2859 isDate : function(item) { 2860 return item && Object.prototype.toString.call(item) == "[object Date]"; 2861 }, 2862 isPlainObject: function(item) 2863 { 2864 if(!item || typeof(item) !== "object" || item.nodeType) 2865 { 2866 return false; 2867 } 2868 2869 var hasProp = Object.prototype.hasOwnProperty; 2870 try 2871 { 2872 if (item.constructor && !hasProp.call(item, "constructor") && !hasProp.call(item.constructor.prototype, "isPrototypeOf") ) 2873 { 2874 return false; 2875 } 2876 } 2877 catch (e) 2878 { 2879 return false; 2880 } 2881 2882 var key; 2883 for (key in item) 2884 { 2885 } 2886 return typeof(key) === "undefined" || hasProp.call(item, key); 2887 } 2888}; 2889 2890BX.isNodeInDom = function(node, doc) 2891{ 2892 return node === (doc || document) ? true : 2893 (node.parentNode ? BX.isNodeInDom(node.parentNode) : false); 2894}; 2895 2896BX.isNodeHidden = function(node) 2897{ 2898 if (node === document) 2899 return false; 2900 else if (BX.style(node, 'display') == 'none') 2901 return true; 2902 else 2903 return (node.parentNode ? BX.isNodeHidden(node.parentNode) : true); 2904}; 2905 2906BX.evalPack = function(code) 2907{ 2908 while (code.length > 0) 2909 { 2910 var c = code.shift(); 2911 2912 if (c.TYPE == 'SCRIPT_EXT' || c.TYPE == 'SCRIPT_SRC') 2913 { 2914 BX.loadScript(c.DATA, function() {BX.evalPack(code)}); 2915 return; 2916 } 2917 else if (c.TYPE == 'SCRIPT') 2918 { 2919 BX.evalGlobal(c.DATA); 2920 } 2921 } 2922}; 2923 2924BX.evalGlobal = function(data) 2925{ 2926 if (data) 2927 { 2928 var head = document.getElementsByTagName("head")[0] || document.documentElement, 2929 script = document.createElement("script"); 2930 2931 script.type = "text/javascript"; 2932 2933 if (!BX.browser.IsIE()) 2934 { 2935 script.appendChild(document.createTextNode(data)); 2936 } 2937 else 2938 { 2939 script.text = data; 2940 } 2941 2942 head.insertBefore(script, head.firstChild); 2943 head.removeChild(script); 2944 } 2945}; 2946 2947BX.processHTML = function(data, scriptsRunFirst) 2948{ 2949 var matchScript, matchStyle, matchSrc, matchHref, matchType, scripts = [], styles = []; 2950 var textIndexes = []; 2951 var lastIndex = r.script.lastIndex = r.script_end.lastIndex = 0; 2952 2953 while ((matchScript = r.script.exec(data)) !== null) 2954 { 2955 r.script_end.lastIndex = r.script.lastIndex; 2956 var matchScriptEnd = r.script_end.exec(data); 2957 if (matchScriptEnd === null) 2958 { 2959 break; 2960 } 2961
2962 // skip script tags of special types 2963 var skipTag = false; 2964 if ((matchType = matchScript[1].match(r.script_type)) !== null) 2965 { 2966 if(matchType[1] == 'text/html' || matchType[1] == 'text/template') 2967 skipTag = true; 2968 } 2969 2970 if(skipTag) 2971 { 2972 textIndexes.push([lastIndex, r.script_end.lastIndex - lastIndex]); 2973 } 2974 else 2975 { 2976 textIndexes.push([lastIndex, matchScript.index - lastIndex]); 2977 2978 var bRunFirst = scriptsRunFirst || (matchScript[1].indexOf('bxrunfirst') != '-1'); 2979 2980 if ((matchSrc = matchScript[1].match(r.script_src)) !== null) 2981 { 2982 scripts.push({"bRunFirst": bRunFirst, "isInternal": false, "JS": matchSrc[1]}); 2983 } 2984 else 2985 { 2986 var start = matchScript.index + matchScript[0].length; 2987 var js = data.substr(start, matchScriptEnd.index-start); 2988 2989 scripts.push({"bRunFirst": bRunFirst, "isInternal": true, "JS": js}); 2990 } 2991 } 2992 2993 lastIndex = matchScriptEnd.index + 9; 2994 r.script.lastIndex = lastIndex; 2995 } 2996 2997 textIndexes.push([lastIndex, lastIndex === 0 ? data.length : data.length - lastIndex]); 2998 var pureData = ""; 2999 for (var i = 0, length = textIndexes.length; i < length; i++) 3000 { 3001 pureData += data.substr(textIndexes[i][0], textIndexes[i][1]); 3002 } 3003 3004 while ((matchStyle = pureData.match(r.style)) !== null) 3005 { 3006 if ((matchHref = matchStyle[0].match(r.style_href)) !== null && matchStyle[0].indexOf('media="') < 0) 3007 { 3008 styles.push(matchHref[1]); 3009 } 3010 3011 pureData = pureData.replace(matchStyle[0], ''); 3012 } 3013 3014 return {'HTML': pureData, 'SCRIPT': scripts, 'STYLE': styles}; 3015}; 3016 3017BX.garbage = function(call, thisObject) 3018{ 3019 garbageCollectors.push({callback: call, context: thisObject}); 3020}; 3021 3022/* window pos functions */ 3023 3024BX.GetDocElement = function (pDoc) 3025{ 3026 pDoc = pDoc || document; 3027 return (BX.browser.IsDoctype(pDoc) ? pDoc.documentElement : pDoc.body); 3028}; 3029 3030BX.GetContext = function(node) 3031{ 3032 if (BX.type.isElementNode(node)) 3033 return node.ownerDocument.parentWindow || node.ownerDocument.defaultView || window; 3034 else if (BX.type.isDomNode(node)) 3035 return node.parentWindow || node.defaultView || window; 3036 else 3037 return window; 3038}; 3039 3040BX.GetWindowInnerSize = function(pDoc) 3041{ 3042 var width, height; 3043 3044 pDoc = pDoc || document; 3045 3046 if (window.innerHeight) // all except Explorer 3047 { 3048 width = BX.GetContext(pDoc).innerWidth; 3049 height = BX.GetContext(pDoc).innerHeight; 3050 } 3051 else if (pDoc.documentElement && (pDoc.documentElement.clientHeight || pDoc.documentElement.clientWidth)) // Explorer 6 Strict Mode 3052 { 3053 width = pDoc.documentElement.clientWidth; 3054 height = pDoc.documentElement.clientHeight; 3055 } 3056 else if (pDoc.body) // other Explorers 3057 { 3058 width = pDoc.body.clientWidth; 3059 height = pDoc.body.clientHeight; 3060 } 3061 return {innerWidth : width, innerHeight : height}; 3062}; 3063 3064BX.GetWindowScrollPos = function(pDoc) 3065{ 3066 var left, top; 3067 3068 pDoc = pDoc || document; 3069 3070 if (window.pageYOffset) // all except Explorer 3071 { 3072 left = BX.GetContext(pDoc).pageXOffset; 3073 top = BX.GetContext(pDoc).pageYOffset; 3074 } 3075 else if (pDoc.documentElement && (pDoc.documentElement.scrollTop || pDoc.documentElement.scrollLeft)) // Explorer 6 Strict 3076 { 3077 left = pDoc.documentElement.scrollLeft; 3078 top = pDoc.documentElement.scrollTop; 3079 } 3080 else if (pDoc.body) // all other Explorers 3081 { 3082 left = pDoc.body.scrollLeft; 3083 top = pDoc.body.scrollTop; 3084 } 3085 return {scrollLeft : left, scrollTop : top}; 3086}; 3087 3088BX.GetWindowScrollSize = function(pDoc) 3089{ 3090 var width, height; 3091 if (!pDoc) 3092 pDoc = document; 3093 3094 if ( (pDoc.compatMode && pDoc.compatMode == "CSS1Compat")) 3095 { 3096 width = pDoc.documentElement.scrollWidth; 3097 height = pDoc.documentElement.scrollHeight; 3098 } 3099 else 3100 { 3101 if (pDoc.body.scrollHeight > pDoc.body.offsetHeight) 3102 height = pDoc.body.scrollHeight; 3103 else 3104 height = pDoc.body.offsetHeight; 3105 3106 if (pDoc.body.scrollWidth > pDoc.body.offsetWidth || 3107 (pDoc.compatMode && pDoc.compatMode == "BackCompat") || 3108 (pDoc.documentElement && !pDoc.documentElement.clientWidth) 3109 ) 3110 width = pDoc.body.scrollWidth; 3111 else 3112 width = pDoc.body.offsetWidth; 3113 } 3114 return {scrollWidth : width, scrollHeight : height}; 3115}; 3116 3117BX.GetWindowSize = function(pDoc) 3118{ 3119 var innerSize = this.GetWindowInnerSize(pDoc); 3120 var scrollPos = this.GetWindowScrollPos(pDoc); 3121 var scrollSize = this.GetWindowScrollSize(pDoc); 3122 3123 return {
3124 innerWidth : innerSize.innerWidth, innerHeight : innerSize.innerHeight, 3125 scrollLeft : scrollPos.scrollLeft, scrollTop : scrollPos.scrollTop, 3126 scrollWidth : scrollSize.scrollWidth, scrollHeight : scrollSize.scrollHeight 3127 }; 3128}; 3129 3130BX.scrollTop = function(node, val){ 3131 if(typeof val != 'undefined'){ 3132 3133 if(node == window){ 3134 throw new Error('scrollTop() for window is not implemented'); 3135 }else 3136 node.scrollTop = parseInt(val); 3137 3138 }else{ 3139 3140 if(node == window) 3141 return BX.GetWindowScrollPos().scrollTop; 3142 3143 return node.scrollTop; 3144 } 3145} 3146 3147BX.scrollLeft = function(node, val){ 3148 if(typeof val != 'undefined'){ 3149 3150 if(node == window){ 3151 throw new Error('scrollLeft() for window is not implemented'); 3152 }else 3153 node.scrollLeft = parseInt(val); 3154 3155 }else{ 3156 3157 if(node == window) 3158 return BX.GetWindowScrollPos().scrollLeft; 3159 3160 return node.scrollLeft; 3161 } 3162} 3163 3164BX.hide_object = function(ob) 3165{ 3166 ob = BX(ob); 3167 ob.style.position = 'absolute'; 3168 ob.style.top = '-1000px'; 3169 ob.style.left = '-1000px'; 3170 ob.style.height = '10px'; 3171 ob.style.width = '10px'; 3172}; 3173 3174BX.is_relative = function(el) 3175{ 3176 var p = BX.style(el, 'position'); 3177 return p == 'relative' || p == 'absolute'; 3178}; 3179 3180BX.is_float = function(el) 3181{ 3182 var p = BX.style(el, 'float'); 3183 return p == 'right' || p == 'left'; 3184}; 3185 3186BX.is_fixed = function(el) 3187{ 3188 var p = BX.style(el, 'position'); 3189 return p == 'fixed'; 3190}; 3191 3192BX.pos = function(el, bRelative) 3193{ 3194 var r = { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; 3195 bRelative = !!bRelative; 3196 if (!el) 3197 return r; 3198 if (typeof (el.getBoundingClientRect) != "undefined" && el.ownerDocument == document && !bRelative) 3199 { 3200 var clientRect = {}; 3201 3202 // getBoundingClientRect can return undefined and generate exception in some cases in IE8. 3203 try 3204 { 3205 clientRect = el.getBoundingClientRect(); 3206 } 3207 catch(e) 3208 { 3209 clientRect = 3210 { 3211 top: el.offsetTop, 3212 left: el.offsetLeft, 3213 width: el.offsetWidth, 3214 height: el.offsetHeight, 3215 right: el.offsetLeft + el.offsetWidth, 3216 bottom: el.offsetTop + el.offsetHeight 3217 }; 3218 } 3219 3220 var root = document.documentElement; 3221 var body = document.body; 3222 3223 r.top = clientRect.top + (root.scrollTop || body.scrollTop); 3224 r.left = clientRect.left + (root.scrollLeft || body.scrollLeft); 3225 r.width = clientRect.right - clientRect.left; 3226 r.height = clientRect.bottom - clientRect.top; 3227 r.right = clientRect.right + (root.scrollLeft || body.scrollLeft); 3228 r.bottom = clientRect.bottom + (root.scrollTop || body.scrollTop); 3229 } 3230 else 3231 { 3232 var x = 0, y = 0, w = el.offsetWidth, h = el.offsetHeight; 3233 var first = true; 3234 for (; el != null; el = el.offsetParent) 3235 { 3236 if (!first && bRelative && BX.is_relative(el)) 3237 break; 3238 3239 x += el.offsetLeft; 3240 y += el.offsetTop; 3241 if (first) 3242 { 3243 first = false; 3244 continue; 3245 } 3246 3247 var elBorderLeftWidth = parseInt(BX.style(el, 'border-left-width')), 3248 elBorderTopWidth = parseInt(BX.style(el, 'border-top-width')); 3249 3250 if (!isNaN(elBorderLeftWidth) && elBorderLeftWidth > 0) 3251 x += elBorderLeftWidth; 3252 if (!isNaN(elBorderTopWidth) && elBorderTopWidth > 0) 3253 y += elBorderTopWidth; 3254 } 3255 3256 r.top = y; 3257 r.left = x; 3258 r.width = w; 3259 r.height = h; 3260 r.right = r.left + w; 3261 r.bottom = r.top + h; 3262 } 3263 3264 for(var i in r) 3265 { 3266 if(r.hasOwnProperty(i)) 3267 { 3268 r[i] = Math.round(r[i]); 3269 } 3270 } 3271 3272 return r; 3273}; 3274 3275BX.width = function(node, val){ 3276 if(typeof val != 'undefined') 3277 BX.style(node, 'width', parseInt(val)+'px'); 3278 else{ 3279 3280 if(node == window) 3281 return window.innerWidth; 3282 3283 //return parseInt(BX.style(node, 'width')); 3284 return BX.pos(node).width; 3285 } 3286} 3287 3288BX.height = function(node, val){ 3289 if(typeof val != 'undefined') 3290 BX.style(node, 'height', parseInt(val)+'px'); 3291 else{ 3292 3293 if(node == window) 3294 return window.innerHeight; 3295 3296 //return parseInt(BX.style(node, 'height')); 3297 return BX.pos(node).height; 3298 } 3299} 3300 3301BX.align = function(pos, w, h, type) 3302{ 3303 if (type) 3304 type = type.toLowerCase(); 3305 else 3306 type = ''; 3307 3308 var pDoc = document; 3309 if (BX.type.isElementNode(pos)) 3310 { 3311 pDoc = pos.ownerDocument; 3312 pos = BX.pos(pos); 3313 } 3314 3315 var x = pos["left"], y = pos["bottom"]; 3316 3317 var scroll = BX.GetWindowScrollPos(pDoc); 3318 var size = BX.GetWindowInnerSize(pDoc); 3319 3320 if((size.innerWidth + scroll.scrollLeft) - (pos["left"] + w) < 0) 3321 { 3322 if(pos["right"] - w >= 0 ) 3323 x = pos["right"] - w; 3324 else 3325 x = scroll.scrollLeft; 3326 } 3327
3328 if(((size.innerHeight + scroll.scrollTop) - (pos["bottom"] + h) < 0) || ~type.indexOf('top')) 3329 { 3330 if(pos["top"] - h >= 0 || ~type.indexOf('top')) 3331 y = pos["top"] - h; 3332 else 3333 y = scroll.scrollTop; 3334 } 3335 3336 return {'left':x, 'top':y}; 3337}; 3338 3339BX.scrollToNode = function(node) 3340{ 3341 var obNode = BX(node); 3342 3343 if (obNode.scrollIntoView) 3344 obNode.scrollIntoView(true); 3345 else 3346 { 3347 var arNodePos = BX.pos(obNode); 3348 window.scrollTo(arNodePos.left, arNodePos.top); 3349 } 3350}; 3351 3352/* non-xhr loadings */ 3353BX.showWait = function(node, msg) 3354{ 3355 node = BX(node) || document.body || document.documentElement; 3356 msg = msg || BX.message('JS_CORE_LOADING'); 3357 3358 var container_id = node.id || Math.random(); 3359 3360 var obMsg = node.bxmsg = document.body.appendChild(BX.create('DIV', { 3361 props: { 3362 id: 'wait_' + container_id 3363 }, 3364 style: { 3365 background: 'url("/bitrix/js/main/core/images/wait.gif") no-repeat scroll 10px center #fcf7d1', 3366 border: '1px solid #E1B52D', 3367 color: 'black', 3368 fontFamily: 'Verdana,Arial,sans-serif', 3369 fontSize: '11px', 3370 padding: '10px 30px 10px 37px', 3371 position: 'absolute', 3372 zIndex:'10000', 3373 textAlign:'center' 3374 }, 3375 text: msg 3376 })); 3377 3378 setTimeout(BX.delegate(_adjustWait, node), 10); 3379 3380 lastWait[lastWait.length] = obMsg; 3381 return obMsg; 3382}; 3383 3384BX.closeWait = function(node, obMsg) 3385{ 3386 if(node && !obMsg) 3387 obMsg = node.bxmsg; 3388 if(node && !obMsg && BX.hasClass(node, 'bx-core-waitwindow')) 3389 obMsg = node; 3390 if(node && !obMsg) 3391 obMsg = BX('wait_' + node.id); 3392 if(!obMsg) 3393 obMsg = lastWait.pop(); 3394 3395 if (obMsg && obMsg.parentNode) 3396 { 3397 for (var i=0,len=lastWait.length;i<len;i++) 3398 { 3399 if (obMsg == lastWait[i]) 3400 { 3401 lastWait = BX.util.deleteFromArray(lastWait, i); 3402 break; 3403 } 3404 } 3405 3406 obMsg.parentNode.removeChild(obMsg); 3407 if (node) node.bxmsg = null; 3408 BX.cleanNode(obMsg, true); 3409 } 3410}; 3411 3412BX.setJSList = function(scripts) 3413{ 3414 if (BX.type.isArray(scripts)) 3415 { 3416 jsList = scripts; 3417 } 3418}; 3419 3420BX.getJSList = function() 3421{ 3422 initJsList(); 3423 return jsList; 3424}; 3425 3426BX.setCSSList = function(scripts) 3427{ 3428 if (BX.type.isArray(scripts)) 3429 { 3430 cssList = scripts; 3431 } 3432}; 3433 3434BX.getCSSList = function() 3435{ 3436 initCssList(); 3437 return cssList; 3438}; 3439 3440BX.getJSPath = function(js) 3441{ 3442 return js.replace(/^(http[s]*:)*\/\/[^\/]+/i, ''); 3443}; 3444 3445BX.getCSSPath = function(css) 3446{ 3447 return css.replace(/^(http[s]*:)*\/\/[^\/]+/i, ''); 3448}; 3449 3450BX.getCDNPath = function(path) 3451{ 3452 return path; 3453}; 3454 3455BX.loadScript = function(script, callback, doc) 3456{ 3457 if (BX.type.isString(script)) 3458 { 3459 script = [script]; 3460 } 3461 3462 return BX.load(script, callback, doc); 3463}; 3464 3465BX.loadCSS = function(css, doc, win) 3466{ 3467 if (BX.type.isString(css)) 3468 { 3469 css = [css]; 3470 } 3471 3472 if (BX.type.isArray(css)) 3473 { 3474 css = css.map(function(url) { 3475 return { url: url, ext: "css" } 3476 }); 3477 3478 BX.load(css, null, doc); 3479 } 3480}; 3481 3482BX.load = function(items, callback, doc) 3483{ 3484 if (!BX.isReady) 3485 { 3486 var _args = arguments; 3487 BX.ready(function() { 3488 BX.load.apply(this, _args); 3489 }); 3490 return null; 3491 } 3492 3493 doc = doc || document; 3494 if (isAsync === null) 3495 { 3496 isAsync = "async" in doc.createElement("script") || "MozAppearance" in doc.documentElement.style || window.opera; 3497 } 3498 3499 return isAsync ? loadAsync(items, callback, doc) : loadAsyncEmulation(items, callback, doc); 3500}; 3501 3502BX.convert = 3503{ 3504 nodeListToArray: function(nodes) 3505 { 3506 try 3507 { 3508 return (Array.prototype.slice.call(nodes, 0)); 3509 } 3510 catch (ex) 3511 { 3512 var ary = []; 3513 for(var i = 0, l = nodes.length; i < l; i++) 3514 { 3515 ary.push(nodes[i]); 3516 } 3517 return ary; 3518 } 3519 } 3520}; 3521 3522function loadAsync(items, callback, doc) 3523{ 3524 if (!BX.type.isArray(items)) 3525 { 3526 return; 3527 } 3528 3529 function allLoaded(items) 3530 { 3531 items = items || assets; 3532 for (var name in items) 3533 { 3534 if (items.hasOwnProperty(name) && items[name].state !== LOADED) 3535 { 3536 return false; 3537 } 3538 } 3539 3540 return true; 3541 } 3542 3543 if (!BX.type.isFunction(callback)) 3544 { 3545 callback = null; 3546 } 3547 3548 var itemSet = {}, item, i; 3549 for (i = 0; i < items.length; i++) 3550 { 3551 item = items[i]; 3552 item = getAsset(item); 3553 itemSet[item.name] = item; 3554 } 3555 3556 var callbackWasCalled = false; 3557 for (i = 0; i < items.length; i++) 3558 { 3559 item = items[i]; 3560 item = getAsset(item); 3561 load(item, function () { 3562 if (allLoaded(itemSet)) 3563 { 3564 if (!callbackWasCalled) 3565 { 3566 callback && callback(); 3567 callbackWasCalled = true; 3568 } 3569 3570 } 3571 }, doc); 3572 } 3573} 3574 3575function loadAsyncEmulation(items, callback, doc) 3576{ 3577 function onPreload(asset) 3578 { 3579 asset.state = PRELOADED;
3580 if (BX.type.isArray(asset.onpreload) && asset.onpreload) 3581 { 3582 for (var i = 0; i < asset.onpreload.length; i++) 3583 { 3584 asset.onpreload[i].call(); 3585 } 3586 } 3587 } 3588 3589 function preLoad(asset) 3590 { 3591 if (asset.state === undefined) 3592 { 3593 asset.state = PRELOADING; 3594 asset.onpreload = []; 3595 3596 loadAsset( 3597 { url: asset.url, type: "cache", ext: asset.ext}, 3598 function () { onPreload(asset); }, 3599 doc 3600 ); 3601 } 3602 } 3603 3604 if (!BX.type.isArray(items)) 3605 { 3606 return; 3607 } 3608 3609 if (!BX.type.isFunction(callback)) 3610 { 3611 callback = null; 3612 } 3613 3614 var rest = [].slice.call(items, 1); 3615 for (var i = 0; i < rest.length; i++) 3616 { 3617 preLoad(getAsset(rest[i])); 3618 } 3619 3620 load(getAsset(items[0]), items.length === 1 ? callback : function () { 3621 loadAsyncEmulation.apply(null, [rest, callback, doc]); 3622 }, doc); 3623} 3624 3625function load(asset, callback, doc) 3626{ 3627 callback = callback || BX.DoNothing; 3628 3629 if (asset.state === LOADED) 3630 { 3631 callback(); 3632 return; 3633 } 3634 3635 if (asset.state === PRELOADING) 3636 { 3637 asset.onpreload.push(function () { 3638 load(asset, callback, doc); 3639 }); 3640 return; 3641 } 3642 3643 asset.state = LOADING; 3644 3645 loadAsset( 3646 asset, 3647 function () { 3648 asset.state = LOADED; 3649 callback(); 3650 }, 3651 doc 3652 ); 3653} 3654 3655function loadAsset(asset, callback, doc) 3656{ 3657 callback = callback || BX.DoNothing; 3658 3659 function error(event) 3660 { 3661 ele.onload = ele.onreadystatechange = ele.onerror = null; 3662 callback(); 3663 } 3664 3665 function process(event) 3666 { 3667 event = event || window.event; 3668 if (event.type === "load" || (/loaded|complete/.test(ele.readyState) && (!doc.documentMode || doc.documentMode < 9))) 3669 { 3670 window.clearTimeout(asset.errorTimeout); 3671 window.clearTimeout(asset.cssTimeout); 3672 ele.onload = ele.onreadystatechange = ele.onerror = null; 3673 callback(); 3674 } 3675 } 3676 3677 function isCssLoaded() 3678 { 3679 if (asset.state !== LOADED && asset.cssRetries <= 20) 3680 { 3681 for (var i = 0, l = doc.styleSheets.length; i < l; i++) 3682 { 3683 if (doc.styleSheets[i].href === ele.href) 3684 { 3685 process({"type": "load"}); 3686 return; 3687 } 3688 } 3689 3690 asset.cssRetries++; 3691 asset.cssTimeout = window.setTimeout(isCssLoaded, 250); 3692 } 3693 } 3694 3695 var ele; 3696 var ext = BX.type.isNotEmptyString(asset.ext) ? asset.ext : BX.util.getExtension(asset.url); 3697 3698 if (ext === "css") 3699 { 3700 ele = doc.createElement("link"); 3701 ele.type = "text/" + (asset.type || "css"); 3702 ele.rel = "stylesheet"; 3703 ele.href = asset.url; 3704 3705 asset.cssRetries = 0; 3706 asset.cssTimeout = window.setTimeout(isCssLoaded, 500); 3707 } 3708 else 3709 { 3710 ele = doc.createElement("script"); 3711 ele.type = "text/" + (asset.type || "javascript"); 3712 ele.src = asset.url; 3713 } 3714 3715 ele.onload = ele.onreadystatechange = process; 3716 ele.onerror = error; 3717 3718 ele.async = false; 3719 ele.defer = false; 3720 3721 asset.errorTimeout = window.setTimeout(function () { 3722 error({type: "timeout"}); 3723 }, 7000); 3724 3725 if (ext === "css") 3726 { 3727 cssList.push(normalizeMinUrl(normalizeUrl(asset.url))); 3728 } 3729 else 3730 { 3731 jsList.push(normalizeMinUrl(normalizeUrl(asset.url))); 3732 } 3733 3734 var templateLink = null; 3735 var head = doc.head || doc.getElementsByTagName("head")[0]; 3736 if (ext === "css" && (templateLink = getTemplateLink(head)) !== null) 3737 { 3738 templateLink.parentNode.insertBefore(ele, templateLink); 3739 } 3740 else 3741 { 3742 head.insertBefore(ele, head.lastChild); 3743 } 3744} 3745 3746function getAsset(item) 3747{ 3748 var asset = {}; 3749 if (typeof item === "object") 3750 { 3751 asset = item; 3752 asset.name = asset.name ? asset.name : BX.util.hashCode(item.url); 3753 } 3754 else 3755 { 3756 asset = { name: BX.util.hashCode(item), url : item }; 3757 } 3758 3759 var ext = BX.type.isNotEmptyString(asset.ext) ? asset.ext : BX.util.getExtension(asset.url); 3760 if ((ext === "css" && isCssLoaded(asset.url)) || isScriptLoaded(asset.url)) 3761 { 3762 asset.state = LOADED; 3763 } 3764 3765 var existing = assets[asset.name]; 3766 if (existing && existing.url === asset.url) 3767 { 3768 return existing; 3769 } 3770 3771 assets[asset.name] = asset; 3772 return asset; 3773} 3774 3775function normalizeUrl(url) 3776{ 3777 if (!BX.type.isNotEmptyString(url)) 3778 { 3779 return ""; 3780 } 3781 3782 url = BX.getJSPath(url); 3783 url = url.replace(/\?[0-9]*$/, ""); 3784 3785 return url; 3786} 3787 3788function normalizeMinUrl(url) 3789{ 3790 if (!BX.type.isNotEmptyString(url)) 3791 { 3792 return ""; 3793 } 3794 3795 var minPos = url.indexOf(".min"); 3796 return minPos >= 0 ? url.substr(0, minPos) + url.substr(minPos + 4) : url; 3797} 3798 3799function isCssLoaded(fileSrc) 3800{ 3801 initCssList(); 3802 3803 fileSrc = normalizeUrl(fileSrc); 3804 var fileSrcMin = normalizeMinUrl(fileSrc); 3805 3806 return (fileSrc !== fileSrcMin && BX.util.in_array(fileSrcMin, cssList)) || BX.util.in_array(fileSrc, cssList); 3807} 3808 3809function initCssList() 3810{ 3811 if(!cssInit) 3812 { 3813 var linksCol = document.getElementsByTagName('link'); 3814 3815 if(!!linksCol && linksCol.length > 0) 3816 { 3817 for(var i = 0; i < linksCol.length; i++) 3818 { 3819 var href = linksCol[i].getAttribute('href'); 3820 if (BX.type.isNotEmptyString(href)) 3821 { 3822 href = normalizeMinUrl(normalizeUrl(href)); 3823 cssList.push(href); 3824 } 3825 } 3826 } 3827 cssInit = true; 3828 } 3829} 3830 3831function getTemplateLink(head) 3832{ 3833 var findLink = function(tag) 3834 { 3835 var links = head.getElementsByTagName(tag); 3836 for (var i = 0, length = links.length; i < length; i++) 3837 { 3838 var templateStyle = links[i].getAttribute("data-template-style"); 3839 if (BX.type.isNotEmptyString(templateStyle) && templateStyle == "true") 3840 { 3841 return links[i]; 3842 } 3843 } 3844 3845 return null; 3846 }; 3847 3848 var link = findLink("link"); 3849 if (link === null) 3850 { 3851 link = findLink("style"); 3852 } 3853 3854 return link; 3855} 3856 3857function isScriptLoaded(fileSrc) 3858{ 3859 initJsList(); 3860 3861 fileSrc = normalizeUrl(fileSrc); 3862 var fileSrcMin = normalizeMinUrl(fileSrc); 3863 3864 return (fileSrc !== fileSrcMin && BX.util.in_array(fileSrcMin, jsList)) || BX.util.in_array(fileSrc, jsList); 3865} 3866 3867function initJsList() 3868{ 3869 if(!jsInit) 3870 { 3871 var scriptCol = document.getElementsByTagName('script'); 3872 3873 if(!!scriptCol && scriptCol.length > 0) 3874 { 3875 for(var i=0; i<scriptCol.length; i++) 3876 { 3877 var src = scriptCol[i].getAttribute('src'); 3878 3879 if (BX.type.isNotEmptyString(src)) 3880 { 3881 src = normalizeMinUrl(normalizeUrl(src)); 3882 jsList.push(src); 3883 } 3884 } 3885 } 3886 jsInit = true; 3887 } 3888} 3889 3890BX.reload = function(back_url, bAddClearCache) 3891{ 3892 if (back_url === true) 3893 { 3894 bAddClearCache = true; 3895 back_url = null; 3896 } 3897 3898 var new_href = back_url || top.location.href; 3899 3900 var hashpos = new_href.indexOf('#'), hash = ''; 3901 3902 if (hashpos != -1) 3903 { 3904 hash = new_href.substr(hashpos); 3905 new_href = new_href.substr(0, hashpos); 3906 } 3907 3908 if (bAddClearCache && new_href.indexOf('clear_cache=Y') < 0) 3909 new_href += (new_href.indexOf('?') == -1 ? '?' : '&') + 'clear_cache=Y'; 3910 3911 if (hash) 3912 { 3913 // hack for clearing cache in ajax mode components with history emulation 3914 if (bAddClearCache && (hash.substr(0, 5) == 'view/' || hash.substr(0, 6) == '#view/') && hash.indexOf('clear_cache%3DY') < 0) 3915 hash += (hash.indexOf('%3F') == -1 ? '%3F' : '%26') + 'clear_cache%3DY'; 3916 3917 new_href = new_href.replace(/(\?|\&)_r=[\d]*/, ''); 3918 new_href += (new_href.indexOf('?') == -1 ? '?' : '&') + '_r='+Math.round(Math.random()*10000) + hash; 3919 } 3920 3921 top.location.href = new_href; 3922}; 3923 3924BX.clearCache = function() 3925{ 3926 BX.showWait(); 3927 BX.reload(true); 3928}; 3929 3930BX.template = function(tpl, callback, bKillTpl) 3931{ 3932 BX.ready(function() { 3933 _processTpl(BX(tpl), callback, bKillTpl); 3934 }); 3935}; 3936 3937BX.isAmPmMode = function() 3938{ 3939 return (BX.message('FORMAT_DATETIME').match('T') != null); 3940}; 3941 3942BX.formatDate = function(date, format) 3943{ 3944 date = date || new Date(); 3945 3946 var bTime = date.getHours() || date.getMinutes() || date.getSeconds(), 3947 str = !!format 3948 ? format : 3949 (bTime ? BX.message('FORMAT_DATETIME') : BX.message('FORMAT_DATE') 3950 ); 3951 3952 return str.replace(/YYYY/ig, date.getFullYear()) 3953 .replace(/MMMM/ig, BX.util.str_pad_left((date.getMonth()+1).toString(), 2, '0')) 3954 .replace(/MM/ig, BX.util.str_pad_left((date.getMonth()+1).toString(), 2, '0')) 3955 .replace(/DD/ig, BX.util.str_pad_left(date.getDate().toString(), 2, '0')) 3956 .replace(/HH/ig, BX.util.str_pad_left(date.getHours().toString(), 2, '0')) 3957 .replace(/MI/ig, BX.util.str_pad_left(date.getMinutes().toString(), 2, '0')) 3958 .replace(/SS/ig, BX.util.str_pad_left(date.getSeconds().toString(), 2, '0')); 3959}; 3960BX.formatName = function(user, template, login) 3961{ 3962 user = user || {}; 3963 template = (template || ''); 3964 var replacement = { 3965 TITLE : (user["TITLE"] || ''),
3966 NAME : (user["NAME"] || ''), 3967 LAST_NAME : (user["LAST_NAME"] || ''), 3968 SECOND_NAME : (user["SECOND_NAME"] || ''), 3969 LOGIN : (user["LOGIN"] || ''), 3970 NAME_SHORT : user["NAME"] ? user["NAME"].substr(0, 1) + '.' : '', 3971 LAST_NAME_SHORT : user["LAST_NAME"] ? user["LAST_NAME"].substr(0, 1) + '.' : '', 3972 SECOND_NAME_SHORT : user["SECOND_NAME"] ? user["SECOND_NAME"].substr(0, 1) + '.' : '', 3973 EMAIL : (user["EMAIL"] || ''), 3974 ID : (user["ID"] || ''), 3975 NOBR : "", 3976 '/NOBR' : "" 3977 }, result = template; 3978 for (var ii in replacement) 3979 { 3980 if (replacement.hasOwnProperty(ii)) 3981 { 3982 result = result.replace("#" + ii+ "#", replacement[ii]) 3983 } 3984 } 3985 result = result.replace(/([\s]+)/gi, " ").trim(); 3986 if (result == "") 3987 { 3988 result = (login == "Y" ? replacement["LOGIN"] : ""); 3989 result = (result == "" ? "Noname" : result); 3990 } 3991 return result; 3992}; 3993 3994BX.getNumMonth = function(month) 3995{ 3996 var wordMonthCut = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; 3997 var wordMonth = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']; 3998 3999 var q = month.toUpperCase(); 4000 for (i = 1; i <= 12; i++) 4001 { 4002 if (q == BX.message('MON_'+i).toUpperCase() || q == BX.message('MONTH_'+i).toUpperCase() || q == wordMonthCut[i-1].toUpperCase() || q == wordMonth[i-1].toUpperCase()) 4003 { 4004 return i; 4005 } 4006 } 4007 return month; 4008}; 4009 4010BX.parseDate = function(str, bUTC, formatDate, formatDatetime) 4011{ 4012 if (BX.type.isNotEmptyString(str)) 4013 { 4014 if (!formatDate) 4015 formatDate = BX.message('FORMAT_DATE'); 4016 if (!formatDatetime) 4017 formatDatetime = BX.message('FORMAT_DATETIME'); 4018 4019 var regMonths = ''; 4020 for (i = 1; i <= 12; i++) 4021 { 4022 regMonths = regMonths + '|' + BX.message('MON_'+i); 4023 } 4024
4025 var expr = new RegExp('([0-9]+|[a-z]+' + regMonths + ')', 'ig'); 4026 var aDate = str.match(expr), 4027 aFormat = formatDate.match(/(DD|MI|MMMM|MM|M|YYYY)/ig), 4028 i, cnt, 4029 aDateArgs=[], aFormatArgs=[], 4030 aResult={}; 4031 4032 if (!aDate) 4033 return null; 4034 4035 if(aDate.length > aFormat.length) 4036 { 4037 aFormat = formatDatetime.match(/(DD|MI|MMMM|MM|M|YYYY|HH|H|SS|TT|T|GG|G)/ig); 4038 } 4039 4040 for(i = 0, cnt = aDate.length; i < cnt; i++) 4041 { 4042 if(BX.util.trim(aDate[i]) != '') 4043 { 4044 aDateArgs[aDateArgs.length] = aDate[i]; 4045 } 4046 } 4047 4048 for(i = 0, cnt = aFormat.length; i < cnt; i++) 4049 { 4050 if(BX.util.trim(aFormat[i]) != '') 4051 { 4052 aFormatArgs[aFormatArgs.length] = aFormat[i]; 4053 } 4054 } 4055 4056 4057 var m = BX.util.array_search('MMMM', aFormatArgs); 4058 if (m > 0) 4059 { 4060 aDateArgs[m] = BX.getNumMonth(aDateArgs[m]); 4061 aFormatArgs[m] = "MM"; 4062 } 4063 else 4064 { 4065 m = BX.util.array_search('M', aFormatArgs); 4066 if (m > 0) 4067 { 4068 aDateArgs[m] = BX.getNumMonth(aDateArgs[m]); 4069 aFormatArgs[m] = "MM"; 4070 } 4071 } 4072 4073 for(i = 0, cnt = aFormatArgs.length; i < cnt; i++) 4074 { 4075 var k = aFormatArgs[i].toUpperCase(); 4076 aResult[k] = k == 'T' || k == 'TT' ? aDateArgs[i] : parseInt(aDateArgs[i], 10); 4077 } 4078 4079 if(aResult['DD'] > 0 && aResult['MM'] > 0 && aResult['YYYY'] > 0) 4080 { 4081 var d = new Date(); 4082 4083 if(bUTC) 4084 { 4085 d.setUTCDate(1); 4086 d.setUTCFullYear(aResult['YYYY']); 4087 d.setUTCMonth(aResult['MM'] - 1); 4088 d.setUTCDate(aResult['DD']); 4089 d.setUTCHours(0, 0, 0); 4090 } 4091 else 4092 { 4093 d.setDate(1); 4094 d.setFullYear(aResult['YYYY']); 4095 d.setMonth(aResult['MM'] - 1); 4096 d.setDate(aResult['DD']); 4097 d.setHours(0, 0, 0); 4098 } 4099 4100 if( 4101 (!isNaN(aResult['HH']) || !isNaN(aResult['GG']) || !isNaN(aResult['H']) || !isNaN(aResult['G'])) 4102 && !isNaN(aResult['MI']) 4103 ) 4104 { 4105 if (!isNaN(aResult['H']) || !isNaN(aResult['G'])) 4106 { 4107 var bPM = (aResult['T']||aResult['TT']||'am').toUpperCase()=='PM'; 4108 var h = parseInt(aResult['H']||aResult['G']||0, 10); 4109 if(bPM) 4110 { 4111 aResult['HH'] = h + (h == 12 ? 0 : 12); 4112 } 4113 else 4114 { 4115 aResult['HH'] = h < 12 ? h : 0; 4116 } 4117 } 4118 else 4119 { 4120 aResult['HH'] = parseInt(aResult['HH']||aResult['GG']||0, 10); 4121 } 4122 4123 if (isNaN(aResult['SS'])) 4124 aResult['SS'] = 0; 4125 4126 if(bUTC) 4127 { 4128 d.setUTCHours(aResult['HH'], aResult['MI'], aResult['SS']); 4129 } 4130 else 4131 { 4132 d.setHours(aResult['HH'], aResult['MI'], aResult['SS']); 4133 } 4134 } 4135 4136 return d; 4137 } 4138 } 4139 4140 return null; 4141}; 4142 4143BX.selectUtils = 4144{ 4145 addNewOption: function(oSelect, opt_value, opt_name, do_sort, check_unique) 4146 { 4147 oSelect = BX(oSelect); 4148 if(oSelect) 4149 { 4150 var n = oSelect.length; 4151 if(check_unique !== false) 4152 { 4153 for(var i=0;i<n;i++) 4154 { 4155 if(oSelect[i].value==opt_value) 4156 { 4157 return; 4158 } 4159 } 4160 } 4161 4162 oSelect.options[n] = new Option(opt_name, opt_value, false, false); 4163 } 4164 4165 if(do_sort === true) 4166 { 4167 this.sortSelect(oSelect); 4168 } 4169 }, 4170 4171 deleteOption: function(oSelect, opt_value) 4172 { 4173 oSelect = BX(oSelect); 4174 if(oSelect) 4175 { 4176 for(var i=0;i<oSelect.length;i++) 4177 { 4178 if(oSelect[i].value==opt_value) 4179 { 4180 oSelect.remove(i); 4181 break; 4182 } 4183 } 4184 } 4185 }, 4186 4187 deleteSelectedOptions: function(oSelect) 4188 { 4189 oSelect = BX(oSelect); 4190 if(oSelect) 4191 { 4192 var i=0; 4193 while(i<oSelect.length) 4194 { 4195 if(oSelect[i].selected) 4196 { 4197 oSelect[i].selected=false; 4198 oSelect.remove(i); 4199 } 4200 else 4201 { 4202 i++; 4203 } 4204 } 4205 } 4206 }, 4207 4208 deleteAllOptions: function(oSelect) 4209 { 4210 oSelect = BX(oSelect); 4211 if(oSelect) 4212 { 4213 for(var i=oSelect.length-1; i>=0; i--) 4214 { 4215 oSelect.remove(i); 4216 } 4217 } 4218 }, 4219 4220 optionCompare: function(record1, record2) 4221 { 4222 var value1 = record1.optText.toLowerCase(); 4223 var value2 = record2.optText.toLowerCase(); 4224 if (value1 > value2) return(1); 4225 if (value1 < value2) return(-1); 4226 return(0); 4227 }, 4228 4229 sortSelect: function(oSelect) 4230 { 4231 oSelect = BX(oSelect); 4232 if(oSelect) 4233 { 4234 var myOptions = []; 4235 var n = oSelect.options.length; 4236 var i; 4237 for (i=0;i<n;i++) 4238 { 4239 myOptions[i] = { 4240 optText:oSelect[i].text, 4241 optValue:oSelect[i].value 4242 }; 4243 } 4244 myOptions.sort(this.optionCompare); 4245 oSelect.length=0; 4246 n = myOptions.length; 4247 for(i=0;i<n;i++) 4248 { 4249 oSelect[i] = new Option(myOptions[i].optText, myOptions[i].optValue, false, false); 4250 } 4251 } 4252 }, 4253 4254 selectAllOptions: function(oSelect) 4255 { 4256 oSelect = BX(oSelect); 4257 if(oSelect) 4258 { 4259 var n = oSelect.length; 4260 for(var i=0;i<n;i++) 4261 { 4262 oSelect[i].selected=true; 4263 } 4264 } 4265 }, 4266 4267 selectOption: function(oSelect, opt_value) 4268 { 4269 oSelect = BX(oSelect); 4270 if(oSelect) 4271 { 4272 var n = oSelect.length; 4273 for(var i=0;i<n;i++) 4274 { 4275 oSelect[i].selected = (oSelect[i].value == opt_value); 4276 } 4277 } 4278 }, 4279 4280 addSelectedOptions: function(oSelect, to_select_id, check_unique, do_sort) 4281 { 4282 oSelect = BX(oSelect); 4283 if(!oSelect) 4284 return; 4285 var n = oSelect.length; 4286 for(var i=0; i<n; i++) 4287 if(oSelect[i].selected) 4288 this.addNewOption(to_select_id, oSelect[i].value, oSelect[i].text, do_sort, check_unique); 4289 }, 4290 4291 moveOptionsUp: function(oSelect) 4292 { 4293 oSelect = BX(oSelect); 4294 if(!oSelect) 4295 return; 4296 var n = oSelect.length; 4297 for(var i=0; i<n; i++) 4298 { 4299 if(oSelect[i].selected && i>0 && oSelect[i-1].selected == false) 4300 { 4301 var option = new Option(oSelect[i].text, oSelect[i].value); 4302 oSelect[i] = new Option(oSelect[i-1].text, oSelect[i-1].value); 4303 oSelect[i].selected = false;
4304 oSelect[i-1] = option; 4305 oSelect[i-1].selected = true; 4306 } 4307 } 4308 }, 4309 4310 moveOptionsDown: function(oSelect) 4311 { 4312 oSelect = BX(oSelect); 4313 if(!oSelect) 4314 return; 4315 var n = oSelect.length; 4316 for(var i=n-1; i>=0; i--) 4317 { 4318 if(oSelect[i].selected && i<n-1 && oSelect[i+1].selected == false) 4319 { 4320 var option = new Option(oSelect[i].text, oSelect[i].value); 4321 oSelect[i] = new Option(oSelect[i+1].text, oSelect[i+1].value); 4322 oSelect[i].selected = false; 4323 oSelect[i+1] = option; 4324 oSelect[i+1].selected = true; 4325 } 4326 } 4327 } 4328}; 4329 4330BX.getEventTarget = function(e) 4331{ 4332 if(e.target) 4333 { 4334 return e.target; 4335 } 4336 else if(e.srcElement) 4337 { 4338 return e.srcElement; 4339 } 4340 return null; 4341}; 4342 4343/******* HINT ***************/ 4344// if function has 2 params - the 2nd one is hint html. otherwise hint_html is third and hint_title - 2nd; 4345// '<div onmouseover="BX.hint(this, 'This is <b>Hint</b>')"'>; 4346// BX.hint(el, 'This is <b>Hint</b>') - this won't work, use constructor 4347BX.hint = function(el, hint_title, hint_html, hint_id) 4348{ 4349 if (null == hint_html) 4350 { 4351 hint_html = hint_title; 4352 hint_title = ''; 4353 } 4354 4355 if (null == el.BXHINT) 4356 { 4357 el.BXHINT = new BX.CHint({ 4358 parent: el, hint: hint_html, title: hint_title, id: hint_id 4359 }); 4360 el.BXHINT.Show(); 4361 } 4362}; 4363 4364BX.hint_replace = function(el, hint_title, hint_html) 4365{ 4366 if (null == hint_html) 4367 { 4368 hint_html = hint_title; 4369 hint_title = ''; 4370 } 4371 4372 if (!el || !el.parentNode || !hint_html) 4373 return null; 4374 4375 var obHint = new BX.CHint({ 4376 hint: hint_html, 4377 title: hint_title 4378 }); 4379 4380 obHint.CreateParent(); 4381 4382 el.parentNode.insertBefore(obHint.PARENT, el); 4383 el.parentNode.removeChild(el); 4384 4385 obHint.PARENT.style.marginLeft = '5px'; 4386 4387 return el; 4388}; 4389 4390BX.CHint = function(params) 4391{ 4392 this.PARENT = BX(params.parent); 4393 4394 this.HINT = params.hint; 4395 this.HINT_TITLE = params.title; 4396 4397 this.PARAMS = {}; 4398 for (var i in this.defaultSettings) 4399 { 4400 if (null == params[i]) 4401 this.PARAMS[i] = this.defaultSettings[i]; 4402 else 4403 this.PARAMS[i] = params[i]; 4404 } 4405 4406 if (null != params.id) 4407 this.ID = params.id; 4408 4409 this.timer = null; 4410 this.bInited = false; 4411 this.msover = true; 4412 4413 if (this.PARAMS.showOnce) 4414 { 4415 this.__show(); 4416 this.msover = false; 4417 this.timer = setTimeout(BX.proxy(this.__hide, this), this.PARAMS.hide_timeout); 4418 } 4419 else if (this.PARENT) 4420 { 4421 BX.bind(this.PARENT, 'mouseover', BX.proxy(this.Show, this)); 4422 BX.bind(this.PARENT, 'mouseout', BX.proxy(this.Hide, this)); 4423 } 4424 4425 BX.addCustomEvent('onMenuOpen', BX.delegate(this.disable, this)); 4426 BX.addCustomEvent('onMenuClose', BX.delegate(this.enable, this)); 4427}; 4428 4429BX.CHint.prototype.defaultSettings = { 4430 show_timeout: 1000, 4431 hide_timeout: 500, 4432 dx: 2, 4433 showOnce: false, 4434 preventHide: true, 4435 min_width: 250 4436}; 4437 4438BX.CHint.prototype.CreateParent = function(element, params) 4439{ 4440 if (this.PARENT) 4441 { 4442 BX.unbind(this.PARENT, 'mouseover', BX.proxy(this.Show, this)); 4443 BX.unbind(this.PARENT, 'mouseout', BX.proxy(this.Hide, this)); 4444 } 4445 4446 if (!params) params = {}; 4447 var type = 'icon'; 4448 4449 if (params.type && (params.type == "link" || params.type == "icon")) 4450 type = params.type; 4451 4452 if (element) 4453 type = "element"; 4454 4455 if (type == "icon") 4456 { 4457 element = BX.create('IMG', { 4458 props: { 4459 src: params.iconSrc 4460 ? params.iconSrc 4461 : "/bitrix/js/main/core/images/hint.gif" 4462 } 4463 }); 4464 } 4465 else if (type == "link") 4466 { 4467 element = BX.create("A", { 4468 props: {href: 'javascript:void(0)'}, 4469 html: '[?]' 4470 }); 4471 } 4472 4473 this.PARENT = element; 4474 4475 BX.bind(this.PARENT, 'mouseover', BX.proxy(this.Show, this)); 4476 BX.bind(this.PARENT, 'mouseout', BX.proxy(this.Hide, this)); 4477 4478 return this.PARENT; 4479}; 4480 4481BX.CHint.prototype.Show = function() 4482{ 4483 this.msover = true; 4484 4485 if (null != this.timer) 4486 clearTimeout(this.timer); 4487 4488 this.timer = setTimeout(BX.proxy(this.__show, this), this.PARAMS.show_timeout); 4489}; 4490 4491BX.CHint.prototype.Hide = function() 4492{ 4493 this.msover = false; 4494 4495 if (null != this.timer) 4496 clearTimeout(this.timer); 4497 4498 this.timer = setTimeout(BX.proxy(this.__hide, this), this.PARAMS.hide_timeout); 4499}; 4500 4501BX.CHint.prototype.__show = function() 4502{ 4503 if (!this.msover || this.disabled) return; 4504 if (!this.bInited) this.Init(); 4505 4506 if (this.prepareAdjustPos()) 4507 { 4508 this.DIV.style.display = 'block'; 4509 this.adjustPos(); 4510 4511 BX.bind(window, 'scroll', BX.proxy(this.__onscroll, this)); 4512 4513 if (this.PARAMS.showOnce) 4514 { 4515 this.timer = setTimeout(BX.proxy(this.__hide, this), this.PARAMS.hide_timeout); 4516 } 4517 } 4518}; 4519 4520BX.CHint.prototype.__onscroll = function() 4521{ 4522 if (!BX.admin || !BX.admin.panel || !BX.admin.panel.isFixed()) return; 4523 4524 if (this.scrollTimer) clearTimeout(this.scrollTimer); 4525 4526 this.DIV.style.display = 'none'; 4527 this.scrollTimer = setTimeout(BX.proxy(this.Reopen, this), this.PARAMS.show_timeout); 4528}; 4529 4530BX.CHint.prototype.Reopen = function() 4531{ 4532 if (null != this.timer) clearTimeout(this.timer); 4533 this.timer = setTimeout(BX.proxy(this.__show, this), 50); 4534}; 4535 4536BX.CHint.prototype.__hide = function() 4537{ 4538 if (this.msover) return; 4539 if (!this.bInited) return; 4540 4541 BX.unbind(window, 'scroll', BX.proxy(this.Reopen, this)); 4542 4543 if (this.PARAMS.showOnce) 4544 { 4545 this.Destroy(); 4546 } 4547 else 4548 { 4549 this.DIV.style.display = 'none'; 4550 } 4551}; 4552 4553BX.CHint.prototype.__hide_immediately = function() 4554{ 4555 this.msover = false;
4556 this.__hide(); 4557}; 4558 4559BX.CHint.prototype.Init = function() 4560{ 4561 this.DIV = document.body.appendChild(BX.create('DIV', { 4562 props: {className: 'bx-panel-tooltip'}, 4563 style: {display: 'none'}, 4564 children: [ 4565 BX.create('DIV', { 4566 props: {className: 'bx-panel-tooltip-top-border'}, 4567 html: '<div class="bx-panel-tooltip-corner bx-panel-tooltip-left-corner"></div><div class="bx-panel-tooltip-border"></div><div class="bx-panel-tooltip-corner bx-panel-tooltip-right-corner"></div>' 4568 }), 4569 (this.CONTENT = BX.create('DIV', { 4570 props: {className: 'bx-panel-tooltip-content'}, 4571 children: [ 4572 BX.create('DIV', { 4573 props: {className: 'bx-panel-tooltip-underlay'}, 4574 children: [ 4575 BX.create('DIV', {props: {className: 'bx-panel-tooltip-underlay-bg'}}) 4576 ] 4577 }) 4578 ] 4579 })), 4580 4581 BX.create('DIV', { 4582 props: {className: 'bx-panel-tooltip-bottom-border'}, 4583 html: '<div class="bx-panel-tooltip-corner bx-panel-tooltip-left-corner"></div><div class="bx-panel-tooltip-border"></div><div class="bx-panel-tooltip-corner bx-panel-tooltip-right-corner"></div>' 4584 }) 4585 ] 4586 })); 4587 4588 if (this.ID) 4589 { 4590 this.CONTENT.insertBefore(BX.create('A', { 4591 attrs: {href: 'javascript:void(0)'}, 4592 props: {className: 'bx-panel-tooltip-close'}, 4593 events: {click: BX.delegate(this.Close, this)} 4594 }), this.CONTENT.firstChild) 4595 } 4596 4597 if (this.HINT_TITLE) 4598 { 4599 this.CONTENT.appendChild( 4600 BX.create('DIV', { 4601 props: {className: 'bx-panel-tooltip-title'}, 4602 text: this.HINT_TITLE 4603 }) 4604 ) 4605 } 4606 4607 if (this.HINT) 4608 { 4609 this.CONTENT_TEXT = this.CONTENT.appendChild(BX.create('DIV', {props: {className: 'bx-panel-tooltip-text'}})).appendChild(BX.create('SPAN', {html: this.HINT})); 4610 } 4611 4612 if (this.PARAMS.preventHide) 4613 { 4614 BX.bind(this.DIV, 'mouseout', BX.proxy(this.Hide, this)); 4615 BX.bind(this.DIV, 'mouseover', BX.proxy(this.Show, this)); 4616 } 4617 4618 this.bInited = true; 4619}; 4620 4621BX.CHint.prototype.setContent = function(content) 4622{ 4623 this.HINT = content; 4624 4625 if (this.CONTENT_TEXT) 4626 this.CONTENT_TEXT.innerHTML = this.HINT; 4627 else 4628 this.CONTENT_TEXT = this.CONTENT.appendChild(BX.create('DIV', {props: {className: 'bx-panel-tooltip-text'}})).appendChild(BX.create('SPAN', {html: this.HINT})); 4629}; 4630 4631BX.CHint.prototype.prepareAdjustPos = function() 4632{ 4633 this._wnd = {scrollPos: BX.GetWindowScrollPos(),scrollSize:BX.GetWindowScrollSize()}; 4634 return BX.style(this.PARENT, 'display') != 'none'; 4635}; 4636 4637BX.CHint.prototype.getAdjustPos = function() 4638{ 4639 var res = {}, pos = BX.pos(this.PARENT), min_top = 0; 4640 4641 res.top = pos.bottom + this.PARAMS.dx; 4642 4643 if (BX.admin && BX.admin.panel.DIV) 4644 { 4645 min_top = BX.admin.panel.DIV.offsetHeight + this.PARAMS.dx; 4646 4647 if (BX.admin.panel.isFixed()) 4648 { 4649 min_top += this._wnd.scrollPos.scrollTop; 4650 } 4651 } 4652 4653 if (res.top < min_top) 4654 res.top = min_top; 4655 else 4656 { 4657 if (res.top + this.DIV.offsetHeight > this._wnd.scrollSize.scrollHeight) 4658 res.top = pos.top - this.PARAMS.dx - this.DIV.offsetHeight; 4659 } 4660 4661 res.left = pos.left; 4662 if (pos.left < this.PARAMS.dx) 4663 pos.left = this.PARAMS.dx; 4664 else 4665 { 4666 var floatWidth = this.DIV.offsetWidth; 4667 4668 var max_left = this._wnd.scrollSize.scrollWidth - floatWidth - this.PARAMS.dx; 4669 4670 if (res.left > max_left) 4671 res.left = max_left; 4672 } 4673 4674 return res; 4675}; 4676 4677BX.CHint.prototype.adjustWidth = function() 4678{ 4679 if (this.bWidthAdjusted) return; 4680 4681 var w = this.DIV.offsetWidth, h = this.DIV.offsetHeight; 4682 4683 if (w > this.PARAMS.min_width) 4684 w = Math.round(Math.sqrt(1.618*w*h)); 4685 4686 if (w < this.PARAMS.min_width) 4687 w = this.PARAMS.min_width; 4688 4689 this.DIV.style.width = w + "px"; 4690 4691 if (this._adjustWidthInt) 4692 clearInterval(this._adjustWidthInt); 4693 this._adjustWidthInt = setInterval(BX.delegate(this._adjustWidthInterval, this), 5); 4694 4695 this.bWidthAdjusted = true; 4696}; 4697 4698BX.CHint.prototype._adjustWidthInterval = function() 4699{ 4700 if (!this.DIV || this.DIV.style.display == 'none') 4701 clearInterval(this._adjustWidthInt); 4702 4703 var 4704 dW = 20, 4705 maxWidth = 1500, 4706 w = this.DIV.offsetWidth, 4707 w1 = this.CONTENT_TEXT.offsetWidth; 4708 4709 if (w > 0 && w1 > 0 && w - w1 < dW && w < maxWidth) 4710 { 4711 this.DIV.style.width = (w + dW) + "px"; 4712 return; 4713 } 4714 4715 clearInterval(this._adjustWidthInt); 4716}; 4717 4718BX.CHint.prototype.adjustPos = function() 4719{ 4720 this.adjustWidth(); 4721 4722 var pos = this.getAdjustPos(); 4723 4724 this.DIV.style.top = pos.top + 'px'; 4725 this.DIV.style.left = pos.left + 'px'; 4726}; 4727 4728BX.CHint.prototype.Close = function() 4729{ 4730 if (this.ID && BX.WindowManager) 4731 BX.WindowManager.saveWindowOptions(this.ID, {display: 'off'}); 4732 this.__hide_immediately(); 4733 this.Destroy(); 4734}; 4735
4736BX.CHint.prototype.Destroy = function() 4737{ 4738 if (this.PARENT) 4739 { 4740 BX.unbind(this.PARENT, 'mouseover', BX.proxy(this.Show, this)); 4741 BX.unbind(this.PARENT, 'mouseout', BX.proxy(this.Hide, this)); 4742 } 4743 4744 if (this.DIV) 4745 { 4746 BX.unbind(this.DIV, 'mouseover', BX.proxy(this.Show, this)); 4747 BX.unbind(this.DIV, 'mouseout', BX.proxy(this.Hide, this)); 4748 4749 BX.cleanNode(this.DIV, true); 4750 } 4751}; 4752 4753BX.CHint.prototype.enable = function(){this.disabled = false;}; 4754BX.CHint.prototype.disable = function(){this.__hide_immediately(); this.disabled = true;}; 4755 4756/* ready */ 4757if (document.addEventListener) 4758{ 4759 __readyHandler = function() 4760 { 4761 document.removeEventListener("DOMContentLoaded", __readyHandler, false); 4762 runReady(); 4763 } 4764} 4765else if (document.attachEvent) 4766{ 4767 __readyHandler = function() 4768 { 4769 if (document.readyState === "complete") 4770 { 4771 document.detachEvent("onreadystatechange", __readyHandler); 4772 runReady(); 4773 } 4774 } 4775} 4776 4777function bindReady() 4778{ 4779 if (!readyBound) 4780 { 4781 readyBound = true; 4782 4783 if (document.readyState === "complete") 4784 { 4785 return runReady(); 4786 } 4787 4788 if (document.addEventListener) 4789 { 4790 document.addEventListener("DOMContentLoaded", __readyHandler, false); 4791 window.addEventListener("load", runReady, false); 4792 } 4793 else if (document.attachEvent) // IE 4794 { 4795 document.attachEvent("onreadystatechange", __readyHandler); 4796 window.attachEvent("onload", runReady); 4797 4798 var toplevel = false; 4799 try {toplevel = (window.frameElement == null);} catch(e) {} 4800 4801 if (document.documentElement.doScroll && toplevel) 4802 doScrollCheck(); 4803 } 4804 } 4805 4806 return null; 4807} 4808 4809 4810function runReady() 4811{ 4812 if (!BX.isReady) 4813 { 4814 if (!document.body) 4815 return setTimeout(runReady, 15); 4816 4817 BX.isReady = true; 4818 4819 if (readyList && readyList.length > 0) 4820 { 4821 var fn, i = 0; 4822 while (readyList && (fn = readyList[i++])) 4823 { 4824 try{ 4825 fn.call(document); 4826 } 4827 catch(e){ 4828 BX.debug('BX.ready error: ', e); 4829 } 4830 } 4831 4832 readyList = null; 4833 } 4834 4835 // TODO: check ready handlers binded some other way; 4836 } 4837 return null; 4838} 4839 4840// hack for IE 4841function doScrollCheck() 4842{ 4843 if (BX.isReady) 4844 return; 4845 4846 try {document.documentElement.doScroll("left");} catch( error ) {setTimeout(doScrollCheck, 1); return;} 4847 4848 runReady(); 4849} 4850/* \ready */ 4851 4852function _adjustWait() 4853{ 4854 if (!this.bxmsg) return; 4855 4856 var arContainerPos = BX.pos(this), 4857 div_top = arContainerPos.top; 4858 4859 if (div_top < BX.GetDocElement().scrollTop) 4860 div_top = BX.GetDocElement().scrollTop + 5; 4861 4862 this.bxmsg.style.top = (div_top + 5) + 'px'; 4863 4864 if (this == BX.GetDocElement()) 4865 { 4866 this.bxmsg.style.right = '5px'; 4867 } 4868 else 4869 { 4870 this.bxmsg.style.left = (arContainerPos.right - this.bxmsg.offsetWidth - 5) + 'px'; 4871 } 4872} 4873 4874function _checkDisplay(ob, displayType) 4875{ 4876 if (typeof displayType != 'undefined') 4877 ob.BXDISPLAY = displayType; 4878 4879 var d = ob.style.display || BX.style(ob, 'display'); 4880 if (d != 'none') 4881 { 4882 ob.BXDISPLAY = ob.BXDISPLAY || d; 4883 return true; 4884 } 4885 else 4886 { 4887 ob.BXDISPLAY = ob.BXDISPLAY || 'block'; 4888 return false; 4889 } 4890} 4891 4892function _processTpl(tplNode, cb, bKillTpl) 4893{ 4894 if (tplNode) 4895 { 4896 if (bKillTpl) 4897 tplNode.parentNode.removeChild(tplNode); 4898 4899 var res = {}, nodes = BX.findChildren(tplNode, {attribute: 'data-role'}, true); 4900 4901 for (var i = 0, l = nodes.length; i < l; i++) 4902 { 4903 res[nodes[i].getAttribute('data-role')] = nodes[i]; 4904 } 4905 4906 cb.apply(tplNode, [res]); 4907 } 4908} 4909 4910function _checkNode(obj, params) 4911{ 4912 params = params || {}; 4913 4914 if (BX.type.isFunction(params)) 4915 return params.call(window, obj); 4916 4917 if (!params.allowTextNodes && !BX.type.isElementNode(obj)) 4918 return false; 4919 var i,j,len; 4920 for (i in params) 4921 { 4922 if(params.hasOwnProperty(i)) 4923 { 4924 switch(i) 4925 { 4926 case 'tag': 4927 case 'tagName': 4928 if (BX.type.isString(params[i])) 4929 { 4930 if (obj.tagName.toUpperCase() != params[i].toUpperCase()) 4931 return false; 4932 } 4933 else if (params[i] instanceof RegExp) 4934 { 4935 if (!params[i].test(obj.tagName)) 4936 return false; 4937 } 4938 break; 4939 4940 case 'class': 4941 case 'className': 4942 if (BX.type.isString(params[i])) 4943 { 4944 if (!BX.hasClass(obj, params[i])) 4945 return false; 4946 } 4947 else if (params[i] instanceof RegExp) 4948 { 4949 if (!BX.type.isString(obj.className) || !params[i].test(obj.className)) 4950 return false;
4951 } 4952 break; 4953 4954 case 'attr': 4955 case 'attrs': 4956 case 'attribute': 4957 if (BX.type.isString(params[i])) 4958 { 4959 if (!obj.getAttribute(params[i])) 4960 return false; 4961 } 4962 else if (BX.type.isArray(params[i])) 4963 { 4964 for (j = 0, len = params[i].length; j < len; j++) 4965 { 4966 if (params[i] && !obj.getAttribute(params[i])) 4967 return false; 4968 } 4969 } 4970 else 4971 { 4972 for (j in params[i]) 4973 { 4974 if(params[i].hasOwnProperty(j)) 4975 { 4976 var q = obj.getAttribute(j); 4977 if (params[i][j] instanceof RegExp) 4978 { 4979 if (!BX.type.isString(q) || !params[i][j].test(q)) 4980 { 4981 return false; 4982 } 4983 } 4984 else 4985 { 4986 if (q != '' + params[i][j]) 4987 { 4988 return false; 4989 } 4990 } 4991 } 4992 } 4993 } 4994 break; 4995 4996 case 'property': 4997 case 'props': 4998 if (BX.type.isString(params[i])) 4999 { 5000 if (!obj[params[i]]) 5001 return false; 5002 } 5003 else if (BX.type.isArray(params[i])) 5004 { 5005 for (j = 0, len = params[i].length; j < len; j++) 5006 { 5007 if (params[i] && !obj[params[i]]) 5008 return false; 5009 } 5010 } 5011 else 5012 { 5013 for (j in params[i]) 5014 { 5015 if (BX.type.isString(params[i][j])) 5016 { 5017 if (obj[j] != params[i][j]) 5018 return false; 5019 } 5020 else if (params[i][j] instanceof RegExp) 5021 { 5022 if (!BX.type.isString(obj[j]) || !params[i][j].test(obj[j])) 5023 return false; 5024 } 5025 } 5026 } 5027 break; 5028 5029 case 'callback': 5030 return params[i](obj); 5031 } 5032 } 5033 } 5034 5035 return true; 5036} 5037 5038/* garbage collector */ 5039function Trash() 5040{ 5041 var i,len; 5042 5043 for (i = 0, len = garbageCollectors.length; i<len; i++) 5044 { 5045 try { 5046 garbageCollectors[i].callback.apply(garbageCollectors[i].context || window); 5047 delete garbageCollectors[i]; 5048 garbageCollectors[i] = null; 5049 } catch (e) {} 5050 } 5051 5052 try {BX.unbindAll();} catch(e) {} 5053/* 5054 for (i = 0, len = proxyList.length; i < len; i++) 5055 { 5056 try { 5057 delete proxyList[i]; 5058 proxyList[i] = null; 5059 } catch (e) {} 5060 } 5061*/ 5062} 5063 5064if(window.attachEvent) // IE 5065 window.attachEvent("onunload", Trash); 5066else if(window.addEventListener) // Gecko / W3C 5067 window.addEventListener('unload', Trash, false); 5068else 5069 window.onunload = Trash; 5070/* \garbage collector */ 5071 5072// set empty ready handler 5073BX(BX.DoNothing); 5074window.BX = BX; 5075BX.browser.addGlobalClass(); 5076 5077/* data storage */ 5078BX.data = function(node, key, value) 5079{ 5080 if(typeof node == 'undefined') 5081 return undefined; 5082 5083 if(typeof key == 'undefined') 5084 return undefined; 5085 5086 if(typeof value != 'undefined') 5087 { 5088 // write to manager 5089 dataStorage.set(node, key, value); 5090 } 5091 else 5092 { 5093 var data; 5094 5095 // from manager 5096 if((data = dataStorage.get(node, key)) != undefined) 5097 { 5098 return data; 5099 } 5100 else 5101 { 5102 // from attribute data-* 5103 if('getAttribute' in node) 5104 { 5105 data = node.getAttribute('data-'+key.toString()); 5106 if(data === null) 5107 { 5108 return undefined; 5109 } 5110 return data; 5111 } 5112 } 5113 5114 return undefined; 5115 } 5116}; 5117 5118BX.DataStorage = function() 5119{ 5120 5121 this.keyOffset = 1; 5122 this.data = {}; 5123 this.uniqueTag = 'BX-'+Math.random(); 5124 5125 this.resolve = function(owner, create){ 5126 if(typeof owner[this.uniqueTag] == 'undefined') 5127 if(create) 5128 { 5129 try 5130 { 5131 Object.defineProperty(owner, this.uniqueTag, { 5132 value: this.keyOffset++ 5133 }); 5134 } 5135 catch(e) 5136 { 5137 owner[this.uniqueTag] = this.keyOffset++; 5138 } 5139 } 5140 else 5141 return undefined; 5142 5143 return owner[this.uniqueTag]; 5144 }; 5145 this.get = function(owner, key){ 5146 if((owner != document && !BX.type.isElementNode(owner)) || typeof key == 'undefined') 5147 return undefined; 5148 5149 owner = this.resolve(owner, false); 5150 5151 if(typeof owner == 'undefined' || typeof this.data[owner] == 'undefined') 5152 return undefined; 5153 5154 return this.data[owner][key]; 5155 }; 5156 this.set = function(owner, key, value){ 5157 5158 if((owner != document && !BX.type.isElementNode(owner)) || typeof value == 'undefined') 5159 return; 5160 5161 var o = this.resolve(owner, true); 5162 5163 if(typeof this.data[o] == 'undefined') 5164 this.data[o] = {}; 5165 5166 this.data[o][key] = value; 5167 }; 5168}; 5169 5170// some internal variables for new logic 5171var dataStorage = new BX.DataStorage(); // manager which BX.data() uses to keep data 5172 5173BX.LazyLoad = { 5174 images: [], 5175 imageStatus: { 5176 hidden: -2, 5177 error: -1, 5178 "undefined": 0, 5179 inited: 1, 5180 loaded: 2 5181 }, 5182 imageTypes: { 5183 image: 1, 5184 background: 2 5185 }, 5186 5187 registerImage: function(id, isImageVisibleCallback) 5188 { 5189 if (BX.type.isNotEmptyString(id)) 5190 { 5191 this.images.push({ 5192 id: id, 5193 node: null, 5194 src: null, 5195 type: null, 5196 func: BX.type.isFunction(isImageVisibleCallback) ? isImageVisibleCallback : null, 5197 status: this.imageStatus.undefined 5198 }); 5199 } 5200 }, 5201 5202 registerImages: function(ids, isImageVisibleCallback) 5203 { 5204 if (BX.type.isArray(ids)) 5205 { 5206 for (var i = 0, length = ids.length; i < length; i++) 5207 { 5208 this.registerImage(ids[i], isImageVisibleCallback); 5209 } 5210 } 5211 }, 5212 5213 showImages: function(checkOwnVisibility) 5214 { 5215 var image = null; 5216 var isImageVisible = false;
5217 5218 checkOwnVisibility = (checkOwnVisibility !== false); 5219 for (var i = 0, length = this.images.length; i < length; i++) 5220 { 5221 image = this.images[i]; 5222 5223 if (image.status == this.imageStatus.undefined) 5224 { 5225 this.initImage(image); 5226 } 5227 5228 if (image.status !== this.imageStatus.inited) 5229 { 5230 continue; 5231 } 5232 5233 if ( 5234 !image.node 5235 || !image.node.parentNode 5236 ) 5237 { 5238 image.node = null; 5239 image.status = this.imageStatus.error; 5240 continue; 5241 } 5242 5243 isImageVisible = true; 5244 if (checkOwnVisibility && image.func) 5245 { 5246 isImageVisible = image.func(image); 5247 } 5248 5249 if ( 5250 isImageVisible === true 5251 && this.isElementVisibleOnScreen(image.node) 5252 ) 5253 { 5254 if (image.type == this.imageTypes.image) 5255 { 5256 image.node.src = image.src; 5257 } 5258 else 5259 { 5260 image.node.style.backgroundImage = "url('" + image.src + "')"; 5261 } 5262 5263 image.node.setAttribute("data-src", ""); 5264 image.status = this.imageStatus.loaded; 5265 } 5266 } 5267 }, 5268 5269 initImage: function(image) 5270 { 5271 image.status = this.imageStatus.error; 5272 var node = BX(image.id); 5273 if (node) 5274 { 5275 var src = node.getAttribute("data-src"); 5276 if (BX.type.isNotEmptyString(src)) 5277 { 5278 image.node = node; 5279 image.src = src; 5280 image.status = this.imageStatus.inited; 5281 image.type = (image.node.tagName.toLowerCase() == "img" 5282 ? this.imageTypes.image 5283 : this.imageTypes.background 5284 ); 5285 } 5286 } 5287 }, 5288 5289 isElementVisibleOnScreen: function (element) 5290 { 5291 var coords = this.getElementCoords(element); 5292 5293 var windowTop = window.pageYOffset || document.documentElement.scrollTop; 5294 var windowBottom = windowTop + document.documentElement.clientHeight; 5295 5296 coords.bottom = coords.top + element.offsetHeight; 5297 5298 var topVisible = coords.top > windowTop && coords.top < windowBottom; 5299 var bottomVisible = coords.bottom < windowBottom && coords.bottom > windowTop; 5300 5301 return topVisible || bottomVisible; 5302 }, 5303 5304 isElementVisibleOn2Screens: function(element) 5305 { 5306 var coords = this.getElementCoords(element); 5307 5308 var windowHeight = document.documentElement.clientHeight; 5309 var windowTop = window.pageYOffset || document.documentElement.scrollTop; 5310 var windowBottom = windowTop + windowHeight; 5311 5312 coords.bottom = coords.top + element.offsetHeight; 5313 5314 windowTop -= windowHeight; 5315 windowBottom += windowHeight; 5316 5317 var topVisible = coords.top > windowTop && coords.top < windowBottom; 5318 var bottomVisible = coords.bottom < windowBottom && coords.bottom > windowTop; 5319 5320 return topVisible || bottomVisible; 5321 }, 5322 5323 getElementCoords: function(element) 5324 { 5325 var box = element.getBoundingClientRect(); 5326 5327 return { 5328 originTop: box.top, 5329 originLeft: box.left, 5330 top: box.top + window.pageYOffset, 5331 left: box.left + window.pageXOffset 5332 }; 5333 }, 5334 5335 onScroll: function() 5336 { 5337 BX.LazyLoad.showImages(); 5338 }, 5339 5340 clearImages: function () 5341 { 5342 this.images = []; 5343 } 5344 5345}; 5346 5347BX.getCookie = function (name) 5348{ 5349 var matches = document.cookie.match(new RegExp( 5350 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 5351 )); 5352 5353 return matches ? decodeURIComponent(matches[1]) : undefined; 5354}; 5355 5356BX.setCookie = function (name, value, options) 5357{ 5358 options = options || {}; 5359 5360 var expires = options.expires; 5361 if (typeof(expires) == "number" && expires) 5362 { 5363 var currentDate = new Date(); 5364 currentDate.setTime(currentDate.getTime() + expires * 1000); 5365 expires = options.expires = currentDate; 5366 } 5367 5368 if (expires && expires.toUTCString) 5369 { 5370 options.expires = expires.toUTCString(); 5371 } 5372 5373 value = encodeURIComponent(value); 5374 5375 var updatedCookie = name + "=" + value; 5376 5377 for (var propertyName in options) 5378 { 5379 if (!options.hasOwnProperty(propertyName)) 5380 { 5381 continue; 5382 } 5383 updatedCookie += "; " + propertyName; 5384 var propertyValue = options[propertyName]; 5385 if (propertyValue !== true) 5386 { 5387 updatedCookie += "=" + propertyValue; 5388 } 5389 } 5390 5391 document.cookie = updatedCookie; 5392 5393 return true; 5394}; 5395 5396BX.FixFontSize = function(params) 5397{ 5398 var widthNode, computedStyles, width; 5399 5400 this.node = null; 5401 this.prevWindowSize = 0; 5402 this.prevWrapperSize = 0; 5403 this.mainWrapper = null; 5404 this.textWrapper = null; 5405 this.objList = params.objList; 5406 this.minFontSizeList = []; 5407 this.minFontSize = 0; 5408 5409 if (params.onresize) 5410 { 5411 this.prevWindowSize = window.innerWidth || document.documentElement.clientWidth; 5412 BX.bind(window, 'resize', BX.proxy(BX.throttle(this.onResize, 350),this)); 5413 } 5414 5415 if (params.onAdaptiveResize) 5416 { 5417 widthNode = this.objList[0].scaleBy || this.objList[0].node; 5418 computedStyles = getComputedStyle(widthNode); 5419 this.prevWrapperSize = parseInt(computedStyles["width"]) - parseInt(computedStyles["paddingLeft"]) - parseInt(computedStyles["paddingRight"]); 5420 BX.bind(window, 'resize', BX.proxy(BX.throttle(this.onAdaptiveResize, 350),this)); 5421 } 5422 5423 this.createTestNodes(); 5424 this.decrease(); 5425}; 5426 5427BX.FixFontSize.prototype = 5428{ 5429 createTestNodes: function() 5430 { 5431 this.textWrapper = BX.create('div',{ 5432 style : { 5433 display : 'inline-block', 5434 whiteSpace : 'nowrap' 5435 } 5436 }); 5437 5438 this.mainWrapper = BX.create('div',{ 5439 style : { 5440 height : 0, 5441 overflow : 'hidden' 5442 }, 5443 children : [this.textWrapper] 5444 }); 5445 5446 }, 5447 insertTestNodes: function() 5448 { 5449 document.body.appendChild(this.mainWrapper); 5450 }, 5451 removeTestNodes: function() 5452 { 5453 document.body.removeChild(this.mainWrapper); 5454 }, 5455 decrease: function() 5456 { 5457 var width, 5458 fontSize, 5459 widthNode, 5460 computedStyles; 5461 5462 this.insertTestNodes(); 5463 5464 for(var i=this.objList.length-1; i>=0; i--) 5465 { 5466 widthNode = this.objList[i].scaleBy || this.objList[i].node; 5467 computedStyles = getComputedStyle(widthNode); 5468 width = parseInt(computedStyles["width"]) - parseInt(computedStyles["paddingLeft"]) - parseInt(computedStyles["paddingRight"]); 5469 fontSize = parseInt(getComputedStyle(this.objList[i].node)["font-size"]); 5470 5471 this.textWrapperSetStyle(this.objList[i].node); 5472 5473 if(this.textWrapperInsertText(this.objList[i].node)) 5474 { 5475 while(this.textWrapper.offsetWidth > width && fontSize > 0) 5476 { 5477 this.textWrapper.style.fontSize = --fontSize + 'px'; 5478 } 5479 5480 if(this.objList[i].smallestValue) 5481 { 5482 this.minFontSize = this.minFontSize ? Math.min(this.minFontSize, fontSize) : fontSize; 5483 5484 this.minFontSizeList.push(this.objList[i].node) 5485 } 5486 else 5487 { 5488 this.objList[i].node.style.fontSize = fontSize + 'px'; 5489 } 5490 } 5491 } 5492 5493 if(this.minFontSizeList.length > 0) 5494 this.setMinFont(); 5495 5496 this.removeTestNodes(); 5497 5498 }, 5499 increase: function() 5500 { 5501 this.insertTestNodes(); 5502 var width, 5503 fontSize, 5504 widthNode, 5505 computedStyles; 5506 5507 this.insertTestNodes(); 5508 5509 for(var i=this.objList.length-1; i>=0; i--) 5510 { 5511 widthNode = this.objList[i].scaleBy || this.objList[i].node; 5512 computedStyles = getComputedStyle(widthNode); 5513 width = parseInt(computedStyles["width"]) - parseInt(computedStyles["paddingLeft"]) - parseInt(computedStyles["paddingRight"]); 5514 fontSize = parseInt(getComputedStyle(this.objList[i].node)["font-size"]); 5515 5516 this.textWrapperSetStyle(this.objList[i].node); 5517 5518 if(this.textWrapperInsertText(this.objList[i].node)) 5519 { 5520 while(this.textWrapper.offsetWidth < width && fontSize < this.objList[i].maxFontSize) 5521 { 5522 this.textWrapper.style.fontSize = ++fontSize + 'px'; 5523 } 5524 5525 fontSize--; 5526 5527 if(this.objList[i].smallestValue) 5528 { 5529 this.minFontSize = this.minFontSize ? Math.min(this.minFontSize, fontSize) : fontSize; 5530 5531 this.minFontSizeList.push(this.objList[i].node) 5532 } 5533 else 5534 { 5535 this.objList[i].node.style.fontSize = fontSize + 'px'; 5536 } 5537 } 5538 } 5539 5540 if(this.minFontSizeList.length > 0) 5541 this.setMinFont(); 5542 5543 this.removeTestNodes(); 5544 }, 5545 setMinFont : function() 5546 { 5547 for(var i = this.minFontSizeList.length-1; i>=0; i--) 5548 { 5549 this.minFontSizeList[i].style.fontSize = this.minFontSize + 'px'; 5550 } 5551 5552 this.minFontSize = 0; 5553 }, 5554 onResize : function() 5555 { 5556 var width = window.innerWidth || document.documentElement.clientWidth; 5557 5558 if(this.prevWindowSize > width) 5559 this.decrease(); 5560 5561 else if (this.prevWindowSize < width) 5562 this.increase(); 5563 5564 this.prevWindowSize = width; 5565 }, 5566 onAdaptiveResize : function() 5567 { 5568 var widthNode = this.objList[0].scaleBy || this.objList[0].node, 5569 computedStyles = getComputedStyle(widthNode), 5570 width = parseInt(computedStyles["width"]) - parseInt(computedStyles["paddingLeft"]) - parseInt(computedStyles["paddingRight"]); 5571 5572 if (this.prevWrapperSize > width) 5573 this.decrease(); 5574 else if (this.prevWrapperSize < width) 5575 this.increase(); 5576 5577 this.prevWrapperSize = width; 5578 }, 5579 textWrapperInsertText : function(node) 5580 { 5581 if(node.textContent){ 5582 this.textWrapper.textContent = node.textContent; 5583 return true; 5584 } 5585 else if(node.innerText) 5586 { 5587 this.textWrapper.innerText = node.innerText; 5588 return true; 5589 } 5590 else { 5591 return false;
5592 } 5593 }, 5594 textWrapperSetStyle : function(node) 5595 { 5596 this.textWrapper.style.fontFamily = getComputedStyle(node)["font-family"]; 5597 this.textWrapper.style.fontSize = getComputedStyle(node)["font-size"]; 5598 this.textWrapper.style.fontStyle = getComputedStyle(node)["font-style"]; 5599 this.textWrapper.style.fontWeight = getComputedStyle(node)["font-weight"]; 5600 this.textWrapper.style.lineHeight = getComputedStyle(node)["line-height"]; 5601 } 5602}; 5603 5604BX.FixFontSize.init = function(params) 5605{ 5606 return new BX.FixFontSize(params); 5607}; 5608 5609if(typeof(BX.ParamBag) === "undefined") 5610{ 5611 BX.ParamBag = function() 5612 { 5613 this._params = {}; 5614 }; 5615 5616 BX.ParamBag.prototype = 5617 { 5618 initialize: function(params) 5619 { 5620 this._params = params ? params : {}; 5621 }, 5622 getParam: function(name, defaultvalue) 5623 { 5624 var p = this._params; 5625 return typeof(p[name]) != "undefined" ? p[name] : defaultvalue; 5626 }, 5627 setParam: function(name, value) 5628 { 5629 this._params[name] = value; 5630 }, 5631 clear: function() 5632 { 5633 this._params = {}; 5634 } 5635 }; 5636 5637 BX.ParamBag.create = function(params) 5638 { 5639 var self = new BX.ParamBag(); 5640 self.initialize(params); 5641 return self; 5642 } 5643} 5644 5645if(typeof(BX.Promise) === "undefined") 5646{ 5647 BX.Promise = function(fn, ctx) // fn is future-reserved 5648 { 5649 this.state = null; 5650 this.value = null; 5651 this.reason = null; 5652 this.next = null; 5653 this.ctx = ctx || this; 5654 5655 this.onFulfilled = []; 5656 this.onRejected = []; 5657 }; 5658 BX.Promise.prototype.fulfill = function(value) 5659 { 5660 this.checkState(); 5661 5662 this.value = value; 5663 this.state = true; 5664 this.execute(); 5665 }; 5666 BX.Promise.prototype.reject = function(reason) 5667 { 5668 this.checkState(); 5669 5670 this.reason = reason; 5671 this.state = false; 5672 this.execute(); 5673 }; 5674 BX.Promise.prototype.then = function(onFulfilled, onRejected) 5675 { 5676 if(BX.type.isFunction(onFulfilled)) 5677 { 5678 this.onFulfilled.push(onFulfilled); 5679 } 5680 if(BX.type.isFunction(onRejected)) 5681 { 5682 this.onRejected.push(onRejected); 5683 } 5684 5685 if(this.next === null) 5686 { 5687 this.next = new BX.Promise(null, this.ctx); 5688 } 5689 5690 if(this.state !== null) // if promise was already resolved, execute immediately 5691 { 5692 this.execute(); 5693 } 5694 5695 return this.next; 5696 }; 5697 5698 BX.Promise.prototype.catch = function(onRejected) 5699 { 5700 if(BX.type.isFunction(onRejected)) 5701 { 5702 this.onRejected.push(onRejected); 5703 } 5704 5705 if(this.next === null) 5706 { 5707 this.next = new BX.Promise(null, this.ctx); 5708 } 5709 5710 if(this.state !== null) // if promise was already resolved, execute immediately 5711 { 5712 this.execute(); 5713 } 5714 5715 return this.next; 5716 }; 5717 5718 BX.Promise.prototype.setAutoResolve = function(way, ms) 5719 { 5720 this.timer = setTimeout(BX.delegate(function(){ 5721 if(this.state === null) 5722 { 5723 this[way ? 'fulfill' : 'reject'](); 5724 } 5725 }, this), ms || 15); 5726 }; 5727 BX.Promise.prototype.cancelAutoResolve = function() 5728 { 5729 clearTimeout(this.timer); 5730 }; 5731 /** 5732 * Resolve function. This function allows promise chaining, like ..then().then()... 5733 * Typical usage: 5734 *
5735 * var p = new Promise(); 5736 * 5737 * p.then(function(value){ 5738 * return someValue; // next promise in the chain will be fulfilled with someValue 5739 * }).then(function(value){ 5740 * 5741 * var p1 = new Promise(); 5742 * *** some async code here, that eventually resolves p1 *** 5743 * 5744 * return p1; // chain will resume when p1 resolved (fulfilled or rejected) 5745 * }).then(function(value){ 5746 * 5747 * // you can also do 5748 * var e = new Error(); 5749 * throw e; 5750 * // it will cause next promise to be rejected with e 5751 * 5752 * return someOtherValue; 5753 * }).then(function(value){ 5754 * ... 5755 * }, function(reason){ 5756 * // promise was rejected with reason 5757 * })...; 5758 * 5759 * p.fulfill('let`s start this chain'); 5760 * 5761 * @param x 5762 */ 5763 BX.Promise.prototype.resolve = function(x) 5764 { 5765 var this_ = this; 5766 5767 if(this === x) 5768 { 5769 this.reject(new TypeError('Promise cannot fulfill or reject itself')); // avoid recursion 5770 } 5771 // allow "pausing" promise chaining until promise x is fulfilled or rejected 5772 else if(x instanceof BX.Promise) 5773 { 5774 x.then(function(value){ 5775 this_.fulfill(value); 5776 }, function(reason){ 5777 this_.reject(reason); 5778 }); 5779 } 5780 else // auto-fulfill this promise 5781 { 5782 this.fulfill(x); 5783 } 5784 }; 5785 BX.Promise.prototype.execute = function() 5786 { 5787 if(this.state === null) 5788 { 5789 //then() must not be called before BX.Promise resolve() happens 5790 return; 5791 } 5792 5793 var value = undefined; 5794 var reason = undefined; 5795 var x = undefined; 5796 var k; 5797 if(this.state === true) // promise was fulfill()-ed 5798 { 5799 if(this.onFulfilled.length) 5800 { 5801 try 5802 { 5803 for(k = 0; k < this.onFulfilled.length; k++) 5804 {
5805 x = this.onFulfilled[k].apply(this.ctx, [this.value]); 5806 if(typeof x != 'undefined') 5807 { 5808 value = x; 5809 } 5810 } 5811 } 5812 catch(e) 5813 { 5814 if('console' in window) 5815 { 5816 console.dir(e); 5817 } 5818 BX.debug(e); 5819 5820 reason = e; // reject next 5821 } 5822 } 5823 else 5824 { 5825 value = this.value; // resolve next 5826 } 5827 } 5828 else if(this.state === false) // promise was reject()-ed 5829 { 5830 if(this.onRejected.length) 5831 { 5832 try 5833 { 5834 for(k = 0; k < this.onRejected.length; k++) 5835 { 5836 x = this.onRejected[k].apply(this.ctx, [this.reason]); 5837 if(typeof x != 'undefined') 5838 { 5839 value = x; 5840 } 5841 } 5842 } 5843 catch(e) 5844 { 5845 if('console' in window) 5846 { 5847 console.dir(e); 5848 } 5849 BX.debug(e); 5850 5851 reason = e; // reject next 5852 } 5853 } 5854 else 5855 { 5856 reason = this.reason; // reject next 5857 } 5858 } 5859 5860 if(this.next !== null) 5861 { 5862 if(typeof reason != 'undefined') 5863 { 5864 this.next.reject(reason); 5865 } 5866 else if(typeof value != 'undefined') 5867 { 5868 this.next.resolve(value); 5869 } 5870 } 5871 }; 5872 BX.Promise.prototype.checkState = function() 5873 { 5874 if(this.state !== null) 5875 { 5876 throw new Error('You can not do fulfill() or reject() multiple times'); 5877 } 5878 }; 5879} 5880 5881})(window); 5882 5883 5884/* End */ 5885; 5886; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/core/core_ajax.min.js?149879921321435";s:6:"source";s:33:"/bitrix/js/main/core/core_ajax.js";s:3:"min";s:37:"/bitrix/js/main/core/core_ajax.min.js";s:3:"map";s:37:"/bitrix/js/main/core/core_ajax.map.js";}"*/ 5887(function(e){if(e.BX.ajax)return;var a=e.BX,t={},r={method:"GET",dataType:"html",timeout:0,async:true,processData:true,scriptsRunFirst:false,emulateOnload:true,skipAuthCheck:false,start:true,cache:true,preparePost:true,headers:false,lsTimeout:30,lsForce:false},o=null,n={},s=[],i={url_utf:/[^\034-\254]+/g,script_self:/\/bitrix\/js\/main\/core\/core(_ajax)*.js$/i,script_self_window:/\/bitrix\/js\/main\/core\/core_window.js$/i,script_self_admin:/\/bitrix\/js\/main\/core\/core_admin.js$/i,script_onload:/window.onload/g};a.ajax=function(e){var o,n;if(!e||!e.url||!a.type.isString(e.url)){return false}for(var s in t)if(typeof e[s]=="undefined")e[s]=t[s];t={};for(s in r)if(typeof e[s]=="undefined")e[s]=r[s];e.method=e.method.toUpperCase();if(!a.localStorage)e.lsId=null;if(a.browser.IsIE()){var u=i.url_utf.exec(e.url);if(u){do{e.url=e.url.replace(u,a.util.urlencode(u));u=i.url_utf.exec(e.url)}while(u)}}if(e.dataType=="json")e.emulateOnload=false;if(!e.cache&&e.method=="GET")e.url=a.ajax._uncache(e.url);if(e.method=="POST"&&e.preparePost){e.data=a.ajax.prepareData(e.data)}var l=true;if(e.lsId&&!e.lsForce){var c=a.localStorage.get("ajax-"+e.lsId);if(c!==null){l=false;var f=function(t){if(t.key=="ajax-"+e.lsId&&t.value!="BXAJAXWAIT"){var r=t.value,o=!!t.oldValue&&r==null;if(!o)a.ajax.__run(e,r);else if(e.onfailure)e.onfailure("timeout");a.removeCustomEvent("onLocalStorageChange",f)}};if(c=="BXAJAXWAIT"){a.addCustomEvent("onLocalStorageChange",f)}else{setTimeout(function(){f({key:"ajax-"+e.lsId,value:c})},10)}}}if(l){e.xhr=a.ajax.xhr();if(!e.xhr)return;if(e.lsId){a.localStorage.set("ajax-"+e.lsId,"BXAJAXWAIT",e.lsTimeout)}e.xhr.open(e.method,e.url,e.async);if(!e.skipBxHeader&&!a.ajax.isCrossDomain(e.url)){e.xhr.setRequestHeader("Bx-ajax","true")}if(e.method=="POST"&&e.preparePost){e.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(typeof e.headers=="object"){for(s=0;s<e.headers.length;s++)e.xhr.setRequestHeader(e.headers[s].name,e.headers[s].value)}if(!!e.onprogress){a.bind(e.xhr,"progress",e.onprogress)}var h=false;var p=e.xhr.onreadystatechange=function(t){if(h)return;if(t==="timeout"){if(e.onfailure){e.onfailure("timeout")}a.onCustomEvent(e.xhr,"onAjaxFailure",["timeout","",e]);e.xhr.onreadystatechange=a.DoNothing;e.xhr.abort();if(e.async){e.xhr=null}}else{if(e.xhr.readyState==4||t=="run"){o=a.ajax.xhrSuccess(e.xhr)?"success":"error";h=true;e.xhr.onreadystatechange=a.DoNothing;if(o=="success"){var r=!!e.skipAuthCheck||a.ajax.isCrossDomain(e.url)?false:e.xhr.getResponseHeader("X-Bitrix-Ajax-Status");if(!!r&&r=="Authorize"){if(e.onfailure){e.onfailure("auth",e.xhr.status)}a.onCustomEvent(e.xhr,"onAjaxFailure",["auth",e.xhr.status,e])}else{var n=e.xhr.responseText;if(e.lsId){a.localStorage.set("ajax-"+e.lsId,n,e.lsTimeout)}a.ajax.__run(e,n)}}else{if(e.onfailure){e.onfailure("status",e.xhr.status)}a.onCustomEvent(e.xhr,"onAjaxFailure",["status",e.xhr.status,e])}if(e.async){e.xhr=null}}}};if(e.async&&e.timeout>0){setTimeout(function(){if(e.xhr&&!h){p("timeout")}}
5887,e.timeout*1e3)}if(e.start){e.xhr.send(e.data);if(!e.async){p("run")}}return e.xhr}};a.ajax.xhr=function(){if(e.XMLHttpRequest){try{return new XMLHttpRequest}catch(a){}}else if(e.ActiveXObject){try{return new e.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new e.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new e.ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}throw new Error("This browser does not support XMLHttpRequest.")}return null};a.ajax.isCrossDomain=function(t,r){r=r||e.location;if(t.indexOf("//")===0){t=r.protocol+t}if(t.indexOf("http")!==0){return false}var o=e.document.createElement("a");o.href=t;return o.protocol!==r.protocol||o.hostname!==r.hostname||a.ajax.getHostPort(o.protocol,o.host)!==a.ajax.getHostPort(r.protocol,r.host)};a.ajax.getHostPort=function(e,a){var t=/:(\d+)$/.exec(a);if(t){return t[1]}else{if(e==="http:"){return"80"}else if(e==="https:"){return"443"}}return""};a.ajax.__prepareOnload=function(t){if(t.length>0){a.ajax["onload_"+o]=null;for(var r=0,n=t.length;r<n;r++){if(t[r].isInternal){t[r].JS=t[r].JS.replace(i.script_onload,"BX.ajax.onload_"+o)}}}a.CaptureEventsGet();a.CaptureEvents(e,"load")};a.ajax.__runOnload=function(){if(null!=a.ajax["onload_"+o]){a.ajax["onload_"+o].apply(e);a.ajax["onload_"+o]=null}var t=a.CaptureEventsGet();if(t){for(var r=0;r<t.length;r++)t[r].apply(e)}};a.ajax.__run=function(e,t){if(!e.processData){if(e.onsuccess){e.onsuccess(t)}a.onCustomEvent(e.xhr,"onAjaxSuccess",[t,e])}else{t=a.ajax.processRequestData(t,e)}};a.ajax._onParseJSONFailure=function(e){this.jsonFailure=true;this.jsonResponse=e;this.jsonProactive=/^\[WAF\]/.test(e)};a.ajax.processRequestData=function(e,t){var r,n=[],s=[];switch(t.dataType.toUpperCase()){case"JSON":a.addCustomEvent(t.xhr,"onParseJSONFailure",a.proxy(a.ajax._onParseJSONFailure,t));r=a.parseJSON(e,t.xhr);a.removeCustomEvent(t.xhr,"onParseJSONFailure",a.proxy(a.ajax._onParseJSONFailure,t));if(!!r&&a.type.isArray(r["bxjs"])){for(var i=0;i<r["bxjs"].length;
5887i++){if(a.type.isNotEmptyString(r["bxjs"][i])){n.push({isInternal:false,JS:r["bxjs"][i],bRunFirst:t.scriptsRunFirst})}else{n.push(r["bxjs"][i])}}}if(!!r&&a.type.isArray(r["bxcss"])){s=r["bxcss"]}break;case"SCRIPT":n.push({isInternal:true,JS:e,bRunFirst:t.scriptsRunFirst});r=e;break;default:var u=a.processHTML(e,t.scriptsRunFirst);r=u.HTML;n=u.SCRIPT;s=u.STYLE;break}var l=false;if(null==o){o=parseInt(Math.random()*1e6);l=true}if(s.length>0)a.loadCSS(s);if(t.emulateOnload)a.ajax.__prepareOnload(n);var c=a.DoNothing;if(t.emulateOnload||l){c=a.defer(function(){if(t.emulateOnload)a.ajax.__runOnload();if(l)o=null;a.onCustomEvent(t.xhr,"onAjaxSuccessFinish",[t])})}try{if(!!t.jsonFailure){throw{type:"json_failure",data:t.jsonResponse,bProactive:t.jsonProactive}}t.scripts=n;a.ajax.processScripts(t.scripts,true);if(t.onsuccess){t.onsuccess(r)}a.onCustomEvent(t.xhr,"onAjaxSuccess",[r,t]);a.ajax.processScripts(t.scripts,false,c)}catch(f){if(t.onfailure)t.onfailure("processing",f);a.onCustomEvent(t.xhr,"onAjaxFailure",["processing",f,t])}};a.ajax.processScripts=function(e,t,r){var o=[],n="";r=r||a.DoNothing;for(var s=0,i=e.length;s<i;s++){if(typeof t!="undefined"&&t!=!!e[s].bRunFirst)continue;if(e[s].isInternal)n+=";"+e[s].JS;else o.push(e[s].JS)}o=a.util.array_unique(o);var u=n.length>0?function(){a.evalGlobal(n)}:a.DoNothing;if(o.length>0){a.load(o,function(){u();r()})}else{u();r()}};a.ajax.prepareData=function(e,t){var r="";if(a.type.isString(e))r=e;else if(null!=e){for(var o in e){if(e.hasOwnProperty(o)){if(r.length>0)r+="&";var n=a.util.urlencode(o);if(t)n=t+"["+n+"]";if(typeof e[o]=="object")r+=a.ajax.prepareData(e[o],n);else r+=n+"="+a.util.urlencode(e[o])}}}return r};a.ajax.xhrSuccess=function(e){return e.status>=200&&e.status<300||e.status===304||e.status===1223||e.status===0};a.ajax.Setup=function(e,a){a=!!a;for(var o in e){if(a)t[o]=e[o];else r[o]=e[o]}};a.ajax.replaceLocalStorageValue=function(e,t,r){if(!!a.localStorage)a.localStorage.set("ajax-"+e,t,r)};a.ajax._uncache=function(e){return e+((e.indexOf("?")!==-1?"&":"?")+"_="+(new Date).getTime())};a.ajax.get=function(e,t,r){if(a.type.isFunction(t)){r=t;t=""}t=a.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return a.ajax({method:"GET",dataType:"html",url:e,data:"",onsuccess:r})};a.ajax.getCaptcha=function(e){return a.ajax.loadJSON("/bitrix/tools/ajax_captcha.php",e)};a.ajax.insertToNode=function(e,r){r=a(r);if(!!r){var o={cancel:false};a.onCustomEvent("onAjaxInsertToNode",[{url:e,node:r,eventArgs:o}]);if(o.cancel===true){return}var n=null;if(!t.denyShowWait){n=a.showWait(r);delete t.denyShowWait}return a.ajax.get(e,function(e){r.innerHTML=e;a.closeWait(r,n)})}};a.ajax.post=function(e,t,r){t=a.ajax.prepareData(t);return a.ajax({method:"POST",dataType:"html",url:e,data:t,onsuccess:r})};a.ajax.promise=function(e){var t=new a.Promise;e.onsuccess=function(e){t.fulfill(e)};e.onfailure=function(e,a){t.reject({reason:e,data:a})};e.onprogress=function(e){if(e.position==0&&e.totalSize==0){t.reject({reason:"progress",data:e})}};var r=a.ajax(e);if(!r){t.reject({reason:"init",data:false})}return t};a.ajax.loadScriptAjax=function(e,t,r){if(a.type.isArray(e)){for(var o=0,s=e.length;o<s;o++){a.ajax.loadScriptAjax(e[o],t,r)}}else{var u=e.replace(/\.js\?.*/,".js");if(i.script_self.test(u))return;if(i.script_self_window.test(u)&&a.CWindow)return;if(i.script_self_admin.test(u)&&a.admin)return;if(typeof n[u]=="undefined"){if(!!r){n[u]="";return a.loadScript(e)}else{return a.ajax({url:e,method:"GET",dataType:"script",processData:true,emulateOnload:false,scriptsRunFirst:true,async:false,start:true,onsuccess:function(e){n[u]=e;if(t)t(e)}})}}else if(t){t(n[u])}}};a.ajax.loadJSON=function(e,t,r,o){if(a.type.isFunction(t)){o=r;r=t;t=""}t=a.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return a.ajax({method:"GET",dataType:"json",url:e,onsuccess:r,onfailure:o})};a.ajax.load=function(e,t){if(!a.type.isArray(e))e=[e];var r=0;if(!a.type.isFunction(t))t=a.DoNothing;var o=function(e){if(a.type.isFunction(this.callback))this.callback(e);if(++r>=s)t()};for(var n=0,s=e.length;n<s;n++){switch(e[n].type.toUpperCase()){case"SCRIPT":a.loadScript([e[n].url],a.proxy(o,e[n]));break;case"CSS":a.loadCSS([e[n].url]);if(++r>=s)t();break;case"JSON":a.ajax.loadJSON(e[n].url,a.proxy(o,e[n]));break;default:a.ajax.get(e[n].url,"",a.proxy(o,e[n]));break}}};a.ajax.submit=function(e,t){if(!e.target){if(null==e.BXFormTarget){var r="formTarget_"+Math.random();e.BXFormTarget=document.body.appendChild(a.create("IFRAME",{props:{name:r,id:r,src:"javascript:void(0)"},style:{display:"none"}}))}e.target=e.BXFormTarget.name}e.BXFormCallback=t;a.bind(e.BXFormTarget,"load",a.proxy(a.ajax._submit_callback,e));a.submit(e);return false};a.ajax.submitComponentForm=function(t,r,o){if(!t.target){if(null==t.BXFormTarget){var n="formTarget_"+Math.random();t.BXFormTarget=document.body.appendChild(a.create("IFRAME",{props:{name:n,id:n,src:"javascript:void(0)"},style:{display:"none"}}))}t.target=t.BXFormTarget.name}if(!!o)var s=a.showWait(r);t.BXFormCallback=function(t){if(!!o)a.closeWait(s);var n=function(){if(!!e.bxcompajaxframeonload){setTimeout(function(){e.bxcompajaxframeonload();e.bxcompajaxframeonload=null},10)}};a(r).innerHTML=t;a.onCustomEvent("onAjaxSuccess",[null,null,n])};a.bind(t.BXFormTarget,"load",a.proxy(a.ajax._submit_callback,t));return true};a.ajax._submit_callback=function(){try{if(this.BXFormTarget.contentWindow.location.href.indexOf("http")!=0)return}catch(e){return}if(this.BXFormCallback)this.BXFormCallback.apply(this,[this.BXFormTarget.contentWindow.document.body.innerHTML]);a.unbindAll(this.BXFormTarget)};a.ajax.prepareForm=function(e,a){a=!!a?a:{};var t,r,o,n=[],s=e.elements.length,i=0,u=0;if(!!e){for(t=0;t<s;t++){o=e.elements[t];if(o.disabled)continue;if(!o.type)continue;switch(o.type.toLowerCase()){case"text":case"textarea":case"password":case"number":case"hidden":case"select-one":n.push({name:o.name,value:o.value});u+=o.name.length+o.value.length;break;case"file":if(!!o.files){for(r=0;r<o.files.length;r++){i++;n.push({name:o.name,value:o.files[r],file:true});u+=o.files[r].size}}break;case"radio":case"checkbox":if(o.checked){n.push({name:o.name,value:o.value});u+=o.name.length+o.value.length}break;case"select-multiple":for(var l=0;l<o.options.length;l++){if(o.options[l].selected){n.push({name:o.name,value:o.options[l].value});u+=o.name.length+o.options[l].length}}break;default:break}}t=0;u=0;var c=a,f,h,p;while(t<n.length){var d=n[t].name.indexOf("[");if(d==-1){c[n[t].name]=n[t].value;c=a;t++}else{f=n[t].name.substring(0,d);h=n[t].name.substring(d+1);p=h.indexOf("]");
5887if(p==-1){if(!c[f])c[f]=[];c=a;t++}else if(p==0){if(!c[f])c[f]=[];c=c[f];n[t].name=""+c.length}else{if(!c[f])c[f]={};c=c[f];n[t].name=h.substring(0,p)+h.substring(p+1)}}}}return{data:a,filesCount:i,roughSize:u}};a.ajax.submitAjax=function(t,r){r=r!==null&&typeof r=="object"?r:{};r.url=r["url"]||t.getAttribute("action");var o=r["data"]||{};r.data=a.ajax.prepareForm(t).data;for(var n in o){if(o.hasOwnProperty(n)){r.data[n]=o[n]}}if(!e["FormData"]){a.ajax(r)}else{var s=function(e){var a=Object.prototype.toString.call(e);return a=="[object File]"||a=="[object Blob]"},i=function(e,a,t){if(!!t&&typeof t=="object"&&!s(t)){for(var r in t){if(t.hasOwnProperty(r)){i(e,a==""?r:a+"["+r+"]",t[r])}}}else e.append(a,!!t?t:"")},u=function(e){var t={};if(null!=e){if(typeof e=="object"){for(var r in e){if(e.hasOwnProperty(r)){var o=a.util.urlencode(r);if(typeof e[r]=="object"&&e[r]["file"]!==true)t[o]=u(e[r]);else if(e[r]["file"]===true)t[o]=e[r]["value"];else t[o]=a.util.urlencode(e[r])}}}else t=a.util.urlencode(e)}return t},l=new e.FormData;if(r.method!=="POST"){r.data=a.ajax.prepareData(r.data);if(r.data){r.url+=(r.url.indexOf("?")!==-1?"&":"?")+r.data;r.data=""}}else{if(r.preparePost===true)r.data=u(r.data);i(l,"",r.data);r.data=l}r.preparePost=false;r.start=false;var c=a.ajax(r);if(!!r["onprogress"])c.upload.addEventListener("progress",function(e){var a=null;if(e.lengthComputable&&(e.total||e["totalSize"])){a=e.loaded*100/(e.total||e["totalSize"])}r["onprogress"](e,a)});c.send(l)}};a.ajax.UpdatePageData=function(e){if(e.TITLE)a.ajax.UpdatePageTitle(e.TITLE);if(e.WINDOW_TITLE||e.TITLE)a.ajax.UpdateWindowTitle(e.WINDOW_TITLE||e.TITLE);if(e.NAV_CHAIN)a.ajax.UpdatePageNavChain(e.NAV_CHAIN);if(e.CSS&&e.CSS.length>0)a.loadCSS(e.CSS);if(e.SCRIPTS&&e.SCRIPTS.length>0){var t=function(r,o,n){if(!!o&&a.type.isArray(o.scripts)){for(var s=0,i=e.SCRIPTS.length;s<i;s++){o.scripts.push({isInternal:false,JS:e.SCRIPTS[s]})}}else{a.loadScript(e.SCRIPTS,n)}a.removeCustomEvent("onAjaxSuccess",t)};a.addCustomEvent("onAjaxSuccess",t)}else{var r=function(e,t,o){if(a.type.isFunction(o)){o()}a.removeCustomEvent("onAjaxSuccess",r)};a.addCustomEvent("onAjaxSuccess",r)}};a.ajax.UpdatePageTitle=function(e){var t=a("pagetitle");if(t){t.removeChild(t.firstChild);if(!t.firstChild)t.appendChild(document.createTextNode(e));else t.insertBefore(document.createTextNode(e),t.firstChild)}};a.ajax.UpdateWindowTitle=function(e){document.title=e};a.ajax.UpdatePageNavChain=function(e){var t=a("navigation");if(t){t.innerHTML=e}};a.userOptions={options:null,bSend:false,delay:5e3,path:"/bitrix/admin/user_options.php?"};a.userOptions.setAjaxPath=function(e){a.userOptions.path=e.indexOf("?")==-1?e+"?":e+"&"};a.userOptions.save=function(e,t,r,o,n){if(null==a.userOptions.options)a.userOptions.options={};n=!!n;a.userOptions.options[e+"."+t+"."+r]=[e,t,r,o,n];var s=a.userOptions.__get();if(s!="")document.cookie=a.message("COOKIE_PREFIX")+"_LAST_SETTINGS="+encodeURIComponent(s)+"&sessid="+a.bitrix_sessid()+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";if(!a.userOptions.bSend){a.userOptions.bSend=true;setTimeout(function(){a.userOptions.send(null)},a.userOptions.delay)}};a.userOptions.send=function(e){var t=a.userOptions.__get();a.userOptions.options=null;a.userOptions.bSend=false;if(t!=""){document.cookie=a.message("COOKIE_PREFIX")+"_LAST_SETTINGS=; path=/;";a.ajax({method:"GET",dataType:"html",processData:false,cache:false,url:a.userOptions.path+t+"&sessid="+a.bitrix_sessid(),onsuccess:e})}};a.userOptions.del=function(e,t,r,o){a.ajax.get(a.userOptions.path+"action=delete&c="+e+"&n="+t+(r==true?"&common=Y":"")+"&sessid="+a.bitrix_sessid(),o)};a.userOptions.__get=function(){if(!a.userOptions.options)return"";var e="",t=-1,r="",o,n;for(n in a.userOptions.options){if(a.userOptions.options.hasOwnProperty(n)){o=a.userOptions.options[n];if(r!=o[0]+"."+o[1]){t++;e+="&p["+t+"][c]="+a.util.urlencode(o[0]);e+="&p["+t+"][n]="+a.util.urlencode(o[1]);if(o[4]==true)e+="&p["+t+"][d]=Y";r=o[0]+"."+o[1]}e+="&p["+t+"][v]["+a.util.urlencode(o[2])+"]="+a.util.urlencode(o[3])}}return e.substr(1)};a.ajax.history={expected_hash:"",obParams:null,obFrame:null,obImage:null,obTimer:null,bInited:false,bHashCollision:false,bPushState:!!(history.pushState&&a.type.isFunction(history.pushState)),startState:null,init:function(t){if(a.ajax.history.bInited)return;this.obParams=t;var r=this.obParams.getState();if(a.ajax.history.bPushState){a.ajax.history.expected_hash=e.location.pathname;if(e.location.search)a.ajax.history.expected_hash+=e.location.search;a.ajax.history.put(r,a.ajax.history.expected_hash,"",true);setTimeout(function(){a.bind(e,"popstate",a.ajax.history.__hashListener)},500)}else{a.ajax.history.expected_hash=e.location.hash;if(!a.ajax.history.expected_hash||a.ajax.history.expected_hash=="#")a.ajax.history.expected_hash="__bx_no_hash__";u.put(a.ajax.history.expected_hash,r);a.ajax.history.obTimer=setTimeout(a.ajax.history.__hashListener,500);if(a.browser.IsIE()){a.ajax.history.obFrame=document.createElement("IF
5887RAME");a.hide_object(a.ajax.history.obFrame);document.body.appendChild(a.ajax.history.obFrame);a.ajax.history.obFrame.contentWindow.document.open();a.ajax.history.obFrame.contentWindow.document.write(a.ajax.history.expected_hash);a.ajax.history.obFrame.contentWindow.document.close()}else if(a.browser.IsOpera()){a.ajax.history.obImage=document.createElement("IMG");a.hide_object(a.ajax.history.obImage);document.body.appendChild(a.ajax.history.obImage);a.ajax.history.obImage.setAttribute("src","javascript:location.href = 'javascript:BX.ajax.history.__hashListener();';")}}a.ajax.history.bInited=true},__hashListener:function(t){t=t||e.event||{state:false};if(a.ajax.history.bPushState){a.ajax.history.obParams.setState(t.state||a.ajax.history.startState)}else{if(a.ajax.history.obTimer){e.clearTimeout(a.ajax.history.obTimer);a.ajax.history.obTimer=null}var r;if(null!=a.ajax.history.obFrame)r=a.ajax.history.obFrame.contentWindow.document.body.innerText;else r=e.location.hash;if(!r||r=="#")r="__bx_no_hash__";if(r.indexOf("#")==0)r=r.substring(1);if(r!=a.ajax.history.expected_hash){var o=u.get(r);if(o){a.ajax.history.obParams.setState(o);a.ajax.history.expected_hash=r;if(null!=a.ajax.history.obFrame){var n=r=="__bx_no_hash__"?"":r;if(e.location.hash!=n&&e.location.hash!="#"+n)e.location.hash=n}}}a.ajax.history.obTimer=setTimeout(a.ajax.history.__hashListener,500)}},put:function(t,r,o,n){if(this.bPushState){if(!n){history.pushState(t,"",r)}else{a.ajax.history.startState=t}}else{if(typeof o!="undefined")r=o;else r="view"+r;u.put(r,t);a.ajax.history.expected_hash=r;e.location.hash=a.util.urlencode(r);if(null!=a.ajax.history.obFrame){a.ajax.history.obFrame.contentWindow.document.open();a.ajax.history.obFrame.contentWindow.document.write(r);a.ajax.history.obFrame.contentWindow.document.close()}}},checkRedirectStart:function(t,r){var o=e.location.hash;if(o.substring(0,1)=="#")o=o.substring(1);var n=o.substring(0,5);if(n=="view/"||n=="view%"){a.ajax.history.bHashCollision=true;document.write("<"+'div id="__ajax_hash_collision_'+r+'" style="display: none;">')}},checkRedirectFinish:function(t,r){document.write("</div>");var o=e.location.hash;if(o.substring(0,1)=="#")o=o.substring(1);a.ready(function(){var e=o.substring(0,5);if(e=="view/"||e=="view%"){var n=a("__ajax_hash_collision_"+r);var s=n.firstChild;a.cleanNode(s);n.style.display="block";if(e!="view%")o=a.util.urlencode(o);o+=(o.indexOf("%3F")==-1?"%3F":"%26")+t+"="+r;var i="/bitrix/tools/ajax_redirector.php?hash="+o;a.ajax.insertToNode(i,s)}})}};a.ajax.component=function(e){this.node=e};a.ajax.component.prototype.getState=function(){var t={node:this.node,title:e.document.title,data:a(this.node).innerHTML};var r=a("navigation");if(null!=r)t.nav_chain=r.innerHTML;a.onCustomEvent(a(t.node),"onComponentAjaxHistoryGetState",[t]);return t};a.ajax.component.prototype.setState=function(e){a(e.node).innerHTML=e.data;a.ajax.UpdatePageTitle(e.title);if(e.nav_chain){a.ajax.UpdatePageNavChain(e.nav_chain)}a.onCustomEvent(a(e.node),"onComponentAjaxHistorySetState",[e])};var u={arHistory:{},put:function(e,a){this.arHistory[e]=a},get:function(e){return this.arHistory[e]}};a.ajax.FormData=function(){this.elements=[];this.files=[];this.features={};this.isSupported();this.log("BX FormData init")};a.ajax.FormData.isSupported=function(){var e=new a.ajax.FormData;var t=e.features.supported;e=null;return t};a.ajax.FormData.prototype.log=function(e){if(false){try{if(a.browser.IsIE())e=JSON.stringify(e);console.log(e)}catch(t){}}};a.ajax.FormData.prototype.isSupported=function(){var a={};a.fileReader=e.FileReader&&e.FileReader.prototype.readAsBinaryString;a.readFormData=a.sendFormData=!!e.FormData;a.supported=!!(a.readFormData&&a.sendFormData);this.features=a;this.log("features:");this.log(a);return a.supported};a.ajax.FormData.prototype.append=function(e,a){if(typeof a==="object"){this.files.push({name:e,value:a})}else{this.elements.push({name:e,value:a})}};a.ajax.FormData.prototype.send=function(e,t,r,o){this.log("FD send");this.xhr=a.ajax({method:"POST",dataType:"html",url:e,onsuccess:t,onfailure:o,start:false,preparePost:false});if(r){this.xhr.upload.addEventListener("progress",function(e){if(e.lengthComputable)r(e.loaded/(e.total||e.totalSize))},false)}if(this.features.readFormData&&this.features.sendFormData){var n=new FormData;this.log("use browser formdata");for(var s in this.elements){if(this.elements.hasOwnProperty(s))n.append(this.elements[s].name,this.elements[s].value)}
5887for(s in this.files){if(this.files.hasOwnProperty(s))n.append(this.files[s].name,this.files[s].value)}this.xhr.send(n)}return this.xhr};a.addCustomEvent("onAjaxFailure",a.debug)})(window); 5888/* End */ 5889; 5890; /* Start:"a:4:{s:4:"full";s:48:"/bitrix/js/main/json/json2.min.js?14580310403467";s:6:"source";s:33:"/bitrix/js/main/json/json2.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 5891 5892var JSON;if(!JSON){JSON={};} 5893(function(){'use strict';function f(n){return n<10?'0'+n:n;} 5894if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ 5895f(this.getUTCMonth()+1)+'-'+ 5896f(this.getUTCDate())+'T'+ 5897f(this.getUTCHours())+':'+ 5898f(this.getUTCMinutes())+':'+ 5899f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} 5900var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} 5901function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} 5902if(typeof rep==='function'){value=rep.call(holder,key,value);} 5903switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} 5904gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';} 5905v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;} 5906if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}} 5907v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}} 5908if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;} 5909rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');} 5910return str('',{'':value});};} 5911if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}} 5912return reviver.call(holder,key,value);} 5913text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+ 5914('0000'+a.charCodeAt(0).toString(16)).slice(-4);});} 5915if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;} 5916throw new SyntaxError('JSON.parse');};}}()); 5917/* End */ 5918; 5919; /* Start:"a:4:{s:4:"full";s:50:"/bitrix/js/main/core/core_ls.min.js?14580310417365";s:6:"source";s:31:"/bitrix/js/main/core/core_ls.js";s:3:"min";s:35:"/bitrix/js/main/core/core_ls.min.js";s:3:"map";s:35:"/bitrix/js/main/core/core_ls.map.js";}"*/ 5920(function(e){if(e.BX.localStorage)return;var t=e.BX,r=null,o=null,a="_bxCurrentKey",i=false;t.localStorage=function(){this.keyChanges={};t.bind(t.browser.IsIE()&&!t.browser.IsIE9()?document:e,"storage",t.proxy(this._onchange,this));setInterval(t.delegate(this._clear,this),5e3)};t.localStorage.checkBrowser=function(){return i};t.localStorage.set=function(e,r,o){return t.localStorage.instance().set(e,r,o)};t.localStorage.get=function(e){return t.localStorage.instance().get(e)};t.localStorage.remove=function(e){return t.localStorage.instance().remove(e)};t.localStorage.instance=function(){if(!r){var e=t.localStorage.checkBrowser();if(e=="native")r=new t.localStorage;else if(e=="ie8")r=new t.localStorageIE8;else if(e=="ie7")r=new t.localStorageIE7;else{r={set:t.DoNothing,get:function(){return null},remove:t.DoNothing}}}return r};t.localStorage.prototype.prefix=function(){if(!o){o="bx"+t.message("USER_ID")+"-"+(t.message.SITE_ID?t.message("S
5920ITE_ID"):"admin")+"-"}return o};t.localStorage.prototype._onchange=function(r){r=r||e.event;if(!r.key)return;if(t.browser.DetectIeVersion()>0&&this.keyChanges[r.key]){this.keyChanges[r.key]=false;return}if(!!r.key&&r.key.substring(0,this.prefix().length)==this.prefix()){var o={key:r.key.substring(this.prefix().length,r.key.length),value:!!r.newValue?this._decode(r.newValue.substring(11,r.newValue.length)):null,oldValue:!!r.oldValue?this._decode(r.oldValue.substring(11,r.oldValue.length)):null};switch(o.key){case"BXGCE":if(o.value){t.onCustomEvent(o.value.e,o.value.p)}break;default:if(r.newValue)t.onCustomEvent(e,"onLocalStorageSet",[o]);if(r.oldValue&&!r.newValue)t.onCustomEvent(e,"onLocalStorageRemove",[o]);t.onCustomEvent(e,"onLocalStorageChange",[o]);break}}};t.localStorage.prototype._clear=function(){var e=+new Date,t,r;for(r=0;r<localStorage.length;r++){t=localStorage.key(r);if(t.substring(0,2)=="bx"){var o=localStorage.getItem(t).split(":",1)*1e3;if(e>=o)localStorage.removeItem(t)}}};t.localStorage.prototype._encode=function(e){if(typeof e=="object")e=JSON.stringify(e);else e=e.toString();return e};t.localStorage.prototype._decode=function(e){var t=null;if(!!e){try{t=JSON.parse(e)}catch(r){t=e}}return t};t.localStorage.prototype._trigger_error=function(e,r,o,a){t.onCustomEvent(this,"onLocalStorageError",[e,{key:r,value:o,ttl:a}])};t.localStorage.prototype.set=function(e,t,r){if(!r||r<=0)r=60;if(e==undefined||e==null||t==undefined)return false;this.keyChanges[this.prefix()+e]=true;try{localStorage.setItem(this.prefix()+e,Math.round(+new Date/1e3)+r+":"+this._encode(t))}catch(o){this._trigger_error(o,e,t,r)}};t.localStorage.prototype.get=function(e){var t=localStorage.getItem(this.prefix()+e);if(t){var r=t.split(":",1)*1e3;if(+new Date<=r){t=t.substring(11,t.length);return this._decode(t)}}return null};t.localStorage.prototype.remove=function(e){this.keyChanges[this.prefix()+e]=true;localStorage.removeItem(this.prefix()+e)};t.localStorageIE7=function(){this.NS="BXLocalStorage";this.__current_state={};this.keyChanges={};t.ready(t.delegate(this._Init,this))};t.extend(t.localStorageIE7,t.localStorage);t.localStorageIE7.prototype._Init=function(){this.storage_element=document.body.appendChild(t.create("DIV"));this.storage_element.addBehavior("#default#userData");this.storage_element.load(this.NS);var e=this.storage_element.xmlDocument,r=e.firstChild.attributes.length;for(var o=0;o<r;o++){if(!!e.firstChild.attributes[o]){var a=e.firstChild.attributes[o].nodeName;if(a.substring(0,this.prefix().length)==this.prefix()){this.__current_state[a]=e.firstChild.attributes[o].nodeValue}}}setInterval(t.delegate(this._Listener,this),500);setInterval(t.delegate(this._clear,this),5e3)};t.localStorageIE7.prototype._Listener=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument,r=t.firstChild.attributes.length,o,a,i;var l={},s=[];for(o=0;o<r;o++){if(!!t.firstChild.attributes[o]){a=t.firstChild.attributes[o].nodeName;if(a.substring(0,this.prefix().length)==this.prefix()){i=t.firstChild.attributes[o].nodeValue;if(this.__current_state[a]!=i){s.push({key:a,newValue:i,oldValue:this.__current_state[a]})}l[a]=i;delete this.__current_state[a]}}}for(o in this.__current_state){if(this.__current_state.hasOwnProperty(o)){s.push({key:o,newValue:undefined,oldValue:this.__current_state[o]})}}this.__current_state=l;for(o=0;o<s.length;o++){this._onchange(s[o])}};t.localStorageIE7.prototype._clear=function(){this.storage_element.load(this.NS);var e=this.storage_element.xmlDocument,t=e.firstChild.attributes.length,r=+new Date,o,a,i,l;for(o=0;o<t;o++){if(!!e.firstChild.attributes[o]){a=e.firstChild.attributes[o].nodeName;if(a.substring(0,2)=="bx"){i=e.firstChild.attributes[o].nodeValue;l=i.split(":",1)*1e3;if(r>=l){e.firstChild.removeAttribute(a)}}}}this.storage_element.save(this.NS)};t.localStorageIE7.prototype.set=function(e,t,r){if(!r||r<=0)r=60;try{this.storage_element.load(this.NS);var o=this.storage_element.xmlDocument;this.keyChanges[this.prefix()+e]=true;o.firstChild.setAttribute(this.prefix()+e,Math.round(+new Date/1e3)+r+":"+this._encode(t));this.storage_element.save(this.NS)}catch(a){this._trigger_error(a,e,t,r)}};t.localStorageIE7.prototype.get=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument;var r=t.firstChild.getAttribute(this.prefix()+e);if(r){var o=r.split(":",1)*1e3;if(+new Date<=o){r=r.substring(11,r.length);return this._decode(r)}}return null};t.localStorageIE7.prototype.remove=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument;t.firstChild.removeAttribute(this.prefix()+e);this.keyChanges[this.prefix()+e]=true;this.storage_element.save(this.NS)};t.localStorageIE8=function(){this.key=a;this.currentKey=null;this.currentValue=null;t.localStorageIE8.superclass.constructor.apply(this)};t.extend(t.localStorageIE8,t.localStorage);t.localStorageIE8.prototype._onchange=function(e){if(null==this.currentKey){this.currentKey=localStorage.getItem(this.key);if(this.currentKey){this.currentValue=localStorage.getItem(this.prefix()+this.currentKey)}}else{e={key:this.prefix()+this.currentKey,newValue:localStorage.getItem(this.prefix()+this.currentKey),oldValue:this.currentValue};this.currentKey=null;this.currentValue=null;if(this.keyChanges[e.key]){this.keyChanges[e.key]=false;return}t.localStorageIE8.superclass._onchange.apply(this,[e])}};t.localStorageIE8.prototype.set=function(e,r,o){this.currentKey=null;this.keyChanges[this.prefix()+e]=true;try{localStorage.setItem(this.key,e);t.localStorageIE8.superclass.set.apply(this,arguments)}catch(a){this._trigger_error(a,e,r,o)}};t.localStorageIE8.prototype.remove=function(e){this.currentKey=null;this.keyChanges[this.prefix()+e]=true;localStorage.setItem(this.key,e);t.localStorageIE8.superclass.remove.apply(this,arguments)};t.onGlobalCustomEvent=function(e,r,o){if(!!t.localStorage.checkBrowser())t.localStorage.set("BXGCE",{e:e,p:r},1);if(!o)t.onCustomEvent(e,r)};try{i=!!localStorage.setItem}catch(l){}if(i){i="native";var s=t.browser.IsIE()&&!t.browser.IsIE9()?document:e,n=function(r){if(typeof(r||e.event).key=="undefined")i="ie8";t.unbind(s,"storage",n);t.localStorage.instance()};t.bind(s,"storage",n);try{localStorage.setItem(a,null)}catch(l){i=false;t.localStorage.instance()}}else if(t.browser.IsIE7()){i="ie7";t.localStorage.instance()}})(window); 5921/* End */ 5922; 5923; /* Start:"a:4:{s:4:"full";
5923s:45:"/bitrix/js/main/session.min.js?14580310402511";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";}"*/ 5924function CBXSession(){var e=this;this.mess={};this.timeout=null;this.sessid=null;this.bShowMess=true;this.dateStart=new Date;this.dateInput=new Date;this.dateCheck=new Date;this.activityInterval=0;this.notifier=null;this.Expand=function(t,i,s,n){this.timeout=t;this.sessid=i;this.bShowMess=s;this.key=n;BX.ready(function(){BX.bind(document,"keypress",e.OnUserInput);BX.bind(document.body,"mousemove",e.OnUserInput);BX.bind(document.body,"click",e.OnUserInput);setTimeout(e.CheckSession,(e.timeout-60)*1e3)})};this.OnUserInput=function(){var t=new Date;e.dateInput.setTime(t.valueOf())};this.CheckSession=function(){var t=new Date;if(t.valueOf()-e.dateCheck.valueOf()<3e4)return;e.activityInterval=Math.round((e.dateInput.valueOf()-e.dateStart.valueOf())/1e3);e.dateStart.setTime(e.dateInput.valueOf());var i=e.activityInterval>e.timeout?e.timeout-60:e.activityInterval;var s={method:"GET",dataType:"html",url:"/bitrix/tools/public_session.php?sessid="+e.sessid+"&interval="+i+"&k="+e.key,data:"",onsuccess:function(t){e.CheckResult(t)},lsId:"sess_expand",lsTimeout:60};if(i>0){s.lsForce=true}BX.ajax(s)};this.CheckResult=function(t){if(t=="SESSION_EXPIRED"){if(e.bShowMess){if(!e.notifier){e.notifier=document.body.appendChild(BX.create("DIV",{props:{className:"bx-session-message"},style:{top:"0px",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>'+e.mess.messSessExpired}));var i=BX.GetWindowScrollPos();var s=BX.GetWindowInnerSize();e.notifier.style.left=parseInt(i.scrollLeft+s.innerWidth/2-parseInt(e.notifier.clientWidth)/2)+"px";if(BX.browser.IsIE()){e.notifier.style.top=i.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=""}}else{var n;if(t=="SESSION_CHANGED")n=e.timeout-60;else n=e.activityInterval<60?60:e.activityInterval>e.timeout?e.timeout-60:e.activityInterval;var o=new Date;e.dateCheck.setTime(o.valueOf());setTimeout(e.CheckSession,n*1e3)}};this.Close=function(){this.notifier.style.display="none"}}var bxSession=new CBXSession; 5925/* End */ 5926; 5927; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/core/core_ajax.min.js?149879921321435";s:6:"source";s:33:"/bitrix/js/main/core/core_ajax.js";s:3:"min";s:37:"/bitrix/js/main/core/core_ajax.min.js";s:3:"map";s:37:"/bitrix/js/main/core/core_ajax.map.js";}"*/ 5928(function(e){if(e.BX.ajax)return;var a=e.BX,t={},r={method:"GET",dataType:"html",timeout:0,async:true,processData:true,scriptsRunFirst:false,emulateOnload:true,skipAuthCheck:false,start:true,cache:true,preparePost:true,headers:false,lsTimeout:30,lsForce:false},o=null,n={},s=[],i={url_utf:/[^\034-\254]+/g,script_self:/\/bitrix\/js\/main\/core\/core(_ajax)*.js$/i,script_self_window:/\/bitrix\/js\/main\/core\/core_window.js$/i,script_self_admin:/\/bitrix\/js\/main\/core\/core_admin.js$/i,script_onload:/window.onload/g};a.ajax=function(e){var o,n;if(!e||!e.url||!a.type.isString(e.url)){return false}for(var s in t)if(typeof e[s]=="undefined")e[s]=t[s];t={};for(s in r)if(typeof e[s]=="undefined")e[s]=r[s];e.method=e.method.toUpperCase();if(!a.localStorage)e.lsId=null;if(a.browser.IsIE()){var u=i.url_utf.exec(e.url);if(u){do{e.url=e.url.replace(u,a.util.urlencode(u));u=i.url_utf.exec(e.url)}while(u)}}if(e.dataType=="json")e.emulateOnload=false;if(!e.cache&&e.method=="GET")e.url=a.ajax._uncache(e.url);if(e.method=="POST"&&e.preparePost){e.data=a.ajax.prepareData(e.data)}var l=true;if(e.lsId&&!e.lsForce){var c=a.localStorage.get("ajax-"+e.lsId);if(c!==null){l=false;var f=function(t){if(t.key=="ajax-"+e.lsId&&t.value!="BXAJAXWAIT"){var r=t.value,o=!!t.oldValue&&r==null;if(!o)a.ajax.__run(e,r);else if(e.onfailure)e.onfailure("timeout");a.removeCustomEvent("onLocalStorageChange",f)}};if(c=="BXAJAXWAIT"){a.addCustomEvent("onLocalStorageChange",f)}else{setTimeout(function(){f({key:"ajax-"+e.lsId,value:c})},10)}}}if(l){e.xhr=a.ajax.xhr();if(!e.xhr)return;if(e.lsId){a.localStorage.set("ajax-"+e.lsId,"BXAJAXWAIT",e.lsTimeout)}e.xhr.open(e.method,e.url,e.async);if(!e.skipBxHeader&&!a.ajax.isCrossDomain(e.url)){e.xhr.setRequestHeader("Bx-ajax","true")}if(e.method=="POST"&&e.preparePost){e.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(typeof e.headers=="object"){for(s=0;s<e.headers.length;s++)e.xhr.setRequestHeader(e.headers[s].name,e.headers[s].value)}if(!!e.onprogress){a.bind(e.xhr,"progress",e.onprogress)}var h=false;var p=e.xhr.onreadystatechange=function(t){if(h)return;if(t==="timeout"){if(e.onfailure){e.onfailure("timeout")}a.onCustomEvent(e.xhr,"onAjaxFailure",["timeout","",e]);e.xhr.onreadystatechange=a.DoNothing;e.xhr.abort();if(e.async){e.xhr=null}}else{if(e.xhr.readyState==4||t=="run"){o=a.ajax.xhrSuccess(e.xhr)?"success":"error";h=true;e.xhr.onreadystatechange=a.DoNothing;if(o=="success"){var r=!!e.skipAuthCheck||a.ajax.isCrossDomain(e.url)?false:e.xhr.getResponseHeader("X-Bitrix-Ajax-Status");
5928if(!!r&&r=="Authorize"){if(e.onfailure){e.onfailure("auth",e.xhr.status)}a.onCustomEvent(e.xhr,"onAjaxFailure",["auth",e.xhr.status,e])}else{var n=e.xhr.responseText;if(e.lsId){a.localStorage.set("ajax-"+e.lsId,n,e.lsTimeout)}a.ajax.__run(e,n)}}else{if(e.onfailure){e.onfailure("status",e.xhr.status)}a.onCustomEvent(e.xhr,"onAjaxFailure",["status",e.xhr.status,e])}if(e.async){e.xhr=null}}}};if(e.async&&e.timeout>0){setTimeout(function(){if(e.xhr&&!h){p("timeout")}},e.timeout*1e3)}if(e.start){e.xhr.send(e.data);if(!e.async){p("run")}}return e.xhr}};a.ajax.xhr=function(){if(e.XMLHttpRequest){try{return new XMLHttpRequest}catch(a){}}else if(e.ActiveXObject){try{return new e.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new e.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new e.ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}throw new Error("This browser does not support XMLHttpRequest.")}return null};a.ajax.isCrossDomain=function(t,r){r=r||e.location;if(t.indexOf("//")===0){t=r.protocol+t}if(t.indexOf("http")!==0){return false}var o=e.document.createElement("a");o.href=t;return o.protocol!==r.protocol||o.hostname!==r.hostname||a.ajax.getHostPort(o.protocol,o.host)!==a.ajax.getHostPort(r.protocol,r.host)};a.ajax.getHostPort=function(e,a){var t=/:(\d+)$/.exec(a);if(t){return t[1]}else{if(e==="http:"){return"80"}else if(e==="https:"){return"443"}}return""};a.ajax.__prepareOnload=function(t){if(t.length>0){a.ajax["onload_"+o]=null;for(var r=0,n=t.length;r<n;r++){if(t[r].isInternal){t[r].JS=t[r].JS.replace(i.script_onload,"BX.ajax.onload_"+o)}}}a.CaptureEventsGet();a.CaptureEvents(e,"load")};a.ajax.__runOnload=function(){if(null!=a.ajax["onload_"+o]){a.ajax["onload_"+o].apply(e);a.ajax["onload_"+o]=null}var t=a.CaptureEventsGet();if(t){for(var r=0;r<t.length;r++)t[r].apply(e)}};a.ajax.__run=function(e,t){if(!e.processData){if(e.onsuccess){e.onsuccess(t)}a.onCustomEvent(e.xhr,"onAjaxSuccess",[t,e])}else{t=a.ajax.processRequestData(t,e)}};a.ajax._onParseJSONFailure=function(e){this.jsonFailure=true;this.jsonResponse=e;this.jsonProactive=/^\[WAF\]/.test(e)};a.ajax.processRequestData=function(e,t){var r,n=[],s=[];switch(t.dataType.toUpperCase()){case"JSON":a.addCustomEvent(t.xhr,"onParseJSONFailure",a.proxy(a.ajax._onParseJSONFailure,t));r=a.parseJSON(e,t.xhr);a.removeCustomEvent(t.xhr,"onParseJSONFailure",a.proxy(a.ajax._onParseJSONFailure,t));if(!!r&&a.type.isArray(r["bxjs"])){for(var i=0;i<r["bxjs"].length;
5928i++){if(a.type.isNotEmptyString(r["bxjs"][i])){n.push({isInternal:false,JS:r["bxjs"][i],bRunFirst:t.scriptsRunFirst})}else{n.push(r["bxjs"][i])}}}if(!!r&&a.type.isArray(r["bxcss"])){s=r["bxcss"]}break;case"SCRIPT":n.push({isInternal:true,JS:e,bRunFirst:t.scriptsRunFirst});r=e;break;default:var u=a.processHTML(e,t.scriptsRunFirst);r=u.HTML;n=u.SCRIPT;s=u.STYLE;break}var l=false;if(null==o){o=parseInt(Math.random()*1e6);l=true}if(s.length>0)a.loadCSS(s);if(t.emulateOnload)a.ajax.__prepareOnload(n);var c=a.DoNothing;if(t.emulateOnload||l){c=a.defer(function(){if(t.emulateOnload)a.ajax.__runOnload();if(l)o=null;a.onCustomEvent(t.xhr,"onAjaxSuccessFinish",[t])})}try{if(!!t.jsonFailure){throw{type:"json_failure",data:t.jsonResponse,bProactive:t.jsonProactive}}t.scripts=n;a.ajax.processScripts(t.scripts,true);if(t.onsuccess){t.onsuccess(r)}a.onCustomEvent(t.xhr,"onAjaxSuccess",[r,t]);a.ajax.processScripts(t.scripts,false,c)}catch(f){if(t.onfailure)t.onfailure("processing",f);a.onCustomEvent(t.xhr,"onAjaxFailure",["processing",f,t])}};a.ajax.processScripts=function(e,t,r){var o=[],n="";r=r||a.DoNothing;for(var s=0,i=e.length;s<i;s++){if(typeof t!="undefined"&&t!=!!e[s].bRunFirst)continue;if(e[s].isInternal)n+=";"+e[s].JS;else o.push(e[s].JS)}o=a.util.array_unique(o);var u=n.length>0?function(){a.evalGlobal(n)}:a.DoNothing;if(o.length>0){a.load(o,function(){u();r()})}else{u();r()}};a.ajax.prepareData=function(e,t){var r="";if(a.type.isString(e))r=e;else if(null!=e){for(var o in e){if(e.hasOwnProperty(o)){if(r.length>0)r+="&";var n=a.util.urlencode(o);if(t)n=t+"["+n+"]";if(typeof e[o]=="object")r+=a.ajax.prepareData(e[o],n);else r+=n+"="+a.util.urlencode(e[o])}}}return r};a.ajax.xhrSuccess=function(e){return e.status>=200&&e.status<300||e.status===304||e.status===1223||e.status===0};a.ajax.Setup=function(e,a){a=!!a;for(var o in e){if(a)t[o]=e[o];else r[o]=e[o]}};a.ajax.replaceLocalStorageValue=function(e,t,r){if(!!a.localStorage)a.localStorage.set("ajax-"+e,t,r)};a.ajax._uncache=function(e){return e+((e.indexOf("?")!==-1?"&":"?")+"_="+(new Date).getTime())};a.ajax.get=function(e,t,r){if(a.type.isFunction(t)){r=t;t=""}t=a.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return a.ajax({method:"GET",dataType:"html",url:e,data:"",onsuccess:r})};a.ajax.getCaptcha=function(e){return a.ajax.loadJSON("/bitrix/tools/ajax_captcha.php",e)};a.ajax.insertToNode=function(e,r){r=a(r);if(!!r){var o={cancel:false};a.onCustomEvent("onAjaxInsertToNode",[{url:e,node:r,eventArgs:o}]);if(o.cancel===true){return}var n=null;if(!t.denyShowWait){n=a.showWait(r);delete t.denyShowWait}return a.ajax.get(e,function(e){r.innerHTML=e;a.closeWait(r,n)})}};a.ajax.post=function(e,t,r){t=a.ajax.prepareData(t);return a.ajax({method:"POST",dataType:"html",url:e,data:t,onsuccess:r})};a.ajax.promise=function(e){var t=new a.Promise;e.onsuccess=function(e){t.fulfill(e)};e.onfailure=function(e,a){t.reject({reason:e,data:a})};e.onprogress=function(e){if(e.position==0&&e.totalSize==0){t.reject({reason:"progress",data:e})}};var r=a.ajax(e);if(!r){t.reject({reason:"init",data:false})}return t};a.ajax.loadScriptAjax=function(e,t,r){if(a.type.isArray(e)){for(var o=0,s=e.length;o<s;o++){a.ajax.loadScriptAjax(e[o],t,r)}}else{var u=e.replace(/\.js\?.*/,".js");if(i.script_self.test(u))return;if(i.script_self_window.test(u)&&a.CWindow)return;if(i.script_self_admin.test(u)&&a.admin)return;if(typeof n[u]=="undefined"){if(!!r){n[u]="";return a.loadScript(e)}else{return a.ajax({url:e,method:"GET",dataType:"script",processData:true,emulateOnload:false,scriptsRunFirst:true,async:false,start:true,onsuccess:function(e){n[u]=e;if(t)t(e)}})}}else if(t){t(n[u])}}};a.ajax.loadJSON=function(e,t,r,o){if(a.type.isFunction(t)){o=r;r=t;t=""}t=a.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return a.ajax({method:"GET",dataType:"json",url:e,onsuccess:r,onfailure:o})};a.ajax.load=function(e,t){if(!a.type.isArray(e))e=[e];var r=0;if(!a.type.isFunction(t))t=a.DoNothing;var o=function(e){if(a.type.isFunction(this.callback))this.callback(e);if(++r>=s)t()};for(var n=0,s=e.length;n<s;n++){switch(e[n].type.toUpperCase()){case"SCRIPT":a.loadScript([e[n].url],a.proxy(o,e[n]));break;case"CSS":a.loadCSS([e[n].url]);if(++r>=s)t();break;case"JSON":a.ajax.loadJSON(e[n].url,a.proxy(o,e[n]));break;default:a.ajax.get(e[n].url,"",a.proxy(o,e[n]));break}}};a.ajax.submit=function(e,t){if(!e.target){if(null==e.BXFormTarget){var r="formTarget_"+Math.random();e.BXFormTarget=document.body.appendChild(a.create("IFRAME",{props:{name:r,id:r,src:"javascript:void(0)"},style:{display:"none"}}))}e.target=e.BXFormTarget.name}e.BXFormCallback=t;a.bind(e.BXFormTarget,"load",a.proxy(a.ajax._submit_callback,e));a.submit(e);return false};a.ajax.submitComponentForm=function(t,r,o){if(!t.target){if(null==t.BXFormTarget){var n="formTarget_"+Math.random();t.BXFormTarget=document.body.appendChild(a.create("IFRAME",{props:{name:n,id:n,src:"javascript:void(0)"},style:{display:"none"}}))}t.target=t.BXFormTarget.name}if(!!o)var s=a.showWait(r);t.BXFormCallback=function(t){if(!!o)a.closeWait(s);var n=function(){if(!!e.bxcompajaxframeonload){setTimeout(function(){e.bxcompajaxframeonload();e.bxcompajaxframeonload=null},10)}};a(r).innerHTML=t;a.onCustomEvent("onAjaxSuccess",[null,null,n])};a.bind(t.BXFormTarget,"load",a.proxy(a.ajax._submit_callback,t));return true};a.ajax._submit_callback=function(){try{if(this.BXFormTarget.contentWindow.location.href.indexOf("http")!=0)return}catch(e){return}if(this.BXFormCallback)this.BXFormCallback.apply(this,[this.BXFormTarget.contentWindow.document.body.innerHTML]);a.unbindAll(this.BXFormTarget)};a.ajax.prepareForm=function(e,a){a=!!a?a:{};var t,r,o,n=[],s=e.elements.length,i=0,u=0;if(!!e){for(t=0;t<s;t++){o=e.elements[t];if(o.disabled)continue;if(!o.type)continue;switch(o.type.toLowerCase()){case"text":case"textarea":case"password":case"number":case"hidden":case"select-one":n.push({name:o.name,value:o.value});u+=o.name.length+o.value.length;break;case"file":if(!!o.files){for(r=0;r<o.files.length;r++){i++;n.push({name:o.name,value:o.files[r],file:true});u+=o.files[r].size}}break;case"radio":case"checkbox":if(o.checked){n.push({name:o.name,value:o.value});u+=o.name.length+o.value.length}break;case"select-multiple":for(var l=0;l<o.options.length;l++){if(o.options[l].selected){n.push({name:o.name,value:o.options[l].value});u+=o.name.length+o.options[l].length}}break;default:break}}t=0;u=0;var c=a,f,h,p;while(t<n.length){var d=n[t].name.indexOf("[");if(d==-1){c[n[t].name]=n[t].value;c=a;t++}else{f=n[t].name.substring(0,d);h=n[t].name.substring(d+1);p=h.indexOf("]");
5928if(p==-1){if(!c[f])c[f]=[];c=a;t++}else if(p==0){if(!c[f])c[f]=[];c=c[f];n[t].name=""+c.length}else{if(!c[f])c[f]={};c=c[f];n[t].name=h.substring(0,p)+h.substring(p+1)}}}}return{data:a,filesCount:i,roughSize:u}};a.ajax.submitAjax=function(t,r){r=r!==null&&typeof r=="object"?r:{};r.url=r["url"]||t.getAttribute("action");var o=r["data"]||{};r.data=a.ajax.prepareForm(t).data;for(var n in o){if(o.hasOwnProperty(n)){r.data[n]=o[n]}}if(!e["FormData"]){a.ajax(r)}else{var s=function(e){var a=Object.prototype.toString.call(e);return a=="[object File]"||a=="[object Blob]"},i=function(e,a,t){if(!!t&&typeof t=="object"&&!s(t)){for(var r in t){if(t.hasOwnProperty(r)){i(e,a==""?r:a+"["+r+"]",t[r])}}}else e.append(a,!!t?t:"")},u=function(e){var t={};if(null!=e){if(typeof e=="object"){for(var r in e){if(e.hasOwnProperty(r)){var o=a.util.urlencode(r);if(typeof e[r]=="object"&&e[r]["file"]!==true)t[o]=u(e[r]);else if(e[r]["file"]===true)t[o]=e[r]["value"];else t[o]=a.util.urlencode(e[r])}}}else t=a.util.urlencode(e)}return t},l=new e.FormData;if(r.method!=="POST"){r.data=a.ajax.prepareData(r.data);if(r.data){r.url+=(r.url.indexOf("?")!==-1?"&":"?")+r.data;r.data=""}}else{if(r.preparePost===true)r.data=u(r.data);i(l,"",r.data);r.data=l}r.preparePost=false;r.start=false;var c=a.ajax(r);if(!!r["onprogress"])c.upload.addEventListener("progress",function(e){var a=null;if(e.lengthComputable&&(e.total||e["totalSize"])){a=e.loaded*100/(e.total||e["totalSize"])}r["onprogress"](e,a)});c.send(l)}};a.ajax.UpdatePageData=function(e){if(e.TITLE)a.ajax.UpdatePageTitle(e.TITLE);if(e.WINDOW_TITLE||e.TITLE)a.ajax.UpdateWindowTitle(e.WINDOW_TITLE||e.TITLE);if(e.NAV_CHAIN)a.ajax.UpdatePageNavChain(e.NAV_CHAIN);if(e.CSS&&e.CSS.length>0)a.loadCSS(e.CSS);if(e.SCRIPTS&&e.SCRIPTS.length>0){var t=function(r,o,n){if(!!o&&a.type.isArray(o.scripts)){for(var s=0,i=e.SCRIPTS.length;s<i;s++){o.scripts.push({isInternal:false,JS:e.SCRIPTS[s]})}}else{a.loadScript(e.SCRIPTS,n)}a.removeCustomEvent("onAjaxSuccess",t)};a.addCustomEvent("onAjaxSuccess",t)}else{var r=function(e,t,o){if(a.type.isFunction(o)){o()}a.removeCustomEvent("onAjaxSuccess",r)};a.addCustomEvent("onAjaxSuccess",r)}};a.ajax.UpdatePageTitle=function(e){var t=a("pagetitle");if(t){t.removeChild(t.firstChild);if(!t.firstChild)t.appendChild(document.createTextNode(e));else t.insertBefore(document.createTextNode(e),t.firstChild)}};a.ajax.UpdateWindowTitle=function(e){document.title=e};a.ajax.UpdatePageNavChain=function(e){var t=a("navigation");if(t){t.innerHTML=e}};a.userOptions={options:null,bSend:false,delay:5e3,path:"/bitrix/admin/user_options.php?"};a.userOptions.setAjaxPath=function(e){a.userOptions.path=e.indexOf("?")==-1?e+"?":e+"&"};a.userOptions.save=function(e,t,r,o,n){if(null==a.userOptions.options)a.userOptions.options={};n=!!n;a.userOptions.options[e+"."+t+"."+r]=[e,t,r,o,n];var s=a.userOptions.__get();if(s!="")document.cookie=a.message("COOKIE_PREFIX")+"_LAST_SETTINGS="+encodeURIComponent(s)+"&sessid="+a.bitrix_sessid()+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";if(!a.userOptions.bSend){a.userOptions.bSend=true;setTimeout(function(){a.userOptions.send(null)},a.userOptions.delay)}};a.userOptions.send=function(e){var t=a.userOptions.__get();a.userOptions.options=null;a.userOptions.bSend=false;if(t!=""){document.cookie=a.message("COOKIE_PREFIX")+"_LAST_SETTINGS=; path=/;";a.ajax({method:"GET",dataType:"html",processData:false,cache:false,url:a.userOptions.path+t+"&sessid="+a.bitrix_sessid(),onsuccess:e})}};a.userOptions.del=function(e,t,r,o){a.ajax.get(a.userOptions.path+"action=delete&c="+e+"&n="+t+(r==true?"&common=Y":"")+"&sessid="+a.bitrix_sessid(),o)};a.userOptions.__get=function(){if(!a.userOptions.options)return"";var e="",t=-1,r="",o,n;for(n in a.userOptions.options){if(a.userOptions.options.hasOwnProperty(n)){o=a.userOptions.options[n];if(r!=o[0]+"."+o[1]){t++;e+="&p["+t+"][c]="+a.util.urlencode(o[0]);e+="&p["+t+"][n]="+a.util.urlencode(o[1]);if(o[4]==true)e+="&p["+t+"][d]=Y";r=o[0]+"."+o[1]}e+="&p["+t+"][v]["+a.util.urlencode(o[2])+"]="+a.util.urlencode(o[3])}}return e.substr(1)};a.ajax.history={expected_hash:"",obParams:null,obFrame:null,obImage:null,obTimer:null,bInited:false,bHashCollision:false,bPushState:!!(history.pushState&&a.type.isFunction(history.pushState)),startState:null,init:function(t){if(a.ajax.history.bInited)return;this.obParams=t;var r=this.obParams.getState();if(a.ajax.history.bPushState){a.ajax.history.expected_hash=e.location.pathname;if(e.location.search)a.ajax.history.expected_hash+=e.location.search;a.ajax.history.put(r,a.ajax.history.expected_hash,"",true);setTimeout(function(){a.bind(e,"popstate",a.ajax.history.__hashListener)},500)}else{a.ajax.history.expected_hash=e.location.hash;if(!a.ajax.history.expected_hash||a.ajax.history.expected_hash=="#")a.ajax.history.expected_hash="__bx_no_hash__";u.put(a.ajax.history.expected_hash,r);a.ajax.history.obTimer=setTimeout(a.ajax.history.__hashListener,500);if(a.browser.IsIE()){a.ajax.history.obFrame=document.createElement("IF
5928RAME");a.hide_object(a.ajax.history.obFrame);document.body.appendChild(a.ajax.history.obFrame);a.ajax.history.obFrame.contentWindow.document.open();a.ajax.history.obFrame.contentWindow.document.write(a.ajax.history.expected_hash);a.ajax.history.obFrame.contentWindow.document.close()}else if(a.browser.IsOpera()){a.ajax.history.obImage=document.createElement("IMG");a.hide_object(a.ajax.history.obImage);document.body.appendChild(a.ajax.history.obImage);a.ajax.history.obImage.setAttribute("src","javascript:location.href = 'javascript:BX.ajax.history.__hashListener();';")}}a.ajax.history.bInited=true},__hashListener:function(t){t=t||e.event||{state:false};if(a.ajax.history.bPushState){a.ajax.history.obParams.setState(t.state||a.ajax.history.startState)}else{if(a.ajax.history.obTimer){e.clearTimeout(a.ajax.history.obTimer);a.ajax.history.obTimer=null}var r;if(null!=a.ajax.history.obFrame)r=a.ajax.history.obFrame.contentWindow.document.body.innerText;else r=e.location.hash;if(!r||r=="#")r="__bx_no_hash__";if(r.indexOf("#")==0)r=r.substring(1);if(r!=a.ajax.history.expected_hash){var o=u.get(r);if(o){a.ajax.history.obParams.setState(o);a.ajax.history.expected_hash=r;if(null!=a.ajax.history.obFrame){var n=r=="__bx_no_hash__"?"":r;if(e.location.hash!=n&&e.location.hash!="#"+n)e.location.hash=n}}}a.ajax.history.obTimer=setTimeout(a.ajax.history.__hashListener,500)}},put:function(t,r,o,n){if(this.bPushState){if(!n){history.pushState(t,"",r)}else{a.ajax.history.startState=t}}else{if(typeof o!="undefined")r=o;else r="view"+r;u.put(r,t);a.ajax.history.expected_hash=r;e.location.hash=a.util.urlencode(r);if(null!=a.ajax.history.obFrame){a.ajax.history.obFrame.contentWindow.document.open();a.ajax.history.obFrame.contentWindow.document.write(r);a.ajax.history.obFrame.contentWindow.document.close()}}},checkRedirectStart:function(t,r){var o=e.location.hash;if(o.substring(0,1)=="#")o=o.substring(1);var n=o.substring(0,5);if(n=="view/"||n=="view%"){a.ajax.history.bHashCollision=true;document.write("<"+'div id="__ajax_hash_collision_'+r+'" style="display: none;">')}},checkRedirectFinish:function(t,r){document.write("</div>");var o=e.location.hash;if(o.substring(0,1)=="#")o=o.substring(1);a.ready(function(){var e=o.substring(0,5);if(e=="view/"||e=="view%"){var n=a("__ajax_hash_collision_"+r);var s=n.firstChild;a.cleanNode(s);n.style.display="block";if(e!="view%")o=a.util.urlencode(o);o+=(o.indexOf("%3F")==-1?"%3F":"%26")+t+"="+r;var i="/bitrix/tools/ajax_redirector.php?hash="+o;a.ajax.insertToNode(i,s)}})}};a.ajax.component=function(e){this.node=e};a.ajax.component.prototype.getState=function(){var t={node:this.node,title:e.document.title,data:a(this.node).innerHTML};var r=a("navigation");if(null!=r)t.nav_chain=r.innerHTML;a.onCustomEvent(a(t.node),"onComponentAjaxHistoryGetState",[t]);return t};a.ajax.component.prototype.setState=function(e){a(e.node).innerHTML=e.data;a.ajax.UpdatePageTitle(e.title);if(e.nav_chain){a.ajax.UpdatePageNavChain(e.nav_chain)}a.onCustomEvent(a(e.node),"onComponentAjaxHistorySetState",[e])};var u={arHistory:{},put:function(e,a){this.arHistory[e]=a},get:function(e){return this.arHistory[e]}};a.ajax.FormData=function(){this.elements=[];this.files=[];this.features={};this.isSupported();this.log("BX FormData init")};a.ajax.FormData.isSupported=function(){var e=new a.ajax.FormData;var t=e.features.supported;e=null;return t};a.ajax.FormData.prototype.log=function(e){if(false){try{if(a.browser.IsIE())e=JSON.stringify(e);console.log(e)}catch(t){}}};a.ajax.FormData.prototype.isSupported=function(){var a={};a.fileReader=e.FileReader&&e.FileReader.prototype.readAsBinaryString;a.readFormData=a.sendFormData=!!e.FormData;a.supported=!!(a.readFormData&&a.sendFormData);this.features=a;this.log("features:");this.log(a);return a.supported};a.ajax.FormData.prototype.append=function(e,a){if(typeof a==="object"){this.files.push({name:e,value:a})}else{this.elements.push({name:e,value:a})}};a.ajax.FormData.prototype.send=function(e,t,r,o){this.log("FD send");this.xhr=a.ajax({method:"POST",dataType:"html",url:e,onsuccess:t,onfailure:o,start:false,preparePost:false});if(r){this.xhr.upload.addEventListener("progress",function(e){if(e.lengthComputable)r(e.loaded/(e.total||e.totalSize))},false)}if(this.features.readFormData&&this.features.sendFormData){var n=new FormData;this.log("use browser formdata");for(var s in this.elements){if(this.elements.hasOwnProperty(s))n.append(this.elements[s].name,this.elements[s].value)}
5928for(s in this.files){if(this.files.hasOwnProperty(s))n.append(this.files[s].name,this.files[s].value)}this.xhr.send(n)}return this.xhr};a.addCustomEvent("onAjaxFailure",a.debug)})(window); 5929/* End */ 5930; 5931; /* Start:"a:4:{s:4:"full";s:48:"/bitrix/js/main/json/json2.min.js?14580310403467";s:6:"source";s:33:"/bitrix/js/main/json/json2.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 5932 5933var JSON;if(!JSON){JSON={};} 5934(function(){'use strict';function f(n){return n<10?'0'+n:n;} 5935if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ 5936f(this.getUTCMonth()+1)+'-'+ 5937f(this.getUTCDate())+'T'+ 5938f(this.getUTCHours())+':'+ 5939f(this.getUTCMinutes())+':'+ 5940f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} 5941var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} 5942function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} 5943if(typeof rep==='function'){value=rep.call(holder,key,value);} 5944switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} 5945gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';} 5946v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;} 5947if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}} 5948v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}} 5949if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;} 5950rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');} 5951return str('',{'':value});};} 5952if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}} 5953return reviver.call(holder,key,value);} 5954text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+ 5955('0000'+a.charCodeAt(0).toString(16)).slice(-4);});} 5956if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;} 5957throw new SyntaxError('JSON.parse');};}}()); 5958/* End */ 5959; 5960; /* Start:"a:4:{s:4:"full";s:50:"/bitrix/js/main/core/core_ls.min.js?14580310417365";s:6:"source";s:31:"/bitrix/js/main/core/core_ls.js";s:3:"min";s:35:"/bitrix/js/main/core/core_ls.min.js";s:3:"map";s:35:"/bitrix/js/main/core/core_ls.map.js";}"*/ 5961(function(e){if(e.BX.localStorage)return;var t=e.BX,r=null,o=null,a="_bxCurrentKey",i=false;t.localStorage=function(){this.keyChanges={};t.bind(t.browser.IsIE()&&!t.browser.IsIE9()?document:e,"storage",t.proxy(this._onchange,this));setInterval(t.delegate(this._clear,this),5e3)};t.localStorage.checkBrowser=function(){return i};t.localStorage.set=function(e,r,o){return t.localStorage.instance().set(e,r,o)};t.localStorage.get=function(e){return t.localStorage.instance().get(e)};t.localStorage.remove=function(e){return t.localStorage.instance().remove(e)};t.localStorage.instance=function(){if(!r){var e=t.localStorage.checkBrowser();if(e=="native")r=new t.localStorage;else if(e=="ie8")r=new t.localStorageIE8;else if(e=="ie7")r=new t.localStorageIE7;else{r={set:t.DoNothing,get:function(){return null},remove:t.DoNothing}}}return r};t.localStorage.prototype.prefix=function(){if(!o){o="bx"+t.message("USER_ID")+"-"+(t.message.SITE_ID?t.message("S
5961ITE_ID"):"admin")+"-"}return o};t.localStorage.prototype._onchange=function(r){r=r||e.event;if(!r.key)return;if(t.browser.DetectIeVersion()>0&&this.keyChanges[r.key]){this.keyChanges[r.key]=false;return}if(!!r.key&&r.key.substring(0,this.prefix().length)==this.prefix()){var o={key:r.key.substring(this.prefix().length,r.key.length),value:!!r.newValue?this._decode(r.newValue.substring(11,r.newValue.length)):null,oldValue:!!r.oldValue?this._decode(r.oldValue.substring(11,r.oldValue.length)):null};switch(o.key){case"BXGCE":if(o.value){t.onCustomEvent(o.value.e,o.value.p)}break;default:if(r.newValue)t.onCustomEvent(e,"onLocalStorageSet",[o]);if(r.oldValue&&!r.newValue)t.onCustomEvent(e,"onLocalStorageRemove",[o]);t.onCustomEvent(e,"onLocalStorageChange",[o]);break}}};t.localStorage.prototype._clear=function(){var e=+new Date,t,r;for(r=0;r<localStorage.length;r++){t=localStorage.key(r);if(t.substring(0,2)=="bx"){var o=localStorage.getItem(t).split(":",1)*1e3;if(e>=o)localStorage.removeItem(t)}}};t.localStorage.prototype._encode=function(e){if(typeof e=="object")e=JSON.stringify(e);else e=e.toString();return e};t.localStorage.prototype._decode=function(e){var t=null;if(!!e){try{t=JSON.parse(e)}catch(r){t=e}}return t};t.localStorage.prototype._trigger_error=function(e,r,o,a){t.onCustomEvent(this,"onLocalStorageError",[e,{key:r,value:o,ttl:a}])};t.localStorage.prototype.set=function(e,t,r){if(!r||r<=0)r=60;if(e==undefined||e==null||t==undefined)return false;this.keyChanges[this.prefix()+e]=true;try{localStorage.setItem(this.prefix()+e,Math.round(+new Date/1e3)+r+":"+this._encode(t))}catch(o){this._trigger_error(o,e,t,r)}};t.localStorage.prototype.get=function(e){var t=localStorage.getItem(this.prefix()+e);if(t){var r=t.split(":",1)*1e3;if(+new Date<=r){t=t.substring(11,t.length);return this._decode(t)}}return null};t.localStorage.prototype.remove=function(e){this.keyChanges[this.prefix()+e]=true;localStorage.removeItem(this.prefix()+e)};t.localStorageIE7=function(){this.NS="BXLocalStorage";this.__current_state={};this.keyChanges={};t.ready(t.delegate(this._Init,this))};t.extend(t.localStorageIE7,t.localStorage);t.localStorageIE7.prototype._Init=function(){this.storage_element=document.body.appendChild(t.create("DIV"));this.storage_element.addBehavior("#default#userData");this.storage_element.load(this.NS);var e=this.storage_element.xmlDocument,r=e.firstChild.attributes.length;for(var o=0;o<r;o++){if(!!e.firstChild.attributes[o]){var a=e.firstChild.attributes[o].nodeName;if(a.substring(0,this.prefix().length)==this.prefix()){this.__current_state[a]=e.firstChild.attributes[o].nodeValue}}}setInterval(t.delegate(this._Listener,this),500);setInterval(t.delegate(this._clear,this),5e3)};t.localStorageIE7.prototype._Listener=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument,r=t.firstChild.attributes.length,o,a,i;var l={},s=[];for(o=0;o<r;o++){if(!!t.firstChild.attributes[o]){a=t.firstChild.attributes[o].nodeName;if(a.substring(0,this.prefix().length)==this.prefix()){i=t.firstChild.attributes[o].nodeValue;if(this.__current_state[a]!=i){s.push({key:a,newValue:i,oldValue:this.__current_state[a]})}l[a]=i;delete this.__current_state[a]}}}for(o in this.__current_state){if(this.__current_state.hasOwnProperty(o)){s.push({key:o,newValue:undefined,oldValue:this.__current_state[o]})}}this.__current_state=l;for(o=0;o<s.length;o++){this._onchange(s[o])}};t.localStorageIE7.prototype._clear=function(){this.storage_element.load(this.NS);var e=this.storage_element.xmlDocument,t=e.firstChild.attributes.length,r=+new Date,o,a,i,l;for(o=0;o<t;o++){if(!!e.firstChild.attributes[o]){a=e.firstChild.attributes[o].nodeName;if(a.substring(0,2)=="bx"){i=e.firstChild.attributes[o].nodeValue;l=i.split(":",1)*1e3;if(r>=l){e.firstChild.removeAttribute(a)}}}}this.storage_element.save(this.NS)};t.localStorageIE7.prototype.set=function(e,t,r){if(!r||r<=0)r=60;try{this.storage_element.load(this.NS);var o=this.storage_element.xmlDocument;this.keyChanges[this.prefix()+e]=true;o.firstChild.setAttribute(this.prefix()+e,Math.round(+new Date/1e3)+r+":"+this._encode(t));this.storage_element.save(this.NS)}catch(a){this._trigger_error(a,e,t,r)}};t.localStorageIE7.prototype.get=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument;var r=t.firstChild.getAttribute(this.prefix()+e);if(r){var o=r.split(":",1)*1e3;if(+new Date<=o){r=r.substring(11,r.length);return this._decode(r)}}return null};t.localStorageIE7.prototype.remove=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument;t.firstChild.removeAttribute(this.prefix()+e);this.keyChanges[this.prefix()+e]=true;this.storage_element.save(this.NS)};t.localStorageIE8=function(){this.key=a;this.currentKey=null;this.currentValue=null;t.localStorageIE8.superclass.constructor.apply(this)};t.extend(t.localStorageIE8,t.localStorage);t.localStorageIE8.prototype._onchange=function(e){if(null==this.currentKey){this.currentKey=localStorage.getItem(this.key);if(this.currentKey){this.currentValue=localStorage.getItem(this.prefix()+this.currentKey)}}else{e={key:this.prefix()+this.currentKey,newValue:localStorage.getItem(this.prefix()+this.currentKey),oldValue:this.currentValue};this.currentKey=null;this.currentValue=null;if(this.keyChanges[e.key]){this.keyChanges[e.key]=false;return}t.localStorageIE8.superclass._onchange.apply(this,[e])}};t.localStorageIE8.prototype.set=function(e,r,o){this.currentKey=null;this.keyChanges[this.prefix()+e]=true;try{localStorage.setItem(this.key,e);t.localStorageIE8.superclass.set.apply(this,arguments)}catch(a){this._trigger_error(a,e,r,o)}};t.localStorageIE8.prototype.remove=function(e){this.currentKey=null;this.keyChanges[this.prefix()+e]=true;localStorage.setItem(this.key,e);t.localStorageIE8.superclass.remove.apply(this,arguments)};t.onGlobalCustomEvent=function(e,r,o){if(!!t.localStorage.checkBrowser())t.localStorage.set("BXGCE",{e:e,p:r},1);if(!o)t.onCustomEvent(e,r)};try{i=!!localStorage.setItem}catch(l){}if(i){i="native";var s=t.browser.IsIE()&&!t.browser.IsIE9()?document:e,n=function(r){if(typeof(r||e.event).key=="undefined")i="ie8";t.unbind(s,"storage",n);t.localStorage.instance()};t.bind(s,"storage",n);try{localStorage.setItem(a,null)}catch(l){i=false;t.localStorage.instance()}}else if(t.browser.IsIE7()){i="ie7";t.localStorage.instance()}})(window); 5962/* End */ 5963; 5964; /* Start:"a:4:{s:4:"full";
5964s:45:"/bitrix/js/main/session.min.js?14580310402511";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";}"*/ 5965function CBXSession(){var e=this;this.mess={};this.timeout=null;this.sessid=null;this.bShowMess=true;this.dateStart=new Date;this.dateInput=new Date;this.dateCheck=new Date;this.activityInterval=0;this.notifier=null;this.Expand=function(t,i,s,n){this.timeout=t;this.sessid=i;this.bShowMess=s;this.key=n;BX.ready(function(){BX.bind(document,"keypress",e.OnUserInput);BX.bind(document.body,"mousemove",e.OnUserInput);BX.bind(document.body,"click",e.OnUserInput);setTimeout(e.CheckSession,(e.timeout-60)*1e3)})};this.OnUserInput=function(){var t=new Date;e.dateInput.setTime(t.valueOf())};this.CheckSession=function(){var t=new Date;if(t.valueOf()-e.dateCheck.valueOf()<3e4)return;e.activityInterval=Math.round((e.dateInput.valueOf()-e.dateStart.valueOf())/1e3);e.dateStart.setTime(e.dateInput.valueOf());var i=e.activityInterval>e.timeout?e.timeout-60:e.activityInterval;var s={method:"GET",dataType:"html",url:"/bitrix/tools/public_session.php?sessid="+e.sessid+"&interval="+i+"&k="+e.key,data:"",onsuccess:function(t){e.CheckResult(t)},lsId:"sess_expand",lsTimeout:60};if(i>0){s.lsForce=true}BX.ajax(s)};this.CheckResult=function(t){if(t=="SESSION_EXPIRED"){if(e.bShowMess){if(!e.notifier){e.notifier=document.body.appendChild(BX.create("DIV",{props:{className:"bx-session-message"},style:{top:"0px",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>'+e.mess.messSessExpired}));var i=BX.GetWindowScrollPos();var s=BX.GetWindowInnerSize();e.notifier.style.left=parseInt(i.scrollLeft+s.innerWidth/2-parseInt(e.notifier.clientWidth)/2)+"px";if(BX.browser.IsIE()){e.notifier.style.top=i.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=""}}else{var n;if(t=="SESSION_CHANGED")n=e.timeout-60;else n=e.activityInterval<60?60:e.activityInterval>e.timeout?e.timeout-60:e.activityInterval;var o=new Date;e.dateCheck.setTime(o.valueOf());setTimeout(e.CheckSession,n*1e3)}};this.Close=function(){this.notifier.style.display="none"}}var bxSession=new CBXSession; 5966/* End */ 5967; 5968; /* Start:"a:4:{s:4:"full";s:55:"/bitrix/js/main/core/core_window.min.js?149879921375204";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";}"*/ 5969(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;var e=t.Get();e.style.zIndex=t.zIndex=this.GetZIndex();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=null;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;
5969if(/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)},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.CWindow.prototype.Hide=function(){BX.WindowManager.unregister(this);this.DIV.style.display="none"};BX.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 a=this.DIV.offsetHeight;if(s>n.scrollWidth-r-i)s=n.scrollWidth-r-i;var h=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight,n.scrollHeight);if(o>h-a-i)o=h-a-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);
5969this.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"}}))}return this.OVERLAY};BX.CWindowDialog.prototype.Show=function(){BX.CWindowDialog.superclass.Show.apply(this,arguments);this.CreateOverlay();this.OVERLAY.style.display="block";this.OVERLAY.style.zIndex=parseInt(this.DIV.style.zIndex)-2;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":"")}
5969,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 a="";if(null==t&&e.elements[r.name+"_alt"]&&r.selectedIndex==0)a=e.elements[r.name+"_alt"].value;else a=r.value;s+=n+r.name+"="+BX.util.urlencode(a);break;case"select-multiple":var h,l=false;var d=r.options.length;for(h=0;h<d;h++){if(r.options[h].selected){s+=n+r.name+"="+BX.util.urlencode(r.o
5969ptions[h].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){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");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]}
5969)]});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(parseInt(BX.style(e,"z-index"))-1);this.OVERLAY.style.display="block"; 5970 5971this.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.addCustomEvent(this,"onWindowResize",BX.proxy(this.__adjustSize,this));if(this.PARAMS.resizable&&(this.PARAMS.content_url||this.PARAMS.resize_id))BX.addCustomEvent(this,"onWindowResizeFinished",BX.delegate(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=BX.GetWindowInnerSize();var e=BX.GetWindowScrollPos();BX.adjust(this.DIV,{style:{left:parseInt(e.scrollLeft+t.innerWidth/2-parseInt(this.DIV.offsetWidth)/2)+"px",top:Math.max(parseInt(e.scrollTop+t.innerHe
5971ight/2-parseInt(this.DIV.offsetHeight)/2),0)+"px"}})}};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",name:"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;
5971t.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.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;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}this.bMenuInit=false};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,LEVEL:this.LEVEL,parent:BX(this.DIV),parent_attach:BX(this.ATTA
5971CH)});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.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()}}};
5971BX.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}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:!!t.LINK||BX.browser.IsIE()&&!BX.browser.IsDoctype()?{href:t.LINK||"javascript:void(0)"}:{},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||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;
5971o.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 a=o.left;o.left=n.scrollWidth-i-10;if(!!this.ARROW)r+=a-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 h=this.PARAMS.ATTACH_MODE=="bottom"?t.top-s-9:t.bottom-s+1;if(h>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=h;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 a=this.attachMenu(this.EXTRA_BUTTONS["components2_submenu"]["MENU"]);BX.addCustomEvent(a,"onOpenerMenuOpen",BX.proxy(this.__menu_open,this));BX.addCustomEvent(a,"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
5971LE||"",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));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.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")}
5971if(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(){ 5972if(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";BX.addCustomEvent(t,"onMenuOpenerHide",BX.proxy(this.restorePosition,this));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")]}));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.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");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;
5972if(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); 5973/* End */ 5974; 5975; /* Start:"a:4:{s:4:"full";s:54:"/bitrix/js/main/core/core_popup.min.js?149879915439932";s:6:"source";s:34:"/bitrix/js/main/core/core_popup.js";s:3:"min";s:38:"/bitrix/js/main/core/core_popup.min.js";s:3:"map";s:38:"/bitrix/js/main/core/core_popup.map.js";}"*/ 5976(function(t){"use strict";if(BX.PopupWindowManager){return}BX.PopupWindowManager={_popups:[],_currentPopup:null,create:function(t,e,i){var o=-1;if((o=this._getPopupIndex(t))!==-1){return this._popups[o]}var n=new BX.PopupWindow(t,e,i);BX.addCustomEvent(n,"onPopupShow",BX.delegate(this.onPopupShow,this));BX.addCustomEvent(n,"onPopupClose",BX.delegate(this.onPopupClose,this));return n},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},_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,o){o=o||{};this.params=o;BX.onCustomEvent("onPopupWindowInit",[e,i,o]);this.uniquePopupId=e;this.params.zIndex=parseInt(o.zIndex);this.params.zIndex=isNaN(o.zIndex)?0:o.zIndex;this.buttons=o.buttons&&BX.type.isArray(o.buttons)?o.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 o.bindOptions==="object"?o.bindOptions:{};this.autoHide=o.autoHide===true;this.isAutoHideBinded=false;this.closeByEsc=o.closeByEsc===true;this.isCloseByEscBinded=false;this.width=null;this.height=null;this.minWidth=0;this.minHeight=0;if(o.parentPopup instanceof BX.PopupWindow){this.parentPopup=o.parentPopup;this.appendContainer=o.parentPopup.contentContainer;o.offsetTop=(o.offsetTop?o.offsetTop:0)-(BX.PopupWindow.fullscreenStatus?0:this.parentPopup.popupContainer.offsetTop);o.offsetLeft=(o.offsetLeft?o.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;if(o.events){for(var n in o.events){BX.addCustomEvent(this,n,o.events[n])}}var s="popup-window";if(o.contentColor&&BX.type.isNotEmptyString(o.contentColor)){s+=" popup-window-content-"+o.contentColor}if(o.contentNoPaddings){s+=" popup-window-content-no-paddings"}if(o.noAllPaddings){s+=" popup-window-no-paddings"}if(o.titleBar){s+=" popup-window-with-titlebar"}if(o.className&&BX.type.isNotEmptyString(o.className)){s+=" "+o.className}if(o.darkMode){s+=" popup-window-dark"}this.popupContainer=document.createElement("div");var p="popup-window-titlebar-"+e;if(o.titleBar){this.titleBar=BX.create("div",{props:{className:"popup-window-titlebar",id:p}})}if(o.closeIcon){this.closeIcon=BX.create("span",{props:{className:"popup-window-close-icon"+(o.titleBar?" popup-window-titlebar-close-icon":"")},style:typeof o.closeIcon==="object"?o.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(o.angle){this.setAngle(o.angle)}if(o.overlay){this.setOverlay(o.overlay)}this.setOffset(o);this.setBindElement(i);this.setTitleBar(o.titleBar);this.setContent(o.content);this.setButtons(o.buttons);this.setWidth(o.width);this.setHeight(o.height);this.setResizeMode(o.resizable);if(o.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=" "}};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 o=this.buttons[i];if(o===null||!BX.is_subclass_of(o,BX.PopupWindowButton)){continue}o.popupWindow=this;e.push(o.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 o=this.popupContainer.offsetWidth;var n=this.popupContainer.offsetHeight;this.bindOptions.forceTop=true;
5976return{left:e.innerWidth/2-o/2+i.scrollLeft,top:e.innerHeight/2-n/2+i.scrollTop,bottom:e.innerHeight/2-n/2+i.scrollTop,windowSize:e,windowScroll:i,popupWidth:o,popupHeight:n}}};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 o=BX.PopupWindow.getOption(i==="top"?"angleMinTop":"angleMinBottom");var n=BX.type.isNumber(t.offset)?t.offset:0;var s=BX.PopupWindow.getOption("angleLeftOffset",null);if(n>0&&BX.type.isNumber(s)){n+=s-BX.PopupWindow.defaultOptions.angleLeftOffset}this.angle={element:BX.create("div",{props:{className:e+" "+e+"-"+i}}),position:i,offset:0,defaultOffset:Math.max(n,o)};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,r;if(this.angle.position==="top"){u=BX.PopupWindow.getOption("angleMinTop");r=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxTop");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);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");r=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxBottom");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);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");r=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxRight");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);this.angle.element.style.top=this.angle.offset+"px"}else if(this.angle.position==="left"){u=BX.PopupWindow.getOption("angleMinLeft");r=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxLeft");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);this.angle.element.style.top=this.angle.offset+"px"}}};BX.PopupWindow.prototype.setWidth=function(t){if(BX.type.isNumber(t)&&t>=0){this.width=t;this.contentContainer.style.width=t+"px";this.contentContainer.style.overflowX="auto";if(this.titleBar){this.titleBar.style.width=t+"px"}}else if(t===false){this.width=null;this.contentContainer.style.removeProperty("width");this.contentContainer.style.removeProperty("overflowX");if(this.titleBar){this.titleBar.style.removeProperty("width")}}};BX.PopupWindow.prototype.setHeight=function(t){if(BX.type.isNumber(t)&&t>=0){this.height=t;this.contentContainer.style.height=t+"px";this.contentContainer.style.overflowY="auto"}else if(t===false){this.height=null;this.contentContainer.style.removeProperty("height");this.contentContainer.style.removeProperty("overflowY")}};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)}if(BX.type.isNumber(t.minWidth)&&t.minWidth>0){this.minWidth=t.minWidth}if(BX.type.isNumber(t.minHeight)&&t.minHeight>0){this.minHeight=t.minHeight}}else if(t===false&&this.resizeIcon){BX.remove(this.resizeIcon);this.resizeIcon=null}};BX.PopupWindow.prototype.getWidth=function(){return this.width};BX.PopupWindow.prototype.getHeight=function(){return this.height};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};
5976BX.PopupWindow.prototype._resize=function(t,e,i,o){var n=i-this.resizeContentPos.left;var s=o-this.resizeContentPos.top;var p=BX.GetWindowScrollSize().scrollWidth;if(this.resizeContentPos.left+n+this.resizeContentOffset>=p){n=p-this.resizeContentPos.left-this.resizeContentOffset}this.setWidth(Math.max(n,this.minWidth));this.setHeight(Math.max(s,this.minHeight))};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(t.offsetLeft&&BX.type.isNumber(t.offsetLeft)){this.offsetLeft=t.offsetLeft+BX.PopupWindow.getOption("offsetLeft")}if(t.offsetTop&&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);BX.bind(document,"click",BX.proxy(this.close,this))}};BX.PopupWindow.prototype.unbindAutoHide=function(){if(this.isAutoHideBinded){this.isAutoHideBinded=false;BX.unbind(this.popupContainer,"click",this.cancelBubble);BX.unbind(document,"click",BX.proxy(this.close,this))}};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 BX.PopupWindow.getOption("popupOverlayZindex")+this.params.zIndex}else{return 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.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.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 true}BX.onCustomEvent(this,"onPopupClose",[this,t]);this.hideOverlay();this.popupContainer.style.display="none";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){o(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 o=e.windowScroll?e.windowScroll:BX.GetWindowScrollPos();var n=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+n+this.bordersWidth>=i.innerWidth+o.scrollLeft&&i.innerWidth+o.scrollLeft-n-this.bordersWidth>0){var r=u;u=i.innerWidth+o.scrollLeft-n-this.bordersWidth;
5976if(this.isTopOrBottomAngle()){this.setAngle({offset:r-u+this.angle.defaultOffset})}}else if(this.isTopOrBottomAngle()){this.setAngle({offset:this.angle.defaultOffset+(u<0?u:0)})}if(u<0){u=0}var a=0;if(this.bindOptions.position&&this.bindOptions.position==="top"){a=this.bindElementPos.top-s-this.offsetTop-(this.isBottomAngle()?p:0);if(a<0||!this.bindOptions.forceTop&&a<o.scrollTop){a=this.bindElementPos.bottom+this.offsetTop;if(this.angle!==null){a+=p;this.setAngle({position:"top"})}}else if(this.isTopAngle()){a=a-p+BX.PopupWindow.getOption("positionTopXOffset");this.setAngle({position:"bottom"})}else{a+=BX.PopupWindow.getOption("positionTopXOffset")}}else{a=this.bindElementPos.bottom+this.offsetTop+this.getAngleHeight();if(!this.bindOptions.forceTop&&a+s>i.innerHeight+o.scrollTop&&this.bindElementPos.top-s-this.getAngleHeight()>=0){a=this.bindElementPos.top-s;if(this.isTopOrBottomAngle()){a-=p;this.setAngle({position:"bottom"})}a+=BX.PopupWindow.getOption("positionTopXOffset")}else if(this.isBottomAngle()){a+=p;this.setAngle({position:"top"})}}if(!this.parentPopup&&a<0){a=0}BX.adjust(this.popupContainer,{style:{top:a+"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,o){var n=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&&n<0){n=0}var p=BX.GetWindowScrollSize();var u=this.popupContainer.offsetWidth;var r=this.popupContainer.offsetHeight;if(n>p.scrollWidth-u){n=p.scrollWidth-u}if(s>p.scrollHeight-r){s=p.scrollHeight-r}if(!this.parentPopup&&s<0){s=0}}this.popupContainer.style.left=n+"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.PopupMenu={Data:{}
5976,currentItem:null,show:function(t,e,i,o){if(this.currentItem!==null){this.currentItem.popupWindow.close()}this.currentItem=this.create(t,e,i,o);this.currentItem.popupWindow.show()},create:function(t,e,i,o){if(!this.Data[t]){this.Data[t]=new BX.PopupMenuWindow(t,e,i,o)}return this.Data[t]},getCurrentMenu:function(){return this.currentItem},getMenuById:function(t){return this.Data[t]?this.Data[t]:null},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,o){this.id=t;this.bindElement=e;this.menuItems=[];this.itemsContainer=null;this.params=o&&typeof o==="object"?o:{};this.parentMenuWindow=null;this.parentMenuItem=null;if(i&&BX.type.isArray(i)){for(var n=0;n<i.length;n++){this.addMenuItemInternal(i[n],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 o=i.getLayout();t.push(o.item)}var n=new BX.PopupWindow("menu-popup-"+this.id,this.bindElement,{closeByEsc:typeof this.params.closeByEsc!=="undefined"?this.params.closeByEsc:false,bindOptions:typeof this.params.bindOptions==="object"?this.params.bindOptions:{},angle:typeof this.params.angle!=="undefined"?this.params.angle:false,zIndex:this.params.zIndex?this.params.zIndex:0,overlay:typeof this.params.overlay==="object"?this.params.overlay:null,autoHide:typeof this.params.autoHide!=="undefined"?this.params.autoHide:true,offsetTop:this.params.offsetTop?this.params.offsetTop:1,offsetLeft:this.params.offsetLeft?this.params.offsetLeft:0,className:BX.type.isNotEmptyString(this.params.className)?this.params.className:"",noAllPaddings:true,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})]}),events:{onPopupClose:this.onMenuWindowClose.bind(this),onPopupDestroy:this.onMenuWindowDestroy.bind(this)}});if(this.params&&this.params.events){for(var s in this.params.events){if(this.params.events.hasOwnProperty(s)){BX.addCustomEvent(n,s,this.params.events[s])}}}return n};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(){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.setParentMenuWindow=function(t){if(t instanceof BX.PopupMenuWindow){this.parentMenuWindow=t}};BX.PopupMenuWindow.prototype.getParentMenuWindow=function(){return this.parentMenuWindow};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 o=i.getLayout();var n=this.getMenuItem(e);if(n!==null){var s=n.getLayout();this.itemsContainer.insertBefore(o.item,s.item)}else{this.itemsContainer.appendChild(o.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 o=this.getMenuItemPosition(e);if(o>=0){this.menuItems=BX.util.insertIntoArray(this.menuItems,o,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 o=e.getMenuWindow();if(o){var n=o.getParentMenuItem();if(n){n.destroySubMenu()}else{o.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;
5976this.href=BX.type.isNotEmptyString(t.href)?t.href:null;this.target=BX.type.isNotEmptyString(t.target)?t.target: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.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){ 5977if(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){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:""},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}BX.bind(this.layout.item,"mouseenter",this.onItemMouseEnter.bind(this));BX.bind(this.layout.item,"mouseleave",this.onItemMouseLeave.bind(this))}return this.layout},onItemClick:function(t){this.onclick.call(this.menuWindow,t,this)},onItemMouseEnter:function(t){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){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}this.subMenuWindow=new BX.PopupMenuWindow("popup-submenu-"+this.id,null,t,{autoHide:false,menuShowDelay:this.menuShowDelay,bindOptions:{forceTop:true,forceLeft:true,forceBindPosition:true}});this.subMenuWindow.setParentMenuWindow(this.menuWindow);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");t.close()}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=BX.pos(this.layout.item);var i=e.width+this.subMenuOffsetX;var o="left";var n=t.popupContainer.offsetWidth;var s=document.documentElement.clientWidth;if(e.left+i+n>s){var p=e.left-n-this.subMenuOffsetX;if(p>0){i=-n-this.subMenuOffsetX;o="right"}}t.setBindElement(this.layout.item);t.setOffset({offsetLeft:i,offsetTop:-(e.height+this.getPopupPadding())});t.setAngle({position:o,offset:e.height/2-this.getPopupPadding()});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}};
5977t.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 o=0,n=this.values.length;o<n;o++){e=i.appendChild(BX.create("DIV",{props:{id:"bxecmr_"+o},text:this.values[o].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[o].DESCRIPTION)e.title=this.values[o].DESCRIPTION;if(this.values[o].CLASS_NAME)BX.addClass(e,this.values[o].CLASS_NAME);if(this.values[o].URL)e.appendChild(BX.create("A",{props:{href:this.values[o].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 o(t,n){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(o)(false)}if(t>e){e=t;i=[n]}else if(t==e){i.push(n)}}}})(window); 5978/* End */ 5979; 5980; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/core/core_date.min.js?149879649334241";s:6:"source";s:33:"/bitrix/js/main/core/core_date.js";s:3:"min";s:37:"/bitrix/js/main/core/core_date.min.js";s:3:"map";s:37:"/bitrix/js/main/core/core_date.map.js";}"*/ 5981(function(){if(BX.date)return;BX.date={};BX.date.format=function(e,t,a,i){var s=BX.type.isDate(t)?new Date(t.getTime()):BX.type.isNumber(t)?new Date(t*1e3):new Date;var r=BX.type.isDate(a)?new Date(a.getTime()):BX.type.isNumber(a)?new Date(a*1e3):new Date;var n=!!i;if(BX.type.isArray(e))return c(e,s,r,n);else if(!BX.type.isNotEmptyString(e))return"";var o=/\\?(sago|iago|isago|Hago|dago|mago|Yago|sdiff|idiff|Hdiff|ddiff|mdiff|Ydiff|yesterday|today|tommorow|[a-z])/gi;var l={d:function(){return BX.util.str_pad_left(p(s).toString(),2,"0")},D:function(){return BX.message("DOW_"+v(s))},j:function(){return p(s)},l:function(){return BX.message("DAY_OF_WEEK_"+v(s))},N:function(){return v(s)||7},S:function(){if(p(s)%10==1&&p(s)!=11)return"st";else if(p(s)%10==2&&p(s)!=12)return"nd";else if(p(s)%10==3&&p(s)!=13)return"rd";else return"th"},w:function(){return v(s)},z:function(){var e=new Date(d(s),0,1);var t=new Date(d(s),h(s),p(s));return Math.ceil((t-e)/(24*3600*1e3))},W:function(){var e=new Date(s.getTime());var t=(v(s)+6)%7;B(e,p(e)-t+3);var a=e.getTime();M(e,0,1);if(v(e)!=4)M(e,0,1+(4-v(e)+7)%7);var i=1+Math.ceil((a-e)/(7*24*3600*1e3));return BX.util.str_pad_left(i.toString(),2,"0")},F:function(){return BX.message("MONTH_"+(h(s)+1)+"_S")},f:function(){return BX.message("MONTH_"+(h(s)+1))},m:function(){return BX.util.str_pad_left((h(s)+1).toString(),2,"0")},M:function(){return BX.message("MON_"+(h(s)+1))},n:function(){return h(s)+1},t:function(){var e=n?new Date(Date.UTC(d(s),h(s)+1,0)):new Date(d(s),h(s)+1,0);return p(e)},L:function(){var e=d(s);return e%4==0&&e%100!=0||e%400==0?1:0},o:function(){var e=new Date(s.getTime());B(e,p(e)-(v(s)+6)%7+3);return d(e)},Y:function(){return d(s)},y:function(){return d(s).toString().slice(2)},a:function(){return f(s)>11?"pm":"am"},A:function(){return f(s)>11?"PM":"AM"},B:function(){var e=(s.getUTCHours()+1)%24+s.getUTCMinutes()/60+s.getUTCSeconds()/3600;return BX.util.str_pad_left(Math.floor(e*1e3/24).toString(),3,"0")},g:function(){return f(s)%12||12},G:function(){return f(s)},h:function(){return BX.util.str_pad_left((f(s)%12||12).toString(),2,"0")},H:function(){return BX.util.str_pad_left(f(s).toString(),2,"0")},i:function(){return BX.util.str_pad_left(m(s).toString(),2,"0")},s:function(){return BX.util.str_pad_left(D(s).toString(),2,"0")},u:function(){return BX.util.str_pad_left((T(s)*1e3).toString(),6,"0")},e:function(){if(n)return"UTC";return""},I:function(){if(n)return 0;var e=new Date(d(s),0,1);var t=Date.UTC(d(s),0,1);var a=new Date(d(s),6,0);var i=Date.UTC(d(s),6,0);return 0+(e-t!==a-i)},O:function(){if(n)return"+0000";var e=s.getTimezoneOffset();var t=Math.abs(e);return(e>0?"-":"+")+BX.util.str_pad_left((Math.floor(t/60)*100+t%60).toString(),4,"0")},P:function(){if(n)return"+00:00";var e=this.O();return e.substr(0,3)+":"+e.substr(3)},Z:function(){if(n)return 0;return-s.getTimezoneOffset()*60},c:function(){return"Y-m-d\\TH:i:sP".replace(o,C)},r:function(){return"D, d M Y H:i:s O".replace(o,C)},U:function(){return Math.floor(s.getTime()/1e3)},sago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},iago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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:function(){var e=O((r-s)/60/1e3);var t=X(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+=" ";var a=O((r-s)/1e3)-e*60;t+=X(a,{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},Hago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},yesterday:function(){return BX.message("FD_YESTERDAY")},today:function(){return BX.message("FD_TODAY")},tommorow:function(){return BX.message("FD_TOMORROW")},dago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},mago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},Yago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},x:function(){return BX.date.format([["tommorow","tommorow, H:i"],["-",BX.date.convertBitrixFormat(BX.message("FORMAT_DATETIME")).replace(/:s$/g,"")],["s","sago"],["i","iago"],["today","today, H:i"],["yesterday","yesterday, H:i"],["",BX.date.convertBitrixFormat(BX.message("FORMAT_DATETIME")).replace(/:s$/g,"")]],s,r,n)},X:function(){var e=BX.date.format([["tommorow","tommorow"],["-",BX.date.convertBitrixFormat(BX.message("FORMAT_DATE"))],["today","today"],["yesterday","yesterday"],["",BX.date.convertBitrixFormat(BX.message("FORMAT_DATE"))]],s,r,n);var t=BX.date.format([["tommorow","H:i"],["today","H:i"],["yesterday","H:i"],["",""]],s,r,n);if(t.length>0)return BX.message("FD_DAY_AT_TIME").replace(/#DAY#/g,e).replace(/#TIME#/g,t);else return e},Q:function(){var e=O((r-s)/60/60/24/1e3);if(e==0)return BX.message("FD_DAY_DIFF_1").replace(/#VALUE#/g,1);else return BX.date.format([["d","ddiff"],["m","mdiff"],["","Ydiff"]],s,r)}};var u=false;if(e[0]&&e[0]=="^"){u=true;e=e.substr(1)}var _=e.replace(o,C);
5981if(u){_=_.replace(/\s*00:00:00\s*/g,"").replace(/(\d\d:\d\d)(:00)/g,"$1").replace(/(\s*00:00\s*)(?!:)/g,"")}return _;function c(e,t,a,i){var s=O((a-t)/1e3);for(var r=0;r<e.length;r++){var n=e[r][0];var o=e[r][1];var l=null;if(n=="s"){if(s<60)return BX.date.format(o,t,a,i)}else if((l=/^s(\d+)/.exec(n))!=null){if(s<l[1])return BX.date.format(o,t,a,i)}else if(n=="i"){if(s<60*60)return BX.date.format(o,t,a,i)}else if((l=/^i(\d+)/.exec(n))!=null){if(s<l[1]*60)return BX.date.format(o,t,a,i)}else if(n=="H"){if(s<24*60*60)return BX.date.format(o,t,a,i)}else if((l=/^H(\d+)/.exec(n))!=null){if(s<l[1]*60*60)return BX.date.format(o,t,a,i)}else if(n=="d"){if(s<31*24*60*60)return BX.date.format(o,t,a,i)}else if((l=/^d(\d+)/.exec(n))!=null){if(s<l[1]*60*60)return BX.date.format(o,t,a,i)}else if(n=="m"){if(s<365*24*60*60)return BX.date.format(o,t,a,i)}else if((l=/^m(\d+)/.exec(n))!=null){if(s<l[1]*31*24*60*60)return BX.date.format(o,t,a,i)}else if(n=="today"){var u=d(a),_=h(a),c=p(a);var f=i?new Date(Date.UTC(u,_,c,0,0,0,0)):new Date(u,_,c,0,0,0,0);var m=i?new Date(Date.UTC(u,_,c+1,0,0,0,0)):new Date(u,_,c+1,0,0,0,0);if(t>=f&&t<m)return BX.date.format(o,t,a,i)}else if(n=="yesterday"){u=d(a);_=h(a);c=p(a);var D=i?new Date(Date.UTC(u,_,c-1,0,0,0,0)):new Date(u,_,c-1,0,0,0,0);var T=i?new Date(Date.UTC(u,_,c,0,0,0,0)):new Date(u,_,c,0,0,0,0);if(t>=D&&t<T)return BX.date.format(o,t,a,i)}else if(n=="tommorow"){u=d(a);_=h(a);c=p(a);var v=i?new Date(Date.UTC(u,_,c+1,0,0,0,0)):new Date(u,_,c+1,0,0,0,0);var B=i?new Date(Date.UTC(u,_,c+2,0,0,0,0)):new Date(u,_,c+2,0,0,0,0);if(t>=v&&t<B)return BX.date.format(o,t,a,i)}else if(n=="-"){if(s<0)return BX.date.format(o,t,a,i)}}return e.length>0?BX.date.format(e.pop()[1],t,a,i):""}function d(e){return n?e.getUTCFullYear():e.getFullYear()}function p(e){return n?e.getUTCDate():e.getDate()}function h(e){return n?e.getUTCMonth():e.getMonth()}function f(e){return n?e.getUTCHours():e.getHours()}function m(e){return n?e.getUTCMinutes():e.getMinutes()}function D(e){return n?e.getUTCSeconds():e.getSeconds()}function T(e){return n?e.getUTCMilliseconds():e.getMilliseconds()}function v(e){return n?e.getUTCDay():e.getDay()}function B(e,t){return n?e.setUTCDate(t):e.setDate(t)}function M(e,t,a){return n?e.setUTCMonth(t,a):e.setMonth(t,a)}function X(e,t){var a=e<100?Math.abs(e):Math.abs(e%100);var i=a%10;var s="";if(a==0)s=BX.message(t["0"]);else if(a==1)s=BX.message(t["1"]);else if(a>=10&&a<=20)s=BX.message(t["10_20"]);else if(i==1)s=BX.message(t["MOD_1"]);else if(2<=i&&i<=4)s=BX.message(t["MOD_2_4"]);else s=BX.message(t["MOD_OTHER"]);return s.replace(/#VALUE#/g,e)}function C(e,t){if(l[e])return l[e]();else return t}function O(e){return e>=0?Math.floor(e):Math.ceil(e)}};BX.date.convertBitrixFormat=function(e){if(!BX.type.isNotEmptyString(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")};BX.date.convertToUTC=function(e){if(!BX.type.isDate(e))return null;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))};BX.date.getNewDate=function(e){return new Date(BX.date.getBrowserTimestamp(e))};BX.date.getBrowserTimestamp=function(e){e=parseInt(e,10);var t=new Date(e*1e3).getTimezoneOffset()*60;return(parseInt(e,10)+parseInt(BX.message("SERVER_TZ_OFFSET"))+t)*1e3};BX.date.getServerTimestamp=function(e){e=parseInt(e,10);var t=new Date(e).getTimezoneOffset()*60;return Math.round(e/1e3-(parseInt(BX.message("SERVER_TZ_OFFSET"),10)+parseInt(t,10)))};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.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,r;a=i=s=r=false;var n=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 u=BX.findChild(t,{className:"adm-calendar-separate"});var _=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=r=true;BX.CalendarPeriod.RestoreInput(_);BX.CalendarPeriod.RestoreInput(c);break;case"":BX.CalendarPeriod.SaveAndClearInput(_);BX.CalendarPeriod.SaveAndClearInput(c);break;default:break}BX.CalendarPeriod.ChangeDirectOpts(e.value,t);n.style.display=a?"inline-block":"none";o.style.display=i?"inline-block":"none";l.style.display=s?"inline-block":"none";u.style.display=r?"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 r=0;switch(e.value){case"previous":r=-1;break;case"next":r=1;break;case"current":default:break}var n=false;var o=false;var l=new Date;var u=l.getFullYear();var _=l.getMonth();var c=l.getDate();var d=l.getDay();if(d==0)d=7;switch(s.value){case"day":n=new Date(u,_,c+r,0,0,0);o=new Date(u,_,c+r,23,59,59);break;case"week":n=new Date(u,_,c-d+1+r*7,0,0,0);o=new Date(u,_,c+(7-d)+r*7,23,59,59);break;case"month":n=new Date(u,_+r,1,0,0,0);o=new Date(u,_+1+r,0,23,59,59);break;case"quarter":var p=Math.floor(_/3)+r;n=new Date(u,3*p,1,0,0,0);o=new Date(u,3*(p+1),0,23,59,59);break;case"year":n=new Date(u+r,0,1,0,0,0);o=new Date(u+1+r,0,0,23,59,59);break;default:break}var h=window[a.name+"_bTime"]?BX.message("FORMAT_DATETIME"):BX.message("FORMAT_DATE");if(n){a.value=BX.formatDate(n,h);BX.addClass(a,"adm-calendar-inp-setted")}
5981if(o){i.value=BX.formatDate(o,h);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.value=null;this.control_id=Math.random();this._layers={};this._current_layer=null;this.DIV=null;this.PARTS={};this.weekStart=0;this.numRows=6;this._create=function(e){this.popup=new BX.PopupWindow("calendar_popup_"+this.control_id,e.node,{closeByEsc:true,autoHide:false,content:this._get_content(),zIndex:3e3,bindOptions:{forceBindPosition:true}});BX.bind(this.popup.popupContainer,"click",this.popup.cancelBubble)};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);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>'}),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");this.popup.adjustPosition();break;case"time_hide":BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");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":this.SaveValue();break;case"cancel":this.Close();break}};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,r=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}}r=true;this.value.setUTCHours(i%24)}if(!isNaN(s)){r=true;this.value.setUTCMinutes(s%60)}if(r){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 r=15;var n;(n=function(){s+=a*r;i+=a*r;if(a*s<0){e.style.top=i+"px";t.style.top=s+"px";setTimeout(n,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(),r="";for(var n=0;n<this.numRows;n++){r+='<div class="bx-calendar-range'+(n==this.numRows-1?" bx-calendar-range-noline":"")+'">';
5981for(var o=0;o<7;o++){a=t.getUTCDate();var l=t.getUTCDay();var u="bx-calendar-cell";if(i!=t.getUTCMonth())u+=" bx-calendar-date-hidden";else if(s==a)u+=" bx-calendar-active";if(l==0||l==6)u+=" bx-calendar-weekend";r+='<a href="javascript:void(0)" class="'+u+'" data-date="'+t.valueOf()+'">'+a+"</a>";t.setUTCDate(t.getUTCDate()+1)}r+="</div>"}e.innerHTML=r;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+='<a href="javascript:void(0)" class="bx-calendar-month'+(a==t?" bx-calendar-month-active":"")+'" onclick="BX.calendar.get().SetMonth('+a+')">'+BX.message("MONTH_"+(a+1))+"</a>"}return'<div class="bx-calendar-month-popup"><div class="bx-calendar-month-title" onclick="BX.calendar.get().popup_month.close();">'+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_"+this.control_id,this.PARTS.MONTH,{content:this._menu_month_content(),zIndex:3001,closeByEsc:true,autoHide:true,offsetTop:-29,offsetLeft:-1,events:{onPopupShow:BX.delegate(function(){if(this.popup_year){this.popup_year.close()}},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._menu_year_content=function(){var e='<div class="bx-calendar-year-popup"><div class="bx-calendar-year-title" onclick="BX.calendar.get().popup_year.close();">'+this.value.getUTCFullYear()+'</div><div class="bx-calendar-year-content" id="bx-calendar-year-content">';for(var t=-3;t<=3;t++){e+='<a href="javascript:void(0)" class="bx-calendar-year-number'+(t==0?" bx-calendar-year-active":"")+'" onclick="BX.calendar.get().SetYear('+(this.value.getUTCFullYear()-t)+')">'+(this.value.getUTCFullYear()-t)+"</a>"}e+='</div><input type="text" class="bx-calendar-year-input" onkeyup="if(this.value>=1900&&this.value<=2100)BX.calendar.get().SetYear(this.value);" maxlength="4" /></div>';return e};this._menu_year=function(){if(!this.popup_year){this.popup_year=new BX.PopupWindow("calendar_popup_year_"+this.control_id,this.PARTS.YEAR,{content:this._menu_year_content(),zIndex:3001,closeByEsc:true,autoHide:true,offsetTop:-29,offsetLeft:-1,events:{onPopupShow:BX.delegate(function(){if(this.popup_month){this.popup_month.close()}},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._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);if(!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.bTime=typeof this.params.bTime=="undefined"?true:!!this.params.bTime;this.params.bHideTime=typeof this.params.bHideTime=="undefined"?true:!!this.params.bHideTime;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)BX.removeClass(this.DIV,"bx-calendar-time-disabled");else BX.addClass(this.DIV,"bx-calendar-time-disabled");if(!!i)BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");else BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-opened");if(a){this._auto_hide_disable();this.popup.show();setTimeout(BX.proxy(this._auto_hide_enable,this),0)}
5981this.params.bSetFocus=typeof this.params.bSetFocus=="undefined"?true:!!this.params.bSetFocus;if(this.params.bSetFocus)e.node.blur();return this};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){this.params.field.value=BX.calendar.ValueToString(this.value,a,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;if(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,r,n,o){return BX.calendar({no
5981de:e,field:t,form:n,bTime:!!s,currentTime:r,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||{ 5982titleBar:BX.message("CAL_TIME"),offsetLeft:-45,offsetTop:-135,autoHide:true,closeIcon:true,closeByEsc:true,zIndex:this.params.zIndex});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}})(); 5983/* End */ 5984; 5985; /* Start:"a:4:{s:4:"full";s:44:"/bitrix/js/main/utils.min.js?145803104219858";s:6:"source";s:24:"/bitrix/js/main/utils.js";s:3:"min";s:28:"/bitrix/js/main/utils.min.js";s:3:"map";s:28:"/bitrix/js/main/utils.map.js";}"*/ 5986var phpVars;if(!phpVars){phpVars={ADMIN_THEME_ID:".default",LANGUAGE_ID:"en",FORMAT_DATE:"DD.MM.YYYY",FORMAT_DATETIME:"DD.MM.YYYY HH:MI:SS",opt_context_ctrl:false,cookiePrefix:"BITRIX_SM",titlePrefix:"",bitrix_sessid:"",messHideMenu:"",messShowMenu:"",messHideButtons:"",messShowButtons:"",messFilterInactive:"",messFilterActive:"",messFilterLess:"",messLoading:"Loading...",messMenuLoading:"",messMenuLoadingTitle:"",messNoData:"",messExpandTabs:"",messCollapseTabs:"",messPanelFixOn:"",messPanelFixOff:"",messPanelCollapse:"",messPanelExpand:""}}var jsUtils={arEvents:Array(),addEvent:function(e,t,n,i){if(e.attachEvent)e.attachEvent("on"+t,n);else if(e.addEventListener)e.addEventListener(t,n,false);else e["on"+t]=n;this.arEvents[this.arEvents.length]={element:e,event:t,fn:n}},removeEvent:function(e,t,n){if(e.detachEvent)e.detachEvent("on"+t,n);else if(e.removeEventListener)e.removeEventListener(t,n,false);else e["on"+t]=null},removeAllEvents:function(e){var t;for(t=0;t<this.arEvents.length;t++){if(this.arEvents[t]&&(e==false||e==this.arEvents[t].element)){jsUtils.removeEvent(this.arEvents[t].element,this.arEvents[t].event,this.arEvents[t].fn);this.arEvents[t]=null}}if(e==false)this.arEvents.length=0},IsDoctype:function(){if(document.compatMode)return document.compatMode=="CSS1Compat";
5986if(document.documentElement&&document.documentElement.clientHeight)return true;return false},GetRealPos:function(e){if(window.BX)return BX.pos(e);if(!e||!e.offsetParent)return false;var t=Array();t["left"]=e.offsetLeft;t["top"]=e.offsetTop;var n=e.offsetParent;while(n&&n.tagName!="BODY"){t["left"]+=n.offsetLeft;t["top"]+=n.offsetTop;n=n.offsetParent}t["right"]=t["left"]+e.offsetWidth;t["bottom"]=t["top"]+e.offsetHeight;return t},FindChildObject:function(e,t,n,i){if(!e)return null;var o=t.toUpperCase();var s=n?n.toLowerCase():null;var r=e.childNodes.length;for(var l=0;l<r;l++){var a=e.childNodes[l];if(a.tagName&&a.tagName.toUpperCase()==o)if(!n||a.className.toLowerCase()==s)return a;if(i==true){var d;if(d=jsUtils.FindChildObject(a,t,n,true))return d}}return null},FindParentObject:function(e,t,n){if(!e)return null;var i=e;var o=t.toUpperCase();var s=n?n.toLowerCase():null;while(i.parentNode){var r=i.parentNode;if(r.tagName&&r.tagName.toUpperCase()==o)if(!n||r.className.toLowerCase()==s)return r;i=r}return null},FindNextSibling:function(e,t){if(!e)return null;var n=e;var i=t.toUpperCase();while(n.nextSibling){var o=n.nextSibling;if(o.tagName&&o.tagName.toUpperCase()==i)return o;n=o}return null},FindPreviousSibling:function(e,t){if(!e)return null;var n=e;var i=t.toUpperCase();while(n.previousSibling){var o=n.previousSibling;if(o.tagName&&o.tagName.toUpperCase()==i)return o;n=o}return null},bOpera:navigator.userAgent.toLowerCase().indexOf("opera")!=-1,bIsIE:document.attachEvent&&navigator.userAgent.toLowerCase().indexOf("opera")==-1,IsIE:function(){return this.bIsIE},IsOpera:function(){return this.bOpera},IsSafari:function(){var e=navigator.userAgent.toLowerCase();return/webkit/.test(e)},IsEditor:function(){var e=navigator.userAgent.toLowerCase();var t=(e.match(/.+(msie)[\/: ]([\d.]+)/)||[])[2];var n=/webkit/.test(e);if(this.IsOpera()||document.all&&!document.compatMode&&t<6||n)return false;return true},ToggleDiv:function(e){var t=document.getElementById(e).style;if(t.display!="none")t.display="none";else t.display="block";return t.display!="none"},urlencode:function(e){return escape(e).replace(new RegExp("\\+","g"),"%2B")},OpenWindow:function(e,t,n){var i=screen.width,o=screen.height;if(this.IsOpera()){i=document.body.offsetWidth;o=document.body.offsetHeight}window.open(e,"","status=no,scrollbars=yes,resizable=yes,width="+t+",height="+n+",top="+Math.floor((o-n)/2-14)+",left="+Math.floor((i-t)/2-5))},SetPageTitle:function(e){document.title=phpVars.titlePrefix+e;var t=document.getElementsByTagName("H1");if(t)t[0].innerHTML=e},LoadPageToDiv:function(e,t){var n=document.getElementById(t);if(!n)return;CHttpRequest.Action=function(e){CloseWaitWindow();document.getElementById(t).innerHTML=e};ShowWaitWindow();CHttpRequest.Send(e)},trim:function(e){if(typeof e=="string"||typeof e=="object"&&e.constructor==String){var t,n;n=/^[\s\r\n]+/g;t=e.replace(n,"");n=/[\s\r\n]+$/g;t=t.replace(n,"");return t}else return e},Redirect:function(e,t){var n=null,i=false;if(e&&e.length>0)n=e[0];if(!n)n=window.event;if(n)i=n.shiftKey;if(i)window.open(t);else{window.location.href=t}},False:function(){return false},AlignToPos:function(e,t,n){var i=e["left"],o=e["bottom"];var s=jsUtils.GetWindowScrollPos();var r=jsUtils.GetWindowInnerSize();if(r.innerWidth+s.scrollLeft-(e["left"]+t)<0){if(e["right"]-t>=0)i=e["right"]-t;else i=s.scrollLeft}if(r.innerHeight+s.scrollTop-(e["bottom"]+n)<0){if(e["top"]-n>=0)o=e["top"]-n;else o=s.scrollTop}return{left:i,top:o}},EvalGlobal:function(e){try{if(window.execScript)window.execScript(e,"javascript");else if(jsUtils.IsSafari())window.setTimeout(e,0);else window.eval(e)}catch(t){}},GetStyleValue:function(e,t){var n;if(e.currentStyle)n=e.currentStyle[t];else if(window.getComputedStyle)n=document.defaultView.getComputedStyle(e,null).getPropertyValue(t);if(!n)n="";return n},GetWindowInnerSize:function(e){var t,n;if(!e)e=document;if(self.innerHeight){t=self.innerWidth;n=self.innerHeight}else if(e.documentElement&&(e.documentElement.clientHeight||e.documentElement.clientWidth)){t=e.documentElement.clientWidth;n=e.documentElement.clientHeight}else if(e.body){t=e.body.clientWidth;n=e.body.clientHeight}
5986return{innerWidth:t,innerHeight:n}},GetWindowScrollPos:function(e){var t,n;if(!e)e=document;if(self.pageYOffset){t=self.pageXOffset;n=self.pageYOffset}else if(e.documentElement&&(e.documentElement.scrollTop||e.documentElement.scrollLeft)){t=document.documentElement.scrollLeft;n=document.documentElement.scrollTop}else if(e.body){t=e.body.scrollLeft;n=e.body.scrollTop}return{scrollLeft:t,scrollTop:n}},GetWindowScrollSize:function(e){var t,n;if(!e)e=document;if(e.compatMode&&e.compatMode=="CSS1Compat"){t=e.documentElement.scrollWidth;n=e.documentElement.scrollHeight}else{if(e.body.scrollHeight>e.body.offsetHeight)n=e.body.scrollHeight;else n=e.body.offsetHeight;if(e.body.scrollWidth>e.body.offsetWidth||e.compatMode&&e.compatMode=="BackCompat"||e.documentElement&&!e.documentElement.clientWidth)t=e.body.scrollWidth;else t=e.body.offsetWidth}return{scrollWidth:t,scrollHeight:n}},GetWindowSize:function(){var e=jsUtils.GetWindowInnerSize();var t=jsUtils.GetWindowScrollPos();var n=jsUtils.GetWindowScrollSize();return{innerWidth:e.innerWidth,innerHeight:e.innerHeight,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight}},arCustomEvents:{},addCustomEvent:function(e,t,n,i){if(!this.arCustomEvents[e])this.arCustomEvents[e]=[];if(!n)n=[];if(!i)i=false;this.arCustomEvents[e].push({handler:t,arParams:n,obj:i})},removeCustomEvent:function(e,t){if(!this.arCustomEvents[e])return;var n=this.arCustomEvents[e].length;if(n==1){delete this.arCustomEvents[e];return}for(var i=0;i<n;i++){if(!this.arCustomEvents[e][i])continue;if(this.arCustomEvents[e][i].handler==t){delete this.arCustomEvents[e][i];return}}},onCustomEvent:function(e,t){if(!this.arCustomEvents[e])return;if(!t)t=[];var n;for(var i=0,o=this.arCustomEvents[e].length;i<o;i++){n=this.arCustomEvents[e][i];if(!n||!n.handler)continue;if(n.obj)n.handler.call(n.obj,n.arParams,t);else n.handler(n.arParams,t)}},loadJSFile:function(e,t,n){if(!n)n=document;if(typeof e=="string")e=[e];var i=function(){if(!t)return;if(typeof t=="function")return t();if(typeof t!="object"||!t.func)return;var e=t.params||{};if(t.obj)t.func.apply(t.obj,e);else t.func(e)};var o=function(t){if(t>=e.length)return i();var s=n.body.appendChild(n.createElement("script"));s.src=e[t];var r=false;s.onload=s.onreadystatechange=function(){if(!r&&(!s.readyState||s.readyState=="loaded"||s.readyState=="complete")){r=true;setTimeout(function(){o(++t)},50)}}};o(0)},loadCSSFile:function(e,t,n){if(typeof e=="string"){var i=true;e=[e]}var o,s=e.length,r=[];if(s==0)return;if(!t)t=document;if(!n)n=window;if(!n.bxhead){var l=t.getElementsByTagName("HEAD");n.bxhead=l[0]}if(!n.bxhead)return;for(o=0;o<s;o++){var a=document.createElement("LINK");a.href=e[o];a.rel="stylesheet";a.type="text/css";n.bxhead.appendChild(a);r.push(a)}if(i)return a;return r},appendBXHint:function(e,t){if(!e||!e.parentNode||!t)return;var n=new BXHint(t);e.parentNode.insertBefore(n.oIcon,e);e.parentNode.removeChild(e);n.oIcon.style.marginLeft="5px"},PreventDefault:function(e){if(!e)e=window.event;if(e.stopPropagation){e.preventDefault();e.stopPropagation()}else{e.cancelBubble=true;e.returnValue=false}return false},CreateElement:function(e,t,n,i){if(!i)i=document;var o=i.createElement(e),s;if(t){for(s in t){if(s=="className"||s=="class"){o.setAttribute("class",t[s]);if(jsUtils.IsIE())o.setAttribute("className",t[s]);continue}if(t[s]!=undefined&&t[s]!=null)o.setAttribute(s,t[s])}}if(n){for(s in n)o.style[s]=n[s]}return o},in_array:function(e,t){for(var n=0;n<t.length;n++){if(t[n]==e)return true}return false},htmlspecialchars:function(e){if(!e.replace)return e;return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}};function JCFloatDiv(){var e=this;this.floatDiv=null;this.x=this.y=0;this.Create=function(e){var t=document.body.appendChild(document.createElement("DIV"));t.id=e.id;t.style.position="absolute";t.style.left="-10000px";t.style.top="-10000px";if(e.className)t.className=e.className;if(e.zIndex)t.style.zIndex=e.zIndex;if(e.width)t.style.width=e.width+"px";if(e.height)t.style.height=e.height+"px";return t};
5986this.Show=function(e,t,n,i,o,s){if(s!==false)s=true;var r=parseInt(e.style.zIndex);if(r<=0||isNaN(r))r=100;e.style.zIndex=r;if(t<0)t=0;if(n<0)n=0;e.style.left=parseInt(t)+"px";e.style.top=parseInt(n)+"px";if(jsUtils.IsIE()&&s===true){var l=document.getElementById(e.id+"_frame");if(!l){l=document.createElement("IFRAME");l.src="javascript:''";l.id=e.id+"_frame";l.style.position="absolute";l.style.borderWidth="0px";l.style.zIndex=r-1;document.body.appendChild(l)}l.style.width=e.offsetWidth+"px";l.style.height=e.offsetHeight+"px";l.style.left=e.style.left;l.style.top=e.style.top;l.style.visibility="visible"}e.restrictDrag=o||false;if(isNaN(i))i=5;if(i>0){var a=document.getElementById(e.id+"_shadow");if(!a){if(jsUtils.IsIE()){a=document.createElement("DIV");a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/shadow.png',sizingMethod='scale')"}else{a=document.createElement("IMG");a.src="/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/shadow.png"}a.id=e.id+"_shadow";a.style.position="absolute";a.style.zIndex=r-2;a.style.left="-1000px";a.style.top="-1000px";a.style.lineHeight="normal";a.className="bx-js-float-shadow";document.body.appendChild(a)}a.style.width=e.offsetWidth+"px";a.style.height=e.offsetHeight+"px";a.style.left=parseInt(e.style.left)+i+"px";a.style.top=parseInt(e.style.top)+i+"px";a.style.visibility="visible"}e.dxShadow=i};this.Close=function(e){if(!e)return;var t=document.getElementById(e.id+"_shadow");if(t)t.style.visibility="hidden";var n=document.getElementById(e.id+"_frame");if(n)n.style.visibility="hidden"};this.Move=function(e,t,n){if(!e)return;var i=e.dxShadow;var o=parseInt(e.style.left)+t;var s=parseInt(e.style.top)+n;if(e.restrictDrag){if(o<0)o=0;if(document.compatMode&&document.compatMode=="CSS1Compat")windowWidth=document.documentElement.scrollWidth;else{if(document.body.scrollWidth>document.body.offsetWidth||document.compatMode&&document.compatMode=="BackCompat"||document.documentElement&&!document.documentElement.clientWidth)windowWidth=document.body.scrollWidth;else windowWidth=document.body.offsetWidth}var r=e.offsetWidth;if(o>windowWidth-r-i)o=windowWidth-r-i;if(s<0)s=0}e.style.left=o+"px";e.style.top=s+"px";this.AdjustShadow(e)};this.HideShadow=function(e){var t=document.getElementById(e.id+"_shadow");t.style.visibility="hidden"};this.UnhideShadow=function(e){var t=document.getElementById(e.id+"_shadow");t.style.visibility="visible"};this.AdjustShadow=function(e){var t=document.getElementById(e.id+"_shadow");if(t&&t.style.visibility!="hidden"){var n=e.dxShadow;t.style.width=e.offsetWidth+"px";t.style.height=e.offsetHeight+"px";t.style.left=parseInt(e.style.left)+n+"px";t.style.top=parseInt(e.style.top)+n+"px"}var i=document.getElementById(e.id+"_frame");if(i){i.style.width=e.offsetWidth+"px";i.style.height=e.offsetHeight+"px";i.style.left=e.style.left;i.style.top=e.style.top}};this.StartDrag=function(t,n){if(!t)t=window.event;this.x=t.clientX+document.body.scrollLeft;this.y=t.clientY+document.body.scrollTop;this.floatDiv=n;jsUtils.addEvent(document,"mousemove",this.MoveDrag);document.onmouseup=this.StopDrag;if(document.body.setCapture)document.body.setCapture();document.onmousedown=jsUtils.False;var i=document.body;i.ondrag=jsUtils.False;i.onselectstart=jsUtils.False;i.style.MozUserSelect=e.floatDiv.style.MozUserSelect="none";i.style.cursor="move"};this.StopDrag=function(t){if(document.body.releaseCapture)document.body.releaseCapture();jsUtils.removeEvent(document,"mousemove",e.MoveDrag);document.onmouseup=null;this.floatDiv=null;document.onmousedown=null;var n=document.body;n.ondrag=null;n.onselectstart=null;n.style.MozUserSelect=e.floatDiv.style.MozUserSelect="";n.style.cursor=""};this.MoveDrag=function(t){var n=t.clientX+document.body.scrollLeft;var i=t.clientY+document.body.scrollTop;if(e.x==n&&e.y==i)return;e.Move(e.floatDiv,n-e.x,i-e.y);e.x=n;e.y=i}}var jsFloatDiv=new JCFloatDiv;var BXHint=function(e,t,n){this.oDivOver=false;this.timeOutID=null;this.oIcon=null;this.freeze=false;this.x=0;this.y=0;this.time=700;if(!e)e="";this.Create(e,t,n)};BXHint.prototype.Create=function(e,t,n){var i=this,o=0,s=0,r=null,l="icon";this.bWidth=true;if(n){if(n.width===false)this.bWidth=false;else if(n.width)o=n.width;if(n.height)s=n.height;if(n.className)r=n.className;if(n.type&&(n.type=="link"||n.type=="icon"))l=n.type;if(n.time>0)this.time=n.time}if(t)l="element";if(l=="icon"){var t=document.createElement("IMG");t.src=n&&n.iconSrc?n.iconSrc:"/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/public/popup/hint.gif";t.ondrag=jsUtils.False}else if(l=="link"){var t=document.createElement("A");t.href="";t.onclick=function(e){return false};t.innerHTML="[?]"}this.element=t;if(l=="element"){if(n&&n.show_on_click){jsUtils.addEvent(t,"click",function(t){if(!t)t=window.event;i.GetMouseXY(t);i.timeOutID=setTimeout(function(){i.Show(e,o,s,r)},10)})}else{jsUtils.addEvent(t,"mouseover",function(t){if(!t)t=window.event;i.GetMouseXY(t);i.timeOutID=setTimeout(function(){i.Show(e,o,s,r)},750)})}jsUtils.addEvent(t,"mouseout",function(e){if(i.timeOutID)clearTimeout(i.timeOutID);i.SmartHide(i)})}else{this.oIcon=t;t.onmouseover=function(t){if(!t)t=window.event;i.GetMouseXY(t);i.Show(e,o,s,r)};t.onmouseout=function(){i.SmartHide(i)}}};BXHint.prototype.IsFrozen=function(){return this.freeze};BXHint.prototype.Freeze=function(){this.freeze=true;this.Hide()};BXHint.prototype.UnFreeze=function(){this.freeze=false};BXHint.prototype.GetMouseXY=function(e){if(e.pageX||e.pageY){this.x=e.pageX;this.y=e.pageY}else if(e.clientX||e.clientY){this.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;this.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}};BXHint.prototype.Show=function(e,t,n,i){var o=document.getElementById("__BXHint_div");if(o)this.Hide();if(this.freeze)return;var s=this;var r=document.body.appendChild(document.createElement("DIV"));r.onmouseover=function(){s.oDivOver=true};r.onmouseout=function(){s.oDivOver=false;s.SmartHide(s)};r.id="__BXHint_div";r.className=i?i:"bxhint";r.style.position="absolute";if(t&&this.bWidth)r.style.width=t+"px";if(n)r.style.height=n+"px";r.innerHTML=e;var l=r.offsetWidth;var a=r.offsetHeight;if(this.bWidth){if(!t&&l>200)l=Math.round(Math.sqrt(1.618*l*a));r.style.width=l+"px";a=r.offsetHeight}var d={left:this.x+10,right:this.x+l,top:this.y,bottom:this.y+a};d=this.AlignToPos(d,l,a);r.style.zIndex=2100;jsFloatDiv.Show(r,d.left,d.top,3);r=null};BXHint.prototype.AlignToPos=function(e,t,n){var i=document.body;if(i.clientWidth+i.scrollLeft<e.left+t)e.left=e.left-t>=0?e.left-t:i.scrollLeft;if(i.clientHeight+i.scrollTop-e["bottom"]<0)e.top=e.top-n>=0?e.top-n:i.scrollTop;return e};BXHint.prototype.Hide=function(){var e=document.getElementById("__BXHint_div");if(!e)return;jsFloatDiv.Close(e);e.parentNode.removeChild(e);e=null};BXHint.prototype.SmartHide=function(e){setTimeout(function(){if(!e.oDivOver)e.Hide()},100)};function WaitOnKeyPress(e){if(!e)e=window.event;if(!e)return;if(e.keyCode==27)CloseWaitWindow()}function ShowWaitWindow(){CloseWaitWindow();var e=jsUtils.GetWindowSize();var t=document.body.appendChild(document.createElement("DIV"));t.id="wait_window_div";t.innerHTML=phpVars.messLoading;t.className="waitwindow";t.style.right=5-e.scrollLeft+"px";t.style.top=e.scrollTop+5+"px";
5986if(jsUtils.IsIE()){var n=document.createElement("IFRAME");n.src="javascript:''";n.id="wait_window_frame";n.className="waitwindow";n.style.width=t.offsetWidth+"px";n.style.height=t.offsetHeight+"px";n.style.right=t.style.right;n.style.top=t.style.top;document.body.appendChild(n)}jsUtils.addEvent(document,"keypress",WaitOnKeyPress)}function CloseWaitWindow(){jsUtils.removeEvent(document,"keypress",WaitOnKeyPress);var e=document.getElementById("wait_window_frame");if(e)e.parentNode.removeChild(e);var t=document.getElementById("wait_window_div");if(t)t.parentNode.removeChild(t)}var jsSelectUtils={addNewOption:function(e,t,n,i,o){var s=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(s){var r=s.length;if(o!==false){for(var l=0;l<r;l++)if(s[l].value==t)return}var a=new Option(n,t,false,false);s.options[r]=a}if(i===true)this.sortSelect(e)},deleteOption:function(e,t){var n=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(n){for(var i=0;i<n.length;i++)if(n[i].value==t){n.remove(i);break}}},deleteSelectedOptions:function(e){var t=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(t){var n=0;while(n<t.length)if(t[n].selected){t[n].selected=false;t.remove(n)}else n++}},deleteAllOptions:function(e){if(e){for(var t=e.length-1;t>=0;t--)e.remove(t)}},optionCompare:function(e,t){var n=e.optText.toLowerCase();var i=t.optText.toLowerCase();if(n>i)return 1;if(n<i)return-1;return 0},sortSelect:function(e){var t=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(t){var n=[];var i=t.options.length;for(var o=0;o<i;o++){n[o]={optText:t[o].text,optValue:t[o].value}}n.sort(this.optionCompare);t.length=0;i=n.length;for(var o=0;o<i;o++){var s=new Option(n[o].optText,n[o].optValue,false,false);t[o]=s}}},selectAllOptions:function(e){var t=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(t){var n=t.length;for(var i=0;i<n;i++)t[i].selected=true}},selectOption:function(e,t){var n=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(n){var i=n.length;for(var o=0;o<i;o++)n[o].selected=n[o].value==t}},addSelectedOptions:function(e,t,n,i){if(!e)return;var o=e.length;for(var s=0;s<o;s++)if(e[s].selected)this.addNewOption(t,e[s].value,e[s].text,i,n)},moveOptionsUp:function(e){if(!e)return;var t=e.length;for(var n=0;n<t;n++){if(e[n].selected&&n>0&&e[n-1].selected==false){var i=new Option(e[n].text,e[n].value);var o=new Option(e[n-1].text,e[n-1].value);e[n]=o;e[n].selected=false;e[n-1]=i;e[n-1].selected=true}}},moveOptionsDown:function(e){if(!e)return;var t=e.length;for(var n=t-1;n>=0;n--){if(e[n].selected&&n<t-1&&e[n+1].selected==false){var i=new Option(e[n].text,e[n].value);var o=new Option(e[n+1].text,e[n+1].value);e[n]=o;e[n].selected=false;e[n+1]=i;e[n+1].selected=true}}}}; 5987/* End */ 5988; 5989; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/core/core_ajax.min.js?149879921321435";s:6:"source";s:33:"/bitrix/js/main/core/core_ajax.js";s:3:"min";s:37:"/bitrix/js/main/core/core_ajax.min.js";s:3:"map";s:37:"/bitrix/js/main/core/core_ajax.map.js";}"*/ 5990(function(e){if(e.BX.ajax)return;var a=e.BX,t={},r={method:"GET",dataType:"html",timeout:0,async:true,processData:true,scriptsRunFirst:false,emulateOnload:true,skipAuthCheck:false,start:true,cache:true,preparePost:true,headers:false,lsTimeout:30,lsForce:false},o=null,n={},s=[],i={url_utf:/[^\034-\254]+/g,script_self:/\/bitrix\/js\/main\/core\/core(_ajax)*.js$/i,script_self_window:/\/bitrix\/js\/main\/core\/core_window.js$/i,script_self_admin:/\/bitrix\/js\/main\/core\/core_admin.js$/i,script_onload:/window.onload/g};a.ajax=function(e){var o,n;if(!e||!e.url||!a.type.isString(e.url)){return false}for(var s in t)if(typeof e[s]=="undefined")e[s]=t[s];t={};for(s in r)if(typeof e[s]=="undefined")e[s]=r[s];e.method=e.method.toUpperCase();if(!a.localStorage)e.lsId=null;if(a.browser.IsIE()){var u=i.url_utf.exec(e.url);if(u){do{e.url=e.url.replace(u,a.util.urlencode(u));u=i.url_utf.exec(e.url)}while(u)}}if(e.dataType=="json")e.emulateOnload=false;if(!e.cache&&e.method=="GET")e.url=a.ajax._uncache(e.url);if(e.method=="POST"&&e.preparePost){e.data=a.ajax.prepareData(e.data)}var l=true;if(e.lsId&&!e.lsForce){var c=a.localStorage.get("ajax-"+e.lsId);if(c!==null){l=false;var f=function(t){if(t.key=="ajax-"+e.lsId&&t.value!="BXAJAXWAIT"){var r=t.value,o=!!t.oldValue&&r==null;if(!o)a.ajax.__run(e,r);else if(e.onfailure)e.onfailure("timeout");a.removeCustomEvent("onLocalStorageChange",f)}};if(c=="BXAJAXWAIT"){a.addCustomEvent("onLocalStorageChange",f)}else{setTimeout(function(){f({key:"ajax-"+e.lsId,value:c})},10)}}}if(l){e.xhr=a.ajax.xhr();if(!e.xhr)return;if(e.lsId){a.localStorage.set("ajax-"+e.lsId,"BXAJAXWAIT",e.lsTimeout)}e.xhr.open(e.method,e.url,e.async);if(!e.skipBxHeader&&!a.ajax.isCrossDomain(e.url)){e.xhr.setRequestHeader("Bx-ajax","true")}if(e.method=="POST"&&e.preparePost){e.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(typeof e.headers=="object"){for(s=0;s<e.headers.length;s++)e.xhr.setRequestHeader(e.headers[s].name,e.headers[s].value)}if(!!e.onprogress){a.bind(e.xhr,"progress",e.onprogress)}var h=false;var p=e.xhr.onreadystatechange=function(t){if(h)return;if(t==="timeout"){if(e.onfailure){e.onfailure("timeout")}a.onCustomEvent(e.xhr,"onAjaxFailure",["timeout","",e]);e.xhr.onreadystatechange=a.DoNothing;e.xhr.abort();if(e.async){e.xhr=null}}else{if(e.xhr.readyState==4||t=="run"){o=a.ajax.xhrSuccess(e.xhr)?"success":"error";h=true;e.xhr.onreadystatechange=a.DoNothing;if(o=="success"){var r=!!e.skipAuthCheck||a.ajax.isCrossDomain(e.url)?false:e.xhr.getResponseHeader("X-Bitrix-Ajax-Status");
5990if(!!r&&r=="Authorize"){if(e.onfailure){e.onfailure("auth",e.xhr.status)}a.onCustomEvent(e.xhr,"onAjaxFailure",["auth",e.xhr.status,e])}else{var n=e.xhr.responseText;if(e.lsId){a.localStorage.set("ajax-"+e.lsId,n,e.lsTimeout)}a.ajax.__run(e,n)}}else{if(e.onfailure){e.onfailure("status",e.xhr.status)}a.onCustomEvent(e.xhr,"onAjaxFailure",["status",e.xhr.status,e])}if(e.async){e.xhr=null}}}};if(e.async&&e.timeout>0){setTimeout(function(){if(e.xhr&&!h){p("timeout")}},e.timeout*1e3)}if(e.start){e.xhr.send(e.data);if(!e.async){p("run")}}return e.xhr}};a.ajax.xhr=function(){if(e.XMLHttpRequest){try{return new XMLHttpRequest}catch(a){}}else if(e.ActiveXObject){try{return new e.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new e.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new e.ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}throw new Error("This browser does not support XMLHttpRequest.")}return null};a.ajax.isCrossDomain=function(t,r){r=r||e.location;if(t.indexOf("//")===0){t=r.protocol+t}if(t.indexOf("http")!==0){return false}var o=e.document.createElement("a");o.href=t;return o.protocol!==r.protocol||o.hostname!==r.hostname||a.ajax.getHostPort(o.protocol,o.host)!==a.ajax.getHostPort(r.protocol,r.host)};a.ajax.getHostPort=function(e,a){var t=/:(\d+)$/.exec(a);if(t){return t[1]}else{if(e==="http:"){return"80"}else if(e==="https:"){return"443"}}return""};a.ajax.__prepareOnload=function(t){if(t.length>0){a.ajax["onload_"+o]=null;for(var r=0,n=t.length;r<n;r++){if(t[r].isInternal){t[r].JS=t[r].JS.replace(i.script_onload,"BX.ajax.onload_"+o)}}}a.CaptureEventsGet();a.CaptureEvents(e,"load")};a.ajax.__runOnload=function(){if(null!=a.ajax["onload_"+o]){a.ajax["onload_"+o].apply(e);a.ajax["onload_"+o]=null}var t=a.CaptureEventsGet();if(t){for(var r=0;r<t.length;r++)t[r].apply(e)}};a.ajax.__run=function(e,t){if(!e.processData){if(e.onsuccess){e.onsuccess(t)}a.onCustomEvent(e.xhr,"onAjaxSuccess",[t,e])}else{t=a.ajax.processRequestData(t,e)}};a.ajax._onParseJSONFailure=function(e){this.jsonFailure=true;this.jsonResponse=e;this.jsonProactive=/^\[WAF\]/.test(e)};a.ajax.processRequestData=function(e,t){var r,n=[],s=[];switch(t.dataType.toUpperCase()){case"JSON":a.addCustomEvent(t.xhr,"onParseJSONFailure",a.proxy(a.ajax._onParseJSONFailure,t));r=a.parseJSON(e,t.xhr);a.removeCustomEvent(t.xhr,"onParseJSONFailure",a.proxy(a.ajax._onParseJSONFailure,t));if(!!r&&a.type.isArray(r["bxjs"])){for(var i=0;i<r["bxjs"].length;
5990i++){if(a.type.isNotEmptyString(r["bxjs"][i])){n.push({isInternal:false,JS:r["bxjs"][i],bRunFirst:t.scriptsRunFirst})}else{n.push(r["bxjs"][i])}}}if(!!r&&a.type.isArray(r["bxcss"])){s=r["bxcss"]}break;case"SCRIPT":n.push({isInternal:true,JS:e,bRunFirst:t.scriptsRunFirst});r=e;break;default:var u=a.processHTML(e,t.scriptsRunFirst);r=u.HTML;n=u.SCRIPT;s=u.STYLE;break}var l=false;if(null==o){o=parseInt(Math.random()*1e6);l=true}if(s.length>0)a.loadCSS(s);if(t.emulateOnload)a.ajax.__prepareOnload(n);var c=a.DoNothing;if(t.emulateOnload||l){c=a.defer(function(){if(t.emulateOnload)a.ajax.__runOnload();if(l)o=null;a.onCustomEvent(t.xhr,"onAjaxSuccessFinish",[t])})}try{if(!!t.jsonFailure){throw{type:"json_failure",data:t.jsonResponse,bProactive:t.jsonProactive}}t.scripts=n;a.ajax.processScripts(t.scripts,true);if(t.onsuccess){t.onsuccess(r)}a.onCustomEvent(t.xhr,"onAjaxSuccess",[r,t]);a.ajax.processScripts(t.scripts,false,c)}catch(f){if(t.onfailure)t.onfailure("processing",f);a.onCustomEvent(t.xhr,"onAjaxFailure",["processing",f,t])}};a.ajax.processScripts=function(e,t,r){var o=[],n="";r=r||a.DoNothing;for(var s=0,i=e.length;s<i;s++){if(typeof t!="undefined"&&t!=!!e[s].bRunFirst)continue;if(e[s].isInternal)n+=";"+e[s].JS;else o.push(e[s].JS)}o=a.util.array_unique(o);var u=n.length>0?function(){a.evalGlobal(n)}:a.DoNothing;if(o.length>0){a.load(o,function(){u();r()})}else{u();r()}};a.ajax.prepareData=function(e,t){var r="";if(a.type.isString(e))r=e;else if(null!=e){for(var o in e){if(e.hasOwnProperty(o)){if(r.length>0)r+="&";var n=a.util.urlencode(o);if(t)n=t+"["+n+"]";if(typeof e[o]=="object")r+=a.ajax.prepareData(e[o],n);else r+=n+"="+a.util.urlencode(e[o])}}}return r};a.ajax.xhrSuccess=function(e){return e.status>=200&&e.status<300||e.status===304||e.status===1223||e.status===0};a.ajax.Setup=function(e,a){a=!!a;for(var o in e){if(a)t[o]=e[o];else r[o]=e[o]}};a.ajax.replaceLocalStorageValue=function(e,t,r){if(!!a.localStorage)a.localStorage.set("ajax-"+e,t,r)};a.ajax._uncache=function(e){return e+((e.indexOf("?")!==-1?"&":"?")+"_="+(new Date).getTime())};a.ajax.get=function(e,t,r){if(a.type.isFunction(t)){r=t;t=""}t=a.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return a.ajax({method:"GET",dataType:"html",url:e,data:"",onsuccess:r})};a.ajax.getCaptcha=function(e){return a.ajax.loadJSON("/bitrix/tools/ajax_captcha.php",e)};a.ajax.insertToNode=function(e,r){r=a(r);if(!!r){var o={cancel:false};a.onCustomEvent("onAjaxInsertToNode",[{url:e,node:r,eventArgs:o}]);if(o.cancel===true){return}var n=null;if(!t.denyShowWait){n=a.showWait(r);delete t.denyShowWait}return a.ajax.get(e,function(e){r.innerHTML=e;a.closeWait(r,n)})}};a.ajax.post=function(e,t,r){t=a.ajax.prepareData(t);return a.ajax({method:"POST",dataType:"html",url:e,data:t,onsuccess:r})};a.ajax.promise=function(e){var t=new a.Promise;e.onsuccess=function(e){t.fulfill(e)};e.onfailure=function(e,a){t.reject({reason:e,data:a})};e.onprogress=function(e){if(e.position==0&&e.totalSize==0){t.reject({reason:"progress",data:e})}};var r=a.ajax(e);if(!r){t.reject({reason:"init",data:false})}return t};a.ajax.loadScriptAjax=function(e,t,r){if(a.type.isArray(e)){for(var o=0,s=e.length;o<s;o++){a.ajax.loadScriptAjax(e[o],t,r)}}else{var u=e.replace(/\.js\?.*/,".js");if(i.script_self.test(u))return;if(i.script_self_window.test(u)&&a.CWindow)return;if(i.script_self_admin.test(u)&&a.admin)return;if(typeof n[u]=="undefined"){if(!!r){n[u]="";return a.loadScript(e)}else{return a.ajax({url:e,method:"GET",dataType:"script",processData:true,emulateOnload:false,scriptsRunFirst:true,async:false,start:true,onsuccess:function(e){n[u]=e;if(t)t(e)}})}}else if(t){t(n[u])}}};a.ajax.loadJSON=function(e,t,r,o){if(a.type.isFunction(t)){o=r;r=t;t=""}t=a.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return a.ajax({method:"GET",dataType:"json",url:e,onsuccess:r,onfailure:o})};a.ajax.load=function(e,t){if(!a.type.isArray(e))e=[e];var r=0;if(!a.type.isFunction(t))t=a.DoNothing;var o=function(e){if(a.type.isFunction(this.callback))this.callback(e);if(++r>=s)t()};for(var n=0,s=e.length;n<s;n++){switch(e[n].type.toUpperCase()){case"SCRIPT":a.loadScript([e[n].url],a.proxy(o,e[n]));break;case"CSS":a.loadCSS([e[n].url]);if(++r>=s)t();break;case"JSON":a.ajax.loadJSON(e[n].url,a.proxy(o,e[n]));break;default:a.ajax.get(e[n].url,"",a.proxy(o,e[n]));break}}};a.ajax.submit=function(e,t){if(!e.target){if(null==e.BXFormTarget){var r="formTarget_"+Math.random();e.BXFormTarget=document.body.appendChild(a.create("IFRAME",{props:{name:r,id:r,src:"javascript:void(0)"},style:{display:"none"}}))}e.target=e.BXFormTarget.name}e.BXFormCallback=t;a.bind(e.BXFormTarget,"load",a.proxy(a.ajax._submit_callback,e));a.submit(e);return false};a.ajax.submitComponentForm=function(t,r,o){if(!t.target){if(null==t.BXFormTarget){var n="formTarget_"+Math.random();t.BXFormTarget=document.body.appendChild(a.create("IFRAME",{props:{name:n,id:n,src:"javascript:void(0)"},style:{display:"none"}}))}t.target=t.BXFormTarget.name}if(!!o)var s=a.showWait(r);t.BXFormCallback=function(t){if(!!o)a.closeWait(s);var n=function(){if(!!e.bxcompajaxframeonload){setTimeout(function(){e.bxcompajaxframeonload();e.bxcompajaxframeonload=null},10)}};a(r).innerHTML=t;a.onCustomEvent("onAjaxSuccess",[null,null,n])};a.bind(t.BXFormTarget,"load",a.proxy(a.ajax._submit_callback,t));return true};a.ajax._submit_callback=function(){try{if(this.BXFormTarget.contentWindow.location.href.indexOf("http")!=0)return}catch(e){return}if(this.BXFormCallback)this.BXFormCallback.apply(this,[this.BXFormTarget.contentWindow.document.body.innerHTML]);a.unbindAll(this.BXFormTarget)};a.ajax.prepareForm=function(e,a){a=!!a?a:{};var t,r,o,n=[],s=e.elements.length,i=0,u=0;if(!!e){for(t=0;t<s;t++){o=e.elements[t];if(o.disabled)continue;if(!o.type)continue;switch(o.type.toLowerCase()){case"text":case"textarea":case"password":case"number":case"hidden":case"select-one":n.push({name:o.name,value:o.value});u+=o.name.length+o.value.length;break;case"file":if(!!o.files){for(r=0;r<o.files.length;r++){i++;n.push({name:o.name,value:o.files[r],file:true});u+=o.files[r].size}}break;case"radio":case"checkbox":if(o.checked){n.push({name:o.name,value:o.value});u+=o.name.length+o.value.length}break;case"select-multiple":for(var l=0;l<o.options.length;l++){if(o.options[l].selected){n.push({name:o.name,value:o.options[l].value});u+=o.name.length+o.options[l].length}}break;default:break}}t=0;u=0;var c=a,f,h,p;while(t<n.length){var d=n[t].name.indexOf("[");if(d==-1){c[n[t].name]=n[t].value;c=a;t++}else{f=n[t].name.substring(0,d);h=n[t].name.substring(d+1);p=h.indexOf("]");
5990if(p==-1){if(!c[f])c[f]=[];c=a;t++}else if(p==0){if(!c[f])c[f]=[];c=c[f];n[t].name=""+c.length}else{if(!c[f])c[f]={};c=c[f];n[t].name=h.substring(0,p)+h.substring(p+1)}}}}return{data:a,filesCount:i,roughSize:u}};a.ajax.submitAjax=function(t,r){r=r!==null&&typeof r=="object"?r:{};r.url=r["url"]||t.getAttribute("action");var o=r["data"]||{};r.data=a.ajax.prepareForm(t).data;for(var n in o){if(o.hasOwnProperty(n)){r.data[n]=o[n]}}if(!e["FormData"]){a.ajax(r)}else{var s=function(e){var a=Object.prototype.toString.call(e);return a=="[object File]"||a=="[object Blob]"},i=function(e,a,t){if(!!t&&typeof t=="object"&&!s(t)){for(var r in t){if(t.hasOwnProperty(r)){i(e,a==""?r:a+"["+r+"]",t[r])}}}else e.append(a,!!t?t:"")},u=function(e){var t={};if(null!=e){if(typeof e=="object"){for(var r in e){if(e.hasOwnProperty(r)){var o=a.util.urlencode(r);if(typeof e[r]=="object"&&e[r]["file"]!==true)t[o]=u(e[r]);else if(e[r]["file"]===true)t[o]=e[r]["value"];else t[o]=a.util.urlencode(e[r])}}}else t=a.util.urlencode(e)}return t},l=new e.FormData;if(r.method!=="POST"){r.data=a.ajax.prepareData(r.data);if(r.data){r.url+=(r.url.indexOf("?")!==-1?"&":"?")+r.data;r.data=""}}else{if(r.preparePost===true)r.data=u(r.data);i(l,"",r.data);r.data=l}r.preparePost=false;r.start=false;var c=a.ajax(r);if(!!r["onprogress"])c.upload.addEventListener("progress",function(e){var a=null;if(e.lengthComputable&&(e.total||e["totalSize"])){a=e.loaded*100/(e.total||e["totalSize"])}r["onprogress"](e,a)});c.send(l)}};a.ajax.UpdatePageData=function(e){if(e.TITLE)a.ajax.UpdatePageTitle(e.TITLE);if(e.WINDOW_TITLE||e.TITLE)a.ajax.UpdateWindowTitle(e.WINDOW_TITLE||e.TITLE);if(e.NAV_CHAIN)a.ajax.UpdatePageNavChain(e.NAV_CHAIN);if(e.CSS&&e.CSS.length>0)a.loadCSS(e.CSS);if(e.SCRIPTS&&e.SCRIPTS.length>0){var t=function(r,o,n){if(!!o&&a.type.isArray(o.scripts)){for(var s=0,i=e.SCRIPTS.length;s<i;s++){o.scripts.push({isInternal:false,JS:e.SCRIPTS[s]})}}else{a.loadScript(e.SCRIPTS,n)}a.removeCustomEvent("onAjaxSuccess",t)};a.addCustomEvent("onAjaxSuccess",t)}else{var r=function(e,t,o){if(a.type.isFunction(o)){o()}a.removeCustomEvent("onAjaxSuccess",r)};a.addCustomEvent("onAjaxSuccess",r)}};a.ajax.UpdatePageTitle=function(e){var t=a("pagetitle");if(t){t.removeChild(t.firstChild);if(!t.firstChild)t.appendChild(document.createTextNode(e));else t.insertBefore(document.createTextNode(e),t.firstChild)}};a.ajax.UpdateWindowTitle=function(e){document.title=e};a.ajax.UpdatePageNavChain=function(e){var t=a("navigation");if(t){t.innerHTML=e}};a.userOptions={options:null,bSend:false,delay:5e3,path:"/bitrix/admin/user_options.php?"};a.userOptions.setAjaxPath=function(e){a.userOptions.path=e.indexOf("?")==-1?e+"?":e+"&"};a.userOptions.save=function(e,t,r,o,n){if(null==a.userOptions.options)a.userOptions.options={};n=!!n;a.userOptions.options[e+"."+t+"."+r]=[e,t,r,o,n];var s=a.userOptions.__get();if(s!="")document.cookie=a.message("COOKIE_PREFIX")+"_LAST_SETTINGS="+encodeURIComponent(s)+"&sessid="+a.bitrix_sessid()+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";if(!a.userOptions.bSend){a.userOptions.bSend=true;setTimeout(function(){a.userOptions.send(null)},a.userOptions.delay)}};a.userOptions.send=function(e){var t=a.userOptions.__get();a.userOptions.options=null;a.userOptions.bSend=false;if(t!=""){document.cookie=a.message("COOKIE_PREFIX")+"_LAST_SETTINGS=; path=/;";a.ajax({method:"GET",dataType:"html",processData:false,cache:false,url:a.userOptions.path+t+"&sessid="+a.bitrix_sessid(),onsuccess:e})}};a.userOptions.del=function(e,t,r,o){a.ajax.get(a.userOptions.path+"action=delete&c="+e+"&n="+t+(r==true?"&common=Y":"")+"&sessid="+a.bitrix_sessid(),o)};a.userOptions.__get=function(){if(!a.userOptions.options)return"";var e="",t=-1,r="",o,n;for(n in a.userOptions.options){if(a.userOptions.options.hasOwnProperty(n)){o=a.userOptions.options[n];if(r!=o[0]+"."+o[1]){t++;e+="&p["+t+"][c]="+a.util.urlencode(o[0]);e+="&p["+t+"][n]="+a.util.urlencode(o[1]);if(o[4]==true)e+="&p["+t+"][d]=Y";r=o[0]+"."+o[1]}e+="&p["+t+"][v]["+a.util.urlencode(o[2])+"]="+a.util.urlencode(o[3])}}return e.substr(1)};a.ajax.history={expected_hash:"",obParams:null,obFrame:null,obImage:null,obTimer:null,bInited:false,bHashCollision:false,bPushState:!!(history.pushState&&a.type.isFunction(history.pushState)),startState:null,init:function(t){if(a.ajax.history.bInited)return;this.obParams=t;var r=this.obParams.getState();if(a.ajax.history.bPushState){a.ajax.history.expected_hash=e.location.pathname;if(e.location.search)a.ajax.history.expected_hash+=e.location.search;a.ajax.history.put(r,a.ajax.history.expected_hash,"",true);setTimeout(function(){a.bind(e,"popstate",a.ajax.history.__hashListener)},500)}else{a.ajax.history.expected_hash=e.location.hash;if(!a.ajax.history.expected_hash||a.ajax.history.expected_hash=="#")a.ajax.history.expected_hash="__bx_no_hash__";u.put(a.ajax.history.expected_hash,r);a.ajax.history.obTimer=setTimeout(a.ajax.history.__hashListener,500);if(a.browser.IsIE()){a.ajax.history.obFrame=document.createElement("IF
5990RAME");a.hide_object(a.ajax.history.obFrame);document.body.appendChild(a.ajax.history.obFrame);a.ajax.history.obFrame.contentWindow.document.open();a.ajax.history.obFrame.contentWindow.document.write(a.ajax.history.expected_hash);a.ajax.history.obFrame.contentWindow.document.close()}else if(a.browser.IsOpera()){a.ajax.history.obImage=document.createElement("IMG");a.hide_object(a.ajax.history.obImage);document.body.appendChild(a.ajax.history.obImage);a.ajax.history.obImage.setAttribute("src","javascript:location.href = 'javascript:BX.ajax.history.__hashListener();';")}}a.ajax.history.bInited=true},__hashListener:function(t){t=t||e.event||{state:false};if(a.ajax.history.bPushState){a.ajax.history.obParams.setState(t.state||a.ajax.history.startState)}else{if(a.ajax.history.obTimer){e.clearTimeout(a.ajax.history.obTimer);a.ajax.history.obTimer=null}var r;if(null!=a.ajax.history.obFrame)r=a.ajax.history.obFrame.contentWindow.document.body.innerText;else r=e.location.hash;if(!r||r=="#")r="__bx_no_hash__";if(r.indexOf("#")==0)r=r.substring(1);if(r!=a.ajax.history.expected_hash){var o=u.get(r);if(o){a.ajax.history.obParams.setState(o);a.ajax.history.expected_hash=r;if(null!=a.ajax.history.obFrame){var n=r=="__bx_no_hash__"?"":r;if(e.location.hash!=n&&e.location.hash!="#"+n)e.location.hash=n}}}a.ajax.history.obTimer=setTimeout(a.ajax.history.__hashListener,500)}},put:function(t,r,o,n){if(this.bPushState){if(!n){history.pushState(t,"",r)}else{a.ajax.history.startState=t}}else{if(typeof o!="undefined")r=o;else r="view"+r;u.put(r,t);a.ajax.history.expected_hash=r;e.location.hash=a.util.urlencode(r);if(null!=a.ajax.history.obFrame){a.ajax.history.obFrame.contentWindow.document.open();a.ajax.history.obFrame.contentWindow.document.write(r);a.ajax.history.obFrame.contentWindow.document.close()}}},checkRedirectStart:function(t,r){var o=e.location.hash;if(o.substring(0,1)=="#")o=o.substring(1);var n=o.substring(0,5);if(n=="view/"||n=="view%"){a.ajax.history.bHashCollision=true;document.write("<"+'div id="__ajax_hash_collision_'+r+'" style="display: none;">')}},checkRedirectFinish:function(t,r){document.write("</div>");var o=e.location.hash;if(o.substring(0,1)=="#")o=o.substring(1);a.ready(function(){var e=o.substring(0,5);if(e=="view/"||e=="view%"){var n=a("__ajax_hash_collision_"+r);var s=n.firstChild;a.cleanNode(s);n.style.display="block";if(e!="view%")o=a.util.urlencode(o);o+=(o.indexOf("%3F")==-1?"%3F":"%26")+t+"="+r;var i="/bitrix/tools/ajax_redirector.php?hash="+o;a.ajax.insertToNode(i,s)}})}};a.ajax.component=function(e){this.node=e};a.ajax.component.prototype.getState=function(){var t={node:this.node,title:e.document.title,data:a(this.node).innerHTML};var r=a("navigation");if(null!=r)t.nav_chain=r.innerHTML;a.onCustomEvent(a(t.node),"onComponentAjaxHistoryGetState",[t]);return t};a.ajax.component.prototype.setState=function(e){a(e.node).innerHTML=e.data;a.ajax.UpdatePageTitle(e.title);if(e.nav_chain){a.ajax.UpdatePageNavChain(e.nav_chain)}a.onCustomEvent(a(e.node),"onComponentAjaxHistorySetState",[e])};var u={arHistory:{},put:function(e,a){this.arHistory[e]=a},get:function(e){return this.arHistory[e]}};a.ajax.FormData=function(){this.elements=[];this.files=[];this.features={};this.isSupported();this.log("BX FormData init")};a.ajax.FormData.isSupported=function(){var e=new a.ajax.FormData;var t=e.features.supported;e=null;return t};a.ajax.FormData.prototype.log=function(e){if(false){try{if(a.browser.IsIE())e=JSON.stringify(e);console.log(e)}catch(t){}}};a.ajax.FormData.prototype.isSupported=function(){var a={};a.fileReader=e.FileReader&&e.FileReader.prototype.readAsBinaryString;a.readFormData=a.sendFormData=!!e.FormData;a.supported=!!(a.readFormData&&a.sendFormData);this.features=a;this.log("features:");this.log(a);return a.supported};a.ajax.FormData.prototype.append=function(e,a){if(typeof a==="object"){this.files.push({name:e,value:a})}else{this.elements.push({name:e,value:a})}};a.ajax.FormData.prototype.send=function(e,t,r,o){this.log("FD send");this.xhr=a.ajax({method:"POST",dataType:"html",url:e,onsuccess:t,onfailure:o,start:false,preparePost:false});if(r){this.xhr.upload.addEventListener("progress",function(e){if(e.lengthComputable)r(e.loaded/(e.total||e.totalSize))},false)}if(this.features.readFormData&&this.features.sendFormData){var n=new FormData;this.log("use browser formdata");for(var s in this.elements){if(this.elements.hasOwnProperty(s))n.append(this.elements[s].name,this.elements[s].value)}
5990for(s in this.files){if(this.files.hasOwnProperty(s))n.append(this.files[s].name,this.files[s].value)}this.xhr.send(n)}return this.xhr};a.addCustomEvent("onAjaxFailure",a.debug)})(window); 5991/* End */ 5992; 5993; /* Start:"a:4:{s:4:"full";s:48:"/bitrix/js/main/json/json2.min.js?14580310403467";s:6:"source";s:33:"/bitrix/js/main/json/json2.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 5994 5995var JSON;if(!JSON){JSON={};} 5996(function(){'use strict';function f(n){return n<10?'0'+n:n;} 5997if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ 5998f(this.getUTCMonth()+1)+'-'+ 5999f(this.getUTCDate())+'T'+ 6000f(this.getUTCHours())+':'+ 6001f(this.getUTCMinutes())+':'+ 6002f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} 6003var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} 6004function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} 6005if(typeof rep==='function'){value=rep.call(holder,key,value);} 6006switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} 6007gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';} 6008v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;} 6009if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}} 6010v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}} 6011if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;} 6012rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');} 6013return str('',{'':value});};} 6014if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}} 6015return reviver.call(holder,key,value);} 6016text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+ 6017('0000'+a.charCodeAt(0).toString(16)).slice(-4);});} 6018if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;} 6019throw new SyntaxError('JSON.parse');};}}()); 6020/* End */ 6021; 6022; /* Start:"a:4:{s:4:"full";s:50:"/bitrix/js/main/core/core_ls.min.js?14580310417365";s:6:"source";s:31:"/bitrix/js/main/core/core_ls.js";s:3:"min";s:35:"/bitrix/js/main/core/core_ls.min.js";s:3:"map";s:35:"/bitrix/js/main/core/core_ls.map.js";}"*/ 6023(function(e){if(e.BX.localStorage)return;var t=e.BX,r=null,o=null,a="_bxCurrentKey",i=false;t.localStorage=function(){this.keyChanges={};t.bind(t.browser.IsIE()&&!t.browser.IsIE9()?document:e,"storage",t.proxy(this._onchange,this));setInterval(t.delegate(this._clear,this),5e3)};t.localStorage.checkBrowser=function(){return i};t.localStorage.set=function(e,r,o){return t.localStorage.instance().set(e,r,o)};t.localStorage.get=function(e){return t.localStorage.instance().get(e)};t.localStorage.remove=function(e){return t.localStorage.instance().remove(e)};t.localStorage.instance=function(){if(!r){var e=t.localStorage.checkBrowser();if(e=="native")r=new t.localStorage;else if(e=="ie8")r=new t.localStorageIE8;else if(e=="ie7")r=new t.localStorageIE7;else{r={set:t.DoNothing,get:function(){return null},remove:t.DoNothing}}}return r};t.localStorage.prototype.prefix=function(){if(!o){o="bx"+t.message("USER_ID")+"-"+(t.message.SITE_ID?t.message("S
6023ITE_ID"):"admin")+"-"}return o};t.localStorage.prototype._onchange=function(r){r=r||e.event;if(!r.key)return;if(t.browser.DetectIeVersion()>0&&this.keyChanges[r.key]){this.keyChanges[r.key]=false;return}if(!!r.key&&r.key.substring(0,this.prefix().length)==this.prefix()){var o={key:r.key.substring(this.prefix().length,r.key.length),value:!!r.newValue?this._decode(r.newValue.substring(11,r.newValue.length)):null,oldValue:!!r.oldValue?this._decode(r.oldValue.substring(11,r.oldValue.length)):null};switch(o.key){case"BXGCE":if(o.value){t.onCustomEvent(o.value.e,o.value.p)}break;default:if(r.newValue)t.onCustomEvent(e,"onLocalStorageSet",[o]);if(r.oldValue&&!r.newValue)t.onCustomEvent(e,"onLocalStorageRemove",[o]);t.onCustomEvent(e,"onLocalStorageChange",[o]);break}}};t.localStorage.prototype._clear=function(){var e=+new Date,t,r;for(r=0;r<localStorage.length;r++){t=localStorage.key(r);if(t.substring(0,2)=="bx"){var o=localStorage.getItem(t).split(":",1)*1e3;if(e>=o)localStorage.removeItem(t)}}};t.localStorage.prototype._encode=function(e){if(typeof e=="object")e=JSON.stringify(e);else e=e.toString();return e};t.localStorage.prototype._decode=function(e){var t=null;if(!!e){try{t=JSON.parse(e)}catch(r){t=e}}return t};t.localStorage.prototype._trigger_error=function(e,r,o,a){t.onCustomEvent(this,"onLocalStorageError",[e,{key:r,value:o,ttl:a}])};t.localStorage.prototype.set=function(e,t,r){if(!r||r<=0)r=60;if(e==undefined||e==null||t==undefined)return false;this.keyChanges[this.prefix()+e]=true;try{localStorage.setItem(this.prefix()+e,Math.round(+new Date/1e3)+r+":"+this._encode(t))}catch(o){this._trigger_error(o,e,t,r)}};t.localStorage.prototype.get=function(e){var t=localStorage.getItem(this.prefix()+e);if(t){var r=t.split(":",1)*1e3;if(+new Date<=r){t=t.substring(11,t.length);return this._decode(t)}}return null};t.localStorage.prototype.remove=function(e){this.keyChanges[this.prefix()+e]=true;localStorage.removeItem(this.prefix()+e)};t.localStorageIE7=function(){this.NS="BXLocalStorage";this.__current_state={};this.keyChanges={};t.ready(t.delegate(this._Init,this))};t.extend(t.localStorageIE7,t.localStorage);t.localStorageIE7.prototype._Init=function(){this.storage_element=document.body.appendChild(t.create("DIV"));this.storage_element.addBehavior("#default#userData");this.storage_element.load(this.NS);var e=this.storage_element.xmlDocument,r=e.firstChild.attributes.length;for(var o=0;o<r;o++){if(!!e.firstChild.attributes[o]){var a=e.firstChild.attributes[o].nodeName;if(a.substring(0,this.prefix().length)==this.prefix()){this.__current_state[a]=e.firstChild.attributes[o].nodeValue}}}setInterval(t.delegate(this._Listener,this),500);setInterval(t.delegate(this._clear,this),5e3)};t.localStorageIE7.prototype._Listener=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument,r=t.firstChild.attributes.length,o,a,i;var l={},s=[];for(o=0;o<r;o++){if(!!t.firstChild.attributes[o]){a=t.firstChild.attributes[o].nodeName;if(a.substring(0,this.prefix().length)==this.prefix()){i=t.firstChild.attributes[o].nodeValue;if(this.__current_state[a]!=i){s.push({key:a,newValue:i,oldValue:this.__current_state[a]})}l[a]=i;delete this.__current_state[a]}}}for(o in this.__current_state){if(this.__current_state.hasOwnProperty(o)){s.push({key:o,newValue:undefined,oldValue:this.__current_state[o]})}}this.__current_state=l;for(o=0;o<s.length;o++){this._onchange(s[o])}};t.localStorageIE7.prototype._clear=function(){this.storage_element.load(this.NS);var e=this.storage_element.xmlDocument,t=e.firstChild.attributes.length,r=+new Date,o,a,i,l;for(o=0;o<t;o++){if(!!e.firstChild.attributes[o]){a=e.firstChild.attributes[o].nodeName;if(a.substring(0,2)=="bx"){i=e.firstChild.attributes[o].nodeValue;l=i.split(":",1)*1e3;if(r>=l){e.firstChild.removeAttribute(a)}}}}this.storage_element.save(this.NS)};t.localStorageIE7.prototype.set=function(e,t,r){if(!r||r<=0)r=60;try{this.storage_element.load(this.NS);var o=this.storage_element.xmlDocument;this.keyChanges[this.prefix()+e]=true;o.firstChild.setAttribute(this.prefix()+e,Math.round(+new Date/1e3)+r+":"+this._encode(t));this.storage_element.save(this.NS)}catch(a){this._trigger_error(a,e,t,r)}};t.localStorageIE7.prototype.get=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument;var r=t.firstChild.getAttribute(this.prefix()+e);if(r){var o=r.split(":",1)*1e3;if(+new Date<=o){r=r.substring(11,r.length);return this._decode(r)}}return null};t.localStorageIE7.prototype.remove=function(e){this.storage_element.load(this.NS);var t=this.storage_element.xmlDocument;t.firstChild.removeAttribute(this.prefix()+e);this.keyChanges[this.prefix()+e]=true;this.storage_element.save(this.NS)};t.localStorageIE8=function(){this.key=a;this.currentKey=null;this.currentValue=null;t.localStorageIE8.superclass.constructor.apply(this)};t.extend(t.localStorageIE8,t.localStorage);t.localStorageIE8.prototype._onchange=function(e){if(null==this.currentKey){this.currentKey=localStorage.getItem(this.key);if(this.currentKey){this.currentValue=localStorage.getItem(this.prefix()+this.currentKey)}}else{e={key:this.prefix()+this.currentKey,newValue:localStorage.getItem(this.prefix()+this.currentKey),oldValue:this.currentValue};this.currentKey=null;this.currentValue=null;if(this.keyChanges[e.key]){this.keyChanges[e.key]=false;return}t.localStorageIE8.superclass._onchange.apply(this,[e])}};t.localStorageIE8.prototype.set=function(e,r,o){this.currentKey=null;this.keyChanges[this.prefix()+e]=true;try{localStorage.setItem(this.key,e);t.localStorageIE8.superclass.set.apply(this,arguments)}catch(a){this._trigger_error(a,e,r,o)}};t.localStorageIE8.prototype.remove=function(e){this.currentKey=null;this.keyChanges[this.prefix()+e]=true;localStorage.setItem(this.key,e);t.localStorageIE8.superclass.remove.apply(this,arguments)};t.onGlobalCustomEvent=function(e,r,o){if(!!t.localStorage.checkBrowser())t.localStorage.set("BXGCE",{e:e,p:r},1);if(!o)t.onCustomEvent(e,r)};try{i=!!localStorage.setItem}catch(l){}if(i){i="native";var s=t.browser.IsIE()&&!t.browser.IsIE9()?document:e,n=function(r){if(typeof(r||e.event).key=="undefined")i="ie8";t.unbind(s,"storage",n);t.localStorage.instance()};t.bind(s,"storage",n);try{localStorage.setItem(a,null)}catch(l){i=false;t.localStorage.instance()}}else if(t.browser.IsIE7()){i="ie7";t.localStorage.instance()}})(window); 6024/* End */ 6025; 6026; /* Start:"a:4:{s:4:"full";
6026s:45:"/bitrix/js/main/session.min.js?14580310402511";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";}"*/ 6027function CBXSession(){var e=this;this.mess={};this.timeout=null;this.sessid=null;this.bShowMess=true;this.dateStart=new Date;this.dateInput=new Date;this.dateCheck=new Date;this.activityInterval=0;this.notifier=null;this.Expand=function(t,i,s,n){this.timeout=t;this.sessid=i;this.bShowMess=s;this.key=n;BX.ready(function(){BX.bind(document,"keypress",e.OnUserInput);BX.bind(document.body,"mousemove",e.OnUserInput);BX.bind(document.body,"click",e.OnUserInput);setTimeout(e.CheckSession,(e.timeout-60)*1e3)})};this.OnUserInput=function(){var t=new Date;e.dateInput.setTime(t.valueOf())};this.CheckSession=function(){var t=new Date;if(t.valueOf()-e.dateCheck.valueOf()<3e4)return;e.activityInterval=Math.round((e.dateInput.valueOf()-e.dateStart.valueOf())/1e3);e.dateStart.setTime(e.dateInput.valueOf());var i=e.activityInterval>e.timeout?e.timeout-60:e.activityInterval;var s={method:"GET",dataType:"html",url:"/bitrix/tools/public_session.php?sessid="+e.sessid+"&interval="+i+"&k="+e.key,data:"",onsuccess:function(t){e.CheckResult(t)},lsId:"sess_expand",lsTimeout:60};if(i>0){s.lsForce=true}BX.ajax(s)};this.CheckResult=function(t){if(t=="SESSION_EXPIRED"){if(e.bShowMess){if(!e.notifier){e.notifier=document.body.appendChild(BX.create("DIV",{props:{className:"bx-session-message"},style:{top:"0px",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>'+e.mess.messSessExpired}));var i=BX.GetWindowScrollPos();var s=BX.GetWindowInnerSize();e.notifier.style.left=parseInt(i.scrollLeft+s.innerWidth/2-parseInt(e.notifier.clientWidth)/2)+"px";if(BX.browser.IsIE()){e.notifier.style.top=i.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=""}}else{var n;if(t=="SESSION_CHANGED")n=e.timeout-60;else n=e.activityInterval<60?60:e.activityInterval>e.timeout?e.timeout-60:e.activityInterval;var o=new Date;e.dateCheck.setTime(o.valueOf());setTimeout(e.CheckSession,n*1e3)}};this.Close=function(){this.notifier.style.display="none"}}var bxSession=new CBXSession; 6028/* End */ 6029; 6030; /* Start:"a:4:{s:4:"full";s:55:"/bitrix/js/main/core/core_window.min.js?149879921375204";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";}"*/ 6031(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;var e=t.Get();e.style.zIndex=t.zIndex=this.GetZIndex();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=null;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;
6031if(/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)},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.CWindow.prototype.Hide=function(){BX.WindowManager.unregister(this);this.DIV.style.display="none"};BX.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 a=this.DIV.offsetHeight;if(s>n.scrollWidth-r-i)s=n.scrollWidth-r-i;var h=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight,n.scrollHeight);if(o>h-a-i)o=h-a-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);
6031this.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"}}))}return this.OVERLAY};BX.CWindowDialog.prototype.Show=function(){BX.CWindowDialog.superclass.Show.apply(this,arguments);this.CreateOverlay();this.OVERLAY.style.display="block";this.OVERLAY.style.zIndex=parseInt(this.DIV.style.zIndex)-2;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":"")}
6031,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 a="";if(null==t&&e.elements[r.name+"_alt"]&&r.selectedIndex==0)a=e.elements[r.name+"_alt"].value;else a=r.value;s+=n+r.name+"="+BX.util.urlencode(a);break;case"select-multiple":var h,l=false;var d=r.options.length;for(h=0;h<d;h++){if(r.options[h].selected){s+=n+r.name+"="+BX.util.urlencode(r.o
6031ptions[h].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){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");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]}
6031)]});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(parseInt(BX.style(e,"z-index"))-1);this.OVERLAY.style.display="block"; 6032 6033this.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.addCustomEvent(this,"onWindowResize",BX.proxy(this.__adjustSize,this));if(this.PARAMS.resizable&&(this.PARAMS.content_url||this.PARAMS.resize_id))BX.addCustomEvent(this,"onWindowResizeFinished",BX.delegate(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=BX.GetWindowInnerSize();var e=BX.GetWindowScrollPos();BX.adjust(this.DIV,{style:{left:parseInt(e.scrollLeft+t.innerWidth/2-parseInt(this.DIV.offsetWidth)/2)+"px",top:Math.max(parseInt(e.scrollTop+t.innerHe
6033ight/2-parseInt(this.DIV.offsetHeight)/2),0)+"px"}})}};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",name:"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;
6033t.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.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;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}this.bMenuInit=false};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,LEVEL:this.LEVEL,parent:BX(this.DIV),parent_attach:BX(this.ATTA
6033CH)});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.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()}}};
6033BX.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}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:!!t.LINK||BX.browser.IsIE()&&!BX.browser.IsDoctype()?{href:t.LINK||"javascript:void(0)"}:{},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||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;
6033o.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 a=o.left;o.left=n.scrollWidth-i-10;if(!!this.ARROW)r+=a-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 h=this.PARAMS.ATTACH_MODE=="bottom"?t.top-s-9:t.bottom-s+1;if(h>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=h;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 a=this.attachMenu(this.EXTRA_BUTTONS["components2_submenu"]["MENU"]);BX.addCustomEvent(a,"onOpenerMenuOpen",BX.proxy(this.__menu_open,this));BX.addCustomEvent(a,"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
6033LE||"",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));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.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")}
6033if(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(){ 6034if(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";BX.addCustomEvent(t,"onMenuOpenerHide",BX.proxy(this.restorePosition,this));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")]}));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.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");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;
6034if(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); 6035/* End */ 6036; 6037; /* Start:"a:4:{s:4:"full";s:54:"/bitrix/js/main/core/core_popup.min.js?149879915439932";s:6:"source";s:34:"/bitrix/js/main/core/core_popup.js";s:3:"min";s:38:"/bitrix/js/main/core/core_popup.min.js";s:3:"map";s:38:"/bitrix/js/main/core/core_popup.map.js";}"*/ 6038(function(t){"use strict";if(BX.PopupWindowManager){return}BX.PopupWindowManager={_popups:[],_currentPopup:null,create:function(t,e,i){var o=-1;if((o=this._getPopupIndex(t))!==-1){return this._popups[o]}var n=new BX.PopupWindow(t,e,i);BX.addCustomEvent(n,"onPopupShow",BX.delegate(this.onPopupShow,this));BX.addCustomEvent(n,"onPopupClose",BX.delegate(this.onPopupClose,this));return n},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},_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,o){o=o||{};this.params=o;BX.onCustomEvent("onPopupWindowInit",[e,i,o]);this.uniquePopupId=e;this.params.zIndex=parseInt(o.zIndex);this.params.zIndex=isNaN(o.zIndex)?0:o.zIndex;this.buttons=o.buttons&&BX.type.isArray(o.buttons)?o.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 o.bindOptions==="object"?o.bindOptions:{};this.autoHide=o.autoHide===true;this.isAutoHideBinded=false;this.closeByEsc=o.closeByEsc===true;this.isCloseByEscBinded=false;this.width=null;this.height=null;this.minWidth=0;this.minHeight=0;if(o.parentPopup instanceof BX.PopupWindow){this.parentPopup=o.parentPopup;this.appendContainer=o.parentPopup.contentContainer;o.offsetTop=(o.offsetTop?o.offsetTop:0)-(BX.PopupWindow.fullscreenStatus?0:this.parentPopup.popupContainer.offsetTop);o.offsetLeft=(o.offsetLeft?o.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;if(o.events){for(var n in o.events){BX.addCustomEvent(this,n,o.events[n])}}var s="popup-window";if(o.contentColor&&BX.type.isNotEmptyString(o.contentColor)){s+=" popup-window-content-"+o.contentColor}if(o.contentNoPaddings){s+=" popup-window-content-no-paddings"}if(o.noAllPaddings){s+=" popup-window-no-paddings"}if(o.titleBar){s+=" popup-window-with-titlebar"}if(o.className&&BX.type.isNotEmptyString(o.className)){s+=" "+o.className}if(o.darkMode){s+=" popup-window-dark"}this.popupContainer=document.createElement("div");var p="popup-window-titlebar-"+e;if(o.titleBar){this.titleBar=BX.create("div",{props:{className:"popup-window-titlebar",id:p}})}if(o.closeIcon){this.closeIcon=BX.create("span",{props:{className:"popup-window-close-icon"+(o.titleBar?" popup-window-titlebar-close-icon":"")},style:typeof o.closeIcon==="object"?o.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(o.angle){this.setAngle(o.angle)}if(o.overlay){this.setOverlay(o.overlay)}this.setOffset(o);this.setBindElement(i);this.setTitleBar(o.titleBar);this.setContent(o.content);this.setButtons(o.buttons);this.setWidth(o.width);this.setHeight(o.height);this.setResizeMode(o.resizable);if(o.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=" "}};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 o=this.buttons[i];if(o===null||!BX.is_subclass_of(o,BX.PopupWindowButton)){continue}o.popupWindow=this;e.push(o.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 o=this.popupContainer.offsetWidth;var n=this.popupContainer.offsetHeight;this.bindOptions.forceTop=true;
6038return{left:e.innerWidth/2-o/2+i.scrollLeft,top:e.innerHeight/2-n/2+i.scrollTop,bottom:e.innerHeight/2-n/2+i.scrollTop,windowSize:e,windowScroll:i,popupWidth:o,popupHeight:n}}};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 o=BX.PopupWindow.getOption(i==="top"?"angleMinTop":"angleMinBottom");var n=BX.type.isNumber(t.offset)?t.offset:0;var s=BX.PopupWindow.getOption("angleLeftOffset",null);if(n>0&&BX.type.isNumber(s)){n+=s-BX.PopupWindow.defaultOptions.angleLeftOffset}this.angle={element:BX.create("div",{props:{className:e+" "+e+"-"+i}}),position:i,offset:0,defaultOffset:Math.max(n,o)};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,r;if(this.angle.position==="top"){u=BX.PopupWindow.getOption("angleMinTop");r=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxTop");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);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");r=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxBottom");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);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");r=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxRight");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);this.angle.element.style.top=this.angle.offset+"px"}else if(this.angle.position==="left"){u=BX.PopupWindow.getOption("angleMinLeft");r=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxLeft");r=r<u?Math.max(u,p):r;this.angle.offset=Math.min(Math.max(u,p),r);this.angle.element.style.top=this.angle.offset+"px"}}};BX.PopupWindow.prototype.setWidth=function(t){if(BX.type.isNumber(t)&&t>=0){this.width=t;this.contentContainer.style.width=t+"px";this.contentContainer.style.overflowX="auto";if(this.titleBar){this.titleBar.style.width=t+"px"}}else if(t===false){this.width=null;this.contentContainer.style.removeProperty("width");this.contentContainer.style.removeProperty("overflowX");if(this.titleBar){this.titleBar.style.removeProperty("width")}}};BX.PopupWindow.prototype.setHeight=function(t){if(BX.type.isNumber(t)&&t>=0){this.height=t;this.contentContainer.style.height=t+"px";this.contentContainer.style.overflowY="auto"}else if(t===false){this.height=null;this.contentContainer.style.removeProperty("height");this.contentContainer.style.removeProperty("overflowY")}};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)}if(BX.type.isNumber(t.minWidth)&&t.minWidth>0){this.minWidth=t.minWidth}if(BX.type.isNumber(t.minHeight)&&t.minHeight>0){this.minHeight=t.minHeight}}else if(t===false&&this.resizeIcon){BX.remove(this.resizeIcon);this.resizeIcon=null}};BX.PopupWindow.prototype.getWidth=function(){return this.width};BX.PopupWindow.prototype.getHeight=function(){return this.height};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};
6038BX.PopupWindow.prototype._resize=function(t,e,i,o){var n=i-this.resizeContentPos.left;var s=o-this.resizeContentPos.top;var p=BX.GetWindowScrollSize().scrollWidth;if(this.resizeContentPos.left+n+this.resizeContentOffset>=p){n=p-this.resizeContentPos.left-this.resizeContentOffset}this.setWidth(Math.max(n,this.minWidth));this.setHeight(Math.max(s,this.minHeight))};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(t.offsetLeft&&BX.type.isNumber(t.offsetLeft)){this.offsetLeft=t.offsetLeft+BX.PopupWindow.getOption("offsetLeft")}if(t.offsetTop&&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);BX.bind(document,"click",BX.proxy(this.close,this))}};BX.PopupWindow.prototype.unbindAutoHide=function(){if(this.isAutoHideBinded){this.isAutoHideBinded=false;BX.unbind(this.popupContainer,"click",this.cancelBubble);BX.unbind(document,"click",BX.proxy(this.close,this))}};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 BX.PopupWindow.getOption("popupOverlayZindex")+this.params.zIndex}else{return 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.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.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 true}BX.onCustomEvent(this,"onPopupClose",[this,t]);this.hideOverlay();this.popupContainer.style.display="none";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){o(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 o=e.windowScroll?e.windowScroll:BX.GetWindowScrollPos();var n=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+n+this.bordersWidth>=i.innerWidth+o.scrollLeft&&i.innerWidth+o.scrollLeft-n-this.bordersWidth>0){var r=u;u=i.innerWidth+o.scrollLeft-n-this.bordersWidth;
6038if(this.isTopOrBottomAngle()){this.setAngle({offset:r-u+this.angle.defaultOffset})}}else if(this.isTopOrBottomAngle()){this.setAngle({offset:this.angle.defaultOffset+(u<0?u:0)})}if(u<0){u=0}var a=0;if(this.bindOptions.position&&this.bindOptions.position==="top"){a=this.bindElementPos.top-s-this.offsetTop-(this.isBottomAngle()?p:0);if(a<0||!this.bindOptions.forceTop&&a<o.scrollTop){a=this.bindElementPos.bottom+this.offsetTop;if(this.angle!==null){a+=p;this.setAngle({position:"top"})}}else if(this.isTopAngle()){a=a-p+BX.PopupWindow.getOption("positionTopXOffset");this.setAngle({position:"bottom"})}else{a+=BX.PopupWindow.getOption("positionTopXOffset")}}else{a=this.bindElementPos.bottom+this.offsetTop+this.getAngleHeight();if(!this.bindOptions.forceTop&&a+s>i.innerHeight+o.scrollTop&&this.bindElementPos.top-s-this.getAngleHeight()>=0){a=this.bindElementPos.top-s;if(this.isTopOrBottomAngle()){a-=p;this.setAngle({position:"bottom"})}a+=BX.PopupWindow.getOption("positionTopXOffset")}else if(this.isBottomAngle()){a+=p;this.setAngle({position:"top"})}}if(!this.parentPopup&&a<0){a=0}BX.adjust(this.popupContainer,{style:{top:a+"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,o){var n=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&&n<0){n=0}var p=BX.GetWindowScrollSize();var u=this.popupContainer.offsetWidth;var r=this.popupContainer.offsetHeight;if(n>p.scrollWidth-u){n=p.scrollWidth-u}if(s>p.scrollHeight-r){s=p.scrollHeight-r}if(!this.parentPopup&&s<0){s=0}}this.popupContainer.style.left=n+"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.PopupMenu={Data:{}
6038,currentItem:null,show:function(t,e,i,o){if(this.currentItem!==null){this.currentItem.popupWindow.close()}this.currentItem=this.create(t,e,i,o);this.currentItem.popupWindow.show()},create:function(t,e,i,o){if(!this.Data[t]){this.Data[t]=new BX.PopupMenuWindow(t,e,i,o)}return this.Data[t]},getCurrentMenu:function(){return this.currentItem},getMenuById:function(t){return this.Data[t]?this.Data[t]:null},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,o){this.id=t;this.bindElement=e;this.menuItems=[];this.itemsContainer=null;this.params=o&&typeof o==="object"?o:{};this.parentMenuWindow=null;this.parentMenuItem=null;if(i&&BX.type.isArray(i)){for(var n=0;n<i.length;n++){this.addMenuItemInternal(i[n],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 o=i.getLayout();t.push(o.item)}var n=new BX.PopupWindow("menu-popup-"+this.id,this.bindElement,{closeByEsc:typeof this.params.closeByEsc!=="undefined"?this.params.closeByEsc:false,bindOptions:typeof this.params.bindOptions==="object"?this.params.bindOptions:{},angle:typeof this.params.angle!=="undefined"?this.params.angle:false,zIndex:this.params.zIndex?this.params.zIndex:0,overlay:typeof this.params.overlay==="object"?this.params.overlay:null,autoHide:typeof this.params.autoHide!=="undefined"?this.params.autoHide:true,offsetTop:this.params.offsetTop?this.params.offsetTop:1,offsetLeft:this.params.offsetLeft?this.params.offsetLeft:0,className:BX.type.isNotEmptyString(this.params.className)?this.params.className:"",noAllPaddings:true,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})]}),events:{onPopupClose:this.onMenuWindowClose.bind(this),onPopupDestroy:this.onMenuWindowDestroy.bind(this)}});if(this.params&&this.params.events){for(var s in this.params.events){if(this.params.events.hasOwnProperty(s)){BX.addCustomEvent(n,s,this.params.events[s])}}}return n};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(){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.setParentMenuWindow=function(t){if(t instanceof BX.PopupMenuWindow){this.parentMenuWindow=t}};BX.PopupMenuWindow.prototype.getParentMenuWindow=function(){return this.parentMenuWindow};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 o=i.getLayout();var n=this.getMenuItem(e);if(n!==null){var s=n.getLayout();this.itemsContainer.insertBefore(o.item,s.item)}else{this.itemsContainer.appendChild(o.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 o=this.getMenuItemPosition(e);if(o>=0){this.menuItems=BX.util.insertIntoArray(this.menuItems,o,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 o=e.getMenuWindow();if(o){var n=o.getParentMenuItem();if(n){n.destroySubMenu()}else{o.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;
6038this.href=BX.type.isNotEmptyString(t.href)?t.href:null;this.target=BX.type.isNotEmptyString(t.target)?t.target: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.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){ 6039if(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){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:""},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}BX.bind(this.layout.item,"mouseenter",this.onItemMouseEnter.bind(this));BX.bind(this.layout.item,"mouseleave",this.onItemMouseLeave.bind(this))}return this.layout},onItemClick:function(t){this.onclick.call(this.menuWindow,t,this)},onItemMouseEnter:function(t){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){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}this.subMenuWindow=new BX.PopupMenuWindow("popup-submenu-"+this.id,null,t,{autoHide:false,menuShowDelay:this.menuShowDelay,bindOptions:{forceTop:true,forceLeft:true,forceBindPosition:true}});this.subMenuWindow.setParentMenuWindow(this.menuWindow);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");t.close()}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=BX.pos(this.layout.item);var i=e.width+this.subMenuOffsetX;var o="left";var n=t.popupContainer.offsetWidth;var s=document.documentElement.clientWidth;if(e.left+i+n>s){var p=e.left-n-this.subMenuOffsetX;if(p>0){i=-n-this.subMenuOffsetX;o="right"}}t.setBindElement(this.layout.item);t.setOffset({offsetLeft:i,offsetTop:-(e.height+this.getPopupPadding())});t.setAngle({position:o,offset:e.height/2-this.getPopupPadding()});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}};
6039t.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 o=0,n=this.values.length;o<n;o++){e=i.appendChild(BX.create("DIV",{props:{id:"bxecmr_"+o},text:this.values[o].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[o].DESCRIPTION)e.title=this.values[o].DESCRIPTION;if(this.values[o].CLASS_NAME)BX.addClass(e,this.values[o].CLASS_NAME);if(this.values[o].URL)e.appendChild(BX.create("A",{props:{href:this.values[o].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 o(t,n){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(o)(false)}if(t>e){e=t;i=[n]}else if(t==e){i.push(n)}}}})(window); 6040/* End */ 6041; 6042; /* Start:"a:4:{s:4:"full";s:53:"/bitrix/js/main/core/core_date.min.js?149879649334241";s:6:"source";s:33:"/bitrix/js/main/core/core_date.js";s:3:"min";s:37:"/bitrix/js/main/core/core_date.min.js";s:3:"map";s:37:"/bitrix/js/main/core/core_date.map.js";}"*/ 6043(function(){if(BX.date)return;BX.date={};BX.date.format=function(e,t,a,i){var s=BX.type.isDate(t)?new Date(t.getTime()):BX.type.isNumber(t)?new Date(t*1e3):new Date;var r=BX.type.isDate(a)?new Date(a.getTime()):BX.type.isNumber(a)?new Date(a*1e3):new Date;var n=!!i;if(BX.type.isArray(e))return c(e,s,r,n);else if(!BX.type.isNotEmptyString(e))return"";var o=/\\?(sago|iago|isago|Hago|dago|mago|Yago|sdiff|idiff|Hdiff|ddiff|mdiff|Ydiff|yesterday|today|tommorow|[a-z])/gi;var l={d:function(){return BX.util.str_pad_left(p(s).toString(),2,"0")},D:function(){return BX.message("DOW_"+v(s))},j:function(){return p(s)},l:function(){return BX.message("DAY_OF_WEEK_"+v(s))},N:function(){return v(s)||7},S:function(){if(p(s)%10==1&&p(s)!=11)return"st";else if(p(s)%10==2&&p(s)!=12)return"nd";else if(p(s)%10==3&&p(s)!=13)return"rd";else return"th"},w:function(){return v(s)},z:function(){var e=new Date(d(s),0,1);var t=new Date(d(s),h(s),p(s));return Math.ceil((t-e)/(24*3600*1e3))},W:function(){var e=new Date(s.getTime());var t=(v(s)+6)%7;B(e,p(e)-t+3);var a=e.getTime();M(e,0,1);if(v(e)!=4)M(e,0,1+(4-v(e)+7)%7);var i=1+Math.ceil((a-e)/(7*24*3600*1e3));return BX.util.str_pad_left(i.toString(),2,"0")},F:function(){return BX.message("MONTH_"+(h(s)+1)+"_S")},f:function(){return BX.message("MONTH_"+(h(s)+1))},m:function(){return BX.util.str_pad_left((h(s)+1).toString(),2,"0")},M:function(){return BX.message("MON_"+(h(s)+1))},n:function(){return h(s)+1},t:function(){var e=n?new Date(Date.UTC(d(s),h(s)+1,0)):new Date(d(s),h(s)+1,0);return p(e)},L:function(){var e=d(s);return e%4==0&&e%100!=0||e%400==0?1:0},o:function(){var e=new Date(s.getTime());B(e,p(e)-(v(s)+6)%7+3);return d(e)},Y:function(){return d(s)},y:function(){return d(s).toString().slice(2)},a:function(){return f(s)>11?"pm":"am"},A:function(){return f(s)>11?"PM":"AM"},B:function(){var e=(s.getUTCHours()+1)%24+s.getUTCMinutes()/60+s.getUTCSeconds()/3600;return BX.util.str_pad_left(Math.floor(e*1e3/24).toString(),3,"0")},g:function(){return f(s)%12||12},G:function(){return f(s)},h:function(){return BX.util.str_pad_left((f(s)%12||12).toString(),2,"0")},H:function(){return BX.util.str_pad_left(f(s).toString(),2,"0")},i:function(){return BX.util.str_pad_left(m(s).toString(),2,"0")},s:function(){return BX.util.str_pad_left(D(s).toString(),2,"0")},u:function(){return BX.util.str_pad_left((T(s)*1e3).toString(),6,"0")},e:function(){if(n)return"UTC";return""},I:function(){if(n)return 0;var e=new Date(d(s),0,1);var t=Date.UTC(d(s),0,1);var a=new Date(d(s),6,0);var i=Date.UTC(d(s),6,0);return 0+(e-t!==a-i)},O:function(){if(n)return"+0000";var e=s.getTimezoneOffset();var t=Math.abs(e);return(e>0?"-":"+")+BX.util.str_pad_left((Math.floor(t/60)*100+t%60).toString(),4,"0")},P:function(){if(n)return"+00:00";var e=this.O();return e.substr(0,3)+":"+e.substr(3)},Z:function(){if(n)return 0;return-s.getTimezoneOffset()*60},c:function(){return"Y-m-d\\TH:i:sP".replace(o,C)},r:function(){return"D, d M Y H:i:s O".replace(o,C)},U:function(){return Math.floor(s.getTime()/1e3)},sago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},iago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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:function(){var e=O((r-s)/60/1e3);var t=X(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+=" ";var a=O((r-s)/1e3)-e*60;t+=X(a,{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},Hago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},yesterday:function(){return BX.message("FD_YESTERDAY")},today:function(){return BX.message("FD_TODAY")},tommorow:function(){return BX.message("FD_TOMORROW")},dago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},mago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},Yago:function(){return X(O((r-s)/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:function(){return X(O((r-s)/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"})},x:function(){return BX.date.format([["tommorow","tommorow, H:i"],["-",BX.date.convertBitrixFormat(BX.message("FORMAT_DATETIME")).replace(/:s$/g,"")],["s","sago"],["i","iago"],["today","today, H:i"],["yesterday","yesterday, H:i"],["",BX.date.convertBitrixFormat(BX.message("FORMAT_DATETIME")).replace(/:s$/g,"")]],s,r,n)},X:function(){var e=BX.date.format([["tommorow","tommorow"],["-",BX.date.convertBitrixFormat(BX.message("FORMAT_DATE"))],["today","today"],["yesterday","yesterday"],["",BX.date.convertBitrixFormat(BX.message("FORMAT_DATE"))]],s,r,n);var t=BX.date.format([["tommorow","H:i"],["today","H:i"],["yesterday","H:i"],["",""]],s,r,n);if(t.length>0)return BX.message("FD_DAY_AT_TIME").replace(/#DAY#/g,e).replace(/#TIME#/g,t);else return e},Q:function(){var e=O((r-s)/60/60/24/1e3);if(e==0)return BX.message("FD_DAY_DIFF_1").replace(/#VALUE#/g,1);else return BX.date.format([["d","ddiff"],["m","mdiff"],["","Ydiff"]],s,r)}};var u=false;if(e[0]&&e[0]=="^"){u=true;e=e.substr(1)}var _=e.replace(o,C);
6043if(u){_=_.replace(/\s*00:00:00\s*/g,"").replace(/(\d\d:\d\d)(:00)/g,"$1").replace(/(\s*00:00\s*)(?!:)/g,"")}return _;function c(e,t,a,i){var s=O((a-t)/1e3);for(var r=0;r<e.length;r++){var n=e[r][0];var o=e[r][1];var l=null;if(n=="s"){if(s<60)return BX.date.format(o,t,a,i)}else if((l=/^s(\d+)/.exec(n))!=null){if(s<l[1])return BX.date.format(o,t,a,i)}else if(n=="i"){if(s<60*60)return BX.date.format(o,t,a,i)}else if((l=/^i(\d+)/.exec(n))!=null){if(s<l[1]*60)return BX.date.format(o,t,a,i)}else if(n=="H"){if(s<24*60*60)return BX.date.format(o,t,a,i)}else if((l=/^H(\d+)/.exec(n))!=null){if(s<l[1]*60*60)return BX.date.format(o,t,a,i)}else if(n=="d"){if(s<31*24*60*60)return BX.date.format(o,t,a,i)}else if((l=/^d(\d+)/.exec(n))!=null){if(s<l[1]*60*60)return BX.date.format(o,t,a,i)}else if(n=="m"){if(s<365*24*60*60)return BX.date.format(o,t,a,i)}else if((l=/^m(\d+)/.exec(n))!=null){if(s<l[1]*31*24*60*60)return BX.date.format(o,t,a,i)}else if(n=="today"){var u=d(a),_=h(a),c=p(a);var f=i?new Date(Date.UTC(u,_,c,0,0,0,0)):new Date(u,_,c,0,0,0,0);var m=i?new Date(Date.UTC(u,_,c+1,0,0,0,0)):new Date(u,_,c+1,0,0,0,0);if(t>=f&&t<m)return BX.date.format(o,t,a,i)}else if(n=="yesterday"){u=d(a);_=h(a);c=p(a);var D=i?new Date(Date.UTC(u,_,c-1,0,0,0,0)):new Date(u,_,c-1,0,0,0,0);var T=i?new Date(Date.UTC(u,_,c,0,0,0,0)):new Date(u,_,c,0,0,0,0);if(t>=D&&t<T)return BX.date.format(o,t,a,i)}else if(n=="tommorow"){u=d(a);_=h(a);c=p(a);var v=i?new Date(Date.UTC(u,_,c+1,0,0,0,0)):new Date(u,_,c+1,0,0,0,0);var B=i?new Date(Date.UTC(u,_,c+2,0,0,0,0)):new Date(u,_,c+2,0,0,0,0);if(t>=v&&t<B)return BX.date.format(o,t,a,i)}else if(n=="-"){if(s<0)return BX.date.format(o,t,a,i)}}return e.length>0?BX.date.format(e.pop()[1],t,a,i):""}function d(e){return n?e.getUTCFullYear():e.getFullYear()}function p(e){return n?e.getUTCDate():e.getDate()}function h(e){return n?e.getUTCMonth():e.getMonth()}function f(e){return n?e.getUTCHours():e.getHours()}function m(e){return n?e.getUTCMinutes():e.getMinutes()}function D(e){return n?e.getUTCSeconds():e.getSeconds()}function T(e){return n?e.getUTCMilliseconds():e.getMilliseconds()}function v(e){return n?e.getUTCDay():e.getDay()}function B(e,t){return n?e.setUTCDate(t):e.setDate(t)}function M(e,t,a){return n?e.setUTCMonth(t,a):e.setMonth(t,a)}function X(e,t){var a=e<100?Math.abs(e):Math.abs(e%100);var i=a%10;var s="";if(a==0)s=BX.message(t["0"]);else if(a==1)s=BX.message(t["1"]);else if(a>=10&&a<=20)s=BX.message(t["10_20"]);else if(i==1)s=BX.message(t["MOD_1"]);else if(2<=i&&i<=4)s=BX.message(t["MOD_2_4"]);else s=BX.message(t["MOD_OTHER"]);return s.replace(/#VALUE#/g,e)}function C(e,t){if(l[e])return l[e]();else return t}function O(e){return e>=0?Math.floor(e):Math.ceil(e)}};BX.date.convertBitrixFormat=function(e){if(!BX.type.isNotEmptyString(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")};BX.date.convertToUTC=function(e){if(!BX.type.isDate(e))return null;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))};BX.date.getNewDate=function(e){return new Date(BX.date.getBrowserTimestamp(e))};BX.date.getBrowserTimestamp=function(e){e=parseInt(e,10);var t=new Date(e*1e3).getTimezoneOffset()*60;return(parseInt(e,10)+parseInt(BX.message("SERVER_TZ_OFFSET"))+t)*1e3};BX.date.getServerTimestamp=function(e){e=parseInt(e,10);var t=new Date(e).getTimezoneOffset()*60;return Math.round(e/1e3-(parseInt(BX.message("SERVER_TZ_OFFSET"),10)+parseInt(t,10)))};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.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,r;a=i=s=r=false;var n=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 u=BX.findChild(t,{className:"adm-calendar-separate"});var _=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=r=true;BX.CalendarPeriod.RestoreInput(_);BX.CalendarPeriod.RestoreInput(c);break;case"":BX.CalendarPeriod.SaveAndClearInput(_);BX.CalendarPeriod.SaveAndClearInput(c);break;default:break}BX.CalendarPeriod.ChangeDirectOpts(e.value,t);n.style.display=a?"inline-block":"none";o.style.display=i?"inline-block":"none";l.style.display=s?"inline-block":"none";u.style.display=r?"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 r=0;switch(e.value){case"previous":r=-1;break;case"next":r=1;break;case"current":default:break}var n=false;var o=false;var l=new Date;var u=l.getFullYear();var _=l.getMonth();var c=l.getDate();var d=l.getDay();if(d==0)d=7;switch(s.value){case"day":n=new Date(u,_,c+r,0,0,0);o=new Date(u,_,c+r,23,59,59);break;case"week":n=new Date(u,_,c-d+1+r*7,0,0,0);o=new Date(u,_,c+(7-d)+r*7,23,59,59);break;case"month":n=new Date(u,_+r,1,0,0,0);o=new Date(u,_+1+r,0,23,59,59);break;case"quarter":var p=Math.floor(_/3)+r;n=new Date(u,3*p,1,0,0,0);o=new Date(u,3*(p+1),0,23,59,59);break;case"year":n=new Date(u+r,0,1,0,0,0);o=new Date(u+1+r,0,0,23,59,59);break;default:break}var h=window[a.name+"_bTime"]?BX.message("FORMAT_DATETIME"):BX.message("FORMAT_DATE");if(n){a.value=BX.formatDate(n,h);BX.addClass(a,"adm-calendar-inp-setted")}
6043if(o){i.value=BX.formatDate(o,h);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.value=null;this.control_id=Math.random();this._layers={};this._current_layer=null;this.DIV=null;this.PARTS={};this.weekStart=0;this.numRows=6;this._create=function(e){this.popup=new BX.PopupWindow("calendar_popup_"+this.control_id,e.node,{closeByEsc:true,autoHide:false,content:this._get_content(),zIndex:3e3,bindOptions:{forceBindPosition:true}});BX.bind(this.popup.popupContainer,"click",this.popup.cancelBubble)};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);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>'}),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");this.popup.adjustPosition();break;case"time_hide":BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");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":this.SaveValue();break;case"cancel":this.Close();break}};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,r=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}}r=true;this.value.setUTCHours(i%24)}if(!isNaN(s)){r=true;this.value.setUTCMinutes(s%60)}if(r){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 r=15;var n;(n=function(){s+=a*r;i+=a*r;if(a*s<0){e.style.top=i+"px";t.style.top=s+"px";setTimeout(n,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(),r="";for(var n=0;n<this.numRows;n++){r+='<div class="bx-calendar-range'+(n==this.numRows-1?" bx-calendar-range-noline":"")+'">';
6043for(var o=0;o<7;o++){a=t.getUTCDate();var l=t.getUTCDay();var u="bx-calendar-cell";if(i!=t.getUTCMonth())u+=" bx-calendar-date-hidden";else if(s==a)u+=" bx-calendar-active";if(l==0||l==6)u+=" bx-calendar-weekend";r+='<a href="javascript:void(0)" class="'+u+'" data-date="'+t.valueOf()+'">'+a+"</a>";t.setUTCDate(t.getUTCDate()+1)}r+="</div>"}e.innerHTML=r;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+='<a href="javascript:void(0)" class="bx-calendar-month'+(a==t?" bx-calendar-month-active":"")+'" onclick="BX.calendar.get().SetMonth('+a+')">'+BX.message("MONTH_"+(a+1))+"</a>"}return'<div class="bx-calendar-month-popup"><div class="bx-calendar-month-title" onclick="BX.calendar.get().popup_month.close();">'+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_"+this.control_id,this.PARTS.MONTH,{content:this._menu_month_content(),zIndex:3001,closeByEsc:true,autoHide:true,offsetTop:-29,offsetLeft:-1,events:{onPopupShow:BX.delegate(function(){if(this.popup_year){this.popup_year.close()}},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._menu_year_content=function(){var e='<div class="bx-calendar-year-popup"><div class="bx-calendar-year-title" onclick="BX.calendar.get().popup_year.close();">'+this.value.getUTCFullYear()+'</div><div class="bx-calendar-year-content" id="bx-calendar-year-content">';for(var t=-3;t<=3;t++){e+='<a href="javascript:void(0)" class="bx-calendar-year-number'+(t==0?" bx-calendar-year-active":"")+'" onclick="BX.calendar.get().SetYear('+(this.value.getUTCFullYear()-t)+')">'+(this.value.getUTCFullYear()-t)+"</a>"}e+='</div><input type="text" class="bx-calendar-year-input" onkeyup="if(this.value>=1900&&this.value<=2100)BX.calendar.get().SetYear(this.value);" maxlength="4" /></div>';return e};this._menu_year=function(){if(!this.popup_year){this.popup_year=new BX.PopupWindow("calendar_popup_year_"+this.control_id,this.PARTS.YEAR,{content:this._menu_year_content(),zIndex:3001,closeByEsc:true,autoHide:true,offsetTop:-29,offsetLeft:-1,events:{onPopupShow:BX.delegate(function(){if(this.popup_month){this.popup_month.close()}},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._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);if(!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.bTime=typeof this.params.bTime=="undefined"?true:!!this.params.bTime;this.params.bHideTime=typeof this.params.bHideTime=="undefined"?true:!!this.params.bHideTime;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)BX.removeClass(this.DIV,"bx-calendar-time-disabled");else BX.addClass(this.DIV,"bx-calendar-time-disabled");if(!!i)BX.removeClass(this.PARTS.TIME,"bx-calendar-set-time-opened");else BX.addClass(this.PARTS.TIME,"bx-calendar-set-time-opened");if(a){this._auto_hide_disable();this.popup.show();setTimeout(BX.proxy(this._auto_hide_enable,this),0)}
6043this.params.bSetFocus=typeof this.params.bSetFocus=="undefined"?true:!!this.params.bSetFocus;if(this.params.bSetFocus)e.node.blur();return this};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){this.params.field.value=BX.calendar.ValueToString(this.value,a,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;if(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,r,n,o){return BX.calendar({no
6043de:e,field:t,form:n,bTime:!!s,currentTime:r,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||{ 6044titleBar:BX.message("CAL_TIME"),offsetLeft:-45,offsetTop:-135,autoHide:true,closeIcon:true,closeByEsc:true,zIndex:this.params.zIndex});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}})(); 6045/* End */ 6046; 6047; /* Start:"a:4:{s:4:"full";s:44:"/bitrix/js/main/utils.min.js?145803104219858";s:6:"source";s:24:"/bitrix/js/main/utils.js";s:3:"min";s:28:"/bitrix/js/main/utils.min.js";s:3:"map";s:28:"/bitrix/js/main/utils.map.js";}"*/ 6048var phpVars;if(!phpVars){phpVars={ADMIN_THEME_ID:".default",LANGUAGE_ID:"en",FORMAT_DATE:"DD.MM.YYYY",FORMAT_DATETIME:"DD.MM.YYYY HH:MI:SS",opt_context_ctrl:false,cookiePrefix:"BITRIX_SM",titlePrefix:"",bitrix_sessid:"",messHideMenu:"",messShowMenu:"",messHideButtons:"",messShowButtons:"",messFilterInactive:"",messFilterActive:"",messFilterLess:"",messLoading:"Loading...",messMenuLoading:"",messMenuLoadingTitle:"",messNoData:"",messExpandTabs:"",messCollapseTabs:"",messPanelFixOn:"",messPanelFixOff:"",messPanelCollapse:"",messPanelExpand:""}}var jsUtils={arEvents:Array(),addEvent:function(e,t,n,i){if(e.attachEvent)e.attachEvent("on"+t,n);else if(e.addEventListener)e.addEventListener(t,n,false);else e["on"+t]=n;this.arEvents[this.arEvents.length]={element:e,event:t,fn:n}},removeEvent:function(e,t,n){if(e.detachEvent)e.detachEvent("on"+t,n);else if(e.removeEventListener)e.removeEventListener(t,n,false);else e["on"+t]=null},removeAllEvents:function(e){var t;for(t=0;t<this.arEvents.length;t++){if(this.arEvents[t]&&(e==false||e==this.arEvents[t].element)){jsUtils.removeEvent(this.arEvents[t].element,this.arEvents[t].event,this.arEvents[t].fn);this.arEvents[t]=null}}if(e==false)this.arEvents.length=0},IsDoctype:function(){if(document.compatMode)return document.compatMode=="CSS1Compat";
6048if(document.documentElement&&document.documentElement.clientHeight)return true;return false},GetRealPos:function(e){if(window.BX)return BX.pos(e);if(!e||!e.offsetParent)return false;var t=Array();t["left"]=e.offsetLeft;t["top"]=e.offsetTop;var n=e.offsetParent;while(n&&n.tagName!="BODY"){t["left"]+=n.offsetLeft;t["top"]+=n.offsetTop;n=n.offsetParent}t["right"]=t["left"]+e.offsetWidth;t["bottom"]=t["top"]+e.offsetHeight;return t},FindChildObject:function(e,t,n,i){if(!e)return null;var o=t.toUpperCase();var s=n?n.toLowerCase():null;var r=e.childNodes.length;for(var l=0;l<r;l++){var a=e.childNodes[l];if(a.tagName&&a.tagName.toUpperCase()==o)if(!n||a.className.toLowerCase()==s)return a;if(i==true){var d;if(d=jsUtils.FindChildObject(a,t,n,true))return d}}return null},FindParentObject:function(e,t,n){if(!e)return null;var i=e;var o=t.toUpperCase();var s=n?n.toLowerCase():null;while(i.parentNode){var r=i.parentNode;if(r.tagName&&r.tagName.toUpperCase()==o)if(!n||r.className.toLowerCase()==s)return r;i=r}return null},FindNextSibling:function(e,t){if(!e)return null;var n=e;var i=t.toUpperCase();while(n.nextSibling){var o=n.nextSibling;if(o.tagName&&o.tagName.toUpperCase()==i)return o;n=o}return null},FindPreviousSibling:function(e,t){if(!e)return null;var n=e;var i=t.toUpperCase();while(n.previousSibling){var o=n.previousSibling;if(o.tagName&&o.tagName.toUpperCase()==i)return o;n=o}return null},bOpera:navigator.userAgent.toLowerCase().indexOf("opera")!=-1,bIsIE:document.attachEvent&&navigator.userAgent.toLowerCase().indexOf("opera")==-1,IsIE:function(){return this.bIsIE},IsOpera:function(){return this.bOpera},IsSafari:function(){var e=navigator.userAgent.toLowerCase();return/webkit/.test(e)},IsEditor:function(){var e=navigator.userAgent.toLowerCase();var t=(e.match(/.+(msie)[\/: ]([\d.]+)/)||[])[2];var n=/webkit/.test(e);if(this.IsOpera()||document.all&&!document.compatMode&&t<6||n)return false;return true},ToggleDiv:function(e){var t=document.getElementById(e).style;if(t.display!="none")t.display="none";else t.display="block";return t.display!="none"},urlencode:function(e){return escape(e).replace(new RegExp("\\+","g"),"%2B")},OpenWindow:function(e,t,n){var i=screen.width,o=screen.height;if(this.IsOpera()){i=document.body.offsetWidth;o=document.body.offsetHeight}window.open(e,"","status=no,scrollbars=yes,resizable=yes,width="+t+",height="+n+",top="+Math.floor((o-n)/2-14)+",left="+Math.floor((i-t)/2-5))},SetPageTitle:function(e){document.title=phpVars.titlePrefix+e;var t=document.getElementsByTagName("H1");if(t)t[0].innerHTML=e},LoadPageToDiv:function(e,t){var n=document.getElementById(t);if(!n)return;CHttpRequest.Action=function(e){CloseWaitWindow();document.getElementById(t).innerHTML=e};ShowWaitWindow();CHttpRequest.Send(e)},trim:function(e){if(typeof e=="string"||typeof e=="object"&&e.constructor==String){var t,n;n=/^[\s\r\n]+/g;t=e.replace(n,"");n=/[\s\r\n]+$/g;t=t.replace(n,"");return t}else return e},Redirect:function(e,t){var n=null,i=false;if(e&&e.length>0)n=e[0];if(!n)n=window.event;if(n)i=n.shiftKey;if(i)window.open(t);else{window.location.href=t}},False:function(){return false},AlignToPos:function(e,t,n){var i=e["left"],o=e["bottom"];var s=jsUtils.GetWindowScrollPos();var r=jsUtils.GetWindowInnerSize();if(r.innerWidth+s.scrollLeft-(e["left"]+t)<0){if(e["right"]-t>=0)i=e["right"]-t;else i=s.scrollLeft}if(r.innerHeight+s.scrollTop-(e["bottom"]+n)<0){if(e["top"]-n>=0)o=e["top"]-n;else o=s.scrollTop}return{left:i,top:o}},EvalGlobal:function(e){try{if(window.execScript)window.execScript(e,"javascript");else if(jsUtils.IsSafari())window.setTimeout(e,0);else window.eval(e)}catch(t){}},GetStyleValue:function(e,t){var n;if(e.currentStyle)n=e.currentStyle[t];else if(window.getComputedStyle)n=document.defaultView.getComputedStyle(e,null).getPropertyValue(t);if(!n)n="";return n},GetWindowInnerSize:function(e){var t,n;if(!e)e=document;if(self.innerHeight){t=self.innerWidth;n=self.innerHeight}else if(e.documentElement&&(e.documentElement.clientHeight||e.documentElement.clientWidth)){t=e.documentElement.clientWidth;n=e.documentElement.clientHeight}else if(e.body){t=e.body.clientWidth;n=e.body.clientHeight}
6048return{innerWidth:t,innerHeight:n}},GetWindowScrollPos:function(e){var t,n;if(!e)e=document;if(self.pageYOffset){t=self.pageXOffset;n=self.pageYOffset}else if(e.documentElement&&(e.documentElement.scrollTop||e.documentElement.scrollLeft)){t=document.documentElement.scrollLeft;n=document.documentElement.scrollTop}else if(e.body){t=e.body.scrollLeft;n=e.body.scrollTop}return{scrollLeft:t,scrollTop:n}},GetWindowScrollSize:function(e){var t,n;if(!e)e=document;if(e.compatMode&&e.compatMode=="CSS1Compat"){t=e.documentElement.scrollWidth;n=e.documentElement.scrollHeight}else{if(e.body.scrollHeight>e.body.offsetHeight)n=e.body.scrollHeight;else n=e.body.offsetHeight;if(e.body.scrollWidth>e.body.offsetWidth||e.compatMode&&e.compatMode=="BackCompat"||e.documentElement&&!e.documentElement.clientWidth)t=e.body.scrollWidth;else t=e.body.offsetWidth}return{scrollWidth:t,scrollHeight:n}},GetWindowSize:function(){var e=jsUtils.GetWindowInnerSize();var t=jsUtils.GetWindowScrollPos();var n=jsUtils.GetWindowScrollSize();return{innerWidth:e.innerWidth,innerHeight:e.innerHeight,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight}},arCustomEvents:{},addCustomEvent:function(e,t,n,i){if(!this.arCustomEvents[e])this.arCustomEvents[e]=[];if(!n)n=[];if(!i)i=false;this.arCustomEvents[e].push({handler:t,arParams:n,obj:i})},removeCustomEvent:function(e,t){if(!this.arCustomEvents[e])return;var n=this.arCustomEvents[e].length;if(n==1){delete this.arCustomEvents[e];return}for(var i=0;i<n;i++){if(!this.arCustomEvents[e][i])continue;if(this.arCustomEvents[e][i].handler==t){delete this.arCustomEvents[e][i];return}}},onCustomEvent:function(e,t){if(!this.arCustomEvents[e])return;if(!t)t=[];var n;for(var i=0,o=this.arCustomEvents[e].length;i<o;i++){n=this.arCustomEvents[e][i];if(!n||!n.handler)continue;if(n.obj)n.handler.call(n.obj,n.arParams,t);else n.handler(n.arParams,t)}},loadJSFile:function(e,t,n){if(!n)n=document;if(typeof e=="string")e=[e];var i=function(){if(!t)return;if(typeof t=="function")return t();if(typeof t!="object"||!t.func)return;var e=t.params||{};if(t.obj)t.func.apply(t.obj,e);else t.func(e)};var o=function(t){if(t>=e.length)return i();var s=n.body.appendChild(n.createElement("script"));s.src=e[t];var r=false;s.onload=s.onreadystatechange=function(){if(!r&&(!s.readyState||s.readyState=="loaded"||s.readyState=="complete")){r=true;setTimeout(function(){o(++t)},50)}}};o(0)},loadCSSFile:function(e,t,n){if(typeof e=="string"){var i=true;e=[e]}var o,s=e.length,r=[];if(s==0)return;if(!t)t=document;if(!n)n=window;if(!n.bxhead){var l=t.getElementsByTagName("HEAD");n.bxhead=l[0]}if(!n.bxhead)return;for(o=0;o<s;o++){var a=document.createElement("LINK");a.href=e[o];a.rel="stylesheet";a.type="text/css";n.bxhead.appendChild(a);r.push(a)}if(i)return a;return r},appendBXHint:function(e,t){if(!e||!e.parentNode||!t)return;var n=new BXHint(t);e.parentNode.insertBefore(n.oIcon,e);e.parentNode.removeChild(e);n.oIcon.style.marginLeft="5px"},PreventDefault:function(e){if(!e)e=window.event;if(e.stopPropagation){e.preventDefault();e.stopPropagation()}else{e.cancelBubble=true;e.returnValue=false}return false},CreateElement:function(e,t,n,i){if(!i)i=document;var o=i.createElement(e),s;if(t){for(s in t){if(s=="className"||s=="class"){o.setAttribute("class",t[s]);if(jsUtils.IsIE())o.setAttribute("className",t[s]);continue}if(t[s]!=undefined&&t[s]!=null)o.setAttribute(s,t[s])}}if(n){for(s in n)o.style[s]=n[s]}return o},in_array:function(e,t){for(var n=0;n<t.length;n++){if(t[n]==e)return true}return false},htmlspecialchars:function(e){if(!e.replace)return e;return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}};function JCFloatDiv(){var e=this;this.floatDiv=null;this.x=this.y=0;this.Create=function(e){var t=document.body.appendChild(document.createElement("DIV"));t.id=e.id;t.style.position="absolute";t.style.left="-10000px";t.style.top="-10000px";if(e.className)t.className=e.className;if(e.zIndex)t.style.zIndex=e.zIndex;if(e.width)t.style.width=e.width+"px";if(e.height)t.style.height=e.height+"px";return t};
6048this.Show=function(e,t,n,i,o,s){if(s!==false)s=true;var r=parseInt(e.style.zIndex);if(r<=0||isNaN(r))r=100;e.style.zIndex=r;if(t<0)t=0;if(n<0)n=0;e.style.left=parseInt(t)+"px";e.style.top=parseInt(n)+"px";if(jsUtils.IsIE()&&s===true){var l=document.getElementById(e.id+"_frame");if(!l){l=document.createElement("IFRAME");l.src="javascript:''";l.id=e.id+"_frame";l.style.position="absolute";l.style.borderWidth="0px";l.style.zIndex=r-1;document.body.appendChild(l)}l.style.width=e.offsetWidth+"px";l.style.height=e.offsetHeight+"px";l.style.left=e.style.left;l.style.top=e.style.top;l.style.visibility="visible"}e.restrictDrag=o||false;if(isNaN(i))i=5;if(i>0){var a=document.getElementById(e.id+"_shadow");if(!a){if(jsUtils.IsIE()){a=document.createElement("DIV");a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/shadow.png',sizingMethod='scale')"}else{a=document.createElement("IMG");a.src="/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/shadow.png"}a.id=e.id+"_shadow";a.style.position="absolute";a.style.zIndex=r-2;a.style.left="-1000px";a.style.top="-1000px";a.style.lineHeight="normal";a.className="bx-js-float-shadow";document.body.appendChild(a)}a.style.width=e.offsetWidth+"px";a.style.height=e.offsetHeight+"px";a.style.left=parseInt(e.style.left)+i+"px";a.style.top=parseInt(e.style.top)+i+"px";a.style.visibility="visible"}e.dxShadow=i};this.Close=function(e){if(!e)return;var t=document.getElementById(e.id+"_shadow");if(t)t.style.visibility="hidden";var n=document.getElementById(e.id+"_frame");if(n)n.style.visibility="hidden"};this.Move=function(e,t,n){if(!e)return;var i=e.dxShadow;var o=parseInt(e.style.left)+t;var s=parseInt(e.style.top)+n;if(e.restrictDrag){if(o<0)o=0;if(document.compatMode&&document.compatMode=="CSS1Compat")windowWidth=document.documentElement.scrollWidth;else{if(document.body.scrollWidth>document.body.offsetWidth||document.compatMode&&document.compatMode=="BackCompat"||document.documentElement&&!document.documentElement.clientWidth)windowWidth=document.body.scrollWidth;else windowWidth=document.body.offsetWidth}var r=e.offsetWidth;if(o>windowWidth-r-i)o=windowWidth-r-i;if(s<0)s=0}e.style.left=o+"px";e.style.top=s+"px";this.AdjustShadow(e)};this.HideShadow=function(e){var t=document.getElementById(e.id+"_shadow");t.style.visibility="hidden"};this.UnhideShadow=function(e){var t=document.getElementById(e.id+"_shadow");t.style.visibility="visible"};this.AdjustShadow=function(e){var t=document.getElementById(e.id+"_shadow");if(t&&t.style.visibility!="hidden"){var n=e.dxShadow;t.style.width=e.offsetWidth+"px";t.style.height=e.offsetHeight+"px";t.style.left=parseInt(e.style.left)+n+"px";t.style.top=parseInt(e.style.top)+n+"px"}var i=document.getElementById(e.id+"_frame");if(i){i.style.width=e.offsetWidth+"px";i.style.height=e.offsetHeight+"px";i.style.left=e.style.left;i.style.top=e.style.top}};this.StartDrag=function(t,n){if(!t)t=window.event;this.x=t.clientX+document.body.scrollLeft;this.y=t.clientY+document.body.scrollTop;this.floatDiv=n;jsUtils.addEvent(document,"mousemove",this.MoveDrag);document.onmouseup=this.StopDrag;if(document.body.setCapture)document.body.setCapture();document.onmousedown=jsUtils.False;var i=document.body;i.ondrag=jsUtils.False;i.onselectstart=jsUtils.False;i.style.MozUserSelect=e.floatDiv.style.MozUserSelect="none";i.style.cursor="move"};this.StopDrag=function(t){if(document.body.releaseCapture)document.body.releaseCapture();jsUtils.removeEvent(document,"mousemove",e.MoveDrag);document.onmouseup=null;this.floatDiv=null;document.onmousedown=null;var n=document.body;n.ondrag=null;n.onselectstart=null;n.style.MozUserSelect=e.floatDiv.style.MozUserSelect="";n.style.cursor=""};this.MoveDrag=function(t){var n=t.clientX+document.body.scrollLeft;var i=t.clientY+document.body.scrollTop;if(e.x==n&&e.y==i)return;e.Move(e.floatDiv,n-e.x,i-e.y);e.x=n;e.y=i}}var jsFloatDiv=new JCFloatDiv;var BXHint=function(e,t,n){this.oDivOver=false;this.timeOutID=null;this.oIcon=null;this.freeze=false;this.x=0;this.y=0;this.time=700;if(!e)e="";this.Create(e,t,n)};BXHint.prototype.Create=function(e,t,n){var i=this,o=0,s=0,r=null,l="icon";this.bWidth=true;if(n){if(n.width===false)this.bWidth=false;else if(n.width)o=n.width;if(n.height)s=n.height;if(n.className)r=n.className;if(n.type&&(n.type=="link"||n.type=="icon"))l=n.type;if(n.time>0)this.time=n.time}if(t)l="element";if(l=="icon"){var t=document.createElement("IMG");t.src=n&&n.iconSrc?n.iconSrc:"/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/public/popup/hint.gif";t.ondrag=jsUtils.False}else if(l=="link"){var t=document.createElement("A");t.href="";t.onclick=function(e){return false};t.innerHTML="[?]"}this.element=t;if(l=="element"){if(n&&n.show_on_click){jsUtils.addEvent(t,"click",function(t){if(!t)t=window.event;i.GetMouseXY(t);i.timeOutID=setTimeout(function(){i.Show(e,o,s,r)},10)})}else{jsUtils.addEvent(t,"mouseover",function(t){if(!t)t=window.event;i.GetMouseXY(t);i.timeOutID=setTimeout(function(){i.Show(e,o,s,r)},750)})}jsUtils.addEvent(t,"mouseout",function(e){if(i.timeOutID)clearTimeout(i.timeOutID);i.SmartHide(i)})}else{this.oIcon=t;t.onmouseover=function(t){if(!t)t=window.event;i.GetMouseXY(t);i.Show(e,o,s,r)};t.onmouseout=function(){i.SmartHide(i)}}};BXHint.prototype.IsFrozen=function(){return this.freeze};BXHint.prototype.Freeze=function(){this.freeze=true;this.Hide()};BXHint.prototype.UnFreeze=function(){this.freeze=false};BXHint.prototype.GetMouseXY=function(e){if(e.pageX||e.pageY){this.x=e.pageX;this.y=e.pageY}else if(e.clientX||e.clientY){this.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;this.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}};BXHint.prototype.Show=function(e,t,n,i){var o=document.getElementById("__BXHint_div");if(o)this.Hide();if(this.freeze)return;var s=this;var r=document.body.appendChild(document.createElement("DIV"));r.onmouseover=function(){s.oDivOver=true};r.onmouseout=function(){s.oDivOver=false;s.SmartHide(s)};r.id="__BXHint_div";r.className=i?i:"bxhint";r.style.position="absolute";if(t&&this.bWidth)r.style.width=t+"px";if(n)r.style.height=n+"px";r.innerHTML=e;var l=r.offsetWidth;var a=r.offsetHeight;if(this.bWidth){if(!t&&l>200)l=Math.round(Math.sqrt(1.618*l*a));r.style.width=l+"px";a=r.offsetHeight}var d={left:this.x+10,right:this.x+l,top:this.y,bottom:this.y+a};d=this.AlignToPos(d,l,a);r.style.zIndex=2100;jsFloatDiv.Show(r,d.left,d.top,3);r=null};BXHint.prototype.AlignToPos=function(e,t,n){var i=document.body;if(i.clientWidth+i.scrollLeft<e.left+t)e.left=e.left-t>=0?e.left-t:i.scrollLeft;if(i.clientHeight+i.scrollTop-e["bottom"]<0)e.top=e.top-n>=0?e.top-n:i.scrollTop;return e};BXHint.prototype.Hide=function(){var e=document.getElementById("__BXHint_div");if(!e)return;jsFloatDiv.Close(e);e.parentNode.removeChild(e);e=null};BXHint.prototype.SmartHide=function(e){setTimeout(function(){if(!e.oDivOver)e.Hide()},100)};function WaitOnKeyPress(e){if(!e)e=window.event;if(!e)return;if(e.keyCode==27)CloseWaitWindow()}function ShowWaitWindow(){CloseWaitWindow();var e=jsUtils.GetWindowSize();var t=document.body.appendChild(document.createElement("DIV"));t.id="wait_window_div";t.innerHTML=phpVars.messLoading;t.className="waitwindow";t.style.right=5-e.scrollLeft+"px";t.style.top=e.scrollTop+5+"px";
6048if(jsUtils.IsIE()){var n=document.createElement("IFRAME");n.src="javascript:''";n.id="wait_window_frame";n.className="waitwindow";n.style.width=t.offsetWidth+"px";n.style.height=t.offsetHeight+"px";n.style.right=t.style.right;n.style.top=t.style.top;document.body.appendChild(n)}jsUtils.addEvent(document,"keypress",WaitOnKeyPress)}function CloseWaitWindow(){jsUtils.removeEvent(document,"keypress",WaitOnKeyPress);var e=document.getElementById("wait_window_frame");if(e)e.parentNode.removeChild(e);var t=document.getElementById("wait_window_div");if(t)t.parentNode.removeChild(t)}var jsSelectUtils={addNewOption:function(e,t,n,i,o){var s=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(s){var r=s.length;if(o!==false){for(var l=0;l<r;l++)if(s[l].value==t)return}var a=new Option(n,t,false,false);s.options[r]=a}if(i===true)this.sortSelect(e)},deleteOption:function(e,t){var n=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(n){for(var i=0;i<n.length;i++)if(n[i].value==t){n.remove(i);break}}},deleteSelectedOptions:function(e){var t=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(t){var n=0;while(n<t.length)if(t[n].selected){t[n].selected=false;t.remove(n)}else n++}},deleteAllOptions:function(e){if(e){for(var t=e.length-1;t>=0;t--)e.remove(t)}},optionCompare:function(e,t){var n=e.optText.toLowerCase();var i=t.optText.toLowerCase();if(n>i)return 1;if(n<i)return-1;return 0},sortSelect:function(e){var t=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(t){var n=[];var i=t.options.length;for(var o=0;o<i;o++){n[o]={optText:t[o].text,optValue:t[o].value}}n.sort(this.optionCompare);t.length=0;i=n.length;for(var o=0;o<i;o++){var s=new Option(n[o].optText,n[o].optValue,false,false);t[o]=s}}},selectAllOptions:function(e){var t=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(t){var n=t.length;for(var i=0;i<n;i++)t[i].selected=true}},selectOption:function(e,t){var n=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(n){var i=n.length;for(var o=0;o<i;o++)n[o].selected=n[o].value==t}},addSelectedOptions:function(e,t,n,i){if(!e)return;var o=e.length;for(var s=0;s<o;s++)if(e[s].selected)this.addNewOption(t,e[s].value,e[s].text,i,n)},moveOptionsUp:function(e){if(!e)return;var t=e.length;for(var n=0;n<t;n++){if(e[n].selected&&n>0&&e[n-1].selected==false){var i=new Option(e[n].text,e[n].value);var o=new Option(e[n-1].text,e[n-1].value);e[n]=o;e[n].selected=false;e[n-1]=i;e[n-1].selected=true}}},moveOptionsDown:function(e){if(!e)return;var t=e.length;for(var n=t-1;n>=0;n--){if(e[n].selected&&n<t-1&&e[n+1].selected==false){var i=new Option(e[n].text,e[n].value);var o=new Option(e[n+1].text,e[n+1].value);e[n]=o;e[n].selected=false;e[n+1]=i;e[n+1].selected=true}}}}; 6049/* End */ 6050; 6051//# 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.