bg_links={sites:location.hostname,version:1,click_tooltip:false,apocrypha:false,related_content:false,show_tooltips:true,book_string:"zanafilla|eksodi|levitiku|numrat|ligji i perterire|jozueu|gjyqtaret|ruthi|1 i samuelit|2 i samuelit|1 i mbreterve|2 i mbreterve|1 i kronikave|2 i kronikave|esdra|nehemia|ester|jobi|psalmet|fjalet e urta|predikuesi|kantiku i kantikeve|isaia|jeremia|vajtimet|ezekieli|danieli|osea|joeli|amosi|abdia|jona|mikea|nahumi|habakuku|sofonia|hagai|zakaria|malakia|mateu|marku|luka|gjoni|veprat e apostujve|romakeve|1 e korintasve|2 e korintasve|galatasve|efesianeve|filipianeve|kolosianeve|1 thesalonikasve|2 thesalonikasve|1 timoteut|2 timoteut|titi|filemonit|hebrenjve|jakobit|1 pjetrit|2 pjetrit|1 gjonit|2 gjonit|3 gjonit|juda|zbulesa|genesis|gen?|gn|exodus|exod?|ex|leviticus|le?v|numbers|nu?m|nu|deuteronomy|deut?|dt|josh?ua|josh?|jsh|judges|ju?dg|jg|ru(?:th)?|ru?t|(?:1|i|2|ii) ?samuel|(?:1|i|2|ii) ?s(?:a|m)|(?:1|i|2|ii) ?sam|(?:1|i|2|ii) ?kin(?:gs?)?|(?:1|i|2|ii) ?kgs|(?:1|i|2|ii) ?chronicles|(?:1|i|2|ii) ?chr(?:o?n)?|(?:1|i|2|ii) ?cr|ezra?|nehemiah|neh?|esther|esth?|jo?b|psalms?|psa?|proverbs|pro?v?|ecclesiastes|ec(?:cl?)?|song of solomon|song of songs?|son(?:gs?)?|ss|isaiah?|isa?|jeremiah|je?r|lamentations|la(?:me?)?|ezekiel|eze?k?|daniel|da?n|da|hosea|hos?|hs|jo(?:el?)?|am(?:os?)?|obadiah|ob(?:ad?)?|jon(?:ah?)?|jnh|mic(?:ah?)?|mi|nah?um|nah?|habakkuk|hab|zephaniah|ze?ph?|haggai|hagg?|hg|zechariah|ze?ch?|malachi|ma?l|matthew|matt?|mt|mark|ma(?:r|k)|m(?:r|k)|luke?|lk|lu?c|john|jn|ac(?:ts?)?|romans|ro?m|(?:1|i|2|ii) ?corinthians|(?:1|i|2|ii) ?c(?:or?)?|galatians|gal?|gl|ephesians|eph?|philippians|phil|colossians|co?l|(?:1|i|2|ii) ?thessalonians|(?:1|i|2|ii) ?th(?:e(?:ss?)?)?|(?:1|i|2|ii) ?timothy|(?:1|i|2|ii) ?tim|(?:1|i|2|ii) ?t(?:i|m)|ti(?:tus)?|ti?t|philemon|phl?m|hebrews|heb?|jam(?:es)?|jms|jas|(?:1|i|2|ii) ?peter|(?:1|i|2|ii) ?pe?t?|(?:1|i|2|ii|3|iii) ?j(?:oh)?n?|jude?|revelations?|rev|r(?:e|v)",apoc_books:"|tobit?|to?b|judi(?:th?)?|jdt|(?:1|2) ?mac(?:cabees)?|(?:1|2) ?ma?|wi(?:sdom)?|wi?s|sir(?:ach)?|ba(?:rac?h)?|ba?r",find_verses:function(){this.traverse_nodes(document.body);this.bibleref_to_link();if(this.show_tooltips===true){this.add_css();this.add_bibleref_listeners();if(this.click_tooltip===true){this.add_listener(document.body,"click",this.hide_all_tooltips)}}},traverse_nodes:function(c){if(c.nodeType===3){var d=bg_links.search_node(c,0);return d}else{if(c.tagName!=undefined&&c.tagName.match(/^(?:a|h\d|img|pre|input|option)$/i)){return 0}else{var b=c.childNodes;var a=0;while(a<b.length){var d=bg_links.traverse_nodes(b[a]);a+=d+1}}}return 0},search_node:function(c,b){var l=bg_links.book_string;var i="";if(this.apocrypha===true){i=bg_links.apoc_books}var a="(?:"+l+i+")(?:.)? ?\\d+:\\d+(?:ff|f|\\w)?(?:\\s?(?:(?:(?:-|–|—)\\s?(?:(?:"+l+i+")(?:.)?\\s)?)|(?:(?:,|;|&amp;|&|and|cf\\.|cf)))\\s?(?:(?:(?:vv.|vs.|vss.|v.) ?)?\\d+\\w?)(?::\\d+\\w?)?)*";var j=new RegExp(a,"i");var h=c.nodeValue.match(j);if(h==null){return b}else{var k=c.nodeValue;var f=k.substr(0,k.indexOf(h[0]));var e=k.substr(k.indexOf(h[0])+h[0].length);if(f.length>0){var d=document.createTextNode(f);c.parentNode.insertBefore(d,c);b++}var g=document.createElement("cite");g.className="bibleref";g.innerHTML=h[0];c.parentNode.insertBefore(g,c);if(e.length>0){var d=document.createTextNode(e);c.parentNode.insertBefore(d,c);c.parentNode.removeChild(c);b=this.search_node(d,b+1)}else{c.parentNode.removeChild(c)}}return b},bibleref_to_link:function(){var o=bg_links.book_string;var l="";if(bg_links.apocrypha===true){l=bg_links.apoc_books}book_chap="((?:("+o+l+")(?:.)? ?)?(?:(\\d*):)?(\\d+(?:(?:ff|f|\\w)|(?:\\s?(?:-|–|—)\\s?\\d+)?)))([^a-z0-9]*)";var m=document.getElementsByTagName("cite");for(var h=0;h<m.length;h++){if(m[h].className!="bibleref"){continue}var a=new RegExp(book_chap,"gi");var d;var c;var n;var k=false;while(matched=a.exec(m[h].innerHTML)){k=true;if(matched[2]!=""&&matched[2]!=null){d=matched[2]}if(matched[3]!=""&&matched[3]!=null){c=matched[3]}n=matched[4];var j=document.createElement("a");j.className="bibleref";j.target="_BLANK";var f=d+" "+c+":"+n;j.href="http://www.biblegateway.com/passage/?search="+f+"&version="+bg_links.version+"&src=tools";j.innerHTML=matched[1];if(this.click_tooltip===true){j.onclick=function(){return false}}m[h].parentNode.insertBefore(j,m[h]);if(matched[6]!=""){var e=document.createTextNode(matched[5]);m[h].parentNode.insertBefore(e,m[h])}}var o=bg_links.book_string;var l="";if(this.apocrypha===true){l=bg_links.apoc_books}var b="(?:"+o+l+")(?:.)? ?\\d+:\\d+(?:ff|f|\\w)?(?:;?\\s?(?:(?:(?:-|–|—)\\s?(?:(?:"+o+l+")(?:.)?\\s)?)|(?:(?:,|&amp;|&|and|cf\\.|cf)))\\s?(?:(?:(?:vv.|vs.|vss.|v.) ?)?\\d+\\w?)(?::\\d+\\w?)?)*";var g=new RegExp(b,"gi");while(m[h].title!=undefined&&(matched=g.exec(m[h].title))){k=true;var j=document.createElement("a");j.className="bibleref";j.target="_BLANK";j.href="http://www.biblegateway.com/passage/?search="+matched[0]+"&version="+bg_links.version;j.innerHTML=m[h].innerHTML;if(this.click_tooltip===true){j.onclick=function(){return false}}m[h].parentNode.insertBefore(j,m[h])}if(k===true){m[h].parentNode.removeChild(m[h]);h--}}},add_css:function(){var a=navigator.appVersion;var b=document.createElement("link");b.type="text/css";b.rel="stylesheet";if(a.search("MSIE 6.0")!=-1){bg_links.browser="ie6";b.href="http://tools.biblegateway.com/css/bglinks-ie.css"}else{b.href="http://tools.biblegateway.com/css/bglinks.css"}b.media="screen";var c=document.getElementsByTagName("head")[0].childNodes[0];c.parentNode.insertBefore(b,c)},add_bibleref_listeners:function(){var a=document.getElementsByTagName("a");for(var b=0;b<a.length;b++){var c=a[b];if(c.className&&c.className=="bibleref"){if(this.click_tooltip!==true){this.add_listener(c,"mouseover",this.show_tooltip);this.add_listener(c,"mouseout",this.hide_tooltip)}else{this.add_listener(c,"click",this.toggle_tooltip)}}}},add_listener:function(a,b,c){if(a.addEventListener){if(b=="mouseover"){a.addEventListener("mouseover",c,false)}else{if(b=="mouseout"){a.addEventListener("mouseout",c,false)}else{if(b=="click"){a.addEventListener("click",c,false)}}}}else{if(a.attachEvent){if(b=="mouseover"){a.attachEvent("onmouseover",c)}else{if(b=="mouseout"){a.attachEvent("onmouseout",c)}else{if(b=="click"){a.attachEvent("onclick",c)}}}}else{if(b=="mouseover"){a.onmouseover=c}else{if(b=="mouseout"){a.onmouseout=c}else{if(b=="click"){a.onclick=c}}}}}},toggle_tooltip:function(c){if(!c){c=window.event}link=c.target||c.srcElement;var a=link.href.match(/search=(.*?)(?:&.*)?$/)[1];var d=a.replace(/%20/g,"");var d=a.replace(/:/g,"_");var b=document.getElementById("bg_popup-"+d);if(b===null||b.style.display=="none"){bg_links.show_tooltip(c)}else{bg_links.hide_tooltip(c)}},show_tooltip:function(c){bg_links.hide_all_tooltips();if(!c){c=window.event}link=c.target||c.srcElement;var a=link.href.match(/search=(.*?)(?:&.*)?$/)[1];var d=a.replace(/%20/g,"");d=d.replace(/:/g,"_");d=d.replace(/ /g,"");var b=document.getElementById("bg_popup-"+d);if(b===null){b=bg_links.get_tooltip(a,link)}else{tooltip_loc=bg_links.tooltip_location(link);b.isOver=true;b.style.left=tooltip_loc.offsetX+"px";b.style.top=tooltip_loc.offsetY+"px";b.arrow_loc=tooltip_loc.arrow_loc;if(bg_links.browser!="ie6"){b=bg_links.display_arrow(b,b.arrow_loc)}setTimeout(function(){if(b.isOver===true){b.style.display="block"}},200)}},hide_tooltip:function(c){if(!c){c=window.event}link=c.target||c.srcElement;var a=link.href.match(/search=(.*?)(?:&.*)?$/)[1].replace(/%20/g,"");a=a.replace(/ /g,"");a=a.replace(/:/g,"_");var b=document.getElementById("bg_popup-"+a);if(b){b.isOver=false;setTimeout(function(){if(b.isOver!==true){b.style.display="none"}},200)}},hide_all_tooltips:function(d){if(d!=null){var c=d.target||d.srcElement;if(c.className!=null&&c.className=="bibleref"){return}while(c.tagName!="BODY"){if(c.className!=null&&c.className=="bg_popup-header_right"){break}if(c.className!=null&&c.className=="bg_popup"){return}c=c.parentNode}}var b=document.getElementsByTagName("div");for(var a=0;a<b.length;a++){if(b[a].className=="bg_popup"){b[a].style.display="none"}}},tooltip_mouseover:function(b){if(!b){b=window.event}var a=b.target||b.srcElement;while(a.className!="bg_popup"){a=a.parentNode}a.isOver=true},tooltip_mouseout:function(b){if(!b){b=window.event}var a=b.target||b.srcElement;while(a.className!="bg_popup"){a=a.parentNode}a.isOver=false;setTimeout(function(){if(a.isOver!==true){a.style.display="none"}},200)},get_tooltip:function(a,e){var f=document.createElement("div");f.style.display="none";f.className="bg_popup";var d=this.tooltip_location(e);f.arrow_loc=d.arrow_loc;f.style.top=d.offsetY+"px";f.style.left=d.offsetX+"px";f.isOver=true;var g="bg_popup-"+a.replace(/%20/g,"");g=g.replace(/:/g,"_");g=g.replace(/ /g,"");f.id=g;f.innerHTML="<div class='bg_popup-header'><div class='bg_popup-small_bible_color'></div><div class='bg_popup-header_left'></div><div class='bg_popup-header_middle'></div><div class='bg_popup-header_right'></div><div class='bg_popup-header_title'><p><strong>Referimi Biblik: "+a.replace(/%20/g," ")+"</strong></p></div></div><div class='bg_popup-content'><div class='bg_popup-left_shadow'></div><div class='bg_popup-right_shadow'></div><div class='bg_popup-spinner'><img alt='loading' src='http://static.bgcdn.com/images/tools/spinner.gif'/></div></div><div class='bg_popup-footer'><div style='height: 39px; width: 348px;'><a href='http://www.biblegateway.com' target='_BLANK'><div class='bg_popup-BGlogo-light'></div><div class='bg_popup-BGlogo-dark'></div></a><div class='bg_popup-corner_spacer'>&nbsp</div></div></div><div class='bg_popup-right_corner'>&nbsp;</div><div class='bg_popup-left_corner'>&nbsp;</div><div class='bg_popup-bottom_shadow'></div>";setTimeout(function(){if(f.isOver===true){bg_links.hide_all_tooltips();f.style.display="block"}},200);bg_links.add_close_button(f);f=document.body.appendChild(f);if(this.click_tooltip!==true){this.add_listener(f,"mouseover",this.tooltip_mouseover);this.add_listener(f,"mouseout",this.tooltip_mouseout)}var b=document.createElement("script");b.type="text/javascript";b.src="http://tools.biblegateway.com/json/passage.php5?search="+a+"&version="+this.version;b.id="bg_remote_passage_script-"+a.replace(/%20/g,"");b.id=b.id.replace(/:/g,"_");b.id=b.id.replace(/ /g,"");document.getElementsByTagName("html")[0].appendChild(b);if(this.related_content==true){var c=document.createElement("script");c.type="text/javascript";c.src="http://tools.biblegateway.com/json/related.php5?search="+a+"&sites="+this.sites;c.id="bg_remote_related_script-"+a.replace(/%20/g,"");c.id=c.id.repla
ce(/:/g,"_");c.id=c.id.replace(/ /g,"");document.getElementsByTagName("html")[0].appendChild(c)}return f},add_tooltip:function(h){var d="";var g="bg_popup-"+h.reference.replace(/%20/g,"");g="bg_popup-"+h.reference.replace(/:/g,"_");g=g.replace(/ /g,"");var e=document.getElementById(g);var a=h.reference_display.replace(/%20/g," ");if(h.text==undefined){if(e.text==undefined){h.text="Retrieving Passage..."}else{h.text=e.text;a=e.reference_display}}else{if(bg_links.related_content===true){if(h.text.length>200){h.text=h.text.replace(/^(.{0,200})\s.*$/,"$1");h.text+="..."}}e.text=h.text;e.reference_display=a}if(h.related==undefined){if(e.related==undefined){h.related="retreiving"}else{h.related=e.related}}else{e.related=h.related}e.isOver=true;if(h.related=="none"){d="<p>No Results found</p>"}else{if(h.related=="retreiving"){d="<p>Retreiving Related Content...</p>"}else{if(h.related!="false"){var b=h.related;for(var c=0;c<h.related.length;c++){if(b[c].yabstract.length>50){b[c].yabstract=b[c].yabstract.replace(/^(.{0,50})\s.*$/,"$1");if(b[c].yabstract.substr(-7,3)!="..."){b[c].yabstract+="..."}}var f=b[c].title.replace(/<.*?>/g,"");if(f.length>20){f=f.substr(0,20)+"..."}d+="<p><a href='"+b[c].url+"' target='_BLANK'>"+f+"</a><br />"+b[c].yabstract+"</p>"}}}}if(bg_links.related_content!==false){e.innerHTML="<div class='bg_popup-header'><div class='bg_popup-small_bible_color'></div><div class='bg_popup-header_left'></div><div class='bg_popup-header_middle'></div><div class='bg_popup-header_right'></div><div class='bg_popup-header_title'><p><strong>Referimi Biblik: "+a+"</strong></p></div></div><div class='bg_popup-content'><div class='bg_popup-left_shadow'></div><div class='bg_popup-right_shadow'></div><div style='float: left;' class='bg_popup-content-bible'><p><strong><a href='http://www.biblegateway.com/passage/?search="+h.reference+"&version="+bg_links.version+"&src=tools' target='_BLANK'>"+a+"</a></strong><br>  "+h.text+"<br></p> <p> <a class='bg_popup-more' href='http://www.biblegateway.com/passage/?search="+h.reference+"&version="+bg_links.version+"&src=tools' target='_BLANK'>Me shume</a></p></div><div style='float: right;' class='bg_popup-content-related'><p><strong>Related Content</strong><br></p>"+d+"</div></div><div class='bg_popup-footer'><div style='height: 39px; width: 348px;'><a href='http://www.biblegateway.com' target='_BLANK'><div class='bg_popup-BGlogo-light'>&nbsp;</div><div class='bg_popup-BGlogo-dark'>&nbsp;</div></a><div class='bg_popup-corner_spacer'>&nbsp;</div></div></div><div class='bg_popup-right_corner'></div><div class='bg_popup-left_corner'></div><div class='bg_popup-bottom_shadow'></div>"}else{e.innerHTML="<div class='bg_popup-header'><div class='bg_popup-small_bible_color'></div><div class='bg_popup-header_left'></div><div class='bg_popup-header_middle'></div><div class='bg_popup-header_right'></div><div class='bg_popup-header_title'><p><strong>Referimi Biblik: "+a+"</strong></p></div></div><div class='bg_popup-content'><div class='bg_popup-left_shadow'></div><div class='bg_popup-right_shadow'></div><div style='float: left;width:340px;' class='bg_popup-content-bible'><p><strong>"+a+"</strong><br> "+h.text+"<br></p> <p>  <a bg_popup-more' href='http://www.biblegateway.com/passage/?search="+h.reference+"&version="+bg_links.version+"&src=tools' target='_BLANK'>Me shume</a></p></div></div><div class='bg_popup-footer'><div style='height: 39px; width: 348px;'><a href='http://www.biblegateway.com' target='_BLANK'><div class='bg_popup-BGlogo-light'>&nbsp</div><div class='bg_popup-BGlogo-dark'>&nbsp;</div></a><div class='bg_popup-corner_spacer'>&nbsp;</div></div></div><div class='bg_popup-right_corner'></div><div class='bg_popup-left_corner'></div><div class='bg_popup-bottom_shadow'></div>"}if(bg_links.browser!="ie6"){e=this.display_arrow(e,e.arrow_loc)}bg_links.add_close_button(e);this.add_listener(e,{over:this.tooltip_mouseover,out:this.tooltip_mouseout})},display_arrow:function(d,a){var c=d.getElementsByTagName("div");for(var b=0;b<c.length;b++){if(c[b].className=="bg_popup-header_left"){if(a=="l"){c[b].style.background="transparent url(http://static.bgcdn.com/images/tools/StaticSprites.png) repeat scroll 0 -75px";c[b].style.height="41px";c[b].style.width="48px";c[b].style.top="0"}else{c[b].style.background="transparent url(http://static.bgcdn.com/images/tools/StaticSprites.png) no-repeat scroll 0 -40px";c[b].style.height="35px";c[b].style.width="48px";c[b].style.top="6px"}}else{if(c[b].className=="bg_popup-header_right"){if(a=="r"){c[b].style.background="transparent url(http://static.bgcdn.com/images/tools/StaticSprites.png) repeat scroll -48px -75px";c[b].style.height="41px";c[b].style.width="48px";c[b].style.top="0"}else{c[b].style.background="transparent url(http://static.bgcdn.com/images/tools/StaticSprites.png) no-repeat scroll -48px -40px";c[b].style.height="35px";c[b].style.width="49px";c[b].style.top="6px"}}}}return d},add_close_button:function(c){var b=c.getElementsByTagName("div");for(var a=0;a<b.length;a++){if(b[a].className=="bg_popup-header_right"){this.add_listener(b[a],"click",this.hide_all_tooltips)}}},tooltip_location:function(e){var h=250;var b=350;if(typeof(window.innerWidth)=="number"){width=window.innerWidth;height=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){width=document.documentElement.clientWidth;height=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){width=document.body.clientWidth;height=document.body.clientHeight}}}var a={};var f=bg_links.getOffsetPos(e);var d=f.leftPos;var c=f.topPos;if(e.offsetWidth/e.parentNode.offsetWidth>0.5){d=bg_links.getOffsetPos(e.parentNode);d=d.leftPos}if((d+b+5)>width){a.arrow_loc="r";d-=b;if((d+b+e.offsetWidth)<=width){d+=e.offsetWidth}if(d+b+25<=width){d+=25}else{a.arrow_loc="none"}if(d-(e.offsetWidth/2)>=0){d-=(e.offsetWidth/2)}}else{a.arrow_loc="l";if(d+(e.offsetWidth/2)<=width&&e.offsetWidth/e.parentNode.offsetWidth<=0.5){d+=(e.offsetWidth/2)}if(d-35>=0){d-=35}else{a.arrow_loc="none"}}var g=window.pageYOffset||document.documentElement.scrollTop||0;if((c+e.offsetHeight+h+15)<=height+g||c-h+5<0){c+=e.offsetHeight}else{c-=h+5;a.arrow_loc="none"}a.offsetY=c;a.offsetX=d;return(a)},getOffsetPos:function(d){var a=d.offsetTop;var b=d.offsetLeft;while((d=d.offsetParent)!=null){if(d.tagName!="HTML"){a+=d.offsetTop;b+=d.offsetLeft;if(document.all){a+=d.clientTop;b+=d.clientLeft}}}var c=new Object;c.topPos=a;c.leftPos=b;return(c)}};
