/* bible-base.js (58%) */
function bible(){this.o='';this.translation='nasb';this.search='';this.searchMatch='';this.searchTitle='';this.searchShare='';this.searchURL='';this.verses='';this.results='';this.copywrite='';this.mobile=false;this.bibleSearchCall=null;this.abortbibleSearch=function(){if(this.bibleSearchCall!=null){this.bibleSearchCall.abort();this.bibleSearchCall=null;}}
this.bibleSearch=function(){this.abortbibleSearch();this.beforeBibleSearch();var searchTerm=this.search.replace(":",".");this.bibleSearchCall=$.getJSON("/api/query?q="+searchTerm+"&app=scriply&translation="+this.translation,this.bibleSearchReturn(this));};this.bibleSearchReturn=function(obj){return function(json){if(json!=undefined){if(json.Settings.results>=1){obj.searchTitle=json.Search.title;obj.searchURL=json.Search.link;obj.searchShare='Currently reading '+json.Search.title+' @Scriply Bible '+json.Search.link;obj.verses=json.Verse;obj.results=json.Settings.results;obj.copywrite=json.Settings.copywrite;obj.searchMatch='passage';obj.afterBibleSearch();}else if(json.Settings.results<=0||json.Settings.results==undefined){obj.searchMatch='fail';obj.emptyBibleSearch();}else{obj.searchMatch='';obj.emptyBibleSearch();}}else{return'';}}}
this.changeSearch=function(newSearchTerm,force){force=(typeof force=='undefined')?false:force;if(this.search!=newSearchTerm||force){this.search=newSearchTerm;if(this.search!=''){this.bibleSearch();}else{this.abortbibleSearch();this.emptyBibleSearch();}}};this.changeTranslation=function(newTranslation){if(this.translation!=newTranslation){this.translation=newTranslation;this.bibleSearch();}};this.initBibleSearch=function(){};this.beforeBibleSearch=function(){};this.afterBibleSearch=function(){};this.emptyBibleSearch=function(){};}

