Your IP : 3.142.119.166


Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/mobileapp/
Upload File :
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/mobileapp/bitrix_mobile.min.js

(function(){if(window.app)return;window.BXCordovaPlugin=function(e,t,i){this.pluginName=e;this.useSyncPlugin=t==true;this.callbackIndex=0;this.callbacks={};this.callbackIndex=0;this.dataBrigePath=(typeof mobileSiteDir=="undefined"?"/":mobileSiteDir)+"mobile/";this.available=false;this.convertBoolean=typeof i=="undefined"?true:i;this.platform=null;this.apiVersion=0;this.db=null;var n=this;document.addEventListener("deviceready",function(){n.available=true},false)};BXCordovaPlugin.prototype.RegisterCallBack=function(e){if(typeof e==="function"){this.callbackIndex++;this.callbacks[this.callbackIndex]=e;return this.callbackIndex}return false};BXCordovaPlugin.prototype.CallBackExecute=function(e,t){if(this.callbacks[e]&&typeof this.callbacks[e]==="function"){this.callbacks[e](t)}};BXCordovaPlugin.prototype.prepareParams=function(e,t){var i=true;if(typeof t=="boolean"){i=t}if(typeof e=="object"){for(var n in e){if(typeof e[n]=="object")e[n]=this.prepareParams(e[n],t);if(typeof e[n]=="function")e[n]=this.RegisterCallBack(e[n]);else if(i){if(e[n]===true)e[n]="YES";else if(e[n]===false)e[n]="NO"}}}else{if(typeof e=="function")e=this.RegisterCallBack(e);else if(i){if(e===true)e="YES";else if(e===false)e="NO"}}return e};BXCordovaPlugin.prototype.clone=function(e,t){var i,n,a;if(t!==false)t=true;if(e===null)return null;if(typeof e=="object"){if(Object.prototype.toString.call(e)=="[object Array]"){i=[];for(n=0,a=e.length;n<a;n++){if(typeof e[n]=="object"&&t)i[n]=this.clone(e[n],t);else i[n]=e[n]}}else{i={};for(n in e){if(typeof e[n]=="object"&&t)i[n]=this.clone(e[n],t);else i[n]=e[n]}}}else{i=e}return i};BXCordovaPlugin.prototype.exec=function(e,t,i){var n={};if(typeof i=="undefined"){i=this.convertBoolean}if(!this.available){document.addEventListener("deviceready",BX.proxy(function(){this.exec(e,t,i)},this),false);return false}if(typeof t!="undefined"){n=this.clone(t,true);n=this.prepareParams(n,i);if(typeof n=="object")n=JSON.stringify(n)}else{n="{}"}if(window.syncPlugin&&this.useSyncPlugin){window.syncPlugin.execute(e,n);return}if(device.platform.toUpperCase()=="ANDROID"||device.cordova>"2.0.0"){return Cordova.exec(null,null,this.pluginName,e,[n])}else{return Cordova.exec(this.pluginName+"."+e,n)}};var e=new BXCordovaPlugin("BitrixMobile",true);window.app=e;document.addEventListener("DOMContentLoaded",function(){e.db=new BX.dataBase.create({name:"Bitrix Base",displayName:"Bitrix Base",capacity:1024*1024*4,version:"1.2"})});e.notificationBar=function(e,t){this.exec("notificationBar",{action:e,params:t})};e.actionSheet=function(e,t){this.exec("actionSheet",{action:e,params:t})};e.titleAction=function(e,t){this.exec("titleAction",{action:e,params:t})};e.refresh=function(e,t){this.exec("refreshAction",{action:e,params:t})};e.textPanelAction=function(e,t){this.exec("textPanelAction",{action:e,params:t})};e.showSlidingPanel=function(e){return this.exec("showSlidingPanel",e)};e.changeAccount=function(){return this.exec("changeAccount",{})};e.showDocumentsCache=function(e){return this.exec("showDocumentsCache",e)};e.showButtonPanel=function(e){return this.exec("showButtonPanel",e)};e.hideSlidingPanel=e.hideButtonPanel=function(e){return this.exec("hideSlidingPanel",e)};e.showSelectPicker=function(e){return this.exec("showSelectPicker",e)};e.hideSelectPicker=function(e){return this.exec("hideSelectPicker",e)};e.updateButtonBadge=function(e){return this.exec("updateButtonBadge",e)};e.openBarCodeScanner=function(e){return this.exec("openBarCodeScanner",e)};e.openPhotos=function(e){return this.exec("openPhotos",e)};e.removeAllCache=function(e){return this.exec("removeAllCache",e)};e.loadPageBlank=function(e){return this.exec("openNewPage",e)};e.loadPageStart=function(e){return this.exec("loadPage",e)};e.confirm=function(e){if(!this.available){document.addEventListener("deviceready",BX.proxy(function(){this.confirm(e)},this),false);return}var t={callback:function(){},title:"",text:"",buttons:"OK"};if(e){if(e.title)t.title=e.title;if(e.buttons&&e.buttons.length>0){t.buttons="";for(var i=0;i<e.buttons.length;i++){if(t.buttons.length>0){t.buttons+=","+e.buttons[i]}else t.buttons=e.buttons[i]}}t.accept=e.accept;if(e.text)t.text=e.text;if(e.callback&&typeof e.callback=="function")t.callback=e.callback}navigator.notification.confirm(t.text,t.callback,t.title,t.buttons)};e.alert=function(e){if(!this.available){document.addEventListener("deviceready",BX.proxy(function(){this.alert(e)},this),false);return}var t={callback:function(){},title:"",button:"",text:""};if(typeof e=="object"){if(e.title)t.title=e.title;if(e.button)t.button=e.button;if(e.text)t.text=e.text;if(e.callback&&typeof e.callback=="function")t.callback=e.callback}else{t.text=e}navigator.notification.alert(t.text,t.callback,t.title,t.button)};e.openLeft=function(){return this.exec("openMenu")};e.setPageTitle=function(e){return this.exec("setPageTitle",e)};e.removeTableCache=function(e){return this.exec("removeTableCache",{table_id:e})};e.showDatePicker=function(e){return this.exec("showDatePicker",e)};e.hideDatePicker=function(){return this.exec("hideDatePicker")};e.showInput=function(e){return this.exec("showInput",e)};e.showInputLoading=function(e){if(e&&e!==true)e=false;return this.exec("showInputLoading",{status:e})};e.clearInput=function(){return this.exec("clearInput")};e.hideInput=function(){return this.exec("hideInput")};e.reload=function(e){var e=e||{url:document.location.href};if(window.platform=="android"){this.exec("reload",e)}else{document.location.href=e.url}};e.flipScreen=function(){return this.exec("flipScreen")};e.removeButtons=function(e){return this.exec("removeButtons",e)};e.openBXTable=function(e){if(typeof e.table_settings!="undefined"){e.TABLE_SETTINGS=e.table_settings;delete e.table_settings}if(e.TABLE_SETTINGS.markmode&&e.TABLE_SETTINGS.markmode==true){if(e.TABLE_SETTINGS.callback&&typeof e.TABLE_SETTINGS.callback=="function"){var t=e.TABLE_SETTINGS.callback;e.TABLE_SETTINGS.callback=function(e){t(BitrixMobile.Utils.htmlspecialchars(e))}}}if(typeof e.TABLE_SETTINGS.modal!=="undefined"){e.modal=e.TABLE_SETTINGS.modal}if(typeof e.TABLE_SETTINGS.name!=="undefined"){e.TABLE_SETTINGS.showtitle=true}return this.exec("openBXTable",e)};e.openDocument=function(e){return this.exec("openDocument",e)};e.showPopupLoader=function(e){return this.exec("showPopupLoader",e)};e.hidePopupLoader=function(e){return this.exec("hidePopupLoader",e)};e.changeCurPageParams=function(e){return this.exec("changeCurPageParams",e)};e.getPageParams=function(e){if(!this.enableInVersion(3))return false;return this.exec("getPageParams",e)};e.menuCreate=function(e){return this.exec("menuCreate",e)};e.menuShow=function(){return this.exec("menuShow")};e.menuHide=function(){return this.exec("menuHide")};e.enableInVersion=function(e,t){if(this.apiVersion==0){try{if(typeof BXMobileAppContext!="undefined"&&typeof BXMobileAppContext.getApiVersion=="function"){this.apiVersion=BXMobileAppContext.getApiVersion()}else if(typeof appVersion!="undefined"){this.apiVersion=appVersion}}catch(e){}}return typeof t!="undefined"&&t==true?parseInt(this.apiVersion)==parseInt(e):parseInt(this.apiVersion)>=parseInt(e)};e.checkOpenStatus=function(e){return this.exec("checkOpenStatus",e)};e.asyncRequest=function(e){return this.exec("asyncRequest",e)};e.openUrl=function(e){return this.exec("openUrl",e)};e.RegisterCallBack=function(e){if(typeof e=="function"){this.callbackIndex++;this.callbacks["callback"+this.callbackIndex]=e;return this.callbackIndex}};e.CallBackExecute=function(e,t){if(this.callbacks["callback"+e]&&typeof this.callbacks["callback"+e]==="function"){this.callbacks["callback"+e](t)}};e.onCustomEvent=function(e,t,i,n){if(typeof n=="undefined"){n=true}if(!this.available){document.addEventListener("deviceready",BX.delegate(function(){this.onCustomEvent(e,t,i,n)},this),false);return}if(n)t=this.prepareParams(t);if(typeof t=="object")t=JSON.stringify(t);if(device.platform.toUpperCase()=="ANDROID"||device.cordova>"2.0.0"){var a={eventName:e,params:t};return Cordova.exec(null,null,"BitrixMobile","onCustomEvent",[a])}else{return Cordova.exec("BitrixMobile.onCustomEvent",e,t,i)}};e.getVar=function(e){return this.exec("getVar",e)};e.passVar=function(e,t){try{evalVar=window[e];if(!evalVar)evalVar="empty"}catch(e){evalVar=""}if(evalVar){if(typeof evalVar=="object")evalVar=JSON.stringify(evalVar);if(platform.toUpperCase()=="ANDROID"){t=t||false;if(t)Bitrix24Android.receiveStringValue(JSON.stringify({variable:evalVar,key:t}));else Bitrix24Android.receiveStringValue(evalVar)}else{return evalVar}}};e.takePhoto=function(e){if(!this.available){document.addEventListener("deviceready",BX.proxy(function(){this.takePhoto(e)},this),false);return}if(!e.callback)e.callback=function(){};if(!e.fail)e.fail=function(){};var t={quality:e.quality||(this.enableInVersion(2)?40:10),correctOrientation:e.correctOrientation||false,targetWidth:e.targetWidth||false,targetHeight:e.targetHeight||false,sourceType:typeof e.source!="undefined"?e.source:0,mediaType:typeof e.mediaType!="undefined"?e.mediaType:0,allowEdit:typeof e.allowEdit!="undefined"?e.allowEdit:false,saveToPhotoAlbum:typeof e.saveToPhotoAlbum!="undefined"?e.saveToPhotoAlbum:false};if(e.destinationType!==undefined)t.destinationType=e.destinationType;navigator.camera.getPicture(e.callback,e.fail,t)};e.openMenu=function(){return this.exec("openMenu")};e.showModalDialog=function(e){if(typeof e["cache"]=="undefined"){e["cache"]=false}return this.exec("showModalDialog",e)};e.closeModalDialog=function(e){return this.exec("closeModalDialog",e)};e.closeController=function(e){return this.exec("closeController",e)};e.addButtons=function(e){return this.exec("addButtons",e)};e.openContent=function(){return this.exec("openContent")};e.closeMenu=function(){return this.exec("closeMenu")};e.loadPage=function(e,t){if(this.enableInVersion(2)&&t){params={url:e,page_id:t};return this.exec("loadPage",params)}return this.exec("loadPage",e)};e.setPageID=function(e){return this.exec("setPageID",e)};e.openNewPage=function(e,t,i){if(this.enableInVersion(3)){var n={url:e,data:t,title:i};return this.exec("openNewPage",n)}else return this.exec("openNewPage",e)};e.loadMenu=function(e){return this.exec("loadMenu",e)};e.openTable=function(e){if(e.markmode&&e.markmode==true){if(e.callback&&typeof e.callback=="function"){if(!(e.skipSpecialChars&&e.skipSpecialChars===true)){var t=e.callback;e.callback=function(e){t(BitrixMobile.Utils.htmlspecialchars(e))}}}}return this.exec("openTable",e)};e.openUserList=function(e){return this.exec("openUserList",e)};e.addUserListButton=function(e){return this.exec("addUserListButton",e)};e.pullDown=function(e){if(typeof e.backgroundColor=="undefined"){var t=document.body.className.length>0?document.querySelector("."+document.body.className):null;if(t!=null){var i=getComputedStyle(t);var n=function(e){e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return e&&e.length===4?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""};var a=n(i.backgroundColor);if(a!="#000000")e.backgroundColor=a;else e.backgroundColor="#ffffff"}}else{e.backgroundColor="#ffffff"}return this.exec("pullDown",e)};e.pullDownLoadingStop=function(){return this.exec("pullDownLoadingStop")};e.enableScroll=function(e){var e=e||false;return this.exec("enableScroll",e)};e.enableCaptureKeyboard=function(e){var e=e||false;return this.exec("enableCaptureKeyboard",e)};e.enableLoadingScreen=function(e){var e=e||false;return this.exec("enableLoadingScreen",e)};e.showLoadingScreen=function(){return this.exec("showLoadingScreen")};e.hideLoadingScreen=function(){return this.exec("hideLoadingScreen")};e.visibleNavigationBar=function(e){var e=e||false;return this.exec("visibleNavigationBar",e)};e.visibleToolBar=function(e){var e=e||false;return this.exec("visibleToolBar",e)};e.enableSliderMenu=function(e){var e=e||false;return this.exec("enableSliderMenu",e)};e.enableRight=function(e){var e=e||false;return this.exec("enableRight",e)};e.setCounters=function(e){return this.exec("setCounters",e)};e.setBadge=function(e){return this.exec("setBadge",e)};e.refreshPanelPage=function(e){if(!e)e="";var t={page:e};return this.exec("refreshPanelPage",t)};e.setPanelPages=function(e){return this.exec("setPanelPages",e)};e.getToken=function(){var t="APPLE";if(platform!="ios")t="GOOGLE";var i={callback:function(i){BX.proxy(BX.ajax.post(e.dataBrigePath,{mobile_action:"save_device_token",device_name:typeof device.name=="undefined"?device.model:device.name,uuid:device.uuid,device_token:i,device_type:t,sessid:BX.bitrix_sessid()},function(e){}),this)}};return this.exec("getToken",i)};e.BasicAuth=function(t){t=t||{};var i=t.success&&typeof t.success=="function"?t.success:function(){};var n=t.failture&&typeof t.failture=="function"?t.failture:function(){};var a={check_url:t.check_url,success:function(t){if(typeof t!="object"){try{t=JSON.parse(t)}catch(e){t={status:"failed"}}}if(t.status=="success"&&t.sessid_md5){if(BX.message.bitrix_sessid!=t.sessid_md5){BX.message.bitrix_sessid=t.sessid_md5;e.onCustomEvent("onSessIdChanged",{sessid:t.sessid_md5})}}i(t)},failture:function(t){if(t.status=="failed")e.exec("showAuthForm");else n(t)}};return this.exec("BasicAuth",a)};e.logOut=function(){if(this.enableInVersion(2)){this.asyncRequest({url:this.dataBrigePath+"?mobile_action=logout&uuid="+device.uuid});return this.exec("showAuthForm")}var t=new XMLHttpRequest;t.open("GET",this.dataBrigePath+"?mobile_action=logout&uuid="+device.uuid,true);t.onreadystatechange=function(){if(t.readyState==4&&t.status=="200"){return e.exec("showAuthForm")}};t.send(null)};e.getCurrentLocation=function(e){if(!this.available){document.addEventListener("deviceready",BX.proxy(function(){this.getCurrentLocation(e)},this),false);return}var t;var i;if(e){t=e.onsuccess;i=e.onerror}navigator.geolocation.getCurrentPosition(t,i)};e.setVibrate=function(e){e=e||500;navigator.notification.vibrate(parseInt(e))};e.bindloadPageBlank=function(){document.addEventListener("DOMContentLoaded",function(){document.body.addEventListener("click",function(e){var t=null;var i="__bx_android_click_detect__";if(e.target.tagName.toUpperCase()=="A")t=e.target;else t=BX.findParent(e.target,{tagName:"A"},10);if(t&&t.href&&t.href.length>0){if(t.href.indexOf(i)==-1&&t.href.indexOf("javascript")!=0){if(t.href.indexOf("#")==-1)t.href+="#"+i;else t.href+="&"+i}}},false)},false)};BitrixMobile={};BitrixMobile.Utils={autoResizeForm:function(e,t,i){if(!e||!t)return;var n=e.parentNode;i=i||126;var a=(e.ownerDocument||document).defaultView.getComputedStyle(e,null).getPropertyValue("height");var o=(n.ownerDocument||document).defaultView.getComputedStyle(n,null).getPropertyValue("height");a=parseInt(a);o=parseInt(o);e.setAttribute("data-orig-height",a);n.setAttribute("data-orig-height",o);var s=a;var r=document.createElement("textarea");r.className="send-message-input";r.style.height=s+"px";r.style.visibility="hidden";r.style.position="absolute";r.style.left="-300px";document.body.appendChild(r);e.addEventListener("change",c,false);e.addEventListener("cut",l,false);e.addEventListener("paste",l,false);e.addEventListener("drop",l,false);e.addEventListener("keyup",c,false);if(window.platform=="android")e.addEventListener("keydown",l,false);function c(){r.value=e.value;var c=r.scrollHeight;if(c>i)c=i;if(s!=c){s=c;e.style.height=c+"px";n.style.height=o+(c-a)+"px";t.style.bottom=o+(c-a)+"px";if(window.platform=="android")window.scrollTo(0,document.documentElement.scrollHeight)}}function l(){setTimeout(c,0)}},resetAutoResize:function(e,t){if(!e||!t)return;var i=e.parentNode;var n=e.getAttribute("data-orig-height");var a=i.getAttribute("data-orig-height");e.style.height=n+"px";i.style.height=a+"px";t.style.bottom=a+"px"},showHiddenImages:function(){var e=document.getElementsByTagName("img");for(var t=0;t<e.length;t++){var i=e[t];var n=i.getAttribute("data-src");if(!n)continue;if(BitrixMobile.Utils.isElementVisibleOnScreen(i)){i.src=n;i.setAttribute("data-src","")}}},isElementVisibleOnScreen:function(e){var t=BitrixMobile.Utils.getElementCoords(e);var i=window.pageYOffset||document.documentElement.scrollTop;var n=i+document.documentElement.clientHeight;t.bottom=t.top+e.offsetHeight;var a=t.top>i&&t.top<n;var o=t.bottom<n&&t.bottom>i;return a||o},isElementVisibleOn2Screens:function(e){var t=BitrixMobile.Utils.getElementCoords(e);var i=document.documentElement.clientHeight;var n=window.pageYOffset||document.documentElement.scrollTop;var a=n+i;t.bottom=t.top+e.offsetHeight;n-=i;a+=i;var o=t.top>n&&t.top<a;var s=t.bottom<a&&t.bottom>n;return o||s},getElementCoords:function(e){var t=e.getBoundingClientRect();return{originTop:t.top,originLeft:t.left,top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},htmlspecialchars:function(e){if(BX.type.isString(e))return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");if(BX.type.isArray(e)){for(var t=0;t<e.length;t++){e[t]=BitrixMobile.Utils.htmlspecialchars(e[t])}}else if(typeof e=="object"&&e!=null){var i={};for(var n in e)i[n]=BitrixMobile.Utils.htmlspecialchars(e[n]);e=i}return e}};BitrixMobile.fastClick={bindDelegate:function(e,t,i){if(typeof window.BX!="undefined"){var n=BX.delegateEvent(t,i);new FastButton(e,n,true)}else{document.addEventListener("DOMContentLoaded",function(){BitrixMobile.fastClick.bindDelegate(e,t,i)})}},bind:function(e,t){new FastButton(e,t,true)}};BitrixMobile.LazyLoad={images:[],status:{hidden:-2,error:-1,undefined:0,inited:1,loaded:2},types:{image:1,background:2},clearImages:function(){this.images=[]},showImages:function(e){e=e===false?false:true;for(var t=0,i=this.images.length;t<i;t++){var n=this.images[t];if(n.status==this.status.undefined){this._initImage(n)}if(n.status!==this.status.inited){continue}if(!n.node||!n.node.parentNode){n.node=null;n.status=BitrixMobile.LazyLoad.status.error;continue}var a=true;if(e&&n.func){a=n.func(n)}if(a===true&&BitrixMobile.Utils.isElementVisibleOn2Screens(n.node)){if(n.type==BitrixMobile.LazyLoad.types.image){n.node.src=n.src}else{n.node.style.backgroundImage="url('"+n.src+"')"}n.node.setAttribute("data-src","");n.status=this.status.loaded}}},registerImage:function(e,t){if(BX.type.isNotEmptyString(e)){this.images.push({id:e,node:null,src:null,type:null,func:BX.type.isFunction(t)?t:null,status:this.status.undefined})}},registerImages:function(e,t){if(BX.type.isArray(e)){for(var i=0,n=e.length;i<n;i++){this.registerImage(e[i],t)}}},_initImage:function(e){e.status=this.status.error;var t=BX(e.id);if(t){var i=t.getAttribute("data-src");if(BX.type.isNotEmptyString(i)){e.node=t;e.src=i;e.status=this.status.inited;e.type=e.node.tagName.toLowerCase()=="img"?BitrixMobile.LazyLoad.types.image:BitrixMobile.LazyLoad.types.background}}},getImageById:function(e){for(var t=0,i=this.images.length;t<i;t++){if(this.images[t].id==e){return this.images[t]}}return null},removeImage:function(e){for(var t=0,i=this.images.length;t<i;t++){if(this.images[t].id==e){this.images=BX.util.deleteFromArray(this.images,t);break}}},onScroll:function(){BitrixMobile.LazyLoad.showImages()}};window.BitrixAnimation={animate:function(e){if(!e||!e.start||!e.finish||typeof e.start!="object"||typeof e.finish!="object")return null;for(var t in e.start){if(!e.finish[t]){delete e.start[t]}}e.progress=function(e){var t={};for(var i in this.start)t[i]=Math.round(this.start[i]+(this.finish[i]-this.start[i])*e);if(this.step)this.step(t)};return BitrixAnimation.animateProgress(e)},animateProgress:function(e){var t=new Date;var i=e.transition||BitrixAnimation.transitions.linear;var n=e.duration||1e3;var a=setInterval(function(){var o=(new Date-t)/n;if(o>1)o=1;e.progress(i(o));if(o==1){clearInterval(a);e.complete&&e.complete()}},e.delay||13);return a},makeEaseInOut:function(e){return function(t){if(t<.5)return e(2*t)/2;else return(2-e(2*(1-t)))/2}},makeEaseOut:function(e){return function(t){return 1-e(1-t)}},transitions:{linear:function(e){return e},elastic:function(e){return Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*1.5/3*e)},quad:function(e){return Math.pow(e,2)},cubic:function(e){return Math.pow(e,3)},quart:function(e){return Math.pow(e,4)},quint:function(e){return Math.pow(e,5)},circ:function(e){return 1-Math.sin(Math.acos(e))},back:function(e){return Math.pow(e,2)*((1.5+1)*e-1.5)},bounce:function(e){for(var t=0,i=1;1;t+=i,i/=2){if(e>=(7-4*t)/11){return-Math.pow((11-6*t-11*e)/4,2)+Math.pow(i,2)}}}}};document.addEventListener("DOMContentLoaded",function(){BX.addCustomEvent("onFrameDataReceived",function(t){if(t.lang)e.onCustomEvent("onServerLangReceived",t.lang)});BX.addCustomEvent("onServerLangReceived",function(e){if(e){for(var t in e){BX.message[t]=e[t]}}})},false);document.addEventListener("deviceready",function(){if(typeof BXMobileAppContext!="undefined"){BX.addCustomEvent("onAppPaused",function(){BXMobileAppContext.active=false});BX.addCustomEvent("UIApplicationDidBecomeActiveNotification",function(){BXMobileAppContext.active=true});BXMobileAppContext.isAppActive=function(){if(typeof this.active=="undefined"||!e.enableInVersion(16)){this.active=!BXMobileAppContext.isBackground()}return this.active}}e.available=true;BX.addCustomEvent("onSessIdChanged",function(e){BX.message.bitrix_sessid=e.sessid});BXMobileApp.addCustomEvent("onPageParamsChangedLegacy",function(e){if(e.url!=location.pathname+location.search)return false;BXMobileApp.UI.Page.params.set({data:e.data});BX.onCustomEvent("onPageParamsChanged",[e.data]);return true})},false);MobileAjaxWrapper=function(){this.type=null;this.method=null;this.url=null;this.callback=null;this.failure_callback=null;this.progress_callback=null;this.offline=null;this.processData=null;this.xhr=null;this.data=null;this.headers=null};MobileAjaxWrapper.prototype.Init=function(e){if(e.type!="json")e.type="html";if(e.method!="POST")e.method="GET";if(e.processData=="undefined")e.processData=true;this.type=e.type;this.method=e.method;this.url=e.url;this.data=e.data;this.headers=typeof e.headers!="undefined"?e.headers:[];this.processData=e.processData;this.start=e.start;this.preparePost=e.preparePost;this.callback=e.callback;if(e.callback_failure!="undefined")this.failure_callback=e.callback_failure;if(e.callback_progress!="undefined")this.progress_callback=e.callback_progress;if(e.callback_loadstart!="undefined")this.loadstart_callback=e.callback_loadstart;if(e.callback_loadend!="undefined")this.loadend_callback=e.callback_loadend};MobileAjaxWrapper.prototype.Wrap=function(e){this.Init(e);this.xhr=BX.ajax({timeout:30,start:this.start,preparePost:this.preparePost,method:this.method,dataType:this.type,url:this.url,data:this.data,headers:this.headers,processData:this.processData,onsuccess:BX.defer(function(e){var t=false;if(this.xhr.status===0){t=true}else if(this.type=="json"){t=typeof e=="object"&&typeof e.status!="undefined"&&e.status=="failed"}else if(this.type=="html"){t=e=='{"status":"failed"}'}if(t){this.RepeatRequest()}else{this.callback(e)}},this),onfailure:BX.delegate(function(e,t){if(e!==undefined&&e=="status"&&t!==undefined&&t==401){this.RepeatRequest()}else{this.failure_callback()}},this)});if(this.progress_callback!=null)BX.bind(this.xhr,"progress",this.progress_callback);if(this.load_callback!=null)BX.bind(this.xhr,"load",this.load_callback);if(this.loadstart_callback!=null)BX.bind(this.xhr,"loadstart",this.loadstart_callback);if(this.loadend_callback!=null)BX.bind(this.xhr,"loadend",this.loadend_callback);if(this.error_callback!=null)BX.bind(this.xhr,"error",this.error_callback);if(this.abort_callback!=null)BX.bind(this.xhr,"abort",this.abort_callback);return this.xhr};MobileAjaxWrapper.prototype.RepeatRequest=function(){e.BasicAuth({success:BX.delegate(function(e){this.data.sessid=e.sessid_md5;this.xhr=BX.ajax({timeout:30,method:this.method,dataType:this.type,url:this.url,data:this.data,onsuccess:BX.delegate(function(e){if(this.xhr.status===0)var t=true;else if(this.type=="json"){var t=typeof e=="object"&&typeof e.status!="undefined"&&e.status=="failed"}else if(this.type=="html")var t=e=='{"status":"failed"}';if(t)this.failure_callback();else this.callback(e)},this),onfailure:BX.delegate(function(){this.failure_callback()},this)})},this),failture:BX.delegate(function(){this.failure_callback()},this)})};MobileAjaxWrapper.prototype.OfflineAlert=function(e){navigator.notification.alert(BX.message("MobileAppOfflineMessage"),e||BX.DoNothing,BX.message("MobileAppOfflineTitle"))};BMAjaxWrapper=new MobileAjaxWrapper;MobileNetworkStatus=function(){this.offline=null;var e=this;document.addEventListener("offline",function(){e.offline=true},false);document.addEventListener("online",function(){e.offline=false},false);document.addEventListener("DOMContentLoaded",function(){BX.addCustomEvent("UIApplicationDidBecomeActiveNotification",function(t){var i=navigator.network.connection.type;e.offline=i==Connection.UNKNOWN||i==Connection.NONE})},false)};BMNetworkStatus=new MobileNetworkStatus})();(function(){function e(e,t,i,n){if(e.addEventListener){e.addEventListener(t,i,n);return{destroy:function(){e.removeEventListener(t,i,n)}}}else{var a=function(e){i.handleEvent(window.event,i)};e.attachEvent("on"+t,a);return{destroy:function(){e.detachEvent("on"+t,a)}}}}var t=true;this.FastButton=function(i,n,a){this.events=[];this.touchEvents=[];this.element=i;this.handler=n;this.useCapture=a;if(t)this.events.push(e(i,"touchstart",this,this.useCapture));this.events.push(e(i,"click",this,this.useCapture))};this.FastButton.prototype.destroy=function(){for(i=this.events.length-1;i>=0;i-=1)this.events[i].destroy();this.events=this.touchEvents=this.element=this.handler=this.fastButton=null};this.FastButton.prototype.handleEvent=function(e){switch(e.type){case"touchstart":this.onTouchStart(e);break;case"touchmove":this.onTouchMove(e);break;case"touchend":this.onClick(e);break;case"click":this.onClick(e);break}};this.FastButton.prototype.onTouchStart=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=true;this.touchEvents.push(e(this.element,"touchend",this,this.useCapture));this.touchEvents.push(e(document.body,"touchmove",this,this.useCapture));this.startX=t.touches[0].clientX;this.startY=t.touches[0].clientY};this.FastButton.prototype.onTouchMove=function(e){if(Math.abs(e.touches[0].clientX-this.startX)>10||Math.abs(e.touches[0].clientY-this.startY)>10){this.reset()}};this.FastButton.prototype.onClick=function(e){this.reset();var t=this.handler.call(this.element,e);if(t!==null){e.preventDefault();e.stopPropagation?e.stopPropagation():e.cancelBubble=true}if(e.type=="touchend")clickbuster.preventGhostClick(this.startX,this.startY);return t};this.FastButton.prototype.reset=function(){for(i=this.touchEvents.length-1;i>=0;i-=1)this.touchEvents[i].destroy();this.touchEvents=[]};this.clickbuster=function(){};this.clickbuster.preventGhostClick=function(e,t){clickbuster.coordinates.push(e,t);window.setTimeout(clickbuster.pop,2500)};this.clickbuster.pop=function(){clickbuster.coordinates.splice(0,2)};this.clickbuster.onClick=function(e){for(var t=0;t<clickbuster.coordinates.length;t+=2){var i=clickbuster.coordinates[t];var n=clickbuster.coordinates[t+1];if(Math.abs(e.clientX-i)<25&&Math.abs(e.clientY-n)<25){e.stopPropagation?e.stopPropagation():e.cancelBubble=true;e.preventDefault?e.preventDefault():e.returnValue=false}}};if(t){document.addEventListener("click",clickbuster.onClick,true);clickbuster.coordinates=[]}})(this);function ReadyDevice(e){if(app.available==true&&typeof e=="function"){e()}else{document.addEventListener("deviceready",e,false)}}