var TOOLBAR_URL="/toolbar";var SLIDE_RATE=30;var TAGBOX_PROMPT="Tag this page";var tagURL="/toolbar";var clearTagBox=true;var timer=null;var processingEvent=false;var tagXHR=null;var bubble=null;var bubbleTimer=null;if(self.addLoadEvent&&isDefined("window","preferences")){addLoadEvent(restoreToolbarPrefs)}function restoreToolbarPrefs(){var A=document.getElementById("controlbox");var D=document.getElementById("hideButton");var C=document.getElementById("edit-txtTag");if(C&&!C.disabled){C.value=TAGBOX_PROMPT}if(isIE6){window.onscroll=updatePosition;window.onresize=updatePosition;A.style.position="absolute";A.style.left="0px";updatePosition()}else{A.style.position="fixed"}if(uid==0){preferences["toolbar"]=getCookie("toolbar","1");preferences["popup"]=getCookie("popup","ASV");var B=document.getElementById("selPopupVersion");B.value=preferences["popup"]}if(preferences["toolbar"]==0){A.style.left=-A.offsetWidth+D.offsetWidth+8+"px";D.value=">";D.onclick=function(){slideControlBox("in")}}getPrevNextLinks();A.style.visibility="visible"}function getPrevNextLinks(){var F=document.getElementsByName("prevNav");var E=document.getElementsByName("nextNav");var D=document.getElementById("prevBtn");var B=document.getElementById("nextBtn");var C=document.getElementById("prevLink");var A=document.getElementById("nextLink");if(F[0]==undefined||E[0]==undefined){D.src="http://static.ccel.org/pix/tb_prev-gray.png";B.src="http://static.ccel.org/pix/tb_next-gray.png"}else{C.href=F[0].href;A.href=E[0].href}}function getCookie(C,E){var D=document.cookie.indexOf(C+"=");var A=D+C.length+1;if(!D&&C!=document.cookie.substring(0,C.length)){return E}if(D==-1){return E}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(A,B))}function setCookie(C,B){var A=new Date();A.setTime(A.getTime()+1000*60*60*24*365*100);document.cookie=C+"="+escape(B)+"; expires="+A.toGMTString()+"; path=/"}function slideControlBox(D){var C=document.getElementById("hideButton");var A=document.getElementById("controlbox");var B=A.offsetLeft;if(D=="out"){B-=SLIDE_RATE;if(B<-A.offsetWidth+C.offsetWidth+8){B=-A.offsetWidth+C.offsetWidth+8;C.value=">";C.onclick=function(){slideControlBox("in")};setToolbarPref("toolbar","0")}else{resetTimer();timer=setTimeout("slideControlBox('out')",10)}}else{if(D=="in"){B+=SLIDE_RATE;if(B>0){B=0;C.value="<";C.onclick=function(){slideControlBox("out")};setToolbarPref("toolbar","1")}else{resetTimer();timer=setTimeout("slideControlBox('in')",10)}}}A.style.left=B+"px"}function getWindowDimensions(){var A=new Array();if(document.documentElement.clientHeight!=0){A["scrollLeft"]=document.documentElement.scrollLeft;A["scrollTop"]=document.documentElement.scrollTop;A["windowWidth"]=document.documentElement.clientWidth;A["windowHeight"]=document.documentElement.clientHeight}else{if(document.body.clientHeight!=0){A["scrollLeft"]=document.body.scrollLeft;A["scrollTop"]=document.body.scrollTop;A["windowWidth"]=document.body.clientWidth;A["windowHeight"]=document.body.clientHeight}else{if(window.innerHeight!=0){A["scrollLeft"]=window.pageXOffset;A["scrollTop"]=window.pageYOffset;A["windowWidth"]=window.innerWidth;A["windowHeight"]=window.innerHeight}}}return A}function updatePosition(){var C=getWindowDimensions();var A=document.getElementById("controlbox");var B=C["windowHeight"]+C["scrollTop"]-A.offsetHeight;A.style.top=B+"px";if(bubble!=null){bubble.style.top=B-bubble.offsetHeight+4+"px"}}function enterTagBox(){var A=document.getElementById("edit-txtTag");if(clearTagBox){A.value="";A.style.color="";clearTagBox=false}}function leaveTagBox(){var A=document.getElementById("edit-txtTag");if(A.value==""){A.value=TAGBOX_PROMPT;A.style.color="gray";clearTagBox=true}}function tagBoxKeyPress(C){if(!processingEvent){var B=document.getElementById("edit-txtTag");var A=B.value;if(C.keyCode==13&&A!=""&&A!=TAGBOX_PROMPT){tagXHR=newXHR();tagXHR.onreadystatechange=tagBoxXHRstateChange;tagXHR.open("GET",tagURL+"?tag="+A+"&url="+document.location.href,true);tagXHR.send(null);processingEvent=true;B.disabled=true}}}function tagBoxXHRstateChange(){if(tagXHR.readyState==4){var A=document.getElementById("edit-txtTag");processingEvent=false;A.disabled=false;A.value="";req=null;processTagBoxResponse(tagXHR.responseText);A.blur();A.focus()}}function processTagBoxResponse(txt){var answer=eval("("+txt+")");var status=answer[0];var msg=answer[1];if(status=="ERROR"){showTagNotice(msg,false)}else{if(status=="UPDATE"){var taglist=document.getElementById("booktags");taglist.innerHTML=msg;showTagNotice("The page was tagged successfully",true)}else{alert(txt)}}}function chooseVersion(B,C){if(popupCache!=null){popupCache=new Array()}if(!C&&(B=="NIV"||B=="TNIVOTNT")){txt="The NIV and TNIV translations are only available for members with a 10-book or 1-year subscription to the site.  ";txt+="For more information, please click the Support tab.";alert(txt);var A=document.getElementById("selPopupVersion");A.value=preferences["popup"]}else{preferences["popup"]=B;setToolbarPref("popup",B)}}function setToolbarPref(A,B){if(uid==0){setCookie(A,B)}else{var C=TOOLBAR_URL+"?save&"+A+"="+B;var D=newXHR();D.onreadystatechange=function(){};D.open("GET",C,true);D.send(null)}}function showTagNotice(B,D){var A=findPos(document.getElementById("edit-txtTag"));if(bubbleTimer!=null){clearTimeout(bubbleTimer);bubbleTimer=null}if(bubble==null){bubble=document.createElement("div");bubble.style.padding="2px 2px 2px 2px";bubble.style.position=(isIE6?"absolute":"fixed");document.body.appendChild(bubble)}if(D){bubble.style.background="#DDFFDD";bubble.style.border="1px solid green"}else{bubble.style.background="#FFDDDD";bubble.style.border="1px solid maroon"}bubble.innerHTML="<b>"+B+"</b>";var C=getWindowDimensions();bubble.style.left=C["scrollLeft"]+A[0]+"px";if(isIE6){updatePosition()}else{bubble.style.bottom=C["windowHeight"]-A[1]+4+"px"}bubble.style.visibility="visible";if(D){bubbleTimer=setTimeout("bubble.style.visibility = 'hidden'",3000)}else{bubbleTimer=setTimeout("bubble.style.visibility = 'hidden'",5000)}}function resetTimer(){if(timer!=null){clearTimeout(timer)}timer=null}function isDefined(obj,variable){return(typeof (eval(obj)[variable])!="undefined")}function defineWord(){var B="http://wiktionary.org/wiki/";text=getSel();if(text!=""&&text!=undefined){text=text.substring(0,100);var D;var A="";for(var C=0;C<text.length;C++){D=text.charCodeAt(C);if((D>=65&&D<=90)||(D>=97&&D<=122)){A+=text.charAt(C)}}B+=escape(A);if(!window.open(B,"definition")){document.location=B}}else{alert("Please select a word to get its definition")}}function getSel(){var B=window,C=document,A="getSelection";return(""+(B[A]?B[A]():C[A]?C[A]():C.selection.createRange().text)).replace(/(^\s+|\s+$)/g,"")}var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(D){for(var A=0;A<D.length;A++){var B=D[A].string;var C=D[A].prop;this.versionSearchString=D[A].versionSearch||D[A].identity;if(B){if(B.indexOf(D[A].subString)!=-1){return D[A].identity}}else{if(C){return D[A].identity}}}},searchVersion:function(B){var A=B.indexOf(this.versionSearchString);if(A==-1){return }return parseFloat(B.substring(A+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();var isIE6=BrowserDetect.browser=="Explorer"&&BrowserDetect.version<7