/* bible.js (60%) */
var bibleObj=new bible();var mobile=false;bibleObj.beforeBibleSearch=function(){animateHeight(false);clearBibles();$(".loading").css('display','block');}
bibleObj.afterBibleSearch=function(){$('.clearButton').fadeIn();$('#shortURL').html(bibleObj.searchURL);$('#toolbar h1').html(bibleObj.searchTitle);$('#toolbar .socialShare').html(bibleObj.searchShare);switch(bibleObj.searchMatch){case'fail':changeInputMatch('fail');$('#toolbar').fadeOut();$('#display').fadeOut();clearBibles();break;case'passage':changeInputMatch('found');$('#toolbar').fadeIn();$('#display').fadeIn();animateHeight(false);$(".loading").css('display','none');if(bibleObj.results>1){incHeader=true;}else{incHeader=false;}
for(var i in bibleObj.verses){insertBible(bibleObj.verses[i],incHeader);}
$('.copyright').html(bibleObj.copywrite);$('.bible').fadeIn();animateHeight(true);break;default:changeInputMatch('');break;}
clearCopyShortUrl();}
bibleObj.emptyBibleSearch=function(){changeInputMatch('');$('.clearButton').fadeOut();$(".loading").css('display','none');$('#display').fadeOut('normal',function(){$('#display').height(0);});$('#toolbar').fadeOut();$('.copyright').html("");clearBibles();}
function insertBible(obj,header){var bible="";bible+='<div class="grid_16 bible">';if(header){bible+='<h2><a href="#">'+obj.title+'</a></h2> <a class="shortURL">'+obj.shortLink+'</a><a href="#" class="share"></a>';bible+='<a href="#" class="clearButton">x</a>';bible+='<div class="clear"></div>';}
bible+='<div>'
bible+=obj.text;bible+='</div>';bible+='</div>';$('#display div.loading').before(bible);}
function clearBibles(){$('.bible').remove();}
function animateHeight(animate){if(animate){newH=$('#display div:first').height();$('#display').animate({height:newH+"px"},{queue:false,duration:'normal'});}else{oldHeight=$('#display').height();$('#display').height(oldHeight);}}
function changeInputMatch(match){switch(match){case'found':$('#searchInput').removeClass("inputFail");$('#searchInput').addClass("inputFound");break;case'fail':$('#searchInput').removeClass("inputFound");$('#searchInput').addClass("inputFail");break;default:$('#searchInput').removeClass("inputFound");$('#searchInput').removeClass("inputFail");break;}}
function clearCopyShortUrl(){$('.shortURL').each(function(){if(this.clip!=undefined){this.clip.destroy();}});resetCopyShortUrl();}
function resetCopyShortUrl(){if(!mobile){$('.shortURL').each(function(){var el=$(this);this.clip=new ZeroClipboard.Client();var copytext=el.html();this.clip.setText(copytext);this.clip.setHandCursor(true);this.clip.setCSSEffects(true);$(window).resize(function(){});this.clip.addEventListener('mouseDown',function(client){client.setText(el.html());SelectText(el[0]);$('.copyOnClick').fadeIn();$('.copyOnClick').animate({opacity:1.0},1500);$('.copyOnClick').fadeOut('slow');});this.clip.glue(el[0]);});}}
$(document).ready(function(){$('#searchInput').focus(function(){if($(this).val()=="Enter a bible passage"){$(this).val('');}});bibleObj.search=$('#searchInput').val();resetCopyShortUrl();$("img").error(function(){$(this).attr("src","/img/defaultTwitIcon.png");var user=$(this).attr("name");var link="http://scriply.info/mrbot/refreshTwitterUser/"+user;$.get(link);});$("a[href*='http://scrip.ly']:not(a[href*='http://twitter.com'])").live('click',function(){var read=$(this).attr("href").replace('http://scrip.ly/','');$('#searchInput').val(read);bibleObj.changeSearch(read,true);$('html, body').animate({scrollTop:0},1000);return false;});$("a[href*='http://www.twitter.com/']:not(a[href*='http://scrip.ly'])").live('click',function(){var read=$(this).attr("href").replace('http://www.twitter.com/','');window.location.replace("/stream/"+read);return false;});$('.dailyReading a').click(function(){var read=$('.dailyReading a').html();$('#searchInput').val(read);bibleObj.changeSearch(read,true);$('html, body').animate({scrollTop:0},1000);return false;});$('#searchInput').keyup(function(){bibleObj.changeSearch($(this).val());});$('.clearButton').live('click',function(){$('#searchInput').val("");$(this).fadeOut();bibleObj.emptyBibleSearch();return false;});$('.socialShare').live('click',function(){link=$(this).html();window.open("http://twitter.com/home?status="+link,'_blank');return false;});$('.share').live('click',function(){link=$(this).prev().html();window.open("http://twitter.com/home?status="+link,'_blank');return false;});});function SelectText(element){var text=element;if($.browser.msie){var range=document.body.createTextRange();range.moveToElementText(text);range.select();}else if($.browser.mozilla||$.browser.opera){var selection=window.getSelection();var range=document.createRange();range.selectNodeContents(text);selection.removeAllRanges();selection.addRange(range);}else if($.browser.safari){var selection=window.getSelection();selection.setBaseAndExtent(text,0,text,1);}}

