/* (c) BibleOnline.RU -- ver 2.7.12 -- Installation of this code https://ref.bble.ru/ */(function(w){var bibleRef={conf:{ToolTip:{width:300,height:150,timeout:10,hideTime:0.3,},Translate:'rus',Target:'blank',Site:'bibleonline.ru',CSS:'https://api.bibleonline.ru/ref/style.css',ToolTipUse:true,VSeparator:':.',RSeparator:',',CSeparator:';',BibleClass:'bibleref',NoBibleClass:'nobibleref',NoTags:['h1','h2','h3','h4','h5','h6'],},xcpt:{A:true,APPLET:true,BODY:true,HEAD:true,HR:true,IMG:true,INPUT:true,META:true,OPTION:true,SCRIPT:true,SELECT:true,TEXTAREA:true},nid:0,init:function(){if(bibleRef.conf.NoTags){var nt=bibleRef.conf.NoTags;for(var i=0;i)','gi');var els=[document.body];var r_bibleclass=new RegExp('(?:^|\\s)'+bibleRef.conf.BibleClass+'(?:\\s|$)',"i");var r_nobibleclass=new RegExp('(?:^|\\s)'+bibleRef.conf.NoBibleClass+'(?:\\s|$)',"i");for(var r=regexp;el=els.pop();) {if(el.nodeType===3){var ee=el.nodeValue.match(r);var res;var pn=el.parentNode;if(pn&&pn.className.length>0&&pn.className.match(r_bibleclass)&&pn.title.length>0&&pn.title.match(r)){res='title';e=pn.title.match(r);j=0;elR=el.nodeValue;lnk=e[0];if(/^[^a-zа-я\.]$/i.test(lnk.substr(0,1)))lnk=lnk.substr(1,lnk.length-1);bble=bibleRef.bblLink(lnk,elR,++nid);el.nodeValue='';if(bble.innerHTML){el===pn.lastChild?pn.appendChild(bble):pn.insertBefore(bble,lnk);el=lnk;}}else if(e=el.nodeValue.match(r)){res='value';j=0;for(i=e.length;jhighest)) {highest=Math.round(zindex);}} highest=highest+1;bibleRef.conf.ToolTip.zindex=highest;return bibleRef.conf.ToolTip.zindex;},showToolTip:function(e,t){var data;var ct=bibleRef.conf.ToolTip;clearTimeout(bibleRef.status.hideTimer);var el=document.getElementById(t.id);var rst=t.getAttribute('text')||t.innerHTML;if(bibleRef.marker[t.id]){var b=bibleRef.marker[t.id];if(b.length==0||(b.status&&b.status=='failed')){var d=document.getElementById('BibleOnlineToolTip');clearTimeout(bibleRef.status.hideTimer);d.style.visibility='hidden';return;} var d=document.getElementById('BibleOnlineToolTipContent');if(d){d.innerHTML='';d.innerHTML='';document.getElementById('BibleOnlineToolTip').style.visibility="visible";if(b.status&&b.status=='failed'){d.innerHTML='
К сожалению, загрузить отрывок не удалось
'} var ctitle='';for(var i=0;i'+ctitle+"";}else if(b[i].v){d.innerHTML+=' '+''+b[i].v.n+' '+b[i].v.t+'';}} var more=document.getElementById('BibleOnlineToolTipMore');more.href='https://bble.ru/'+bibleRef.fixLink(rst)+'?'+bibleRef.conf.Translate;}}else{var f="https://api.bibleonline.ru/ref/get/";var q=bibleRef.fixLink(rst).replace(/([^\+\,\;\$\.%a-z0-9]+)/ig,function(match,c){return encodeURIComponent(c)});f+=f.indexOf("?")>-1?"&callback=":"?callback=";f+="bibleRef.loaded";f+="&q="+q;f+="&marker="+t.id;f+="&trans="+bibleRef.conf.Translate;var b=document.getElementsByTagName("head")[0];var k=document.createElement("script");k.setAttribute("id",'script-'+t.id);k.setAttribute("src",f);k.setAttribute("charset","utf-8");k.setAttribute("type","text/javascript");setTimeout(function(){bibleRef.marker[t.id]||bibleRef.requestFailed(t.id)},1000*bibleRef.conf.ToolTip.timeout);setTimeout(function(){bibleRef.showToolTip(e,t);},100);if(k.addEventListener){k.addEventListener("load",bibleRef.requestFinished(t.id),false);}else{k.attachEvent("onload",bibleRef.requestFinished(t.id));} if(!document.getElementById('script-'+t.id)) {b.appendChild(k);} if(!document.getElementById('BibleOnlineToolTip')) {c=document.createElement("div");c.id='BibleOnlineToolTip';c.setAttribute("ref",t.id);c.className="BibleOnlineRefTooltip";c.style.position="absolute";c.style.visibility="hidden";c.style.overflow="auto";c.style.zIndex=bibleRef.zIndex();c.style.width=ct.width+'px';c.style.height=ct.height+'px';c.innerHTML='
';document.body.appendChild(c);c.onmouseover=function(){clearTimeout(bibleRef.status.hideTimer);};c.onmouseout=function(){var d=document.getElementById('BibleOnlineToolTip');if(d&&d.style.visibility=="visible"){clearTimeout(bibleRef.status.hideTimer);bibleRef.status.hideTimer=setTimeout(function(){d.style.visibility='hidden';},bibleRef.conf.ToolTip.hideTime*1000)}};} c=document.getElementById('BibleOnlineToolTipContent');c.innerHTML='
Loading...
';} if(c=document.getElementById('BibleOnlineToolTip')){var cc=document.getElementById('BibleOnlineToolTipContent');c.style.width=ct.width+'px';c.style.height=ct.height+'px';cc.style.width=ct.width+'px';cc.style.height=Math.round(ct.height-20)+'px';if(cc.scrollHeight-cc.scrollTop>cc.clientHeight){var bigger=cc.scrollHeight-cc.scrollTop>cc.clientHeight;for(var i=1;i<100&&bigger;i++){bigger=cc.scrollHeight-cc.scrollTop>cc.clientHeight;var cid=Math.round(100+i)/100;c.style.width=Math.round(cid*ct.width)+'px';c.style.height=Math.round(cid*ct.height)+'px';cc.style.width=Math.round(cid*ct.width)+'px';cc.style.height=Math.round(cid*ct.height-20)+'px';}} var tbc=document.getElementById(t.id).getBoundingClientRect();var body=document.body;var docElem=document.documentElement;var scrollTop=window.pageYOffset||docElem.scrollTop||body.scrollTop;var scrollLeft=window.pageXOffset||docElem.scrollLeft||body.scrollLeft;var clientTop=docElem.clientTop||body.clientTop||0;var clientLeft=docElem.clientLeft||body.clientLeft||0;var wWidth=0,wHeight=0;if(window.innerWidth)wWidth=window.innerWidth;else if(docElem&&docElem.clientWidth)wWidth=docElem.clientWidth;else if(body&&body.clientWidth)wWidth=body.clientWidth;if(window.innerHeight)wHeight=window.innerHeight;else if(docElem&&docElem.clientHeight)wHeight=docElem.clientHeight;else if(body&&body.clientHeight)wHeight=body.clientHeight;var cTop=Math.round(tbc.bottom+scrollTop-clientTop);var cBottom=Math.round(tbc.top+scrollTop-clientTop);var cLeft=Math.round(tbc.left+scrollLeft-clientLeft);if(cLeft+c.offsetWidth+40>=wWidth)cLeft=wWidth-c.offsetWidth-40;if(cTop+cc.offsetHeight+10>=wHeight+scrollTop-clientTop){cTop=2*cBottom-cTop-cc.offsetHeight;if(cTop<=10)cTop=10} c.style.left=cLeft+'px';c.style.top=cTop+'px';}},marker:{},status:{hideTimer:null,lastToolTip:null},requestFailed:function(tid){if(bibleRef.marker[tid]){return} bibleRef.removeScript(tid);bibleRef.marker[tid]={status:'failed'};var c=document.getElementById('BibleOnlineToolTipContent') if(c&&c.getAttribute("ref")==tid) {c.innerHTML='
К сожалению, загрузить отрывок не удалось
';}},removeScript:function(s){var sc=document.getElementById('script-'+s);if(sc)sc.parentNode.removeChild(sc);},requestFinished:function(tid){setTimeout(function(){if(!bibleRef.marker[tid])bibleRef.requestFailed(tid)},500)},loaded:function(r){bibleRef.marker[r.marker]=r.data;bibleRef.removeScript(r.marker);if(bibleRef.status.lastToolTip&&bibleRef.status.lastToolTip[1].id==r.marker){bibleRef.showToolTip(bibleRef.status.lastToolTip[0],bibleRef.status.lastToolTip[1])}},loadStyle:function() {if(bibleRef.conf.CSS&&/\S/.test(bibleRef.conf.CSS)) {var dh=document.getElementsByTagName("head")[0],st=document.createElement("link");st.type="text/css";st.rel="stylesheet";st.href=bibleRef.conf.CSS;dh.insertBefore(st,dh.firstChild);}},configure:function(i,item){bibleRef.conf[i]=item;}};w.bibleRef={loaded:bibleRef.loaded,conf:bibleRef.configure,rebuild:bibleRef.init};if(w.addEventListener){w.addEventListener("load",function(){bibleRef.init()},false);}else if(w.attachEvent){w.attachEvent("onload",function(){bibleRef.init()});}})(window);