;(function(window){if(window.BX)return;var BX=function(node,bCache)
{if(BX.type.isNotEmptyString(node))
{var ob;if(!!bCache&&null!=NODECACHE[node])ob=NODECACHE[node];ob=ob||document.getElementById(node);if(!!bCache)NODECACHE[node]=ob;return ob;}
else if(BX.type.isDomNode(node))
return node;else if(BX.type.isFunction(node))
return BX.ready(node);return null;},MESS={},__readyHandler=null,readyBound=false,readyList=[],proxyId=1,proxyList=[],NODECACHE={},deniedEvents=[],eventsList=[],customEvents={},garbageCollectors=[],bOpera=navigator.userAgent.toLowerCase().indexOf('opera')!=-1,bSafari=navigator.userAgent.toLowerCase().indexOf('webkit')!=-1,bIE=document.attachEvent&&!bOpera,r={script:/<script([^>]*)>/i,script_src:/src=["\']([^"\']+)["\']/i,space:/\s+/,ltrim:/^[\s\r\n]+/g,rtrim:/[\s\r\n]+$/g,style:/<link.*?(rel="stylesheet"|type="text\/css")[^>]*/i,style_href:/href=["\']([^"\']+)["\']/i},eventTypes={click:'MouseEvent',dblclick:'MouseEvent',mousedown:'MouseEvent',mousemove:'MouseEvent',mouseout:'MouseEvent',mouseover:'MouseEvent',mouseup:'MouseEvent'}
lastWait=[];BX.ext=function(ob){for(var i in ob)this[i]=ob[i];}
BX.extend=function(child,parent)
{var f=function(){};f.prototype=parent.prototype;child.prototype=new f();child.prototype.constructor=child;child.superclass=parent.prototype;if(parent.prototype.constructor==Object.prototype.constructor)
{parent.prototype.constructor=parent;}}
BX.is_subclass_of=function(ob,parent_class)
{if(ob instanceof parent_class)
return true;if(parent_class.superclass)
return BX.is_subclass_of(ob,parent_class.superclass);return false;}
BX.message=function(mess)
{if(BX.type.isString(mess))
return MESS[mess];else
{for(var i in mess)
{MESS[i]=mess[i];}
return true;}}
BX.bitrix_sessid=function(){return MESS.bitrix_sessid;}
BX.create=function(tag,data,context)
{context=context||document;if(null==data&&typeof tag=='object'&&tag.constructor!==String)
{data=tag;tag=tag.tag;}
var elem;if(BX.browser.IsIE()&&!BX.browser.IsIE9()&&null!=data&&null!=data.props&&(data.props.name||data.props.id))
{elem=context.createElement('<'+tag+(data.props.name?' name="'+data.props.name+'"':'')+(data.props.id?' id="'+data.props.id+'"':'')+'>');}
else
{elem=context.createElement(tag);}
return data?BX.adjust(elem,data):elem;}
BX.adjust=function(elem,data)
{var j,len;if(!elem.nodeType)
return null;if(elem.nodeType==9)
elem=elem.body;if(data.attrs)
{for(j in data.attrs)
{if(j=='class'||j=='className')
elem.className=data.attrs[j];else if(data.attrs[j]=="")
elem.removeAttribute(j);else
elem.setAttribute(j,data.attrs[j]);}}
if(data.style)
{for(j in data.style)
elem.style[j]=data.style[j];}
if(data.props)
{for(j in data.props)
elem[j]=data.props[j];}
if(data.events)
{for(j in data.events)
BX.bind(elem,j,data.events[j]);}
if(data.children&&data.children.length>0)
{for(j=0,len=data.children.length;j<len;j++)
{if(BX.type.isNotEmptyString(data.children[j]))
elem.innerHTML+=data.children[j];else if(BX.type.isElementNode(data.children[j]))
elem.appendChild(data.children[j]);}}
else if(data.text)
{BX.cleanNode(elem);elem.appendChild((elem.ownerDocument||document).createTextNode(data.text));}
else if(data.html)
{elem.innerHTML=data.html;}
return elem;}
BX.remove=function(ob)
{if(null!=ob.parentNode)
ob.parentNode.removeChild(ob);ob=null;return null;}
BX.cleanNode=function(node,bSuicide)
{node=BX(node);bSuicide=!!bSuicide;if(node&&node.childNodes)
{while(node.childNodes.length>0)
node.removeChild(node.firstChild);}
if(node&&bSuicide)
{node=BX.remove(node);}
return node;}
BX.addClass=function(ob,value)
{var classNames;ob=BX(ob)
if(ob)
{if(!ob.className)
{ob.className=value}
else
{classNames=(value||"").split(r.space);var className=" "+ob.className+" ";for(var j=0,cl=classNames.length;j<cl;j++)
{if(className.indexOf(" "+classNames[j]+" ")<0)
{ob.className+=" "+classNames[j];}}}}
return ob;}
BX.removeClass=function(ob,value)
{ob=BX(ob);if(ob)
{if(ob.className)
{if(BX.type.isString(value))
{var classNames=value.split(r.space),className=" "+ob.className+" ";for(var j=0,cl=classNames.length;j<cl;j++)
{className=className.replace(" "+classNames[j]+" "," ");}
ob.className=BX.util.trim(className);}
else
{ob.className="";}}}
return ob;}
BX.toggleClass=function(ob,value)
{var className;if(BX.type.isArray(value))
{className=' '+ob.className+' ';for(var j=0,len=value.length;j<len;j++)
{if(BX.hasClass(ob,value[j]))
{className=(' '+className+' ').replace(' '+value[j]+' ',' ');className+=' '+value[j>=len-1?0:j+1];j--;break;}}
if(j==len)
ob.className+=' '+value[0];else
ob.className=className;ob.className=BX.util.trim(ob.className);}
else if(BX.type.isNotEmptyString(value))
{className=ob.className;if(BX.hasClass(ob,value))
{className=(' '+className+' ').replace(' '+value+' ',' ');}
else
{className+=' '+value;}
ob.className=BX.util.trim(className);}
return ob;}
BX.hasClass=function(el,className)
{if(!el.className)
return false;return((" "+el.className+" ").indexOf(" "+className+" "))>=0;}
BX.hoverEvents=function(el)
{if(el)
return BX.adjust(el,{events:BX.hoverEvents()});else
return{mouseover:BX.hoverEventsHover,mouseout:BX.hoverEventsHout};}
BX.hoverEventsHover=function(){BX.addClass(this,'bx-hover');this.BXHOVER=true;}
BX.hoverEventsHout=function(){BX.removeClass(this,'bx-hover');this.BXHOVER=false;}
BX.focusEvents=function(el)
{if(el)
return BX.adjust(el,{events:BX.focusEvents()});else
return{mouseover:BX.focusEventsFocus,mouseout:BX.focusEventsBlur};}
BX.focusEventsFocus=function(){BX.addClass(this,'bx-focus');this.BXFOCUS=true;}
BX.focusEventsBlur=function(){BX.removeClass(this,'bx-focus');this.BXFOCUS=false;}
BX.setUnselectable=function(node)
{BX.addClass(node,'bx-unselectable');node.setAttribute('unSelectable','on');}
BX.setSelectable=function(node)
{BX.removeClass(node,'bx-unselectable');node.removeAttribute('unSelectable');}
BX.styleIEPropertyName=function(name)
{if(name=='float')
name=BX.browser.IsIE()?'styleFloat':'cssFloat';else
{var reg=/(\-([a-z]){1})/g;if(reg.test(name))
{name=name.replace(reg,function(){return arguments[2].toUpperCase();});}}
return name;}
BX.style=function(el,property,value)
{if(!BX.type.isElementNode(el))
return null;if(value==null)
{var res;if(el.currentStyle)
res=el.currentStyle[BX.styleIEPropertyName(property)];else if(window.getComputedStyle)
res=BX.GetContext(el).getComputedStyle(el,null).getPropertyValue(property);if(!res)
res='';return res;}
else
{el.style[BX.styleIEPropertyName(property)]=value;return el;}}
BX.focus=function(el)
{try
{el.focus();return true;}
catch(e)
{return false;}}
BX.findChildren=function(obj,params,recursive)
{return BX.findChild(obj,params,recursive,true);}
BX.findChild=function(obj,params,recursive,get_all)
{if(!obj||!obj.childNodes)return null;recursive=!!recursive;get_all=!!get_all;var n=obj.childNodes.length,result=[];for(var j=0;j<n;j++)
{var child=obj.childNodes[j];if(_checkNode(child,params))
{if(get_all)
result.push(child)
else
return child;}
if(recursive==true)
{var res=BX.findChild(child,params,recursive,get_all);if(res)
{if(get_all)
result=BX.util.array_merge(result,res);else
return res;}}}
if(get_all&&result.length>0)
return result;else
return null;}
BX.findParent=function(obj,params)
{if(!obj)
return null;var o=obj;while(o.parentNode)
{var parent=o.parentNode;if(_checkNode(parent,params))
return parent;o=parent;}
return null;}
BX.findNextSibling=function(obj,params)
{if(!obj)
return null;var o=obj;while(o.nextSibling)
{var sibling=o.nextSibling;if(_checkNode(sibling,params))
return sibling;o=sibling;}
return null;}
BX.findPreviousSibling=function(obj,params)
{if(!obj)
return null;var o=obj;while(o.previousSibling)
{var sibling=o.previousSibling;if(_checkNode(sibling,params))
return sibling;o=sibling;}
return null;}
BX.clone=function(obj,bCopyObj)
{var _obj,i,l;if(bCopyObj!==false)
bCopyObj=true;if(obj===null)
return null;if(BX.type.isDomNode(obj))
{_obj=obj.cloneNode(bCopyObj);}
else if(typeof obj=='object')
{if(BX.type.isArray(obj))
{_obj=[];for(i=0,l=obj.length;i<l;i++)
{if(typeof obj[i]=="object"&&bCopyObj)
_obj[i]=BX.clone(obj[i],bCopyObj);else
_obj[i]=obj[i];}}
else
{_obj={};if(obj.constructor)
{if(obj.constructor===Date)
_obj=new Date(obj);else
_obj=new obj.constructor();}
for(i in obj)
{if(typeof obj[i]=="object"&&bCopyObj)
_obj[i]=BX.clone(obj[i],bCopyObj);else
_obj[i]=obj[i];}}}
else
{_obj=obj;}
return _obj;}
BX.bind=function(el,evname,func)
{if(!el)
return;if(evname==='mousewheel')
BX.bind(el,'DOMMouseScroll',func);if(el.addEventListener)
el.addEventListener(evname,func,false);else if(el.attachEvent)
el.attachEvent("on"+evname,BX.proxy(func,el));else
el["on"+evname]=func;eventsList[eventsList.length]={'element':el,'event':evname,'fn':func};}
BX.unbind=function(el,evname,func)
{if(!el)
return;if(evname==='mousewheel')
BX.unbind(el,'DOMMouseScroll',func);if(el.removeEventListener)
el.removeEventListener(evname,func,false);else if(el.detachEvent)
el.detachEvent("on"+evname,BX.proxy(func,el));else
el["on"+evname]=null;}
BX.unbindAll=function(el)
{if(!el)
return;for(var i=0,len=eventsList.length;i<len;i++)
{try
{if(eventsList[i]&&(null==el||el==eventsList[i].element))
{BX.unbind(eventsList[i].element,eventsList[i].event,eventsList[i].fn);eventsList[i]=null;}}
catch(e){}}
if(null==el)
{eventsList=[];}}
var captured_events=null,_bind=null;BX.CaptureEvents=function(el_c,evname_c)
{if(_bind)
return false;_bind=BX.bind;captured_events=[];BX.bind=function(el,evname,func)
{if(el===el_c&&evname===evname_c)
captured_events.push(func);_bind.apply(this,arguments);}}
BX.CaptureEventsGet=function()
{if(_bind)
{BX.bind=_bind;var captured=captured_events;_bind=null;captured_events=null;return captured;}}
BX.fireEvent=function(ob,ev)
{if(document.createEventObject)
{var e=document.createEventObject();ob.fireEvent('on'+ev,e)
if(ob[ev])
ob[ev]();}
else
{var e=null;switch(eventTypes[ev])
{case'MouseEvent':e=document.createEvent('MouseEvent');e.initMouseEvent(ev,true,true,top,1,0,0,0,0,0,0,0,0,0,null);break;default:e=document.createEvent('Event');e.initEvent(ev,true,true);}
ob.dispatchEvent(e);}}
BX.getWheelData=function(e)
{e=e||window.event;return wheelData=e.detail?e.detail*-1:e.wheelDelta/40;}
BX.proxy_context=null;BX.delegate=function(func,thisObject)
{return function(){var cur=BX.proxy_context;BX.proxy_context=this;var res=func.apply(thisObject,arguments);BX.proxy_context=cur;return res;}}
BX.delegateLater=function(func_name,thisObject,contextObject)
{return function()
{if(thisObject[func_name])
{var cur=BX.proxy_context;BX.proxy_context=this;var res=thisObject[func_name].apply(contextObject||thisObject,arguments);BX.proxy_context=cur;return res;}}}
BX.proxy=function(func,thisObject)
{if(null==thisObject.__proxy_id)
{proxyList[thisObject.__proxy_id=proxyList.length]={};}
if(null==func.__proxy_id)
func.__proxy_id=proxyId++;if(null==proxyList[thisObject.__proxy_id][func.__proxy_id])
proxyList[thisObject.__proxy_id][func.__proxy_id]=BX.delegate(func,thisObject);return proxyList[thisObject.__proxy_id][func.__proxy_id];}
BX.bindDelegate=function(elem,eventName,isTarget,handler)
{var h=BX.delegateEvent(elem,isTarget,handler);BX.bind(elem,eventName,h);return h;}
BX.delegateEvent=function(el,isTarget,handler)
{return function(e)
{e=e||window.event;var target=e.target||e.srcElement;while(target!=this)
{if(_checkNode(target,isTarget))
{return handler.call(target,e);}
target=target.parentNode;}}}
BX.False=function(){return false;}
BX.DoNothing=function(){}
BX.denyEvent=function(el,ev)
{deniedEvents.push([el,ev,el['on'+ev]]);el['on'+ev]=BX.DoNothing;}
BX.allowEvent=function(el,ev)
{for(var i=0,len=deniedEvents.length;i<len;i++)
{if(deniedEvents[i][0]==el&&deniedEvents[i][1]==ev)
{el['on'+ev]=deniedEvents[i][2];BX.util.deleteFromArray(deniedEvents,i);return;}}}
BX.fixEventPageXY=function(event)
{BX.fixEventPageX(event);BX.fixEventPageY(event);return event;};BX.fixEventPageX=function(event)
{if(event.pageX==null&&event.clientX!=null)
{event.pageX=event.clientX+
(document.documentElement&&document.documentElement.scrollLeft||document.body&&document.body.scrollLeft||0)-
(document.documentElement.clientLeft||0);}
return event;};BX.fixEventPageY=function(event)
{if(event.pageY==null&&event.clientY!=null)
{event.pageY=event.clientY+
(document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0)-
(document.documentElement.clientTop||0);}
return event;};BX.PreventDefault=function(e)
{if(!e)e=window.event;if(e.stopPropagation)
{e.preventDefault();e.stopPropagation();}
else
{e.cancelBubble=true;e.returnValue=false;}
return false;}
BX.eventReturnFalse=function(e)
{e=e||window.event;if(e&&e.preventDefault)e.preventDefault();else e.returnValue=false;return false;}
BX.eventCancelBubble=function(e)
{e=e||window.event;if(e&&e.stopPropagation)
e.stopPropagation();else
e.cancelBubble=true;}
BX.addCustomEvent=function(eventObject,eventName,eventHandler)
{if(BX.type.isString(eventObject))
{eventHandler=eventName;eventName=eventObject;eventObject=window;}
eventName=eventName.toUpperCase();if(!customEvents[eventName])
customEvents[eventName]=[];customEvents[eventName].push({handler:eventHandler,obj:eventObject});}
BX.removeCustomEvent=function(eventObject,eventName,eventHandler)
{if(BX.type.isString(eventObject))
{eventHandler=eventName;eventName=eventObject;eventObject=window;}
eventName=eventName.toUpperCase();if(!customEvents[eventName])
return;for(var i=0,l=customEvents[eventName].length;i<l;i++)
{if(!customEvents[eventName][i])
continue;if(customEvents[eventName][i].handler==eventHandler&&customEvents[eventName][i].obj==eventObject)
{delete customEvents[eventName][i];return;}}}
BX.onCustomEvent=function(eventObject,eventName,arEventParams)
{if(BX.type.isString(eventObject))
{arEventParams=eventName;eventName=eventObject;eventObject=window;}
eventName=eventName.toUpperCase();if(!customEvents[eventName])
return;if(!arEventParams)
arEventParams=[];var h;for(var i=0,l=customEvents[eventName].length;i<l;i++)
{h=customEvents[eventName][i];if(!h||!h.handler)
continue;if(h.obj==window||h.obj==eventObject)
{h.handler.apply(eventObject,arEventParams);}}}
BX.isReady=false;BX.ready=function(handler)
{bindReady();if(BX.isReady)
handler.call(document);else if(readyList)
readyList.push(handler);}
BX.submit=function(obForm,action_name,action_value)
{action_name=action_name||'save';if(!obForm['BXFormSubmit_'+action_name])
{obForm['BXFormSubmit_'+action_name]=obForm.appendChild(BX.create('INPUT',{'props':{'type':'submit','name':action_name,'value':action_value||'Y'},'style':{'display':'none'}}));}
BX.fireEvent(obForm['BXFormSubmit_'+action_name],'click');}
BX.browser={IsIE:function()
{return bIE;},IsIE6:function()
{return(/MSIE 6/i.test(navigator.userAgent));},IsIE9:function()
{return!!document.documentMode&&document.documentMode>=9;},IsOpera:function()
{return bOpera;},IsSafari:function()
{return bSafari;},IsDoctype:function(pDoc)
{pDoc=pDoc||document;if(pDoc.compatMode)
return(pDoc.compatMode=="CSS1Compat");if(pDoc.documentElement&&pDoc.documentElement.clientHeight)
return true;return false;},SupportLocalStorage:function(){try{return!!localStorage.getItem;}catch(e){return false;}}}
BX.show=function(ob)
{if(ob.BXDISPLAY||!_checkDisplay(ob))
{ob.style.display=ob.BXDISPLAY;}}
BX.hide=function(ob)
{if(!ob.BXDISPLAY)
_checkDisplay(ob);ob.style.display='none';}
BX.toggle=function(ob,values)
{if(!values&&BX.type.isElementNode(ob))
{var bShow=true;if(ob.BXDISPLAY)
bShow=!_checkDisplay(ob);else
bShow=ob.style.display=='none';if(bShow)
BX.show(ob);else
BX.hide(ob);}
else if(BX.type.isArray(values))
{for(var i=0,len=values.length;i<len;i++)
{if(ob==values[i])
{ob=values[i==len-1?0:i+1]
break;}}
if(i==len)
ob=values[0];}
return ob;}
BX.util={array_values:function(ar)
{if(!BX.type.isArray(ar))
return BX.util._array_values_ob(ar);var arv=[];for(var i=0,l=ar.length;i<l;i++)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(ar[i]);return arv;},_array_values_ob:function(ar)
{var arv=[];for(var i in ar)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(ar[i]);return arv;},array_keys:function(ar)
{if(!BX.type.isArray(ar))
return BX.util._array_keys_ob(ar);var arv=[];for(var i=0,l=ar.length;i<l;i++)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(i);return arv;},_array_keys_ob:function(ar)
{var arv=[];for(var i in ar)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(i);return arv;},array_merge:function(first,second)
{if(!BX.type.isArray(first))first=[];if(!BX.type.isArray(second))second=[];var i=first.length,j=0;if(typeof second.length==="number")
{for(var l=second.length;j<l;j++)
{first[i++]=second[j];}}
else
{while(second[j]!==undefined)
{first[i++]=second[j++];}}
first.length=i;return first;},array_unique:function(ar)
{var i=0,j,len=ar.length;if(len<2)return ar;for(;i<len-1;i++)
{for(j=i+1;j<len;j++)
{if(ar[i]==ar[j])
{ar.splice(j--,1);len--;}}}
return ar;},in_array:function(needle,haystack)
{for(var i=0;i<haystack.length;i++)
{if(haystack[i]==needle)
return true;}
return false;},array_search:function(needle,haystack)
{for(var i=0;i<haystack.length;i++)
{if(haystack[i]==needle)
return i;}
return-1;},trim:function(s)
{if(BX.type.isString(s))
return s.replace(r.ltrim,'').replace(r.rtrim,'');else
return s;},urlencode:function(s){return encodeURIComponent(s);},deleteFromArray:function(ar,ind){return ar.slice(0,ind).concat(ar.slice(ind+1));},insertIntoArray:function(ar,ind,el){return ar.slice(0,ind).concat([el]).concat(ar.slice(ind));},htmlspecialchars:function(str)
{if(!str.replace)return str;return str.replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},htmlspecialcharsback:function(str)
{if(!str.replace)return str;return str.replace(/\&quot;/g,'"').replace(/&#39;/g,"'").replace(/\&lt;/g,'<').replace(/\&gt;/g,'>').replace(/\&amp;/g,'&');},preg_quote:function(str,delimiter)
{if(!str.replace)
return str;return str.replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\'+(delimiter||'')+'-]','g'),'\\$&');},jsencode:function(str)
{if(!str||!str.replace)
return str;var escapes=[{c:"\\\\",r:"\\\\"},{c:"\\t",r:"\\t"},{c:"\\n",r:"\\n"},{c:"\\r",r:"\\r"},{c:"\"",r:"\\\""},{c:"'",r:"\\'"},{c:"<",r:"\\x3C"},{c:">",r:"\\x3E"},{c:"\\u2028",r:"\\u2028"},{c:"\\u2029",r:"\\u2029"}];for(var i=0;i<escapes.length;i++)
str=str.replace(new RegExp(escapes[i].c,'g'),escapes[i].r);return str;},str_pad:function(input,pad_length,pad_string,pad_type)
{pad_string=pad_string||' ';pad_type=pad_type||'right';input=input.toString();if(pad_type=='left')
return BX.util.str_pad_left(input,pad_length,pad_string);else
return BX.util.str_pad_right(input,pad_length,pad_string);},str_pad_left:function(input,pad_length,pad_string)
{var i=input.length,q=pad_string.length;if(i>=pad_length)return input;for(;i<pad_length;i+=q)
input=pad_string+input;return input;},str_pad_right:function(input,pad_length,pad_string)
{var i=input.length,q=pad_string.length;if(i>=pad_length)return input;for(;i<pad_length;i+=q)
input+=pad_string;return input;},popup:function(url,width,height)
{var w,h;if(BX.browser.IsOpera())
{w=document.body.offsetWidth;h=document.body.offsetHeight;}
else
{w=screen.width;h=screen.height;}
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));}}
BX.type={isString:function(item){return item===''?true:(item?(typeof(item)=="string"||item instanceof String):false);},isNotEmptyString:function(item){return BX.type.isString(item)?item.length>0:false;},isBoolean:function(item){return item===false||item===false;},isNumber:function(item){return item===0?true:(item?(typeof(item)=="number"||item instanceof Number):false);},isFunction:function(item){return item===null?false:(typeof(item)=="function"||item instanceof Function);},isElementNode:function(item){return item&&typeof(item)=="object"&&"nodeType"in item&&item.nodeType==1;},isDomNode:function(item){return item&&typeof(item)=="object"&&"nodeType"in item;},isArray:function(item){return item&&Object.prototype.toString.call(item)=="[object Array]";},isDate:function(item){return item&&Object.prototype.toString.call(item)=="[object Date]";}}
BX.isNodeInDom=function(node)
{return node===document?true:(node.parentNode?BX.isNodeInDom(node.parentNode):false);}
BX.evalPack=function(code)
{while(code.length>0)
{var c=code.shift();if(c.TYPE=='SCRIPT_EXT'||c.TYPE=='SCRIPT_SRC')
{BX.loadScript(c.DATA,function(){BX.evalPack(code)});}
else if(c.TYPE=='SCRIPT')
BX.evalGlobal(c.DATA);}}
BX.evalGlobal=function(data)
{if(data)
{var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(!BX.browser.IsIE())
{script.appendChild(document.createTextNode(data));}
else
{script.text=data;}
head.insertBefore(script,head.firstChild);head.removeChild(script);}}
BX.processHTML=function(HTML,scriptsRunFirst)
{var matchScript,scripts=[],data=HTML;while((matchScript=data.match(r.script))!==null)
{var end=data.search('<\/script>','i');if(end==-1)
break;var bRunFirst=scriptsRunFirst||(matchScript[1].indexOf('bxrunfirst')!='-1');var matchSrc;if((matchSrc=matchScript[1].match(r.script_src))!==null)
scripts.push({"bRunFirst":bRunFirst,"isInternal":false,"JS":matchSrc[1]});else
{var start=matchScript.index+matchScript[0].length;var js=data.substr(start,end-start);scripts.push({"bRunFirst":bRunFirst,"isInternal":true,"JS":js});}
data=data.substr(0,matchScript.index)+data.substr(end+9);}
var res={'HTML':data,'SCRIPT':scripts,'STYLE':[]};if(BX.browser.IsIE())
{while((matchStyle=data.match(r.style))!==null)
{var matchHref;if((matchHref=matchStyle[0].match(r.style_href))!==null)
{res.STYLE.push(matchHref[1]);}
data=data.replace(matchStyle[0],'');}}
return res;}
BX.garbage=function(call,thisObject)
{garbageCollectors.push({callback:call,context:thisObject});}
BX.GetDocElement=function(pDoc)
{pDoc=pDoc||document;return(BX.browser.IsDoctype(pDoc)?pDoc.documentElement:pDoc.body);}
BX.GetContext=function(node)
{if(BX.type.isElementNode(node))
return node.ownerDocument.parentWindow||node.ownerDocument.defaultView||window;else if(BX.type.isDomNode(node))
return node.parentWindow||node.defaultView||window;else
return window;}
BX.GetWindowInnerSize=function(pDoc)
{var width,height;pDoc=pDoc||document;if(self.innerHeight)
{width=BX.GetContext(pDoc).innerWidth;height=BX.GetContext(pDoc).innerHeight;}
else if(pDoc.documentElement&&(pDoc.documentElement.clientHeight||pDoc.documentElement.clientWidth))
{width=pDoc.documentElement.clientWidth;height=pDoc.documentElement.clientHeight;}
else if(pDoc.body)
{width=pDoc.body.clientWidth;height=pDoc.body.clientHeight;}
return{innerWidth:width,innerHeight:height};}
BX.GetWindowScrollPos=function(pDoc)
{var left,top;pDoc=pDoc||document;if(self.pageYOffset)
{left=BX.GetContext(pDoc).pageXOffset;top=BX.GetContext(pDoc).pageYOffset;}
else if(pDoc.documentElement&&(pDoc.documentElement.scrollTop||pDoc.documentElement.scrollLeft))
{left=pDoc.documentElement.scrollLeft;top=pDoc.documentElement.scrollTop;}
else if(pDoc.body)
{left=pDoc.body.scrollLeft;top=pDoc.body.scrollTop;}
return{scrollLeft:left,scrollTop:top};}
BX.GetWindowScrollSize=function(pDoc)
{var width,height;if(!pDoc)
pDoc=document;if((pDoc.compatMode&&pDoc.compatMode=="CSS1Compat"))
{width=pDoc.documentElement.scrollWidth;height=pDoc.documentElement.scrollHeight;}
else
{if(pDoc.body.scrollHeight>pDoc.body.offsetHeight)
height=pDoc.body.scrollHeight;else
height=pDoc.body.offsetHeight;if(pDoc.body.scrollWidth>pDoc.body.offsetWidth||(pDoc.compatMode&&pDoc.compatMode=="BackCompat")||(pDoc.documentElement&&!pDoc.documentElement.clientWidth))
width=pDoc.body.scrollWidth;else
width=pDoc.body.offsetWidth;}
return{scrollWidth:width,scrollHeight:height};}
BX.GetWindowSize=function(pDoc)
{var innerSize=this.GetWindowInnerSize(pDoc);var scrollPos=this.GetWindowScrollPos(pDoc);var scrollSize=this.GetWindowScrollSize(pDoc);return{innerWidth:innerSize.innerWidth,innerHeight:innerSize.innerHeight,scrollLeft:scrollPos.scrollLeft,scrollTop:scrollPos.scrollTop,scrollWidth:scrollSize.scrollWidth,scrollHeight:scrollSize.scrollHeight};}
BX.hide_object=function(ob)
{ob=BX(ob);ob.style.position='absolute';ob.style.top='-1000px';ob.style.left='-1000px';ob.style.height='10px';ob.style.width='10px';};BX.is_relative=function(el)
{var p=BX.style(el,'position');return p=='relative'||p=='absolute';}
BX.is_float=function(el)
{var p=BX.style(el,'float');return p=='right'||p=='left';}
BX.pos=function(el,bRelative)
{var r={top:0,right:0,bottom:0,left:0,width:0,height:0};bRelative=!!bRelative;if(!el)
return r;if(typeof(el.getBoundingClientRect)!="undefined"&&el.ownerDocument==document&&!bRelative)
{var clientRect=el.getBoundingClientRect();var root=document.documentElement;var body=document.body;r.top=clientRect.top+root.scrollTop+body.scrollTop;r.left=clientRect.left+root.scrollLeft+body.scrollLeft;r.width=clientRect.right-clientRect.left;r.height=clientRect.bottom-clientRect.top;r.right=clientRect.right+root.scrollLeft+body.scrollLeft;r.bottom=clientRect.bottom+root.scrollTop+body.scrollTop;}
else
{var x=0,y=0,w=el.offsetWidth,h=el.offsetHeight;var first=true;for(;el!=null;el=el.offsetParent)
{if(!first&&bRelative&&BX.is_relative(el))
break;x+=el.offsetLeft;y+=el.offsetTop;if(first)
{first=false;continue;}
var elBorderLeftWidth=parseInt(BX.style(el,'border-left-width')),elBorderTopWidth=parseInt(BX.style(el,'border-top-width'));if(!isNaN(elBorderLeftWidth)&&elBorderLeftWidth>0)
x+=elBorderLeftWidth;if(!isNaN(elBorderTopWidth)&&elBorderTopWidth>0)
y+=elBorderTopWidth;}
r.top=y;r.left=x;r.width=w;r.height=h;r.right=r.left+w;r.bottom=r.top+h;}
for(var i in r)r[i]=parseInt(r[i]);return r;}
BX.align=function(pos,w,h)
{var pDoc=document;if(BX.type.isElementNode(pos))
{pDoc=pos.ownerDocument;pos=BX.pos(pos);}
var x=pos["left"],y=pos["bottom"];var scroll=BX.GetWindowScrollPos(pDoc);var size=BX.GetWindowInnerSize(pDoc);if((size.innerWidth+scroll.scrollLeft)-(pos["left"]+w)<0)
{if(pos["right"]-w>=0)
x=pos["right"]-w;else
x=scroll.scrollLeft;}
if((size.innerHeight+scroll.scrollTop)-(pos["bottom"]+h)<0)
{if(pos["top"]-h>=0)
y=pos["top"]-h;else
y=scroll.scrollTop;}
return{'left':x,'top':y};}
BX.scrollToNode=function(node)
{var obNode=BX(node);if(obNode.scrollIntoView)
obNode.scrollIntoView(true);else
{var arNodePos=BX.pos(obNode);window.scrollTo(arNodePos.left,arNodePos.top);}}
BX.showWait=function(node,msg)
{node=BX(node)||document.body||document.documentElement;msg=msg||BX.message('JS_CORE_LOADING');var container_id=node.id||Math.random();var obMsg=node.bxmsg=document.body.appendChild(BX.create('DIV',{props:{id:'wait_'+container_id,className:'bx-core-waitwindow'},text:msg}));setTimeout(BX.delegate(_adjustWait,node),10);lastWait[lastWait.length]=obMsg;return obMsg;}
BX.closeWait=function(node,obMsg)
{obMsg=obMsg||node&&(node.bxmsg||BX('wait_'+node.id))||lastWait.pop();if(obMsg&&obMsg.parentNode)
{for(var i=0,len=lastWait.length;i<len;i++)
{if(obMsg==lastWait[i])
{lastWait=BX.util.deleteFromArray(lastWait,i);break;}}
obMsg.parentNode.removeChild(obMsg);if(node)node.bxmsg=null;BX.cleanNode(obMsg,true);}}
BX.loadScript=function(script,callback,doc)
{if(!BX.isReady)
{var _args=arguments;BX.ready(function(){BX.loadScript.apply(this,_args);});return;}
doc=doc||document;if(BX.type.isString(script))
script=[script];var _callback=function()
{return(callback&&BX.type.isFunction(callback))?callback():null}
var load_js=function(ind)
{if(ind>=script.length)
return _callback();var oHead=doc.getElementsByTagName("head")[0]||doc.documentElement;var oScript=doc.createElement('script');oScript.src=script[ind];var bLoaded=false;oScript.onload=oScript.onreadystatechange=function()
{if(!bLoaded&&(!oScript.readyState||oScript.readyState=="loaded"||oScript.readyState=="complete"))
{bLoaded=true;setTimeout(function(){load_js(++ind);},50);oScript.onload=oScript.onreadystatechange=null;if(oHead&&oScript.parentNode)
{oHead.removeChild(oScript);}}}
return oHead.insertBefore(oScript,oHead.firstChild);}
load_js(0);}
BX.loadCSS=function(arCSS,doc,win)
{if(!BX.isReady)
{var _args=arguments;BX.ready(function(){BX.loadCSS.apply(this,_args);});return null;}
if(BX.type.isString(arCSS))
{var bSingle=true;arCSS=[arCSS];}
var i,l=arCSS.length,pLnk=[];if(l==0)
return null;doc=doc||document;win=win||window;if(!win.bxhead)
{var heads=doc.getElementsByTagName('HEAD');win.bxhead=heads[0];}
if(!win.bxhead)
return null;for(i=0;i<l;i++)
{var lnk=document.createElement('LINK');lnk.href=arCSS[i];lnk.rel='stylesheet';lnk.type='text/css';win.bxhead.appendChild(lnk);pLnk.push(lnk);}
if(bSingle)
return lnk;return pLnk;}
BX.reload=function(back_url,bAddClearCache)
{if(back_url===true)
{bAddClearCache=true;back_url=null;}
var new_href=back_url||top.location.href;var hashpos=new_href.indexOf('#'),hash='';if(hashpos!=-1)
{hash=new_href.substr(hashpos);new_href=new_href.substr(0,hashpos);}
if(bAddClearCache&&new_href.indexOf('clear_cache=Y')<0)
new_href+=(new_href.indexOf('?')==-1?'?':'&')+'clear_cache=Y';if(hash)
{if(bAddClearCache&&(hash.substr(0,5)=='view/'||hash.substr(0,6)=='#view/')&&hash.indexOf('clear_cache%3DY')<0)
hash+=(hash.indexOf('%3F')==-1?'%3F':'%26')+'clear_cache%3DY'
new_href=new_href.replace(/(\?|\&)_r=[\d]*/,'');new_href+=(new_href.indexOf('?')==-1?'?':'&')+'_r='+Math.round(Math.random()*10000)+hash;}
top.location.href=new_href;}
BX.clearCache=function()
{BX.showWait();BX.reload(true);}
BX.formatDate=function(date,format)
{date=date||new Date();var bTime=date.getHours()||date.getMinutes()||date.getSeconds(),str=!!format?format:(bTime?BX.message('FORMAT_DATETIME'):BX.message('FORMAT_DATE'));return str.replace(/YYYY/ig,date.getFullYear()).replace(/MM/ig,BX.util.str_pad_left((date.getMonth()+1).toString(),2,'0')).replace(/DD/ig,BX.util.str_pad_left(date.getDate().toString(),2,'0')).replace(/HH/ig,BX.util.str_pad_left(date.getHours().toString(),2,'0')).replace(/MI/ig,BX.util.str_pad_left(date.getMinutes().toString(),2,'0')).replace(/SS/ig,BX.util.str_pad_left(date.getSeconds().toString(),2,'0'));}
BX.parseDate=function(str)
{var aDate=str.split(/\D/ig);var aFormat=BX.message('FORMAT_DATE').split(/\W/ig);if(aDate.length>aFormat.length)
aFormat=BX.message('FORMAT_DATETIME').split(/\W/ig);var i,cnt;var aDateArgs=[],aFormatArgs=[];for(i=0,cnt=aDate.length;i<cnt;i++)
if(BX.util.trim(aDate[i])!='')
aDateArgs[aDateArgs.length]=aDate[i];for(i=0,cnt=aFormat.length;i<cnt;i++)
if(BX.util.trim(aFormat[i])!='')
aFormatArgs[aFormatArgs.length]=aFormat[i];var aResult={};for(i=0,cnt=aFormatArgs.length;i<cnt;i++)
aResult[aFormatArgs[i].toUpperCase()]=parseInt(aDateArgs[i],10);if(aResult['DD']>0&&aResult['MM']>0&&aResult['YYYY']>0)
{var d=new Date();d.setDate(1);d.setFullYear(aResult['YYYY']);d.setMonth(aResult['MM']-1);d.setDate(aResult['DD']);d.setHours(0,0,0);if(!isNaN(aResult['HH'])&&!isNaN(aResult['MI'])&&!isNaN(aResult['SS']))
{d.setHours(aResult['HH'],aResult['MI'],aResult['SS']);}
return d;}
return null;}
BX.hint=function(el,hint_title,hint_html,hint_id)
{if(null==hint_html)
{hint_html=hint_title;hint_title='';}
if(null==el.BXHINT)
{el.BXHINT=new BX.CHint({parent:el,hint:hint_html,title:hint_title,id:hint_id});el.BXHINT.Show();}}
BX.hint_replace=function(el,hint_title,hint_html)
{if(null==hint_html)
{hint_html=hint_title;hint_title='';}
if(!el||!el.parentNode||!hint_html)
return null;var obHint=new BX.CHint({hint:hint_html,title:hint_title});obHint.CreateParent();el.parentNode.insertBefore(obHint.PARENT,el);el.parentNode.removeChild(el);obHint.PARENT.style.marginLeft='5px';return el;}
BX.CHint=function(params)
{this.PARENT=BX(params.parent);this.HINT=params.hint;this.HINT_TITLE=params.title;this.PARAMS={}
for(var i in this.defaultSettings)
{if(null==params[i])
this.PARAMS[i]=this.defaultSettings[i];else
this.PARAMS[i]=params[i];}
if(null!=params.id)
this.ID=params.id;this.timer=null;this.bInited=false;this.msover=true;if(this.PARAMS.showOnce)
{this.__show();this.msover=false;this.timer=setTimeout(BX.proxy(this.__hide,this),this.PARAMS.hide_timeout);}
else if(this.PARENT)
{BX.bind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.bind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));}
BX.addCustomEvent('onMenuOpen',BX.delegate(this.disable,this));BX.addCustomEvent('onMenuClose',BX.delegate(this.enable,this));}
BX.CHint.prototype.defaultSettings={show_timeout:1000,hide_timeout:500,dx:2,showOnce:false,preventHide:true,min_width:250}
BX.CHint.prototype.CreateParent=function(element,params)
{if(this.PARENT)
{BX.unbind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.unbind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));}
if(!params)params={}
var type='icon';if(params.type&&(params.type=="link"||params.type=="icon"))
type=params.type;if(element)
type="element";if(type=="icon")
{element=BX.create('IMG',{props:{src:params.iconSrc?params.iconSrc:"/bitrix/js/main/core/images/hint.gif"}});}
else if(type=="link")
{element=BX.create("A",{props:{href:'javascript:void(0)'},html:'[?]'});}
this.PARENT=element;BX.bind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.bind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));return this.PARENT;}
BX.CHint.prototype.Show=function()
{this.msover=true;if(null!=this.timer)
clearTimeout(this.timer);this.timer=setTimeout(BX.proxy(this.__show,this),this.PARAMS.show_timeout);}
BX.CHint.prototype.Hide=function()
{this.msover=false;if(null!=this.timer)
clearTimeout(this.timer);this.timer=setTimeout(BX.proxy(this.__hide,this),this.PARAMS.hide_timeout);}
BX.CHint.prototype.__show=function()
{if(!this.msover||this.disabled)return;if(!this.bInited)this.Init();this.prepareAdjustPos();this.DIV.style.display='block';this.adjustPos();BX.bind(window,'scroll',BX.proxy(this.__onscroll,this));if(this.PARAMS.showOnce)
{this.timer=setTimeout(BX.proxy(this.__hide,this),this.PARAMS.hide_timeout);}}
BX.CHint.prototype.__onscroll=function()
{if(!BX.admin||!BX.admin.panel||!BX.admin.panel.isFixed())return;if(this.scrollTimer)clearTimeout(this.scrollTimer);this.DIV.style.display='none';this.scrollTimer=setTimeout(BX.proxy(this.Reopen,this),this.PARAMS.show_timeout);}
BX.CHint.prototype.Reopen=function()
{if(null!=this.timer)clearTimeout(this.timer);this.timer=setTimeout(BX.proxy(this.__show,this),50);}
BX.CHint.prototype.__hide=function()
{if(this.msover)return;if(!this.bInited)return;BX.unbind(window,'scroll',BX.proxy(this.Reopen,this));if(this.PARAMS.showOnce)
{this.Destroy();}
else
{this.DIV.style.display='none';}}
BX.CHint.prototype.__hide_immediately=function()
{this.msover=false;this.__hide();}
BX.CHint.prototype.Init=function()
{this.DIV=document.body.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip'},style:{display:'none'},children:[BX.create('DIV',{props:{className:'bx-panel-tooltip-top-border'},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>'}),(this.CONTENT=BX.create('DIV',{props:{className:'bx-panel-tooltip-content'},children:[BX.create('DIV',{props:{className:'bx-panel-tooltip-underlay'},children:[BX.create('DIV',{props:{className:'bx-panel-tooltip-underlay-bg'}})]})]})),BX.create('DIV',{props:{className:'bx-panel-tooltip-bottom-border'},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>'})]}));if(this.ID)
{this.CONTENT.insertBefore(BX.create('A',{attrs:{href:'javascript:void(0)'},props:{className:'bx-panel-tooltip-close'},events:{click:BX.delegate(this.Close,this)}}),this.CONTENT.firstChild)}
if(this.HINT_TITLE)
{this.CONTENT.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip-title'},text:this.HINT_TITLE}))}
if(this.HINT)
{this.CONTENT_TEXT=this.CONTENT.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip-text'}})).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.CHint.prototype.setContent=function(content)
{this.HINT=content;if(this.CONTENT_TEXT)
this.CONTENT_TEXT.innerHTML=this.HINT;else
this.CONTENT_TEXT=this.CONTENT.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip-text'}})).appendChild(BX.create('SPAN',{html:this.HINT}));}
BX.CHint.prototype.prepareAdjustPos=function()
{this._wnd={scrollPos:BX.GetWindowScrollPos(),scrollSize:BX.GetWindowScrollSize()};}
BX.CHint.prototype.getAdjustPos=function()
{var res={},pos=BX.pos(this.PARENT);res.top=pos.bottom+this.PARAMS.dx;if(BX.admin&&BX.admin.panel.DIV)
{var min_top=BX.admin.panel.DIV.offsetHeight+this.PARAMS.dx;if(BX.admin.panel.isFixed())
{min_top+=this._wnd.scrollPos.scrollTop;}}
if(res.top<min_top)
res.top=min_top;else
{if(res.top+this.DIV.offsetHeight>this._wnd.scrollSize.scrollHeight)
res.top=pos.top-this.PARAMS.dx-this.DIV.offsetHeight;}
res.left=pos.left;if(pos.left<this.PARAMS.dx)pos.left=this.PARAMS.dx;else
{floatWidth=this.DIV.offsetWidth;var max_left=this._wnd.scrollSize.scrollWidth-floatWidth-this.PARAMS.dx;if(res.left>max_left)
res.left=max_left;}
return res;}
BX.CHint.prototype.adjustWidth=function()
{if(this.bWidthAdjusted)return;var w=this.DIV.offsetWidth,h=this.DIV.offsetHeight;if(w>this.PARAMS.min_width)
w=Math.round(Math.sqrt(1.618*w*h));if(w<this.PARAMS.min_width)
w=this.PARAMS.min_width;this.DIV.style.width=w+"px";if(this._adjustWidthInt)
clearInterval(this._adjustWidthInt);this._adjustWidthInt=setInterval(BX.delegate(this._adjustWidthInterval,this),5);this.bWidthAdjusted=true;}
BX.CHint.prototype._adjustWidthInterval=function()
{if(!this.DIV||this.DIV.style.display=='none')
clearInterval(this._adjustWidthInt);var
dW=20,maxWidth=1500,w=this.DIV.offsetWidth,w1=this.CONTENT_TEXT.offsetWidth;if(w>0&&w1>0&&w-w1<dW&&w<maxWidth)
{this.DIV.style.width=(w+dW)+"px";return;}
clearInterval(this._adjustWidthInt);}
BX.CHint.prototype.adjustPos=function()
{this.adjustWidth();var pos=this.getAdjustPos();this.DIV.style.top=pos.top+'px';this.DIV.style.left=pos.left+'px';}
BX.CHint.prototype.Close=function()
{if(this.ID&&BX.WindowManager)
BX.WindowManager.saveWindowOptions(this.ID,{display:'off'});this.__hide_immediately();this.Destroy();}
BX.CHint.prototype.Destroy=function()
{if(this.PARENT)
{BX.unbind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.unbind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));}
if(this.DIV)
{BX.unbind(this.DIV,'mouseover',BX.proxy(this.Show,this));BX.unbind(this.DIV,'mouseout',BX.proxy(this.Hide,this));BX.cleanNode(this.DIV,true);}}
BX.CHint.prototype.enable=function(){this.disabled=false;}
BX.CHint.prototype.disable=function(){this.__hide_immediately();this.disabled=true;}
if(document.addEventListener)
{__readyHandler=function()
{document.removeEventListener("DOMContentLoaded",__readyHandler,false);runReady();}}
else if(document.attachEvent)
{__readyHandler=function()
{if(document.readyState==="complete")
{document.detachEvent("onreadystatechange",__readyHandler);runReady();}}}
function bindReady()
{if(!readyBound)
{readyBound=true;if(document.readyState==="complete")
{return runReady();}
if(document.addEventListener)
{document.addEventListener("DOMContentLoaded",__readyHandler,false);window.addEventListener("load",runReady,false);}
else if(document.attachEvent)
{document.attachEvent("onreadystatechange",__readyHandler);window.attachEvent("onload",runReady);var toplevel=false;try{toplevel=(window.frameElement==null);}catch(e){}
if(document.documentElement.doScroll&&toplevel)
doScrollCheck();}}
return null;}
function runReady()
{if(!BX.isReady)
{if(!document.body)
return setTimeout(runReady,15);BX.isReady=true;if(readyList&&readyList.length>0)
{var fn,i=0;while(readyList&&(fn=readyList[i++]))
{fn.call(document);}
readyList=null;}}
return null;}
function doScrollCheck()
{if(BX.isReady)
return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(doScrollCheck,1);return;}
runReady();}
function Trash()
{var i,len;for(i=0,len=garbageCollectors.length;i<len;i++)
{garbageCollectors[i].callback.apply(garbageCollectors[i].context||window);try{delete garbageCollectors[i];garbageCollectors[i]=null;}catch(e){}}
for(i=0,len=proxyList.length;i<len;i++)
{try{delete proxyList[i];proxyList[i]=null;}catch(e){}}
try{BX.unbindAll();}catch(e){}
NODECACHE=null;garbageCollectors=null;proxyList=null;eventsList=null;readyList=null;deniedEvents=null;customEvents=null;__readyHandler=null;}
function _adjustWait()
{if(!this.bxmsg)return;var arContainerPos=BX.pos(this),div_top=arContainerPos.top;if(div_top<BX.GetDocElement().scrollTop)
div_top=BX.GetDocElement().scrollTop+5;this.bxmsg.style.top=(div_top+5)+'px';if(this==BX.GetDocElement())
{this.bxmsg.style.right='5px';}
else
{this.bxmsg.style.left=(arContainerPos.right-this.bxmsg.offsetWidth-5)+'px';}}
function _checkDisplay(ob)
{var d=ob.style.display||BX.style(ob,'display');if(d!='none')
{ob.BXDISPLAY=d;return true;}
else
{ob.BXDISPLAY='block';return false;}}
function _checkNode(obj,params)
{params=params||{};if(BX.type.isFunction(params))
return params.call(window,obj);if(!params.allowTextNodes&&!BX.type.isElementNode(obj))
return false;var i,j,len;for(i in params)
{switch(i)
{case'tag':case'tagName':if(BX.type.isString(params[i]))
{if(obj.tagName.toUpperCase()!=params[i].toUpperCase())
return false;}
else if(params[i]instanceof RegExp)
{if(!params[i].test(obj.tagName))
return false;}
break;case'class':case'className':if(BX.type.isString(params[i]))
{if(!BX.hasClass(obj,params[i]))
return false;}
else if(params[i]instanceof RegExp)
{if(!BX.type.isString(obj.className)||!params[i].test(obj.className))
return false;}
break;case'attr':case'attribute':if(BX.type.isString(params[i]))
{if(!obj.getAttribute(params[i]))
return false;}
else if(BX.type.isArray(params[i]))
{for(j=0,len=params[i].length;j<len;j++)
{if(params[i]&&!obj.getAttribute(params[i]))
return false;}}
else
{for(j in params[i])
{var q=obj.getAttribute(j);if(BX.type.isString(params[i][j]))
{if(q!=params[i][j])
return false;}
else if(params[i][j]instanceof RegExp)
{if(!BX.type.isString(q)||!params[i][j].test(q))
return false;}}}
break;case'property':if(BX.type.isString(params[i]))
{if(!obj[params[i]])
return false;}
else if(BX.type.isArray(params[i]))
{for(j=0,len=params[i].length;j<len;j++)
{if(params[i]&&!obj[params[i]])
return false;}}
else
{for(j in params[i])
{if(BX.type.isString(params[i][j]))
{if(obj[j]!=params[i][j])
return false;}
else if(params[i][j]instanceof RegExp)
{if(!BX.type.isString(obj[j])||!params[i][j].test(obj[j]))
return false;}}}
break;case'callback':return params[i](obj);break;}}
return true;}
if(window.attachEvent)
window.attachEvent("onunload",Trash);else if(window.addEventListener)
window.addEventListener('unload',Trash,false);else
window.onunload=Trash;BX(BX.DoNothing);window.BX=BX;})(window);(function(window){if(window.BX)return;var BX=function(node,bCache)
{if(BX.type.isNotEmptyString(node))
{var ob;if(!!bCache&&null!=NODECACHE[node])ob=NODECACHE[node];ob=ob||document.getElementById(node);if(!!bCache)NODECACHE[node]=ob;return ob;}
else if(BX.type.isDomNode(node))
return node;else if(BX.type.isFunction(node))
return BX.ready(node);return null;},MESS={},__readyHandler=null,readyBound=false,readyList=[],proxyId=1,proxyList=[],NODECACHE={},deniedEvents=[],eventsList=[],customEvents={},garbageCollectors=[],bOpera=navigator.userAgent.toLowerCase().indexOf('opera')!=-1,bSafari=navigator.userAgent.toLowerCase().indexOf('webkit')!=-1,bIE=document.attachEvent&&!bOpera,r={script:/<script([^>]*)>/i,script_src:/src=["\']([^"\']+)["\']/i,space:/\s+/,ltrim:/^[\s\r\n]+/g,rtrim:/[\s\r\n]+$/g,style:/<link.*?(rel="stylesheet"|type="text\/css")[^>]*/i,style_href:/href=["\']([^"\']+)["\']/i},eventTypes={click:'MouseEvent',dblclick:'MouseEvent',mousedown:'MouseEvent',mousemove:'MouseEvent',mouseout:'MouseEvent',mouseover:'MouseEvent',mouseup:'MouseEvent'}
lastWait=[];BX.ext=function(ob){for(var i in ob)this[i]=ob[i];}
BX.extend=function(child,parent)
{var f=function(){};f.prototype=parent.prototype;child.prototype=new f();child.prototype.constructor=child;child.superclass=parent.prototype;if(parent.prototype.constructor==Object.prototype.constructor)
{parent.prototype.constructor=parent;}}
BX.is_subclass_of=function(ob,parent_class)
{if(ob instanceof parent_class)
return true;if(parent_class.superclass)
return BX.is_subclass_of(ob,parent_class.superclass);return false;}
BX.message=function(mess)
{if(BX.type.isString(mess))
return MESS[mess];else
{for(var i in mess)
{MESS[i]=mess[i];}
return true;}}
BX.bitrix_sessid=function(){return MESS.bitrix_sessid;}
BX.create=function(tag,data,context)
{context=context||document;if(null==data&&typeof tag=='object'&&tag.constructor!==String)
{data=tag;tag=tag.tag;}
var elem;if(BX.browser.IsIE()&&!BX.browser.IsIE9()&&null!=data&&null!=data.props&&(data.props.name||data.props.id))
{elem=context.createElement('<'+tag+(data.props.name?' name="'+data.props.name+'"':'')+(data.props.id?' id="'+data.props.id+'"':'')+'>');}
else
{elem=context.createElement(tag);}
return data?BX.adjust(elem,data):elem;}
BX.adjust=function(elem,data)
{var j,len;if(!elem.nodeType)
return null;if(elem.nodeType==9)
elem=elem.body;if(data.attrs)
{for(j in data.attrs)
{if(j=='class'||j=='className')
elem.className=data.attrs[j];else if(data.attrs[j]=="")
elem.removeAttribute(j);else
elem.setAttribute(j,data.attrs[j]);}}
if(data.style)
{for(j in data.style)
elem.style[j]=data.style[j];}
if(data.props)
{for(j in data.props)
elem[j]=data.props[j];}
if(data.events)
{for(j in data.events)
BX.bind(elem,j,data.events[j]);}
if(data.children&&data.children.length>0)
{for(j=0,len=data.children.length;j<len;j++)
{if(BX.type.isNotEmptyString(data.children[j]))
elem.innerHTML+=data.children[j];else if(BX.type.isElementNode(data.children[j]))
elem.appendChild(data.children[j]);}}
else if(data.text)
{BX.cleanNode(elem);elem.appendChild((elem.ownerDocument||document).createTextNode(data.text));}
else if(data.html)
{elem.innerHTML=data.html;}
return elem;}
BX.remove=function(ob)
{if(null!=ob.parentNode)
ob.parentNode.removeChild(ob);ob=null;return null;}
BX.cleanNode=function(node,bSuicide)
{node=BX(node);bSuicide=!!bSuicide;if(node&&node.childNodes)
{while(node.childNodes.length>0)
node.removeChild(node.firstChild);}
if(node&&bSuicide)
{node=BX.remove(node);}
return node;}
BX.addClass=function(ob,value)
{var classNames;ob=BX(ob)
if(ob)
{if(!ob.className)
{ob.className=value}
else
{classNames=(value||"").split(r.space);var className=" "+ob.className+" ";for(var j=0,cl=classNames.length;j<cl;j++)
{if(className.indexOf(" "+classNames[j]+" ")<0)
{ob.className+=" "+classNames[j];}}}}
return ob;}
BX.removeClass=function(ob,value)
{ob=BX(ob);if(ob)
{if(ob.className)
{if(BX.type.isString(value))
{var classNames=value.split(r.space),className=" "+ob.className+" ";for(var j=0,cl=classNames.length;j<cl;j++)
{className=className.replace(" "+classNames[j]+" "," ");}
ob.className=BX.util.trim(className);}
else
{ob.className="";}}}
return ob;}
BX.toggleClass=function(ob,value)
{var className;if(BX.type.isArray(value))
{className=' '+ob.className+' ';for(var j=0,len=value.length;j<len;j++)
{if(BX.hasClass(ob,value[j]))
{className=(' '+className+' ').replace(' '+value[j]+' ',' ');className+=' '+value[j>=len-1?0:j+1];j--;break;}}
if(j==len)
ob.className+=' '+value[0];else
ob.className=className;ob.className=BX.util.trim(ob.className);}
else if(BX.type.isNotEmptyString(value))
{className=ob.className;if(BX.hasClass(ob,value))
{className=(' '+className+' ').replace(' '+value+' ',' ');}
else
{className+=' '+value;}
ob.className=BX.util.trim(className);}
return ob;}
BX.hasClass=function(el,className)
{if(!el.className)
return false;return((" "+el.className+" ").indexOf(" "+className+" "))>=0;}
BX.hoverEvents=function(el)
{if(el)
return BX.adjust(el,{events:BX.hoverEvents()});else
return{mouseover:BX.hoverEventsHover,mouseout:BX.hoverEventsHout};}
BX.hoverEventsHover=function(){BX.addClass(this,'bx-hover');this.BXHOVER=true;}
BX.hoverEventsHout=function(){BX.removeClass(this,'bx-hover');this.BXHOVER=false;}
BX.focusEvents=function(el)
{if(el)
return BX.adjust(el,{events:BX.focusEvents()});else
return{mouseover:BX.focusEventsFocus,mouseout:BX.focusEventsBlur};}
BX.focusEventsFocus=function(){BX.addClass(this,'bx-focus');this.BXFOCUS=true;}
BX.focusEventsBlur=function(){BX.removeClass(this,'bx-focus');this.BXFOCUS=false;}
BX.setUnselectable=function(node)
{BX.addClass(node,'bx-unselectable');node.setAttribute('unSelectable','on');}
BX.setSelectable=function(node)
{BX.removeClass(node,'bx-unselectable');node.removeAttribute('unSelectable');}
BX.styleIEPropertyName=function(name)
{if(name=='float')
name=BX.browser.IsIE()?'styleFloat':'cssFloat';else
{var reg=/(\-([a-z]){1})/g;if(reg.test(name))
{name=name.replace(reg,function(){return arguments[2].toUpperCase();});}}
return name;}
BX.style=function(el,property,value)
{if(!BX.type.isElementNode(el))
return null;if(value==null)
{var res;if(el.currentStyle)
res=el.currentStyle[BX.styleIEPropertyName(property)];else if(window.getComputedStyle)
res=BX.GetContext(el).getComputedStyle(el,null).getPropertyValue(property);if(!res)
res='';return res;}
else
{el.style[BX.styleIEPropertyName(property)]=value;return el;}}
BX.focus=function(el)
{try
{el.focus();return true;}
catch(e)
{return false;}}
BX.findChildren=function(obj,params,recursive)
{return BX.findChild(obj,params,recursive,true);}
BX.findChild=function(obj,params,recursive,get_all)
{if(!obj||!obj.childNodes)return null;recursive=!!recursive;get_all=!!get_all;var n=obj.childNodes.length,result=[];for(var j=0;j<n;j++)
{var child=obj.childNodes[j];if(_checkNode(child,params))
{if(get_all)
result.push(child)
else
return child;}
if(recursive==true)
{var res=BX.findChild(child,params,recursive,get_all);if(res)
{if(get_all)
result=BX.util.array_merge(result,res);else
return res;}}}
if(get_all&&result.length>0)
return result;else
return null;}
BX.findParent=function(obj,params)
{if(!obj)
return null;var o=obj;while(o.parentNode)
{var parent=o.parentNode;if(_checkNode(parent,params))
return parent;o=parent;}
return null;}
BX.findNextSibling=function(obj,params)
{if(!obj)
return null;var o=obj;while(o.nextSibling)
{var sibling=o.nextSibling;if(_checkNode(sibling,params))
return sibling;o=sibling;}
return null;}
BX.findPreviousSibling=function(obj,params)
{if(!obj)
return null;var o=obj;while(o.previousSibling)
{var sibling=o.previousSibling;if(_checkNode(sibling,params))
return sibling;o=sibling;}
return null;}
BX.clone=function(obj,bCopyObj)
{var _obj,i,l;if(bCopyObj!==false)
bCopyObj=true;if(obj===null)
return null;if(BX.type.isDomNode(obj))
{_obj=obj.cloneNode(bCopyObj);}
else if(typeof obj=='object')
{if(BX.type.isArray(obj))
{_obj=[];for(i=0,l=obj.length;i<l;i++)
{if(typeof obj[i]=="object"&&bCopyObj)
_obj[i]=BX.clone(obj[i],bCopyObj);else
_obj[i]=obj[i];}}
else
{_obj={};if(obj.constructor)
{if(obj.constructor===Date)
_obj=new Date(obj);else
_obj=new obj.constructor();}
for(i in obj)
{if(typeof obj[i]=="object"&&bCopyObj)
_obj[i]=BX.clone(obj[i],bCopyObj);else
_obj[i]=obj[i];}}}
else
{_obj=obj;}
return _obj;}
BX.bind=function(el,evname,func)
{if(!el)
return;if(evname==='mousewheel')
BX.bind(el,'DOMMouseScroll',func);if(el.addEventListener)
el.addEventListener(evname,func,false);else if(el.attachEvent)
el.attachEvent("on"+evname,BX.proxy(func,el));else
el["on"+evname]=func;eventsList[eventsList.length]={'element':el,'event':evname,'fn':func};}
BX.unbind=function(el,evname,func)
{if(!el)
return;if(evname==='mousewheel')
BX.unbind(el,'DOMMouseScroll',func);if(el.removeEventListener)
el.removeEventListener(evname,func,false);else if(el.detachEvent)
el.detachEvent("on"+evname,BX.proxy(func,el));else
el["on"+evname]=null;}
BX.unbindAll=function(el)
{if(!el)
return;for(var i=0,len=eventsList.length;i<len;i++)
{try
{if(eventsList[i]&&(null==el||el==eventsList[i].element))
{BX.unbind(eventsList[i].element,eventsList[i].event,eventsList[i].fn);eventsList[i]=null;}}
catch(e){}}
if(null==el)
{eventsList=[];}}
var captured_events=null,_bind=null;BX.CaptureEvents=function(el_c,evname_c)
{if(_bind)
return false;_bind=BX.bind;captured_events=[];BX.bind=function(el,evname,func)
{if(el===el_c&&evname===evname_c)
captured_events.push(func);_bind.apply(this,arguments);}}
BX.CaptureEventsGet=function()
{if(_bind)
{BX.bind=_bind;var captured=captured_events;_bind=null;captured_events=null;return captured;}}
BX.fireEvent=function(ob,ev)
{if(document.createEventObject)
{var e=document.createEventObject();ob.fireEvent('on'+ev,e)
if(ob[ev])
ob[ev]();}
else
{var e=null;switch(eventTypes[ev])
{case'MouseEvent':e=document.createEvent('MouseEvent');e.initMouseEvent(ev,true,true,top,1,0,0,0,0,0,0,0,0,0,null);break;default:e=document.createEvent('Event');e.initEvent(ev,true,true);}
ob.dispatchEvent(e);}}
BX.getWheelData=function(e)
{e=e||window.event;return wheelData=e.detail?e.detail*-1:e.wheelDelta/40;}
BX.proxy_context=null;BX.delegate=function(func,thisObject)
{return function(){var cur=BX.proxy_context;BX.proxy_context=this;var res=func.apply(thisObject,arguments);BX.proxy_context=cur;return res;}}
BX.delegateLater=function(func_name,thisObject,contextObject)
{return function()
{if(thisObject[func_name])
{var cur=BX.proxy_context;BX.proxy_context=this;var res=thisObject[func_name].apply(contextObject||thisObject,arguments);BX.proxy_context=cur;return res;}}}
BX.proxy=function(func,thisObject)
{if(null==thisObject.__proxy_id)
{proxyList[thisObject.__proxy_id=proxyList.length]={};}
if(null==func.__proxy_id)
func.__proxy_id=proxyId++;if(null==proxyList[thisObject.__proxy_id][func.__proxy_id])
proxyList[thisObject.__proxy_id][func.__proxy_id]=BX.delegate(func,thisObject);return proxyList[thisObject.__proxy_id][func.__proxy_id];}
BX.bindDelegate=function(elem,eventName,isTarget,handler)
{var h=BX.delegateEvent(elem,isTarget,handler);BX.bind(elem,eventName,h);return h;}
BX.delegateEvent=function(el,isTarget,handler)
{return function(e)
{e=e||window.event;var target=e.target||e.srcElement;while(target!=this)
{if(_checkNode(target,isTarget))
{return handler.call(target,e);}
target=target.parentNode;}}}
BX.False=function(){return false;}
BX.DoNothing=function(){}
BX.denyEvent=function(el,ev)
{deniedEvents.push([el,ev,el['on'+ev]]);el['on'+ev]=BX.DoNothing;}
BX.allowEvent=function(el,ev)
{for(var i=0,len=deniedEvents.length;i<len;i++)
{if(deniedEvents[i][0]==el&&deniedEvents[i][1]==ev)
{el['on'+ev]=deniedEvents[i][2];BX.util.deleteFromArray(deniedEvents,i);return;}}}
BX.fixEventPageXY=function(event)
{BX.fixEventPageX(event);BX.fixEventPageY(event);return event;};BX.fixEventPageX=function(event)
{if(event.pageX==null&&event.clientX!=null)
{event.pageX=event.clientX+
(document.documentElement&&document.documentElement.scrollLeft||document.body&&document.body.scrollLeft||0)-
(document.documentElement.clientLeft||0);}
return event;};BX.fixEventPageY=function(event)
{if(event.pageY==null&&event.clientY!=null)
{event.pageY=event.clientY+
(document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0)-
(document.documentElement.clientTop||0);}
return event;};BX.PreventDefault=function(e)
{if(!e)e=window.event;if(e.stopPropagation)
{e.preventDefault();e.stopPropagation();}
else
{e.cancelBubble=true;e.returnValue=false;}
return false;}
BX.eventReturnFalse=function(e)
{e=e||window.event;if(e&&e.preventDefault)e.preventDefault();else e.returnValue=false;return false;}
BX.eventCancelBubble=function(e)
{e=e||window.event;if(e&&e.stopPropagation)
e.stopPropagation();else
e.cancelBubble=true;}
BX.addCustomEvent=function(eventObject,eventName,eventHandler)
{if(BX.type.isString(eventObject))
{eventHandler=eventName;eventName=eventObject;eventObject=window;}
eventName=eventName.toUpperCase();if(!customEvents[eventName])
customEvents[eventName]=[];customEvents[eventName].push({handler:eventHandler,obj:eventObject});}
BX.removeCustomEvent=function(eventObject,eventName,eventHandler)
{if(BX.type.isString(eventObject))
{eventHandler=eventName;eventName=eventObject;eventObject=window;}
eventName=eventName.toUpperCase();if(!customEvents[eventName])
return;for(var i=0,l=customEvents[eventName].length;i<l;i++)
{if(!customEvents[eventName][i])
continue;if(customEvents[eventName][i].handler==eventHandler&&customEvents[eventName][i].obj==eventObject)
{delete customEvents[eventName][i];return;}}}
BX.onCustomEvent=function(eventObject,eventName,arEventParams)
{if(BX.type.isString(eventObject))
{arEventParams=eventName;eventName=eventObject;eventObject=window;}
eventName=eventName.toUpperCase();if(!customEvents[eventName])
return;if(!arEventParams)
arEventParams=[];var h;for(var i=0,l=customEvents[eventName].length;i<l;i++)
{h=customEvents[eventName][i];if(!h||!h.handler)
continue;if(h.obj==window||h.obj==eventObject)
{h.handler.apply(eventObject,arEventParams);}}}
BX.isReady=false;BX.ready=function(handler)
{bindReady();if(BX.isReady)
handler.call(document);else if(readyList)
readyList.push(handler);}
BX.submit=function(obForm,action_name,action_value)
{action_name=action_name||'save';if(!obForm['BXFormSubmit_'+action_name])
{obForm['BXFormSubmit_'+action_name]=obForm.appendChild(BX.create('INPUT',{'props':{'type':'submit','name':action_name,'value':action_value||'Y'},'style':{'display':'none'}}));}
BX.fireEvent(obForm['BXFormSubmit_'+action_name],'click');}
BX.browser={IsIE:function()
{return bIE;},IsIE6:function()
{return(/MSIE 6/i.test(navigator.userAgent));},IsIE9:function()
{return!!document.documentMode&&document.documentMode>=9;},IsOpera:function()
{return bOpera;},IsSafari:function()
{return bSafari;},IsDoctype:function(pDoc)
{pDoc=pDoc||document;if(pDoc.compatMode)
return(pDoc.compatMode=="CSS1Compat");if(pDoc.documentElement&&pDoc.documentElement.clientHeight)
return true;return false;},SupportLocalStorage:function(){try{return!!localStorage.getItem;}catch(e){return false;}}}
BX.show=function(ob)
{if(ob.BXDISPLAY||!_checkDisplay(ob))
{ob.style.display=ob.BXDISPLAY;}}
BX.hide=function(ob)
{if(!ob.BXDISPLAY)
_checkDisplay(ob);ob.style.display='none';}
BX.toggle=function(ob,values)
{if(!values&&BX.type.isElementNode(ob))
{var bShow=true;if(ob.BXDISPLAY)
bShow=!_checkDisplay(ob);else
bShow=ob.style.display=='none';if(bShow)
BX.show(ob);else
BX.hide(ob);}
else if(BX.type.isArray(values))
{for(var i=0,len=values.length;i<len;i++)
{if(ob==values[i])
{ob=values[i==len-1?0:i+1]
break;}}
if(i==len)
ob=values[0];}
return ob;}
BX.util={array_values:function(ar)
{if(!BX.type.isArray(ar))
return BX.util._array_values_ob(ar);var arv=[];for(var i=0,l=ar.length;i<l;i++)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(ar[i]);return arv;},_array_values_ob:function(ar)
{var arv=[];for(var i in ar)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(ar[i]);return arv;},array_keys:function(ar)
{if(!BX.type.isArray(ar))
return BX.util._array_keys_ob(ar);var arv=[];for(var i=0,l=ar.length;i<l;i++)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(i);return arv;},_array_keys_ob:function(ar)
{var arv=[];for(var i in ar)
if(ar[i]!==null&&typeof ar[i]!='undefined')
arv.push(i);return arv;},array_merge:function(first,second)
{if(!BX.type.isArray(first))first=[];if(!BX.type.isArray(second))second=[];var i=first.length,j=0;if(typeof second.length==="number")
{for(var l=second.length;j<l;j++)
{first[i++]=second[j];}}
else
{while(second[j]!==undefined)
{first[i++]=second[j++];}}
first.length=i;return first;},array_unique:function(ar)
{var i=0,j,len=ar.length;if(len<2)return ar;for(;i<len-1;i++)
{for(j=i+1;j<len;j++)
{if(ar[i]==ar[j])
{ar.splice(j--,1);len--;}}}
return ar;},in_array:function(needle,haystack)
{for(var i=0;i<haystack.length;i++)
{if(haystack[i]==needle)
return true;}
return false;},array_search:function(needle,haystack)
{for(var i=0;i<haystack.length;i++)
{if(haystack[i]==needle)
return i;}
return-1;},trim:function(s)
{if(BX.type.isString(s))
return s.replace(r.ltrim,'').replace(r.rtrim,'');else
return s;},urlencode:function(s){return encodeURIComponent(s);},deleteFromArray:function(ar,ind){return ar.slice(0,ind).concat(ar.slice(ind+1));},insertIntoArray:function(ar,ind,el){return ar.slice(0,ind).concat([el]).concat(ar.slice(ind));},htmlspecialchars:function(str)
{if(!str.replace)return str;return str.replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},htmlspecialcharsback:function(str)
{if(!str.replace)return str;return str.replace(/\&quot;/g,'"').replace(/&#39;/g,"'").replace(/\&lt;/g,'<').replace(/\&gt;/g,'>').replace(/\&amp;/g,'&');},preg_quote:function(str,delimiter)
{if(!str.replace)
return str;return str.replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\'+(delimiter||'')+'-]','g'),'\\$&');},jsencode:function(str)
{if(!str||!str.replace)
return str;var escapes=[{c:"\\\\",r:"\\\\"},{c:"\\t",r:"\\t"},{c:"\\n",r:"\\n"},{c:"\\r",r:"\\r"},{c:"\"",r:"\\\""},{c:"'",r:"\\'"},{c:"<",r:"\\x3C"},{c:">",r:"\\x3E"},{c:"\\u2028",r:"\\u2028"},{c:"\\u2029",r:"\\u2029"}];for(var i=0;i<escapes.length;i++)
str=str.replace(new RegExp(escapes[i].c,'g'),escapes[i].r);return str;},str_pad:function(input,pad_length,pad_string,pad_type)
{pad_string=pad_string||' ';pad_type=pad_type||'right';input=input.toString();if(pad_type=='left')
return BX.util.str_pad_left(input,pad_length,pad_string);else
return BX.util.str_pad_right(input,pad_length,pad_string);},str_pad_left:function(input,pad_length,pad_string)
{var i=input.length,q=pad_string.length;if(i>=pad_length)return input;for(;i<pad_length;i+=q)
input=pad_string+input;return input;},str_pad_right:function(input,pad_length,pad_string)
{var i=input.length,q=pad_string.length;if(i>=pad_length)return input;for(;i<pad_length;i+=q)
input+=pad_string;return input;},popup:function(url,width,height)
{var w,h;if(BX.browser.IsOpera())
{w=document.body.offsetWidth;h=document.body.offsetHeight;}
else
{w=screen.width;h=screen.height;}
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));}}
BX.type={isString:function(item){return item===''?true:(item?(typeof(item)=="string"||item instanceof String):false);},isNotEmptyString:function(item){return BX.type.isString(item)?item.length>0:false;},isBoolean:function(item){return item===false||item===false;},isNumber:function(item){return item===0?true:(item?(typeof(item)=="number"||item instanceof Number):false);},isFunction:function(item){return item===null?false:(typeof(item)=="function"||item instanceof Function);},isElementNode:function(item){return item&&typeof(item)=="object"&&"nodeType"in item&&item.nodeType==1;},isDomNode:function(item){return item&&typeof(item)=="object"&&"nodeType"in item;},isArray:function(item){return item&&Object.prototype.toString.call(item)=="[object Array]";},isDate:function(item){return item&&Object.prototype.toString.call(item)=="[object Date]";}}
BX.isNodeInDom=function(node)
{return node===document?true:(node.parentNode?BX.isNodeInDom(node.parentNode):false);}
BX.evalPack=function(code)
{while(code.length>0)
{var c=code.shift();if(c.TYPE=='SCRIPT_EXT'||c.TYPE=='SCRIPT_SRC')
{BX.loadScript(c.DATA,function(){BX.evalPack(code)});}
else if(c.TYPE=='SCRIPT')
BX.evalGlobal(c.DATA);}}
BX.evalGlobal=function(data)
{if(data)
{var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(!BX.browser.IsIE())
{script.appendChild(document.createTextNode(data));}
else
{script.text=data;}
head.insertBefore(script,head.firstChild);head.removeChild(script);}}
BX.processHTML=function(HTML,scriptsRunFirst)
{var matchScript,scripts=[],data=HTML;while((matchScript=data.match(r.script))!==null)
{var end=data.search('<\/script>','i');if(end==-1)
break;var bRunFirst=scriptsRunFirst||(matchScript[1].indexOf('bxrunfirst')!='-1');var matchSrc;if((matchSrc=matchScript[1].match(r.script_src))!==null)
scripts.push({"bRunFirst":bRunFirst,"isInternal":false,"JS":matchSrc[1]});else
{var start=matchScript.index+matchScript[0].length;var js=data.substr(start,end-start);scripts.push({"bRunFirst":bRunFirst,"isInternal":true,"JS":js});}
data=data.substr(0,matchScript.index)+data.substr(end+9);}
var res={'HTML':data,'SCRIPT':scripts,'STYLE':[]};if(BX.browser.IsIE())
{while((matchStyle=data.match(r.style))!==null)
{var matchHref;if((matchHref=matchStyle[0].match(r.style_href))!==null)
{res.STYLE.push(matchHref[1]);}
data=data.replace(matchStyle[0],'');}}
return res;}
BX.garbage=function(call,thisObject)
{garbageCollectors.push({callback:call,context:thisObject});}
BX.GetDocElement=function(pDoc)
{pDoc=pDoc||document;return(BX.browser.IsDoctype(pDoc)?pDoc.documentElement:pDoc.body);}
BX.GetContext=function(node)
{if(BX.type.isElementNode(node))
return node.ownerDocument.parentWindow||node.ownerDocument.defaultView||window;else if(BX.type.isDomNode(node))
return node.parentWindow||node.defaultView||window;else
return window;}
BX.GetWindowInnerSize=function(pDoc)
{var width,height;pDoc=pDoc||document;if(self.innerHeight)
{width=BX.GetContext(pDoc).innerWidth;height=BX.GetContext(pDoc).innerHeight;}
else if(pDoc.documentElement&&(pDoc.documentElement.clientHeight||pDoc.documentElement.clientWidth))
{width=pDoc.documentElement.clientWidth;height=pDoc.documentElement.clientHeight;}
else if(pDoc.body)
{width=pDoc.body.clientWidth;height=pDoc.body.clientHeight;}
return{innerWidth:width,innerHeight:height};}
BX.GetWindowScrollPos=function(pDoc)
{var left,top;pDoc=pDoc||document;if(self.pageYOffset)
{left=BX.GetContext(pDoc).pageXOffset;top=BX.GetContext(pDoc).pageYOffset;}
else if(pDoc.documentElement&&(pDoc.documentElement.scrollTop||pDoc.documentElement.scrollLeft))
{left=pDoc.documentElement.scrollLeft;top=pDoc.documentElement.scrollTop;}
else if(pDoc.body)
{left=pDoc.body.scrollLeft;top=pDoc.body.scrollTop;}
return{scrollLeft:left,scrollTop:top};}
BX.GetWindowScrollSize=function(pDoc)
{var width,height;if(!pDoc)
pDoc=document;if((pDoc.compatMode&&pDoc.compatMode=="CSS1Compat"))
{width=pDoc.documentElement.scrollWidth;height=pDoc.documentElement.scrollHeight;}
else
{if(pDoc.body.scrollHeight>pDoc.body.offsetHeight)
height=pDoc.body.scrollHeight;else
height=pDoc.body.offsetHeight;if(pDoc.body.scrollWidth>pDoc.body.offsetWidth||(pDoc.compatMode&&pDoc.compatMode=="BackCompat")||(pDoc.documentElement&&!pDoc.documentElement.clientWidth))
width=pDoc.body.scrollWidth;else
width=pDoc.body.offsetWidth;}
return{scrollWidth:width,scrollHeight:height};}
BX.GetWindowSize=function(pDoc)
{var innerSize=this.GetWindowInnerSize(pDoc);var scrollPos=this.GetWindowScrollPos(pDoc);var scrollSize=this.GetWindowScrollSize(pDoc);return{innerWidth:innerSize.innerWidth,innerHeight:innerSize.innerHeight,scrollLeft:scrollPos.scrollLeft,scrollTop:scrollPos.scrollTop,scrollWidth:scrollSize.scrollWidth,scrollHeight:scrollSize.scrollHeight};}
BX.hide_object=function(ob)
{ob=BX(ob);ob.style.position='absolute';ob.style.top='-1000px';ob.style.left='-1000px';ob.style.height='10px';ob.style.width='10px';};BX.is_relative=function(el)
{var p=BX.style(el,'position');return p=='relative'||p=='absolute';}
BX.is_float=function(el)
{var p=BX.style(el,'float');return p=='right'||p=='left';}
BX.pos=function(el,bRelative)
{var r={top:0,right:0,bottom:0,left:0,width:0,height:0};bRelative=!!bRelative;if(!el)
return r;if(typeof(el.getBoundingClientRect)!="undefined"&&el.ownerDocument==document&&!bRelative)
{var clientRect=el.getBoundingClientRect();var root=document.documentElement;var body=document.body;r.top=clientRect.top+root.scrollTop+body.scrollTop;r.left=clientRect.left+root.scrollLeft+body.scrollLeft;r.width=clientRect.right-clientRect.left;r.height=clientRect.bottom-clientRect.top;r.right=clientRect.right+root.scrollLeft+body.scrollLeft;r.bottom=clientRect.bottom+root.scrollTop+body.scrollTop;}
else
{var x=0,y=0,w=el.offsetWidth,h=el.offsetHeight;var first=true;for(;el!=null;el=el.offsetParent)
{if(!first&&bRelative&&BX.is_relative(el))
break;x+=el.offsetLeft;y+=el.offsetTop;if(first)
{first=false;continue;}
var elBorderLeftWidth=parseInt(BX.style(el,'border-left-width')),elBorderTopWidth=parseInt(BX.style(el,'border-top-width'));if(!isNaN(elBorderLeftWidth)&&elBorderLeftWidth>0)
x+=elBorderLeftWidth;if(!isNaN(elBorderTopWidth)&&elBorderTopWidth>0)
y+=elBorderTopWidth;}
r.top=y;r.left=x;r.width=w;r.height=h;r.right=r.left+w;r.bottom=r.top+h;}
for(var i in r)r[i]=parseInt(r[i]);return r;}
BX.align=function(pos,w,h)
{var pDoc=document;if(BX.type.isElementNode(pos))
{pDoc=pos.ownerDocument;pos=BX.pos(pos);}
var x=pos["left"],y=pos["bottom"];var scroll=BX.GetWindowScrollPos(pDoc);var size=BX.GetWindowInnerSize(pDoc);if((size.innerWidth+scroll.scrollLeft)-(pos["left"]+w)<0)
{if(pos["right"]-w>=0)
x=pos["right"]-w;else
x=scroll.scrollLeft;}
if((size.innerHeight+scroll.scrollTop)-(pos["bottom"]+h)<0)
{if(pos["top"]-h>=0)
y=pos["top"]-h;else
y=scroll.scrollTop;}
return{'left':x,'top':y};}
BX.scrollToNode=function(node)
{var obNode=BX(node);if(obNode.scrollIntoView)
obNode.scrollIntoView(true);else
{var arNodePos=BX.pos(obNode);window.scrollTo(arNodePos.left,arNodePos.top);}}
BX.showWait=function(node,msg)
{node=BX(node)||document.body||document.documentElement;msg=msg||BX.message('JS_CORE_LOADING');var container_id=node.id||Math.random();var obMsg=node.bxmsg=document.body.appendChild(BX.create('DIV',{props:{id:'wait_'+container_id,className:'bx-core-waitwindow'},text:msg}));setTimeout(BX.delegate(_adjustWait,node),10);lastWait[lastWait.length]=obMsg;return obMsg;}
BX.closeWait=function(node,obMsg)
{obMsg=obMsg||node&&(node.bxmsg||BX('wait_'+node.id))||lastWait.pop();if(obMsg&&obMsg.parentNode)
{for(var i=0,len=lastWait.length;i<len;i++)
{if(obMsg==lastWait[i])
{lastWait=BX.util.deleteFromArray(lastWait,i);break;}}
obMsg.parentNode.removeChild(obMsg);if(node)node.bxmsg=null;BX.cleanNode(obMsg,true);}}
BX.loadScript=function(script,callback,doc)
{if(!BX.isReady)
{var _args=arguments;BX.ready(function(){BX.loadScript.apply(this,_args);});return;}
doc=doc||document;if(BX.type.isString(script))
script=[script];var _callback=function()
{return(callback&&BX.type.isFunction(callback))?callback():null}
var load_js=function(ind)
{if(ind>=script.length)
return _callback();var oHead=doc.getElementsByTagName("head")[0]||doc.documentElement;var oScript=doc.createElement('script');oScript.src=script[ind];var bLoaded=false;oScript.onload=oScript.onreadystatechange=function()
{if(!bLoaded&&(!oScript.readyState||oScript.readyState=="loaded"||oScript.readyState=="complete"))
{bLoaded=true;setTimeout(function(){load_js(++ind);},50);oScript.onload=oScript.onreadystatechange=null;if(oHead&&oScript.parentNode)
{oHead.removeChild(oScript);}}}
return oHead.insertBefore(oScript,oHead.firstChild);}
load_js(0);}
BX.loadCSS=function(arCSS,doc,win)
{if(!BX.isReady)
{var _args=arguments;BX.ready(function(){BX.loadCSS.apply(this,_args);});return null;}
if(BX.type.isString(arCSS))
{var bSingle=true;arCSS=[arCSS];}
var i,l=arCSS.length,pLnk=[];if(l==0)
return null;doc=doc||document;win=win||window;if(!win.bxhead)
{var heads=doc.getElementsByTagName('HEAD');win.bxhead=heads[0];}
if(!win.bxhead)
return null;for(i=0;i<l;i++)
{var lnk=document.createElement('LINK');lnk.href=arCSS[i];lnk.rel='stylesheet';lnk.type='text/css';win.bxhead.appendChild(lnk);pLnk.push(lnk);}
if(bSingle)
return lnk;return pLnk;}
BX.reload=function(back_url,bAddClearCache)
{if(back_url===true)
{bAddClearCache=true;back_url=null;}
var new_href=back_url||top.location.href;var hashpos=new_href.indexOf('#'),hash='';if(hashpos!=-1)
{hash=new_href.substr(hashpos);new_href=new_href.substr(0,hashpos);}
if(bAddClearCache&&new_href.indexOf('clear_cache=Y')<0)
new_href+=(new_href.indexOf('?')==-1?'?':'&')+'clear_cache=Y';if(hash)
{if(bAddClearCache&&(hash.substr(0,5)=='view/'||hash.substr(0,6)=='#view/')&&hash.indexOf('clear_cache%3DY')<0)
hash+=(hash.indexOf('%3F')==-1?'%3F':'%26')+'clear_cache%3DY'
new_href=new_href.replace(/(\?|\&)_r=[\d]*/,'');new_href+=(new_href.indexOf('?')==-1?'?':'&')+'_r='+Math.round(Math.random()*10000)+hash;}
top.location.href=new_href;}
BX.clearCache=function()
{BX.showWait();BX.reload(true);}
BX.formatDate=function(date,format)
{date=date||new Date();var bTime=date.getHours()||date.getMinutes()||date.getSeconds(),str=!!format?format:(bTime?BX.message('FORMAT_DATETIME'):BX.message('FORMAT_DATE'));return str.replace(/YYYY/ig,date.getFullYear()).replace(/MM/ig,BX.util.str_pad_left((date.getMonth()+1).toString(),2,'0')).replace(/DD/ig,BX.util.str_pad_left(date.getDate().toString(),2,'0')).replace(/HH/ig,BX.util.str_pad_left(date.getHours().toString(),2,'0')).replace(/MI/ig,BX.util.str_pad_left(date.getMinutes().toString(),2,'0')).replace(/SS/ig,BX.util.str_pad_left(date.getSeconds().toString(),2,'0'));}
BX.parseDate=function(str)
{var aDate=str.split(/\D/ig);var aFormat=BX.message('FORMAT_DATE').split(/\W/ig);if(aDate.length>aFormat.length)
aFormat=BX.message('FORMAT_DATETIME').split(/\W/ig);var i,cnt;var aDateArgs=[],aFormatArgs=[];for(i=0,cnt=aDate.length;i<cnt;i++)
if(BX.util.trim(aDate[i])!='')
aDateArgs[aDateArgs.length]=aDate[i];for(i=0,cnt=aFormat.length;i<cnt;i++)
if(BX.util.trim(aFormat[i])!='')
aFormatArgs[aFormatArgs.length]=aFormat[i];var aResult={};for(i=0,cnt=aFormatArgs.length;i<cnt;i++)
aResult[aFormatArgs[i].toUpperCase()]=parseInt(aDateArgs[i],10);if(aResult['DD']>0&&aResult['MM']>0&&aResult['YYYY']>0)
{var d=new Date();d.setDate(1);d.setFullYear(aResult['YYYY']);d.setMonth(aResult['MM']-1);d.setDate(aResult['DD']);d.setHours(0,0,0);if(!isNaN(aResult['HH'])&&!isNaN(aResult['MI'])&&!isNaN(aResult['SS']))
{d.setHours(aResult['HH'],aResult['MI'],aResult['SS']);}
return d;}
return null;}
BX.hint=function(el,hint_title,hint_html,hint_id)
{if(null==hint_html)
{hint_html=hint_title;hint_title='';}
if(null==el.BXHINT)
{el.BXHINT=new BX.CHint({parent:el,hint:hint_html,title:hint_title,id:hint_id});el.BXHINT.Show();}}
BX.hint_replace=function(el,hint_title,hint_html)
{if(null==hint_html)
{hint_html=hint_title;hint_title='';}
if(!el||!el.parentNode||!hint_html)
return null;var obHint=new BX.CHint({hint:hint_html,title:hint_title});obHint.CreateParent();el.parentNode.insertBefore(obHint.PARENT,el);el.parentNode.removeChild(el);obHint.PARENT.style.marginLeft='5px';return el;}
BX.CHint=function(params)
{this.PARENT=BX(params.parent);this.HINT=params.hint;this.HINT_TITLE=params.title;this.PARAMS={}
for(var i in this.defaultSettings)
{if(null==params[i])
this.PARAMS[i]=this.defaultSettings[i];else
this.PARAMS[i]=params[i];}
if(null!=params.id)
this.ID=params.id;this.timer=null;this.bInited=false;this.msover=true;if(this.PARAMS.showOnce)
{this.__show();this.msover=false;this.timer=setTimeout(BX.proxy(this.__hide,this),this.PARAMS.hide_timeout);}
else if(this.PARENT)
{BX.bind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.bind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));}
BX.addCustomEvent('onMenuOpen',BX.delegate(this.disable,this));BX.addCustomEvent('onMenuClose',BX.delegate(this.enable,this));}
BX.CHint.prototype.defaultSettings={show_timeout:1000,hide_timeout:500,dx:2,showOnce:false,preventHide:true,min_width:250}
BX.CHint.prototype.CreateParent=function(element,params)
{if(this.PARENT)
{BX.unbind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.unbind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));}
if(!params)params={}
var type='icon';if(params.type&&(params.type=="link"||params.type=="icon"))
type=params.type;if(element)
type="element";if(type=="icon")
{element=BX.create('IMG',{props:{src:params.iconSrc?params.iconSrc:"/bitrix/js/main/core/images/hint.gif"}});}
else if(type=="link")
{element=BX.create("A",{props:{href:'javascript:void(0)'},html:'[?]'});}
this.PARENT=element;BX.bind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.bind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));return this.PARENT;}
BX.CHint.prototype.Show=function()
{this.msover=true;if(null!=this.timer)
clearTimeout(this.timer);this.timer=setTimeout(BX.proxy(this.__show,this),this.PARAMS.show_timeout);}
BX.CHint.prototype.Hide=function()
{this.msover=false;if(null!=this.timer)
clearTimeout(this.timer);this.timer=setTimeout(BX.proxy(this.__hide,this),this.PARAMS.hide_timeout);}
BX.CHint.prototype.__show=function()
{if(!this.msover||this.disabled)return;if(!this.bInited)this.Init();this.prepareAdjustPos();this.DIV.style.display='block';this.adjustPos();BX.bind(window,'scroll',BX.proxy(this.__onscroll,this));if(this.PARAMS.showOnce)
{this.timer=setTimeout(BX.proxy(this.__hide,this),this.PARAMS.hide_timeout);}}
BX.CHint.prototype.__onscroll=function()
{if(!BX.admin||!BX.admin.panel||!BX.admin.panel.isFixed())return;if(this.scrollTimer)clearTimeout(this.scrollTimer);this.DIV.style.display='none';this.scrollTimer=setTimeout(BX.proxy(this.Reopen,this),this.PARAMS.show_timeout);}
BX.CHint.prototype.Reopen=function()
{if(null!=this.timer)clearTimeout(this.timer);this.timer=setTimeout(BX.proxy(this.__show,this),50);}
BX.CHint.prototype.__hide=function()
{if(this.msover)return;if(!this.bInited)return;BX.unbind(window,'scroll',BX.proxy(this.Reopen,this));if(this.PARAMS.showOnce)
{this.Destroy();}
else
{this.DIV.style.display='none';}}
BX.CHint.prototype.__hide_immediately=function()
{this.msover=false;this.__hide();}
BX.CHint.prototype.Init=function()
{this.DIV=document.body.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip'},style:{display:'none'},children:[BX.create('DIV',{props:{className:'bx-panel-tooltip-top-border'},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>'}),(this.CONTENT=BX.create('DIV',{props:{className:'bx-panel-tooltip-content'},children:[BX.create('DIV',{props:{className:'bx-panel-tooltip-underlay'},children:[BX.create('DIV',{props:{className:'bx-panel-tooltip-underlay-bg'}})]})]})),BX.create('DIV',{props:{className:'bx-panel-tooltip-bottom-border'},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>'})]}));if(this.ID)
{this.CONTENT.insertBefore(BX.create('A',{attrs:{href:'javascript:void(0)'},props:{className:'bx-panel-tooltip-close'},events:{click:BX.delegate(this.Close,this)}}),this.CONTENT.firstChild)}
if(this.HINT_TITLE)
{this.CONTENT.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip-title'},text:this.HINT_TITLE}))}
if(this.HINT)
{this.CONTENT_TEXT=this.CONTENT.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip-text'}})).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.CHint.prototype.setContent=function(content)
{this.HINT=content;if(this.CONTENT_TEXT)
this.CONTENT_TEXT.innerHTML=this.HINT;else
this.CONTENT_TEXT=this.CONTENT.appendChild(BX.create('DIV',{props:{className:'bx-panel-tooltip-text'}})).appendChild(BX.create('SPAN',{html:this.HINT}));}
BX.CHint.prototype.prepareAdjustPos=function()
{this._wnd={scrollPos:BX.GetWindowScrollPos(),scrollSize:BX.GetWindowScrollSize()};}
BX.CHint.prototype.getAdjustPos=function()
{var res={},pos=BX.pos(this.PARENT);res.top=pos.bottom+this.PARAMS.dx;if(BX.admin&&BX.admin.panel.DIV)
{var min_top=BX.admin.panel.DIV.offsetHeight+this.PARAMS.dx;if(BX.admin.panel.isFixed())
{min_top+=this._wnd.scrollPos.scrollTop;}}
if(res.top<min_top)
res.top=min_top;else
{if(res.top+this.DIV.offsetHeight>this._wnd.scrollSize.scrollHeight)
res.top=pos.top-this.PARAMS.dx-this.DIV.offsetHeight;}
res.left=pos.left;if(pos.left<this.PARAMS.dx)pos.left=this.PARAMS.dx;else
{floatWidth=this.DIV.offsetWidth;var max_left=this._wnd.scrollSize.scrollWidth-floatWidth-this.PARAMS.dx;if(res.left>max_left)
res.left=max_left;}
return res;}
BX.CHint.prototype.adjustWidth=function()
{if(this.bWidthAdjusted)return;var w=this.DIV.offsetWidth,h=this.DIV.offsetHeight;if(w>this.PARAMS.min_width)
w=Math.round(Math.sqrt(1.618*w*h));if(w<this.PARAMS.min_width)
w=this.PARAMS.min_width;this.DIV.style.width=w+"px";if(this._adjustWidthInt)
clearInterval(this._adjustWidthInt);this._adjustWidthInt=setInterval(BX.delegate(this._adjustWidthInterval,this),5);this.bWidthAdjusted=true;}
BX.CHint.prototype._adjustWidthInterval=function()
{if(!this.DIV||this.DIV.style.display=='none')
clearInterval(this._adjustWidthInt);var
dW=20,maxWidth=1500,w=this.DIV.offsetWidth,w1=this.CONTENT_TEXT.offsetWidth;if(w>0&&w1>0&&w-w1<dW&&w<maxWidth)
{this.DIV.style.width=(w+dW)+"px";return;}
clearInterval(this._adjustWidthInt);}
BX.CHint.prototype.adjustPos=function()
{this.adjustWidth();var pos=this.getAdjustPos();this.DIV.style.top=pos.top+'px';this.DIV.style.left=pos.left+'px';}
BX.CHint.prototype.Close=function()
{if(this.ID&&BX.WindowManager)
BX.WindowManager.saveWindowOptions(this.ID,{display:'off'});this.__hide_immediately();this.Destroy();}
BX.CHint.prototype.Destroy=function()
{if(this.PARENT)
{BX.unbind(this.PARENT,'mouseover',BX.proxy(this.Show,this));BX.unbind(this.PARENT,'mouseout',BX.proxy(this.Hide,this));}
if(this.DIV)
{BX.unbind(this.DIV,'mouseover',BX.proxy(this.Show,this));BX.unbind(this.DIV,'mouseout',BX.proxy(this.Hide,this));BX.cleanNode(this.DIV,true);}}
BX.CHint.prototype.enable=function(){this.disabled=false;}
BX.CHint.prototype.disable=function(){this.__hide_immediately();this.disabled=true;}
if(document.addEventListener)
{__readyHandler=function()
{document.removeEventListener("DOMContentLoaded",__readyHandler,false);runReady();}}
else if(document.attachEvent)
{__readyHandler=function()
{if(document.readyState==="complete")
{document.detachEvent("onreadystatechange",__readyHandler);runReady();}}}
function bindReady()
{if(!readyBound)
{readyBound=true;if(document.readyState==="complete")
{return runReady();}
if(document.addEventListener)
{document.addEventListener("DOMContentLoaded",__readyHandler,false);window.addEventListener("load",runReady,false);}
else if(document.attachEvent)
{document.attachEvent("onreadystatechange",__readyHandler);window.attachEvent("onload",runReady);var toplevel=false;try{toplevel=(window.frameElement==null);}catch(e){}
if(document.documentElement.doScroll&&toplevel)
doScrollCheck();}}
return null;}
function runReady()
{if(!BX.isReady)
{if(!document.body)
return setTimeout(runReady,15);BX.isReady=true;if(readyList&&readyList.length>0)
{var fn,i=0;while(readyList&&(fn=readyList[i++]))
{fn.call(document);}
readyList=null;}}
return null;}
function doScrollCheck()
{if(BX.isReady)
return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(doScrollCheck,1);return;}
runReady();}
function Trash()
{var i,len;for(i=0,len=garbageCollectors.length;i<len;i++)
{garbageCollectors[i].callback.apply(garbageCollectors[i].context||window);try{delete garbageCollectors[i];garbageCollectors[i]=null;}catch(e){}}
for(i=0,len=proxyList.length;i<len;i++)
{try{delete proxyList[i];proxyList[i]=null;}catch(e){}}
try{BX.unbindAll();}catch(e){}
NODECACHE=null;garbageCollectors=null;proxyList=null;eventsList=null;readyList=null;deniedEvents=null;customEvents=null;__readyHandler=null;}
function _adjustWait()
{if(!this.bxmsg)return;var arContainerPos=BX.pos(this),div_top=arContainerPos.top;if(div_top<BX.GetDocElement().scrollTop)
div_top=BX.GetDocElement().scrollTop+5;this.bxmsg.style.top=(div_top+5)+'px';if(this==BX.GetDocElement())
{this.bxmsg.style.right='5px';}
else
{this.bxmsg.style.left=(arContainerPos.right-this.bxmsg.offsetWidth-5)+'px';}}
function _checkDisplay(ob)
{var d=ob.style.display||BX.style(ob,'display');if(d!='none')
{ob.BXDISPLAY=d;return true;}
else
{ob.BXDISPLAY='block';return false;}}
function _checkNode(obj,params)
{params=params||{};if(BX.type.isFunction(params))
return params.call(window,obj);if(!params.allowTextNodes&&!BX.type.isElementNode(obj))
return false;var i,j,len;for(i in params)
{switch(i)
{case'tag':case'tagName':if(BX.type.isString(params[i]))
{if(obj.tagName.toUpperCase()!=params[i].toUpperCase())
return false;}
else if(params[i]instanceof RegExp)
{if(!params[i].test(obj.tagName))
return false;}
break;case'class':case'className':if(BX.type.isString(params[i]))
{if(!BX.hasClass(obj,params[i]))
return false;}
else if(params[i]instanceof RegExp)
{if(!BX.type.isString(obj.className)||!params[i].test(obj.className))
return false;}
break;case'attr':case'attribute':if(BX.type.isString(params[i]))
{if(!obj.getAttribute(params[i]))
return false;}
else if(BX.type.isArray(params[i]))
{for(j=0,len=params[i].length;j<len;j++)
{if(params[i]&&!obj.getAttribute(params[i]))
return false;}}
else
{for(j in params[i])
{var q=obj.getAttribute(j);if(BX.type.isString(params[i][j]))
{if(q!=params[i][j])
return false;}
else if(params[i][j]instanceof RegExp)
{if(!BX.type.isString(q)||!params[i][j].test(q))
return false;}}}
break;case'property':if(BX.type.isString(params[i]))
{if(!obj[params[i]])
return false;}
else if(BX.type.isArray(params[i]))
{for(j=0,len=params[i].length;j<len;j++)
{if(params[i]&&!obj[params[i]])
return false;}}
else
{for(j in params[i])
{if(BX.type.isString(params[i][j]))
{if(obj[j]!=params[i][j])
return false;}
else if(params[i][j]instanceof RegExp)
{if(!BX.type.isString(obj[j])||!params[i][j].test(obj[j]))
return false;}}}
break;case'callback':return params[i](obj);break;}}
return true;}
if(window.attachEvent)
window.attachEvent("onunload",Trash);else if(window.addEventListener)
window.addEventListener('unload',Trash,false);else
window.onunload=Trash;BX(BX.DoNothing);window.BX=BX;})(window);(function(window){if(window.BX.ajax)return;var
BX=window.BX,tempDefaultConfig={},defaultConfig={method:'GET',dataType:'html',timeout:0,async:true,processData:true,scriptsRunFirst:false,emulateOnload:true,start:true,cache:true,preparePost:true},ajax_session=null,loadedScripts={},r={'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};BX.ajax=function(config)
{var status,data;if(!config||!config.url||!BX.type.isString(config.url))
{return false;}
for(var i in tempDefaultConfig)
if(typeof(config[i])=="undefined")config[i]=tempDefaultConfig[i];tempDefaultConfig={};for(var i in defaultConfig)
if(typeof(config[i])=="undefined")config[i]=defaultConfig[i];config.method=config.method.toUpperCase();if(BX.browser.IsIE())
{var result=r.url_utf.exec(config.url);if(result)
{do
{config.url=config.url.replace(result,BX.util.urlencode(result));result=r.url_utf.exec(config.url);}while(result);}}
if(!config.cache&&config.method=='GET')
config.url=BX.ajax._uncache(config.url);if(config.method=='POST'&&config.preparePost)
{config.data=BX.ajax.prepareData(config.data);}
config.xhr=BX.ajax.xhr();if(!config.xhr)return;config.xhr.open(config.method,config.url,config.async);if(config.method=='POST'&&config.preparePost)
{config.xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}
var bRequestCompleted=false;var onreadystatechange=config.xhr.onreadystatechange=function(additional)
{if(bRequestCompleted)
return;if(additional==='timeout')
{if(config.onfailure)
config.onfailure("timeout");BX.onCustomEvent(config.xhr,'onAjaxFailure',['timeout','',config]);config.xhr.onreadystatechange=BX.DoNothing;config.xhr.abort();if(config.async)
{config.xhr=null;}}
else
{if(config.xhr.readyState==4||additional=='run')
{status=BX.ajax.xhrSuccess(config.xhr)?"success":"error";bRequestCompleted=true;config.xhr.onreadystatechange=BX.DoNothing;if(status=='success')
{var data=config.xhr.responseText;if(!config.processData)
{if(config.onsuccess)
{config.onsuccess(data);}
BX.onCustomEvent(config.xhr,'onAjaxSuccess',[data,config]);}
else
{try
{data=BX.ajax.processRequestData(data,config);}
catch(e)
{if(config.onfailure)
config.onfailure("processing",e);BX.onCustomEvent(config.xhr,'onAjaxFailure',['processing',e,config]);}}}
else if(config.onfailure)
{config.onfailure("status",config.xhr.status);BX.onCustomEvent(config.xhr,'onAjaxFailure',['status',config.xhr.status,config]);}
if(config.async)
{config.xhr=null;}}}}
if(config.async&&config.timeout>0)
{setTimeout(function(){if(config.xhr&&!bRequestCompleted)
{onreadystatechange("timeout");}},config.timeout*1000);}
if(config.start)
{config.xhr.send(config.data);if(!config.async)
{onreadystatechange('run');}}
return config.xhr;}
BX.ajax.xhr=function()
{if(window.XMLHttpRequest)
{try{return new XMLHttpRequest();}catch(e){}}
else if(window.ActiveXObject)
{try{return new ActiveXObject("Msxml2.XMLHTTP.6.0");}
catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}
catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){}
throw new Error("This browser does not support XMLHttpRequest.");}
return null;}
BX.ajax.__prepareOnload=function(scripts)
{if(scripts.length>0)
{BX.ajax['onload_'+ajax_session]=null;for(var i=0,len=scripts.length;i<len;i++)
{if(scripts[i].isInternal)
{scripts[i].JS=scripts[i].JS.replace(r.script_onload,'BX.ajax.onload_'+ajax_session);}}}
BX.CaptureEventsGet();BX.CaptureEvents(window,'load');}
BX.ajax.__runOnload=function()
{if(null!=BX.ajax['onload_'+ajax_session])
{BX.ajax['onload_'+ajax_session].apply(window);BX.ajax['onload_'+ajax_session]=null;}
var h=BX.CaptureEventsGet();if(h)
{for(var i=0;i<h.length;i++)
h[i].apply(window);}}
BX.ajax.processRequestData=function(data,config)
{var result,scripts=[],styles=[];switch(config.dataType.toUpperCase())
{case'JSON':if(data.indexOf("\n")>=0)
eval('result = '+data);else
result=(new Function("return "+data))();break;case'SCRIPT':scripts.push({"isInternal":true,"JS":data,bRunFirst:config.scriptsRunFirst});result=data;break;default:var ob=BX.processHTML(data,config.scriptsRunFirst);result=ob.HTML;scripts=ob.SCRIPT;styles=ob.STYLE
break;}
var bSessionCreated=false;if(null==ajax_session)
{ajax_session=parseInt(Math.random()*1000000);bSessionCreated=true;}
if(styles.length>0)
BX.loadCSS(styles);if(config.emulateOnload)
BX.ajax.__prepareOnload(scripts);BX.ajax.processScripts(scripts,true);if(config.onsuccess)
{config.onsuccess(result);}
BX.onCustomEvent(config.xhr,'onAjaxSuccess',[result,config]);BX.ajax.processScripts(scripts,false);setTimeout(function()
{if(config.emulateOnload)
BX.ajax.__runOnload();if(bSessionCreated)
ajax_session=null;},10);}
BX.ajax.processScripts=function(scripts,bRunFirst)
{for(var i=0,length=scripts.length;i<length;i++)
{if(null!=bRunFirst&&bRunFirst!=!!scripts[i].bRunFirst)
continue;if(scripts[i].isInternal)
{BX.evalGlobal(scripts[i].JS);}
else
{BX.ajax.loadScriptAjax([scripts[i].JS]);}}}
BX.ajax.prepareData=function(arData,prefix)
{var data='';if(BX.type.isString(arData))
data=arData;else if(null!=arData)
{for(var i in arData)
{if(data.length>0)data+='&';var name=BX.util.urlencode(i);if(prefix)
name=prefix+'['+name+']';if(typeof arData[i]=='object')
data+=BX.ajax.prepareData(arData[i],name)
else
data+=name+'='+BX.util.urlencode(arData[i])}}
return data;}
BX.ajax.xhrSuccess=function(xhr)
{return(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0;}
BX.ajax.Setup=function(config,bTemp)
{bTemp=!!bTemp;for(var i in config)
{if(bTemp)
tempDefaultConfig[i]=config[i];else
defaultConfig[i]=config[i];}}
BX.ajax._uncache=function(url)
{return url+((url.indexOf('?')!==-1?"&":"?")+'_='+(new Date).getTime());}
BX.ajax.get=function(url,data,callback)
{if(BX.type.isFunction(data))
{callback=data;data='';}
data=BX.ajax.prepareData(data);if(data)
{url+=(url.indexOf('?')!==-1?"&":"?")+data;data='';}
return BX.ajax({'method':'GET','dataType':'html','url':url,'data':'','onsuccess':callback});}
BX.ajax.getCaptcha=function(callback)
{return BX.ajax.loadJSON('/bitrix/tools/ajax_captcha.php',callback);}
BX.ajax.insertToNode=function(url,node)
{if(node=BX(node))
{BX.onCustomEvent('onAjaxInsertToNode',[{url:url,node:node}]);var show=null;if(!tempDefaultConfig.denyShowWait)
{show=BX.showWait(node);delete tempDefaultConfig.denyShowWait;}
return BX.ajax.get(url,function(data){node.innerHTML=data;BX.closeWait(node,show);});}}
BX.ajax.post=function(url,data,callback)
{data=BX.ajax.prepareData(data);return BX.ajax({'method':'POST','dataType':'html','url':url,'data':data,'onsuccess':callback});}
BX.ajax.loadScriptAjax=function(script_src,callback)
{if(BX.type.isArray(script_src))
{for(var i=0,len=script_src.length;i<len;i++)
BX.ajax.loadScriptAjax(script_src[i],callback);}
else
{if(r.script_self.test(script_src))return;if(r.script_self_window.test(script_src)&&BX.CWindow)return;if(r.script_self_admin.test(script_src)&&BX.admin)return;if(!loadedScripts[script_src])
{return BX.ajax({url:script_src,method:'GET',dataType:'script',processData:true,emulateOnload:false,async:false,start:true,onsuccess:function(result){loadedScripts[script_src]=result;if(callback)
callback(result);}});}
else if(callback)
{callback(loadedScripts[script_src]);}}}
BX.ajax.loadJSON=function(url,data,callback)
{if(BX.type.isFunction(data))
{callback=data;data='';}
data=BX.ajax.prepareData(data);if(data)
{url+=(url.indexOf('?')!==-1?"&":"?")+data;data='';}
return BX.ajax({'method':'GET','dataType':'json','url':url,'onsuccess':callback});}
BX.ajax.load=function(arObs,callback)
{if(!BX.type.isArray(arObs))
arObs=[arObs];var cnt=0;if(!BX.type.isFunction(callback))
callback=BX.DoNothing;var handler=function(data)
{if(BX.type.isFunction(this.callback))
this.callback(data);if(++cnt>=len)
callback();};for(var i=0,len=arObs.length;i<len;i++)
{switch(arObs.type.toUpperCase())
{case'SCRIPT':BX.loadScript([arObs[i].url],jsBX.proxy(handler,arObs[i]));break;case'CSS':BX.loadCSS([arObs[i].url]);if(++cnt>=len)
callback();break;case'JSON':BX.ajax.loadJSON(arObs.url,jsBX.proxy(handler,arObs[i]));break;default:BX.ajax.get(arObs.url,'',jsBX.proxy(handler,arObs[i]));break;}}}
BX.ajax.submit=function(obForm,callback)
{if(!obForm.target)
{if(null==obForm.BXFormTarget)
{var frame_name='formTarget_'+Math.random();obForm.BXFormTarget=document.body.appendChild(BX.create('IFRAME',{props:{name:frame_name,id:frame_name,src:'javascript:void(0)'},style:{display:'none'}}));}
obForm.target=obForm.BXFormTarget.name;}
obForm.BXFormCallback=callback;BX.bind(obForm.BXFormTarget,'load',BX.proxy(BX.ajax._submit_callback,obForm));BX.submit(obForm);return false;}
BX.ajax.submitComponentForm=function(obForm,container)
{if(!obForm.target)
{if(null==obForm.BXFormTarget)
{var frame_name='formTarget_'+Math.random();obForm.BXFormTarget=document.body.appendChild(BX.create('IFRAME',{props:{name:frame_name,id:frame_name,src:'javascript:void(0)'},style:{display:'none'}}));}
obForm.target=obForm.BXFormTarget.name;}
obForm.BXFormCallback=function(d){BX(container).innerHTML=d;if(window.bxcompajaxframeonload){setTimeout("window.bxcompajaxframeonload();window.bxcompajaxframeonload=null;",10)};BX.onCustomEvent('onAjaxSuccess',[]);};BX.bind(obForm.BXFormTarget,'load',BX.proxy(BX.ajax._submit_callback,obForm));return true;}
BX.ajax._submit_callback=function()
{if(this.BXFormTarget.contentWindow.location.href.indexOf('http')!=0)
return;if(this.BXFormCallback)
this.BXFormCallback.apply(this,[this.BXFormTarget.contentWindow.document.body.innerHTML]);BX.unbindAll(this.BXFormTarget);}
BX.ajax.submitAjax=function(obForm,callback)
{}
BX.ajax.UpdatePageData=function(arData)
{if(arData.TITLE)
BX.ajax.UpdatePageTitle(arData.TITLE);if(arData.NAV_CHAIN)
BX.ajax.UpdatePageNavChain(arData.NAV_CHAIN);if(arData.CSS&&arData.CSS.length>0)
BX.loadCSS(arData.CSS);if(arData.SCRIPTS&&arData.SCRIPTS.length>0)
BX.loadScript(arData.SCRIPTS);}
BX.ajax.UpdatePageTitle=function(title)
{var obTitle=BX('pagetitle');if(obTitle)
{obTitle.removeChild(obTitle.firstChild);if(!obTitle.firstChild)
obTitle.appendChild(document.createTextNode(title));else
obTitle.insertBefore(document.createTextNode(title),obTitle.firstChild);}
document.title=title;}
BX.ajax.UpdatePageNavChain=function(nav_chain)
{var obNavChain=BX('navigation');if(obNavChain)
{obNavChain.innerHTML=nav_chain;}}
BX.userOptions={options:null,bSend:false,delay:5000}
BX.userOptions.save=function(sCategory,sName,sValName,sVal,bCommon)
{if(null==BX.userOptions.options)
BX.userOptions.options={};bCommon=!!bCommon;BX.userOptions.options[sCategory+'.'+sName+'.'+sValName]=[sCategory,sName,sValName,sVal,bCommon];var sParam=BX.userOptions.__get();if(sParam!='')
document.cookie=BX.message('COOKIE_PREFIX')+"_LAST_SETTINGS="+sParam+"&sessid="+BX.bitrix_sessid()+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";if(!BX.userOptions.bSend)
{BX.userOptions.bSend=true;setTimeout(function(){BX.userOptions.send(null)},BX.userOptions.delay);}}
BX.userOptions.send=function(callback)
{var sParam=BX.userOptions.__get();BX.userOptions.options=null;BX.userOptions.bSend=false;if(sParam!='')
{document.cookie=BX.message('COOKIE_PREFIX')+"_LAST_SETTINGS=; path=/;";BX.ajax({'method':'GET','dataType':'html','processData':false,'cache':false,'url':'/bitrix/admin/user_options.php?'+sParam+'&sessid='+BX.bitrix_sessid(),'onsuccess':callback});}}
BX.userOptions.del=function(sCategory,sName,bCommon,callback)
{BX.ajax.get('/bitrix/admin/user_options.php?action=delete&c='+sCategory+'&n='+sName+(bCommon==true?'&common=Y':'')+'&sessid='+BX.bitrix_sessid(),callback);}
BX.userOptions.__get=function()
{if(!BX.userOptions.options)return'';var sParam='',n=-1,prevParam='',arOpt,i;for(i in BX.userOptions.options)
{aOpt=BX.userOptions.options[i];if(prevParam!=aOpt[0]+'.'+aOpt[1])
{n++;sParam+='&p['+n+'][c]='+BX.util.urlencode(aOpt[0]);sParam+='&p['+n+'][n]='+BX.util.urlencode(aOpt[1]);if(aOpt[4]==true)
sParam+='&p['+n+'][d]=Y';prevParam=aOpt[0]+'.'+aOpt[1];}
sParam+='&p['+n+'][v]['+BX.util.urlencode(aOpt[2])+']='+BX.util.urlencode(aOpt[3]);}
return sParam.substr(1);}
BX.ajax.history={expected_hash:'',obParams:null,obFrame:null,obImage:null,obTimer:null,bInited:false,bHashCollision:false,bPushState:!!(history.pushState&&BX.type.isFunction(history.pushState)),init:function(obParams)
{if(BX.ajax.history.bInited)
return;this.obParams=obParams;var obCurrentState=this.obParams.getState();if(BX.ajax.history.bPushState)
{BX.ajax.history.expected_hash=window.location.pathname;if(window.location.search)
BX.ajax.history.expected_hash+=window.location.search;BX.ajax.history.put(obCurrentState,BX.ajax.history.expected_hash);BX.bind(window,'popstate',BX.ajax.history.__hashListener);}
else
{BX.ajax.history.expected_hash=window.location.hash;if(!BX.ajax.history.expected_hash||BX.ajax.history.expected_hash=='#')
BX.ajax.history.expected_hash='__bx_no_hash__';jsAjaxHistoryContainer.put(BX.ajax.history.expected_hash,obCurrentState);BX.ajax.history.obTimer=setTimeout(BX.ajax.history.__hashListener,500);if(BX.browser.IsIE())
{BX.ajax.history.obFrame=document.createElement('IFRAME');BX.hide_object(BX.ajax.history.obFrame);document.body.appendChild(BX.ajax.history.obFrame);BX.ajax.history.obFrame.contentWindow.document.open();BX.ajax.history.obFrame.contentWindow.document.write(BX.ajax.history.expected_hash);BX.ajax.history.obFrame.contentWindow.document.close();}
else if(BX.browser.IsOpera())
{BX.ajax.history.obImage=document.createElement('IMG');BX.hide_object(BX.ajax.history.obImage);document.body.appendChild(BX.ajax.history.obImage);BX.ajax.history.obImage.setAttribute('src','javascript:location.href = \'javascript:BX.ajax.history.__hashListener();\';');}}
BX.ajax.history.bInited=true;},__hashListener:function(e)
{e=e||window.event||{state:false};if(BX.ajax.history.bPushState&&e.state)
{BX.ajax.history.obParams.setState(e.state);}
else
{if(BX.ajax.history.obTimer)
{window.clearTimeout(BX.ajax.history.obTimer);BX.ajax.history.obTimer=null;}
if(null!=BX.ajax.history.obFrame)
var current_hash=BX.ajax.history.obFrame.contentWindow.document.body.innerText;else
var current_hash=window.location.hash;if(!current_hash||current_hash=='#')
current_hash='__bx_no_hash__';if(current_hash.indexOf('#')==0)
current_hash=current_hash.substring(1);if(current_hash!=BX.ajax.history.expected_hash)
{var state=jsAjaxHistoryContainer.get(current_hash);if(state)
{BX.ajax.history.obParams.setState(state);BX.ajax.history.expected_hash=current_hash;if(null!=BX.ajax.history.obFrame)
{var __hash=current_hash=='__bx_no_hash__'?'':current_hash;if(window.location.hash!=__hash&&window.location.hash!='#'+__hash)
window.location.hash=__hash;}}}
BX.ajax.history.obTimer=setTimeout(BX.ajax.history.__hashListener,500);}},put:function(state,new_hash,new_hash1)
{if(this.bPushState)
{history.pushState(state,'',new_hash);}
else
{if(typeof new_hash1!='undefined')
new_hash=new_hash1;else
new_hash='view'+new_hash;jsAjaxHistoryContainer.put(new_hash,state);BX.ajax.history.expected_hash=new_hash;window.location.hash=BX.util.urlencode(new_hash);if(null!=BX.ajax.history.obFrame)
{BX.ajax.history.obFrame.contentWindow.document.open();BX.ajax.history.obFrame.contentWindow.document.write(new_hash);BX.ajax.history.obFrame.contentWindow.document.close();}}},checkRedirectStart:function(param_name,param_value)
{var current_hash=window.location.hash;if(current_hash.substring(0,1)=='#')current_hash=current_hash.substring(1);var test=current_hash.substring(0,5);if(test=='view/'||test=='view%')
{BX.ajax.history.bHashCollision=true;document.write('<'+'div id="__ajax_hash_collision_'+param_value+'" style="display: none;">');}},checkRedirectFinish:function(param_name,param_value)
{document.write('</div>');var current_hash=window.location.hash;if(current_hash.substring(0,1)=='#')current_hash=current_hash.substring(1);BX.ready(function()
{var test=current_hash.substring(0,5);if(test=='view/'||test=='view%')
{var obColNode=BX('__ajax_hash_collision_'+param_value);var obNode=obColNode.firstChild;BX.cleanNode(obNode);obColNode.style.display='block';if(test!='view%')
current_hash=BX.util.urlencode(current_hash);current_hash+=(current_hash.indexOf('%3F')==-1?'%3F':'%26')+param_name+'='+param_value;var url='/bitrix/tools/ajax_redirector.php?hash='+current_hash;BX.ajax.insertToNode(url,obNode);}});}}
BX.ajax.component=function(node)
{this.node=node;}
BX.ajax.component.prototype.getState=function()
{var state={'node':this.node,'title':window.document.title,'data':BX(this.node).innerHTML};var obNavChain=BX('navigation');if(null!=obNavChain)
state.nav_chain=obNavChain.innerHTML;return state;}
BX.ajax.component.prototype.setState=function(state)
{BX(state.node).innerHTML=state.data;BX.ajax.UpdatePageTitle(state.title);if(state.nav_chain)
BX.ajax.UpdatePageNavChain(state.nav_chain);}
var jsAjaxHistoryContainer={arHistory:{},put:function(hash,state)
{this.arHistory[hash]=state;},get:function(hash)
{return this.arHistory[hash];}}
BX.ajax.FormData=function()
{this.elements=[];this.files=[];this.features={};this.isSupported();this.log('BX FormData init');}
BX.ajax.FormData.isSupported=function()
{var f=new BX.ajax.FormData()
var result=f.features.supported;f=null;return result;}
BX.ajax.FormData.prototype.log=function(o)
{if(false){try{if(BX.browser.IsIE())o=JSON.stringify(o);console.log(o);}catch(e){}}}
BX.ajax.FormData.prototype.isSupported=function()
{var f={};f.fileReader=(window.FileReader&&window.FileReader.prototype.readAsBinaryString);f.readFormData=f.sendFormData=!!(window.FormData);f.supported=!!(f.readFormData&&f.sendFormData);this.features=f;this.log('features:');this.log(f);return f.supported;}
BX.ajax.FormData.prototype.append=function(name,value)
{if(typeof(value)==='object'){this.files.push({'name':name,'value':value});}else{this.elements.push({'name':name,'value':value});}}
BX.ajax.FormData.prototype.send=function(url,callbackOk,callbackError)
{this.log('FD send');this.xhr=BX.ajax({'method':'POST','dataType':'html','url':url,'onsuccess':callbackOk,'onerror':callbackError,'start':false,'preparePost':false});if(this.features.readFormData&&this.features.sendFormData)
{var fd=new FormData();this.log('use browser formdata');for(i in this.elements)
fd.append(this.elements[i].name,this.elements[i].value);for(i in this.files)
fd.append(this.files[i].name,this.files[i].value);this.xhr.send(fd);}
return this.xhr;}})(window)
BX.message({'LANGUAGE_ID':'ru','FORMAT_DATE':'DD.MM.YYYY','FORMAT_DATETIME':'DD.MM.YYYY HH:MI:SS','COOKIE_PREFIX':'BITRIX_SM','bitrix_sessid':'75e294240913b2d8d0439731ddb41047','SITE_ID':'s1','JS_CORE_LOADING':'Загрузка...','JS_CORE_WINDOW_CLOSE':'Закрыть','JS_CORE_WINDOW_EXPAND':'Развернуть','JS_CORE_WINDOW_NARROW':'Свернуть в окно','JS_CORE_WINDOW_SAVE':'Сохранить','JS_CORE_WINDOW_CANCEL':'Отменить','JS_CORE_H':'ч','JS_CORE_M':'м','JS_CORE_S':'с'})
(function(window){if(window.BX.ajax)return;var
BX=window.BX,tempDefaultConfig={},defaultConfig={method:'GET',dataType:'html',timeout:0,async:true,processData:true,scriptsRunFirst:false,emulateOnload:true,start:true,cache:true,preparePost:true},ajax_session=null,loadedScripts={},r={'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};BX.ajax=function(config)
{var status,data;if(!config||!config.url||!BX.type.isString(config.url))
{return false;}
for(var i in tempDefaultConfig)
if(typeof(config[i])=="undefined")config[i]=tempDefaultConfig[i];tempDefaultConfig={};for(var i in defaultConfig)
if(typeof(config[i])=="undefined")config[i]=defaultConfig[i];config.method=config.method.toUpperCase();if(BX.browser.IsIE())
{var result=r.url_utf.exec(config.url);if(result)
{do
{config.url=config.url.replace(result,BX.util.urlencode(result));result=r.url_utf.exec(config.url);}while(result);}}
if(!config.cache&&config.method=='GET')
config.url=BX.ajax._uncache(config.url);if(config.method=='POST'&&config.preparePost)
{config.data=BX.ajax.prepareData(config.data);}
config.xhr=BX.ajax.xhr();if(!config.xhr)return;config.xhr.open(config.method,config.url,config.async);if(config.method=='POST'&&config.preparePost)
{config.xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}
var bRequestCompleted=false;var onreadystatechange=config.xhr.onreadystatechange=function(additional)
{if(bRequestCompleted)
return;if(additional==='timeout')
{if(config.onfailure)
config.onfailure("timeout");BX.onCustomEvent(config.xhr,'onAjaxFailure',['timeout','',config]);config.xhr.onreadystatechange=BX.DoNothing;config.xhr.abort();if(config.async)
{config.xhr=null;}}
else
{if(config.xhr.readyState==4||additional=='run')
{status=BX.ajax.xhrSuccess(config.xhr)?"success":"error";bRequestCompleted=true;config.xhr.onreadystatechange=BX.DoNothing;if(status=='success')
{var data=config.xhr.responseText;if(!config.processData)
{if(config.onsuccess)
{config.onsuccess(data);}
BX.onCustomEvent(config.xhr,'onAjaxSuccess',[data,config]);}
else
{try
{data=BX.ajax.processRequestData(data,config);}
catch(e)
{if(config.onfailure)
config.onfailure("processing",e);BX.onCustomEvent(config.xhr,'onAjaxFailure',['processing',e,config]);}}}
else if(config.onfailure)
{config.onfailure("status",config.xhr.status);BX.onCustomEvent(config.xhr,'onAjaxFailure',['status',config.xhr.status,config]);}
if(config.async)
{config.xhr=null;}}}}
if(config.async&&config.timeout>0)
{setTimeout(function(){if(config.xhr&&!bRequestCompleted)
{onreadystatechange("timeout");}},config.timeout*1000);}
if(config.start)
{config.xhr.send(config.data);if(!config.async)
{onreadystatechange('run');}}
return config.xhr;}
BX.ajax.xhr=function()
{if(window.XMLHttpRequest)
{try{return new XMLHttpRequest();}catch(e){}}
else if(window.ActiveXObject)
{try{return new ActiveXObject("Msxml2.XMLHTTP.6.0");}
catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}
catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){}
throw new Error("This browser does not support XMLHttpRequest.");}
return null;}
BX.ajax.__prepareOnload=function(scripts)
{if(scripts.length>0)
{BX.ajax['onload_'+ajax_session]=null;for(var i=0,len=scripts.length;i<len;i++)
{if(scripts[i].isInternal)
{scripts[i].JS=scripts[i].JS.replace(r.script_onload,'BX.ajax.onload_'+ajax_session);}}}
BX.CaptureEventsGet();BX.CaptureEvents(window,'load');}
BX.ajax.__runOnload=function()
{if(null!=BX.ajax['onload_'+ajax_session])
{BX.ajax['onload_'+ajax_session].apply(window);BX.ajax['onload_'+ajax_session]=null;}
var h=BX.CaptureEventsGet();if(h)
{for(var i=0;i<h.length;i++)
h[i].apply(window);}}
BX.ajax.processRequestData=function(data,config)
{var result,scripts=[],styles=[];switch(config.dataType.toUpperCase())
{case'JSON':if(data.indexOf("\n")>=0)
eval('result = '+data);else
result=(new Function("return "+data))();break;case'SCRIPT':scripts.push({"isInternal":true,"JS":data,bRunFirst:config.scriptsRunFirst});result=data;break;default:var ob=BX.processHTML(data,config.scriptsRunFirst);result=ob.HTML;scripts=ob.SCRIPT;styles=ob.STYLE
break;}
var bSessionCreated=false;if(null==ajax_session)
{ajax_session=parseInt(Math.random()*1000000);bSessionCreated=true;}
if(styles.length>0)
BX.loadCSS(styles);if(config.emulateOnload)
BX.ajax.__prepareOnload(scripts);BX.ajax.processScripts(scripts,true);if(config.onsuccess)
{config.onsuccess(result);}
BX.onCustomEvent(config.xhr,'onAjaxSuccess',[result,config]);BX.ajax.processScripts(scripts,false);setTimeout(function()
{if(config.emulateOnload)
BX.ajax.__runOnload();if(bSessionCreated)
ajax_session=null;},10);}
BX.ajax.processScripts=function(scripts,bRunFirst)
{for(var i=0,length=scripts.length;i<length;i++)
{if(null!=bRunFirst&&bRunFirst!=!!scripts[i].bRunFirst)
continue;if(scripts[i].isInternal)
{BX.evalGlobal(scripts[i].JS);}
else
{BX.ajax.loadScriptAjax([scripts[i].JS]);}}}
BX.ajax.prepareData=function(arData,prefix)
{var data='';if(BX.type.isString(arData))
data=arData;else if(null!=arData)
{for(var i in arData)
{if(data.length>0)data+='&';var name=BX.util.urlencode(i);if(prefix)
name=prefix+'['+name+']';if(typeof arData[i]=='object')
data+=BX.ajax.prepareData(arData[i],name)
else
data+=name+'='+BX.util.urlencode(arData[i])}}
return data;}
BX.ajax.xhrSuccess=function(xhr)
{return(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0;}
BX.ajax.Setup=function(config,bTemp)
{bTemp=!!bTemp;for(var i in config)
{if(bTemp)
tempDefaultConfig[i]=config[i];else
defaultConfig[i]=config[i];}}
BX.ajax._uncache=function(url)
{return url+((url.indexOf('?')!==-1?"&":"?")+'_='+(new Date).getTime());}
BX.ajax.get=function(url,data,callback)
{if(BX.type.isFunction(data))
{callback=data;data='';}
data=BX.ajax.prepareData(data);if(data)
{url+=(url.indexOf('?')!==-1?"&":"?")+data;data='';}
return BX.ajax({'method':'GET','dataType':'html','url':url,'data':'','onsuccess':callback});}
BX.ajax.getCaptcha=function(callback)
{return BX.ajax.loadJSON('/bitrix/tools/ajax_captcha.php',callback);}
BX.ajax.insertToNode=function(url,node)
{if(node=BX(node))
{BX.onCustomEvent('onAjaxInsertToNode',[{url:url,node:node}]);var show=null;if(!tempDefaultConfig.denyShowWait)
{show=BX.showWait(node);delete tempDefaultConfig.denyShowWait;}
return BX.ajax.get(url,function(data){node.innerHTML=data;BX.closeWait(node,show);});}}
BX.ajax.post=function(url,data,callback)
{data=BX.ajax.prepareData(data);return BX.ajax({'method':'POST','dataType':'html','url':url,'data':data,'onsuccess':callback});}
BX.ajax.loadScriptAjax=function(script_src,callback)
{if(BX.type.isArray(script_src))
{for(var i=0,len=script_src.length;i<len;i++)
BX.ajax.loadScriptAjax(script_src[i],callback);}
else
{if(r.script_self.test(script_src))return;if(r.script_self_window.test(script_src)&&BX.CWindow)return;if(r.script_self_admin.test(script_src)&&BX.admin)return;if(!loadedScripts[script_src])
{return BX.ajax({url:script_src,method:'GET',dataType:'script',processData:true,emulateOnload:false,async:false,start:true,onsuccess:function(result){loadedScripts[script_src]=result;if(callback)
callback(result);}});}
else if(callback)
{callback(loadedScripts[script_src]);}}}
BX.ajax.loadJSON=function(url,data,callback)
{if(BX.type.isFunction(data))
{callback=data;data='';}
data=BX.ajax.prepareData(data);if(data)
{url+=(url.indexOf('?')!==-1?"&":"?")+data;data='';}
return BX.ajax({'method':'GET','dataType':'json','url':url,'onsuccess':callback});}
BX.ajax.load=function(arObs,callback)
{if(!BX.type.isArray(arObs))
arObs=[arObs];var cnt=0;if(!BX.type.isFunction(callback))
callback=BX.DoNothing;var handler=function(data)
{if(BX.type.isFunction(this.callback))
this.callback(data);if(++cnt>=len)
callback();};for(var i=0,len=arObs.length;i<len;i++)
{switch(arObs.type.toUpperCase())
{case'SCRIPT':BX.loadScript([arObs[i].url],jsBX.proxy(handler,arObs[i]));break;case'CSS':BX.loadCSS([arObs[i].url]);if(++cnt>=len)
callback();break;case'JSON':BX.ajax.loadJSON(arObs.url,jsBX.proxy(handler,arObs[i]));break;default:BX.ajax.get(arObs.url,'',jsBX.proxy(handler,arObs[i]));break;}}}
BX.ajax.submit=function(obForm,callback)
{if(!obForm.target)
{if(null==obForm.BXFormTarget)
{var frame_name='formTarget_'+Math.random();obForm.BXFormTarget=document.body.appendChild(BX.create('IFRAME',{props:{name:frame_name,id:frame_name,src:'javascript:void(0)'},style:{display:'none'}}));}
obForm.target=obForm.BXFormTarget.name;}
obForm.BXFormCallback=callback;BX.bind(obForm.BXFormTarget,'load',BX.proxy(BX.ajax._submit_callback,obForm));BX.submit(obForm);return false;}
BX.ajax.submitComponentForm=function(obForm,container)
{if(!obForm.target)
{if(null==obForm.BXFormTarget)
{var frame_name='formTarget_'+Math.random();obForm.BXFormTarget=document.body.appendChild(BX.create('IFRAME',{props:{name:frame_name,id:frame_name,src:'javascript:void(0)'},style:{display:'none'}}));}
obForm.target=obForm.BXFormTarget.name;}
obForm.BXFormCallback=function(d){BX(container).innerHTML=d;if(window.bxcompajaxframeonload){setTimeout("window.bxcompajaxframeonload();window.bxcompajaxframeonload=null;",10)};BX.onCustomEvent('onAjaxSuccess',[]);};BX.bind(obForm.BXFormTarget,'load',BX.proxy(BX.ajax._submit_callback,obForm));return true;}
BX.ajax._submit_callback=function()
{if(this.BXFormTarget.contentWindow.location.href.indexOf('http')!=0)
return;if(this.BXFormCallback)
this.BXFormCallback.apply(this,[this.BXFormTarget.contentWindow.document.body.innerHTML]);BX.unbindAll(this.BXFormTarget);}
BX.ajax.submitAjax=function(obForm,callback)
{}
BX.ajax.UpdatePageData=function(arData)
{if(arData.TITLE)
BX.ajax.UpdatePageTitle(arData.TITLE);if(arData.NAV_CHAIN)
BX.ajax.UpdatePageNavChain(arData.NAV_CHAIN);if(arData.CSS&&arData.CSS.length>0)
BX.loadCSS(arData.CSS);if(arData.SCRIPTS&&arData.SCRIPTS.length>0)
BX.loadScript(arData.SCRIPTS);}
BX.ajax.UpdatePageTitle=function(title)
{var obTitle=BX('pagetitle');if(obTitle)
{obTitle.removeChild(obTitle.firstChild);if(!obTitle.firstChild)
obTitle.appendChild(document.createTextNode(title));else
obTitle.insertBefore(document.createTextNode(title),obTitle.firstChild);}
document.title=title;}
BX.ajax.UpdatePageNavChain=function(nav_chain)
{var obNavChain=BX('navigation');if(obNavChain)
{obNavChain.innerHTML=nav_chain;}}
BX.userOptions={options:null,bSend:false,delay:5000}
BX.userOptions.save=function(sCategory,sName,sValName,sVal,bCommon)
{if(null==BX.userOptions.options)
BX.userOptions.options={};bCommon=!!bCommon;BX.userOptions.options[sCategory+'.'+sName+'.'+sValName]=[sCategory,sName,sValName,sVal,bCommon];var sParam=BX.userOptions.__get();if(sParam!='')
document.cookie=BX.message('COOKIE_PREFIX')+"_LAST_SETTINGS="+sParam+"&sessid="+BX.bitrix_sessid()+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";if(!BX.userOptions.bSend)
{BX.userOptions.bSend=true;setTimeout(function(){BX.userOptions.send(null)},BX.userOptions.delay);}}
BX.userOptions.send=function(callback)
{var sParam=BX.userOptions.__get();BX.userOptions.options=null;BX.userOptions.bSend=false;if(sParam!='')
{document.cookie=BX.message('COOKIE_PREFIX')+"_LAST_SETTINGS=; path=/;";BX.ajax({'method':'GET','dataType':'html','processData':false,'cache':false,'url':'/bitrix/admin/user_options.php?'+sParam+'&sessid='+BX.bitrix_sessid(),'onsuccess':callback});}}
BX.userOptions.del=function(sCategory,sName,bCommon,callback)
{BX.ajax.get('/bitrix/admin/user_options.php?action=delete&c='+sCategory+'&n='+sName+(bCommon==true?'&common=Y':'')+'&sessid='+BX.bitrix_sessid(),callback);}
BX.userOptions.__get=function()
{if(!BX.userOptions.options)return'';var sParam='',n=-1,prevParam='',arOpt,i;for(i in BX.userOptions.options)
{aOpt=BX.userOptions.options[i];if(prevParam!=aOpt[0]+'.'+aOpt[1])
{n++;sParam+='&p['+n+'][c]='+BX.util.urlencode(aOpt[0]);sParam+='&p['+n+'][n]='+BX.util.urlencode(aOpt[1]);if(aOpt[4]==true)
sParam+='&p['+n+'][d]=Y';prevParam=aOpt[0]+'.'+aOpt[1];}
sParam+='&p['+n+'][v]['+BX.util.urlencode(aOpt[2])+']='+BX.util.urlencode(aOpt[3]);}
return sParam.substr(1);}
BX.ajax.history={expected_hash:'',obParams:null,obFrame:null,obImage:null,obTimer:null,bInited:false,bHashCollision:false,bPushState:!!(history.pushState&&BX.type.isFunction(history.pushState)),init:function(obParams)
{if(BX.ajax.history.bInited)
return;this.obParams=obParams;var obCurrentState=this.obParams.getState();if(BX.ajax.history.bPushState)
{BX.ajax.history.expected_hash=window.location.pathname;if(window.location.search)
BX.ajax.history.expected_hash+=window.location.search;BX.ajax.history.put(obCurrentState,BX.ajax.history.expected_hash);BX.bind(window,'popstate',BX.ajax.history.__hashListener);}
else
{BX.ajax.history.expected_hash=window.location.hash;if(!BX.ajax.history.expected_hash||BX.ajax.history.expected_hash=='#')
BX.ajax.history.expected_hash='__bx_no_hash__';jsAjaxHistoryContainer.put(BX.ajax.history.expected_hash,obCurrentState);BX.ajax.history.obTimer=setTimeout(BX.ajax.history.__hashListener,500);if(BX.browser.IsIE())
{BX.ajax.history.obFrame=document.createElement('IFRAME');BX.hide_object(BX.ajax.history.obFrame);document.body.appendChild(BX.ajax.history.obFrame);BX.ajax.history.obFrame.contentWindow.document.open();BX.ajax.history.obFrame.contentWindow.document.write(BX.ajax.history.expected_hash);BX.ajax.history.obFrame.contentWindow.document.close();}
else if(BX.browser.IsOpera())
{BX.ajax.history.obImage=document.createElement('IMG');BX.hide_object(BX.ajax.history.obImage);document.body.appendChild(BX.ajax.history.obImage);BX.ajax.history.obImage.setAttribute('src','javascript:location.href = \'javascript:BX.ajax.history.__hashListener();\';');}}
BX.ajax.history.bInited=true;},__hashListener:function(e)
{e=e||window.event||{state:false};if(BX.ajax.history.bPushState&&e.state)
{BX.ajax.history.obParams.setState(e.state);}
else
{if(BX.ajax.history.obTimer)
{window.clearTimeout(BX.ajax.history.obTimer);BX.ajax.history.obTimer=null;}
if(null!=BX.ajax.history.obFrame)
var current_hash=BX.ajax.history.obFrame.contentWindow.document.body.innerText;else
var current_hash=window.location.hash;if(!current_hash||current_hash=='#')
current_hash='__bx_no_hash__';if(current_hash.indexOf('#')==0)
current_hash=current_hash.substring(1);if(current_hash!=BX.ajax.history.expected_hash)
{var state=jsAjaxHistoryContainer.get(current_hash);if(state)
{BX.ajax.history.obParams.setState(state);BX.ajax.history.expected_hash=current_hash;if(null!=BX.ajax.history.obFrame)
{var __hash=current_hash=='__bx_no_hash__'?'':current_hash;if(window.location.hash!=__hash&&window.location.hash!='#'+__hash)
window.location.hash=__hash;}}}
BX.ajax.history.obTimer=setTimeout(BX.ajax.history.__hashListener,500);}},put:function(state,new_hash,new_hash1)
{if(this.bPushState)
{history.pushState(state,'',new_hash);}
else
{if(typeof new_hash1!='undefined')
new_hash=new_hash1;else
new_hash='view'+new_hash;jsAjaxHistoryContainer.put(new_hash,state);BX.ajax.history.expected_hash=new_hash;window.location.hash=BX.util.urlencode(new_hash);if(null!=BX.ajax.history.obFrame)
{BX.ajax.history.obFrame.contentWindow.document.open();BX.ajax.history.obFrame.contentWindow.document.write(new_hash);BX.ajax.history.obFrame.contentWindow.document.close();}}},checkRedirectStart:function(param_name,param_value)
{var current_hash=window.location.hash;if(current_hash.substring(0,1)=='#')current_hash=current_hash.substring(1);var test=current_hash.substring(0,5);if(test=='view/'||test=='view%')
{BX.ajax.history.bHashCollision=true;document.write('<'+'div id="__ajax_hash_collision_'+param_value+'" style="display: none;">');}},checkRedirectFinish:function(param_name,param_value)
{document.write('</div>');var current_hash=window.location.hash;if(current_hash.substring(0,1)=='#')current_hash=current_hash.substring(1);BX.ready(function()
{var test=current_hash.substring(0,5);if(test=='view/'||test=='view%')
{var obColNode=BX('__ajax_hash_collision_'+param_value);var obNode=obColNode.firstChild;BX.cleanNode(obNode);obColNode.style.display='block';if(test!='view%')
current_hash=BX.util.urlencode(current_hash);current_hash+=(current_hash.indexOf('%3F')==-1?'%3F':'%26')+param_name+'='+param_value;var url='/bitrix/tools/ajax_redirector.php?hash='+current_hash;BX.ajax.insertToNode(url,obNode);}});}}
BX.ajax.component=function(node)
{this.node=node;}
BX.ajax.component.prototype.getState=function()
{var state={'node':this.node,'title':window.document.title,'data':BX(this.node).innerHTML};var obNavChain=BX('navigation');if(null!=obNavChain)
state.nav_chain=obNavChain.innerHTML;return state;}
BX.ajax.component.prototype.setState=function(state)
{BX(state.node).innerHTML=state.data;BX.ajax.UpdatePageTitle(state.title);if(state.nav_chain)
BX.ajax.UpdatePageNavChain(state.nav_chain);}
var jsAjaxHistoryContainer={arHistory:{},put:function(hash,state)
{this.arHistory[hash]=state;},get:function(hash)
{return this.arHistory[hash];}}
BX.ajax.FormData=function()
{this.elements=[];this.files=[];this.features={};this.isSupported();this.log('BX FormData init');}
BX.ajax.FormData.isSupported=function()
{var f=new BX.ajax.FormData()
var result=f.features.supported;f=null;return result;}
BX.ajax.FormData.prototype.log=function(o)
{if(false){try{if(BX.browser.IsIE())o=JSON.stringify(o);console.log(o);}catch(e){}}}
BX.ajax.FormData.prototype.isSupported=function()
{var f={};f.fileReader=(window.FileReader&&window.FileReader.prototype.readAsBinaryString);f.readFormData=f.sendFormData=!!(window.FormData);f.supported=!!(f.readFormData&&f.sendFormData);this.features=f;this.log('features:');this.log(f);return f.supported;}
BX.ajax.FormData.prototype.append=function(name,value)
{if(typeof(value)==='object'){this.files.push({'name':name,'value':value});}else{this.elements.push({'name':name,'value':value});}}
BX.ajax.FormData.prototype.send=function(url,callbackOk,callbackError)
{this.log('FD send');this.xhr=BX.ajax({'method':'POST','dataType':'html','url':url,'onsuccess':callbackOk,'onerror':callbackError,'start':false,'preparePost':false});if(this.features.readFormData&&this.features.sendFormData)
{var fd=new FormData();this.log('use browser formdata');for(i in this.elements)
fd.append(this.elements[i].name,this.elements[i].value);for(i in this.files)
fd.append(this.files[i].name,this.files[i].value);this.xhr.send(fd);}
return this.xhr;}})(window);function CBXSession()
{var _this=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(timeout,sessid,bShowMess,key)
{this.timeout=timeout;this.sessid=sessid;this.bShowMess=bShowMess;this.key=key;BX.ready(function(){BX.bind(document,"keypress",_this.OnUserInput);BX.bind(document.body,"mousemove",_this.OnUserInput);BX.bind(document.body,"click",_this.OnUserInput);setTimeout(_this.CheckSession,(_this.timeout-60)*1000);})},this.OnUserInput=function()
{var curr=new Date();_this.dateInput.setTime(curr.valueOf());}
this.CheckSession=function()
{var curr=new Date();if(curr.valueOf()-_this.dateCheck.valueOf()<30000)
return;_this.activityInterval=Math.round((_this.dateInput.valueOf()-_this.dateStart.valueOf())/1000);_this.dateStart.setTime(_this.dateInput.valueOf());var interval=(_this.activityInterval>_this.timeout?(_this.timeout-60):_this.activityInterval);BX.ajax.get('/bitrix/tools/public_session.php?sessid='+_this.sessid+'&interval='+interval+'&k='+_this.key,function(data){_this.CheckResult(data)});}
this.CheckResult=function(data)
{if(data=='SESSION_EXPIRED')
{if(_this.bShowMess)
{_this.notifier=document.body.appendChild(BX.create('DIV',{props:{className:'bx-session-message'},style:{top:'-1000px'},html:'<a class="bx-session-message-close" href="javascript:bxSession.Close()"></a>'+_this.mess.messSessExpired}));var windowScroll=BX.GetWindowScrollPos();var windowSize=BX.GetWindowInnerSize();_this.notifier.style.left=parseInt(windowScroll.scrollLeft+windowSize.innerWidth/2-parseInt(_this.notifier.clientWidth)/2)+'px';var fxStart=windowScroll.scrollTop-_this.notifier.offsetHeight;var fxFinish=windowScroll.scrollTop;(new BX.fx({time:0.5,step:0.01,type:'accelerated',start:fxStart,finish:fxFinish,callback:function(top){_this.notifier.style.top=top+'px';},callback_complete:function()
{if(BX.browser.IsIE())
{BX.bind(window,'scroll',function()
{var windowScroll=BX.GetWindowScrollPos();_this.notifier.style.top=windowScroll.scrollTop+'px';});}
else
{_this.notifier.style.top='0px';_this.notifier.style.position='fixed';}}})).start();}}
else
{var timeout;if(data=='SESSION_CHANGED')
timeout=(_this.timeout-60);else
timeout=(_this.activityInterval<60?60:(_this.activityInterval>_this.timeout?(_this.timeout-60):_this.activityInterval));var curr=new Date();_this.dateCheck.setTime(curr.valueOf());setTimeout(_this.CheckSession,timeout*1000);}}
this.Close=function()
{this.notifier.style.display='none';}}
var bxSession=new CBXSession();function CBXSession()
{var _this=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(timeout,sessid,bShowMess,key)
{this.timeout=timeout;this.sessid=sessid;this.bShowMess=bShowMess;this.key=key;BX.ready(function(){BX.bind(document,"keypress",_this.OnUserInput);BX.bind(document.body,"mousemove",_this.OnUserInput);BX.bind(document.body,"click",_this.OnUserInput);setTimeout(_this.CheckSession,(_this.timeout-60)*1000);})},this.OnUserInput=function()
{var curr=new Date();_this.dateInput.setTime(curr.valueOf());}
this.CheckSession=function()
{var curr=new Date();if(curr.valueOf()-_this.dateCheck.valueOf()<30000)
return;_this.activityInterval=Math.round((_this.dateInput.valueOf()-_this.dateStart.valueOf())/1000);_this.dateStart.setTime(_this.dateInput.valueOf());var interval=(_this.activityInterval>_this.timeout?(_this.timeout-60):_this.activityInterval);BX.ajax.get('/bitrix/tools/public_session.php?sessid='+_this.sessid+'&interval='+interval+'&k='+_this.key,function(data){_this.CheckResult(data)});}
this.CheckResult=function(data)
{if(data=='SESSION_EXPIRED')
{if(_this.bShowMess)
{_this.notifier=document.body.appendChild(BX.create('DIV',{props:{className:'bx-session-message'},style:{top:'-1000px'},html:'<a class="bx-session-message-close" href="javascript:bxSession.Close()"></a>'+_this.mess.messSessExpired}));var windowScroll=BX.GetWindowScrollPos();var windowSize=BX.GetWindowInnerSize();_this.notifier.style.left=parseInt(windowScroll.scrollLeft+windowSize.innerWidth/2-parseInt(_this.notifier.clientWidth)/2)+'px';var fxStart=windowScroll.scrollTop-_this.notifier.offsetHeight;var fxFinish=windowScroll.scrollTop;(new BX.fx({time:0.5,step:0.01,type:'accelerated',start:fxStart,finish:fxFinish,callback:function(top){_this.notifier.style.top=top+'px';},callback_complete:function()
{if(BX.browser.IsIE())
{BX.bind(window,'scroll',function()
{var windowScroll=BX.GetWindowScrollPos();_this.notifier.style.top=windowScroll.scrollTop+'px';});}
else
{_this.notifier.style.top='0px';_this.notifier.style.position='fixed';}}})).start();}}
else
{var timeout;if(data=='SESSION_CHANGED')
timeout=(_this.timeout-60);else
timeout=(_this.activityInterval<60?60:(_this.activityInterval>_this.timeout?(_this.timeout-60):_this.activityInterval));var curr=new Date();_this.dateCheck.setTime(curr.valueOf());setTimeout(_this.CheckSession,timeout*1000);}}
this.Close=function()
{this.notifier.style.display='none';}}
var bxSession=new CBXSession();bxSession.Expand(1440,'75e294240913b2d8d0439731ddb41047',false,'68e90d4444742919a247e578dbcb8381');;