/* zeroclipboard/ZeroClipboard.js (63%) */
var ZeroClipboard={version:"1.0.6",clients:{},moviePath:'/js/zeroclipboard/ZeroClipboard.swf',nextId:1,$:function(thingy){if(typeof(thingy)=='string')thingy=document.getElementById(thingy);if(!thingy.addClass){thingy.hide=function(){this.style.display='none';};thingy.show=function(){this.style.display='';};thingy.addClass=function(name){this.removeClass(name);this.className+=' '+name;};thingy.removeClass=function(name){var classes=this.className.split(/\s+/);var idx=-1;for(var k=0;k<classes.length;k++){if(classes[k]==name){idx=k;k=classes.length;}}
if(idx>-1){classes.splice(idx,1);this.className=classes.join(' ');}
return this;};thingy.hasClass=function(name){return!!this.className.match(new RegExp("\\s*"+name+"\\s*"));};}
return thingy;},setMoviePath:function(path){this.moviePath=path;},dispatch:function(id,eventName,args){var client=this.clients[id];if(client){client.receiveEvent(eventName,args);}},register:function(id,client){this.clients[id]=client;},getDOMObjectPosition:function(obj,stopObj){var info={left:0,top:0,width:obj.width?obj.width:obj.offsetWidth,height:obj.height?obj.height:obj.offsetHeight};while(obj&&(obj!=stopObj)){info.left+=obj.offsetLeft;info.top+=obj.offsetTop;obj=obj.offsetParent;}
return info;},Client:function(elem){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId='ZeroClipboardMovie_'+this.id;ZeroClipboard.register(this.id,this);if(elem)this.glue(elem);}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:'',handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(elem,appendElem,stylesToAdd){this.domElement=ZeroClipboard.$(elem);var zIndex=99;if(this.domElement.style.zIndex){zIndex=parseInt(this.domElement.style.zIndex,10)+1;}
if(typeof(appendElem)=='string'){appendElem=ZeroClipboard.$(appendElem);}
else if(typeof(appendElem)=='undefined'){appendElem=document.getElementsByTagName('body')[0];}
var box=ZeroClipboard.getDOMObjectPosition(this.domElement,appendElem);this.div=document.createElement('div');var style=this.div.style;style.position='absolute';style.left=''+box.left+'px';style.top=''+box.top+'px';style.width=''+box.width+'px';style.height=''+box.height+'px';style.zIndex=zIndex;if(typeof(stylesToAdd)=='object'){for(addedStyle in stylesToAdd){style[addedStyle]=stylesToAdd[addedStyle];}}
appendElem.appendChild(this.div);this.div.innerHTML=this.getHTML(box.width,box.height);},getHTML:function(width,height){var html='';var flashvars='id='+this.id+'&width='+width+'&height='+height;if(navigator.userAgent.match(/MSIE/)){var protocol=location.href.match(/^https/i)?'https://':'http://';html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';}
else{html+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';}
return html;},hide:function(){if(this.div){this.div.style.left='-2000px';}},show:function(){this.reposition();},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML='';var body=document.getElementsByTagName('body')[0];try{body.removeChild(this.div);}catch(e){;}
this.domElement=null;this.div=null;}},reposition:function(elem){if(elem){this.domElement=ZeroClipboard.$(elem);if(!this.domElement)this.hide();}
if(this.domElement&&this.div){var box=ZeroClipboard.getDOMObjectPosition(this.domElement);var style=this.div.style;style.left=''+box.left+'px';style.top=''+box.top+'px';}},setText:function(newText){this.clipText=newText;if(this.ready)this.movie.setText(newText);},addEventListener:function(eventName,func){eventName=eventName.toString().toLowerCase().replace(/^on/,'');if(!this.handlers[eventName])this.handlers[eventName]=[];this.handlers[eventName].push(func);},setHandCursor:function(enabled){this.handCursorEnabled=enabled;if(this.ready)this.movie.setHandCursor(enabled);},setCSSEffects:function(enabled){this.cssEffects=!!enabled;},receiveEvent:function(eventName,args){eventName=eventName.toString().toLowerCase().replace(/^on/,'');switch(eventName){case'load':this.movie=document.getElementById(this.movieId);if(!this.movie){var self=this;setTimeout(function(){self.receiveEvent('load',null);},1);return;}
if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var self=this;setTimeout(function(){self.receiveEvent('load',null);},100);this.ready=true;return;}
this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case'mouseover':if(this.domElement&&this.cssEffects){this.domElement.addClass('hover');if(this.recoverActive)this.domElement.addClass('active');}
break;case'mouseout':if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass('active')){this.domElement.removeClass('active');this.recoverActive=true;}
this.domElement.removeClass('hover');}
break;case'mousedown':if(this.domElement&&this.cssEffects){this.domElement.addClass('active');}
break;case'mouseup':if(this.domElement&&this.cssEffects){this.domElement.removeClass('active');this.recoverActive=false;}
break;}
if(this.handlers[eventName]){for(var idx=0,len=this.handlers[eventName].length;idx<len;idx++){var func=this.handlers[eventName][idx];if(typeof(func)=='function'){func(this,args);}
else if((typeof(func)=='object')&&(func.length==2)){func[0][func[1]](this,args);}
else if(typeof(func)=='string'){window[func](this,args);}}}}};

/* dropdown.js (72%) */
$(document).ready(function(){$(".dropdown a:first").click(function(){$(this).parent().find("ul").toggle();$(this).addClass("active");return false;});$(document).bind('click',function(e){var $clicked=$(e.target);if(!$clicked.parents().hasClass("dropdown")){$(".dropdown ul").hide();$(".dropdown a:first").removeClass("active");};});$(".dropdown ul li a").click(function(){var value=$(this).attr("class");var text=$("span",this).html();$(this).parent().parent().parent().find("a:first span").html(value);$(this).parent().parent().parent().find("a:first").removeClass("active");$(this).parent().parent().parent().find("a:first").attr("class",value);$(this).parent().parent().parent().find("ul").hide();bibleObj.changeTranslation(value);});});