/* 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(){var searchTerm=this.search.replace(":",".");if(searchTerm!='Enter a bible passage or keyword'){this.abortbibleSearch();this.beforeBibleSearch();this.bibleSearchCall=$.getJSON("/api/bible/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 (61%) */
var bibleObj=new bible();var mobile=false;bibleObj.beforeBibleSearch=function(){console.log("beforeafterBibleSearch");animateHeight(false);clearBibles();$(".loading, #display").css('display','block');$(".toggleBible").show();$('.bibleHolder').fadeIn();$('.bibleHolder h3').html("Searching...");}
bibleObj.afterBibleSearch=function(){console.log("afterBibleSearch");$('.clearBible').fadeIn();$('#shortURL').html(bibleObj.searchURL);$('.socialShare').attr("data-share",bibleObj.searchURL);switch(bibleObj.searchMatch){case'fail':changeInputMatch('fail');$('#display').fadeOut();$('.bibleHolder').fadeOut();clearBibles();break;case'passage':changeInputMatch('found');animateHeight(false);$(".loading").css('display','none');$('#display').fadeIn();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(){console.log("emptyBibleSearch");changeInputMatch('');$('.clearBible').fadeOut();$(".loading").css('display','none');$('#display').fadeOut('normal',function(){$('#display').height(0);$(".toggleBible").hide();});$('.bibleHolder').fadeOut();$('.copyright').html("");$('.biblyDisplay h3').html("");clearBibles();}
function insertBible(obj,header){console.log("insertBible");var bible="";bible+='<div class="bible">';if(header){bible+='<h2><a href="#">'+obj.title+'</a></h2> <a class="shortURL">'+obj.shortLink+'</a><a href="#" class="share"></a>';bible+='<div class="clear"></div>';}
bible+='<div>'
bible+=obj.text;bible+='</div>';bible+='</div>';$('.bibleHolder h3').html(obj.title);$('#display div.loading').before(bible);}
function clearBibles(){console.log("clearBibles");$('.bible').remove();}
function animateHeight(animate){console.log("animateHeight");if(animate){newH=$('.bibleWrap').height()+$('.display .toolbar').height();$('#display').animate({height:newH+"px"},{queue:false,duration:'normal'});}else{oldHeight=$('#display').height();$('#display').height(oldHeight);}}
function changeInputMatch(match){console.log("changeInputMatch");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(){console.log("clearCopyShortUrl");$('.shortURL').each(function(){if(this.clip!=undefined){this.clip.destroy();}});resetCopyShortUrl();}
function resetCopyShortUrl(){console.log("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()=="Search the Bible for any passage or keyword"){$(this).val('');}}).blur(function(){if($(this).val()==''){$(this).val('Search the Bible for any passage or keyword');}});resetCopyShortUrl();$("a[href*='http://scrip.ly']:not(a[href*='http://twitter.com'])").live('click',function(){var read=$(this).attr("href").replace('http://scrip.ly/','');bibleObj.changeSearch(read,true);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());});$('.closeBible').live('click',function(){$('.bible').remove();$('.display').slideUp();bibleObj.emptyBibleSearch();$('#searchInput').val("").focus();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 (69%) */
$.fn.extend({translationDropdown:function(obj){dropdown=$(this);dropdown.find("a:first-child").live('click',function(){$(this).parent().find("ul").show();return false;});dropdown.find("ul li a").click(function(){$(this).removeClass("active");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).parents("ul:first").hide();console.log(obj);obj.changeTranslation(value);});}});$(document).ready(function(){$(document).bind('click',function(e){var $clicked=$(e.target);if(!$clicked.parents().hasClass("dropdown")){$(".dropdown ul").hide();$(".dropdown a:first").removeClass("active");}});$('.grid_16 .dropdown').each(function(){if(bibleObj!=undefined){$(this).translationDropdown(bibleObj,'');}});});

/* scriply.util.js (42%) */
if(!window.console){console={};console.log=console.log||function(){};console.warn=console.warn||function(){};console.error=console.error||function(){};console.info=console.info||function(){};}
function relative_time(time_value){time_value=new Date(time_value*1000);var parsed_date=Date.parse(time_value);var relative_to=(arguments.length>1)?arguments[1]:new Date();var delta=parseInt((relative_to.getTime()-parsed_date)/1000);if(delta<10){return'just now';}else if(delta<60){return'less than a minute ago';}else if(delta<120){return'about a minute ago';}else if(delta<(45*60)){return(parseInt(delta/60)).toString()+' minutes ago';}else if(delta<(90*60)){return'about an hour ago';}else if(delta<(24*60*60)){return'about '+(parseInt(delta/3600)).toString()+' hours ago';}else if(delta<(48*60*60)){return'1 day ago';}else{return(parseInt(delta/86400)).toString()+' days ago';}}
function watch_timestamp(){$('.watch_timestamp').each(function(){time=$(this).attr('data-timestamp');if(time!=''){$(this).html(relative_time(time));}});}
$(document).ready(function(){watch_timestamp();setInterval("watch_timestamp()",30000);$('.flash').fadeIn(function(){setTimeout("$('.flash').fadeOut();",2000);});$("img").error(function(){$(this).attr("src","/img/defaultTwitIcon.png");});});function isObjEmpty(obj){for(var prop in obj){if(obj.hasOwnProperty(prop))
return false;}
return true;}
(function($){var timerCycle=100;var watchedObjects=[];var watchedCallbacks=[];var watchTimer=null;$.fn.watch=function(propertyName,callbackMethod){for(var i=0;i<this.length;i++){var o=this[i];watchIt(o,propertyName,callbackMethod);}}
$.fn.unwatch=function(propertyName,callbackMethod){for(var i=0;i<this.length;i++){var o=this[i];unwatchIt(o,propertyName,callbackMethod);}}
function watchIt(obj,propertyName,callbackMethod){propertyName=String(propertyName);if(!(obj&&propertyName in obj&&typeof callbackMethod=="function"))
return;var item,props,prop,oldval,newval;for(var i=0;i<watchedObjects.length;i++){if(obj!=watchedCallbacks[i])continue;item=watchedObjects[i];props=watchedCallbacks[i];for(var j=0;j<props.length;i++){prop=props[j];if(prop.name!=propertyName)continue;prop.callbacks.push(callbackMethod);return;}
props.push({"name":propertyName,oldValue:obj[propertyName],callbacks:[callbackMethod]})
return;}
watchedObjects.push(obj);watchedCallbacks.push([{"name":propertyName,oldValue:obj[propertyName],callbacks:[callbackMethod]}]);}
function unwatchIt(obj,propertyName,callbackMethod){var props,remprops,prop,pname;for(var i=0;i<watchedObjects.length;i++){if(obj==watchedObjects[i]){props=watchedCallbacks[i];remprops=[];for(var j=0;j<props.length;j++){if(!propertyName||propertyName==props[j].name){prop=props[j];for(var k=0;k<prop.callbacks.length;k++){var cb=prop.callbacks[k];if(!callbackMethod||cb==callbackMethod){prop.callbacks.splice(k,1);k--;}}
if(!prop.callbacks.length)
remprops.push(prop.name);}}
remitems:while(remprops.length){pname=remprops.pop();for(var j=0;j<props.length;j++){if(props[j].name==pname){props.splice(j,1);continue remitems;}}}
if(props.length==0){watchedObjects.splice(i,1);watchedCallbacks.splice(i,1);}
return;}}}
function wind(){watchTimer=window.setTimeout(genericWatchTimer,timerCycle);}
function genericWatchTimer(){var item,props,prop,oldval,newval;for(var i=0;i<watchedObjects.length;i++){item=watchedObjects[i];props=watchedCallbacks[i];for(var j=0;j<props.length;j++){prop=props[j];newval=item[prop.name];if(prop.oldValue!=newval||typeof(prop.oldValue)!=typeof(newval)){for(var k=0;k<prop.callbacks.length;k++){prop.callbacks[k].call(item,prop.name,prop.oldValue,newval);prop.oldValue=newval;}}}}
wind();}
wind();})(jQuery);

/* jquery.form.js (51%) */
;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
if(typeof options=='function')
options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1];}
url=url||window.location.href||'';options=$.extend({url:url,type:this.attr('method')||'GET',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])
a.push({name:n,value:options.data[n][k]});}
else
a.push({name:n,value:options.data[n]});}}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
else
options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(oldSuccess,arguments);});}
else if(options.success)
callbacks.push(options.success);options.success=function(data,status,xhr){for(var i=0,max=callbacks.length;i<max;i++)
callbacks[i].apply(options,[data,status,xhr||$form,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
if(files[j])
found=true;var multipart=false;if((files.length&&options.iframe!==false)||options.iframe||found||multipart){if(options.closeKeepAlive)
$.get(options.closeKeepAlive,fileUpload);else
fileUpload();}
else
$.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}
var opts=$.extend({},$.ajaxSettings,options);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" src="'+opts.iframeSrc+'" onload="(jQuery(this).data(\'form-plugin-onload\'))()" />');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src',opts.iframeSrc);}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return;}
if(xhr.aborted)
return;var cbInvoked=false;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){opts.extraData=opts.extraData||{};opts.extraData[n]=sub.value;if(sub.type=="image"){opts.extraData[n+'.x']=form.clk_x;opts.extraData[n+'.y']=form.clk_y;}}}
function doSubmit(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')
form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)
form.setAttribute('action',opts.url);if(!opts.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
if(opts.timeout)
setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(opts.extraData)
for(var n in opts.extraData)
extraInputs.push($('<input type="hidden" name="'+n+'" value="'+opts.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');$io.data('form-plugin-onload',cb);form.submit();}
finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove();}};if(opts.forceSync)
doSubmit();else
setTimeout(doSubmit,10);var domCheckCount=100;function cb(){if(cbInvoked)
return;var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;var isXml=opts.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&(doc.body==null||doc.body.innerHTML=='')){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}
log('Could not access iframe DOM after 100 tries.');return;}
log('response detected');cbInvoked=true;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];if(ta)
xhr.responseText=ta.value;else{var pre=doc.getElementsByTagName('pre')[0];if(pre)
xhr.responseText=pre.innerHTML;}}
else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
data=$.httpData(xhr,opts.dataType);}
catch(e){log('error caught:',e);ok=false;xhr.error=e;$.handleError(opts,xhr,'error',e);}
if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}
if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.removeData('form-plugin-onload');$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
else
doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(e){e.preventDefault();$(this).ajaxSubmit(options);}).bind('click.form-plugin',function(e){var target=e.target;var $el=$(target);if(!($el.is(":submit,input:image"))){var t=$el.closest(':submit');if(t.length==0)
return;target=t[0];}
var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);});};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
continue;}
var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
a.push({name:n,value:v[j]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:n,value:v});}
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)
a.push({name:n,value:v[i]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:this.name,value:v});});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
continue;v.constructor==Array?$.merge(val,v):val.push(v);}
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true;if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1))
return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v)
v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;if(one)return v;a.push(v);}}
return a;}
return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')
this.value='';else if(t=='checkbox'||t=='radio')
this.checked=false;else if(tag=='select')
this.selectedIndex=-1;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')
this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug){var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log)
window.console.log(msg);else if(window.opera&&window.opera.postError)
window.opera.postError(msg);}};})(jQuery);

/* account/auth.js (57%) */
$(document).ready(function(){$('.auth-required').live('click',function(){$('.signInBlock .authMessage').html('Sign in using your Scriply.com account.');if(auth.userstatus()){return true;}else{return false;}});$(".auth-login").live('click',function(){$('.signInBlock .authMessage').html("Sign in below.");auth.login();return false;});$(".auth-logout").live('click',function(){auth.logout();return false;});$('.blockOverlay').live('click',function(){$.unblockUI();});$('.signInBlock .signInForm #userLogin').live('submit',function(){auth.post_login($(this));return false;});});var auth=auth||{status:true,site:'',url:'',force_in:false,force_out:false,login:function(){auth.status=false;auth.beforeLogin();$('#menubar').removeClass('userIn').addClass('userOut');$.blockUI({message:$(".signInBlock"),css:{top:'25%',left:'25%',width:'45%',border:'1px solid #FFF',cursor:'wait'},baseZ:40000,focusInput:true});},post_login:function(form){form.ajaxSubmit({beforeSubmit:function(formData,jqForm,options){$('.authError').slideUp();return true;},success:function(data){console.log(data);if(data==''){$('.authError').html('Invaild username or password');$('.authError').slideDown();$('#UserPassword').val('');}else{$('#menubarAjax').replaceWith(data);$('#UserPassword').val('');$.unblockUI();auth.status=true;}
auth.afterLogin();if(auth.force_in){window.location="/";}}});},logout:function(){auth.beforeLogout();auth.status=false;$("#menubar .signInForm").hide();$('#menubar').removeClass('userIn').addClass('userOut');$.get("/account/logout",function(data){auth.afterLogout();if(auth.force_out){window.location="/";}});},userstatus:function(){if(auth.status==undefined||auth.status){return true;}else{this.login();return false;}},beforeLogin:function(){},afterLogin:function(){},beforeLogout:function(){},afterLogout:function(){}}

/* oauth.js (73%) */
$(document).ready(function(){$('.oauth-twitter').live('click',function(){oauth.twitter();return false;});$('.oauth-facebook').live('click',function(){oauth.facebook();return false;});});var oauth=oauth||{t:false,f:false,popup:false,twitter:function(){oauth.t=false;oauth.beforeTwitter();oauth.open_popup("/oauth/twitter",800,500);},callbackTwitter:function(response){if(response.status=='TwitterSaved'){oauth.t=true;oauth.afterTwitter(response);}
console.log(response);return true;},beforeTwitter:function(){},afterTwitter:function(response){$('.oauth-twitter-screenname').html(response.twitter.User.screen_name);$('.twitterOAuthWrapper').addClass('authorized');},facebook:function(){oauth.f=false;oauth.beforeFacebook();oauth.open_popup("/oauth/facebook",600,500);},callbackFacebook:function(response){if(response.status=='FacebookSaved'){oauth.f=true;oauth.afterFacebook(response);}
console.log(response);return true;},beforeFacebook:function(){},afterFacebook:function(response){$('.oauth-facebook-screenname').html(response.facebook.name);$('.facebookConnect').addClass('authorized');},open_popup:function(link,w,h){if(oauth.popup){oauth.popup.close();}
var winl=(screen.width-w)/2;var wint=(screen.height-h)/2;oauth.popup=window.open(link,'name','height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');}}

/* jquery.blockUI.js (58%) */
;(function($){if(/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery)||/^1.1/.test($.fn.jquery)){alert('blockUI requires jQuery v1.2.3 or later!  You are using v'+$.fn.jquery);return;}
$.fn._fadeIn=$.fn.fadeIn;var noOp=function(){};var mode=document.documentMode||0;var setExpr=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);var ie6=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!mode;$.blockUI=function(opts){install(window,opts);};$.unblockUI=function(opts){remove(window,opts);};$.growlUI=function(title,message,timeout,onClose){var $m=$('<div class="growlUI"></div>');if(title)$m.append('<h1>'+title+'</h1>');if(message)$m.append('<h2>'+message+'</h2>');if(timeout==undefined)timeout=3000;$.blockUI({message:$m,fadeIn:700,fadeOut:1000,centerY:false,timeout:timeout,showOverlay:false,onUnblock:onClose,css:$.blockUI.defaults.growlCSS});};$.fn.block=function(opts){return this.unblock({fadeOut:0}).each(function(){if($.css(this,'position')=='static')
this.style.position='relative';if($.browser.msie)
this.style.zoom=1;install(this,opts);});};$.fn.unblock=function(opts){return this.each(function(){remove(this,opts);});};$.blockUI.version=2.33;$.blockUI.defaults={message:'<h1>Please wait...</h1>',title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:'30%',top:'40%',left:'35%',textAlign:'center',color:'#000',border:'3px solid #aaa',backgroundColor:'#fff',cursor:'wait'},themedCSS:{width:'30%',top:'40%',left:'35%'},overlayCSS:{backgroundColor:'#000',opacity:0.6,cursor:'wait'},growlCSS:{width:'350px',top:'10px',left:'',right:'10px',border:'none',padding:'5px',opacity:0.6,cursor:'default',color:'#fff',backgroundColor:'#000','-webkit-border-radius':'10px','-moz-border-radius':'10px','border-radius':'10px'},iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank',forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4};var pageBlock=null;var pageBlockEls=[];function install(el,opts){var full=(el==window);var msg=opts&&opts.message!==undefined?opts.message:undefined;opts=$.extend({},$.blockUI.defaults,opts||{});opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{});var css=$.extend({},$.blockUI.defaults.css,opts.css||{});var themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{});msg=msg===undefined?opts.message:msg;if(full&&pageBlock)
remove(window,{fadeOut:0});if(msg&&typeof msg!='string'&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg;var data={};$(el).data('blockUI.history',data);data.el=node;data.parent=node.parentNode;data.display=node.style.display;data.position=node.style.position;if(data.parent)
data.parent.removeChild(node);}
var z=opts.baseZ;var lyr1=($.browser.msie||opts.forceIframe)?$('<iframe class="blockUI" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'):$('<div class="blockUI" style="display:none"></div>');var lyr2=$('<div class="blockUI blockOverlay" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var lyr3,s;if(opts.theme&&full){s='<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">'+'<div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title||'&nbsp;')+'</div>'+'<div class="ui-widget-content ui-dialog-content"></div>'+'</div>';}
else if(opts.theme){s='<div class="blockUI blockMsg blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:absolute">'+'<div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title||'&nbsp;')+'</div>'+'<div class="ui-widget-content ui-dialog-content"></div>'+'</div>';}
else if(full){s='<div class="blockUI blockMsg blockPage" style="z-index:'+z+';display:none;position:fixed"></div>';}
else{s='<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>';}
lyr3=$(s);if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass('ui-widget-content');}
else
lyr3.css(css);}
if(!opts.applyPlatformOpacityRules||!($.browser.mozilla&&/Linux/.test(navigator.platform)))
lyr2.css(opts.overlayCSS);lyr2.css('position',full?'fixed':'absolute');if($.browser.msie||opts.forceIframe)
lyr1.css('opacity',0.0);var layers=[lyr1,lyr2,lyr3],$par=full?$('body'):$(el);$.each(layers,function(){this.appendTo($par);});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:'.ui-dialog-titlebar',cancel:'li'});}
var expr=setExpr&&(!$.boxModel||$('object,embed',full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.boxModel)
$('html,body').css('height','100%');if((ie6||!$.boxModel)&&!full){var t=sz(el,'borderTopWidth'),l=sz(el,'borderLeftWidth');var fixT=t?'(0 - '+t+')':0;var fixL=l?'(0 - '+l+')':0;}
$.each([lyr1,lyr2,lyr3],function(i,o){var s=o[0].style;s.position='absolute';if(i<2){full?s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'):s.setExpression('height','this.parentNode.offsetHeight + "px"');full?s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):s.setExpression('width','this.parentNode.offsetWidth + "px"');if(fixL)s.setExpression('left',fixL);if(fixT)s.setExpression('top',fixT);}
else if(opts.centerY){if(full)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0;}
else if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top):0;var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';s.setExpression('top',expression);}});}
if(msg){if(opts.theme)
lyr3.find('.ui-widget-content').append(msg);else
lyr3.append(msg);if(msg.jquery||msg.nodeType)
$(msg).show();}
if(($.browser.msie||opts.forceIframe)&&opts.showOverlay)
lyr1.show();if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay)
lyr2._fadeIn(opts.fadeIn,cb1);if(msg)
lyr3._fadeIn(opts.fadeIn,cb2);}
else{if(opts.showOverlay)
lyr2.show();if(msg)
lyr3.show();if(opts.onBlock)
opts.onBlock();}
bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(':input:enabled:visible',pageBlock);if(opts.focusInput)
setTimeout(focus,20);}
else
center(lyr3[0],opts.centerX,opts.centerY);if(opts.timeout){var to=setTimeout(function(){full?$.unblockUI(opts):$(el).unblock(opts);},opts.timeout);$(el).data('blockUI.timeout',to);}};function remove(el,opts){var full=(el==window);var $el=$(el);var data=$el.data('blockUI.history');var to=$el.data('blockUI.timeout');if(to){clearTimeout(to);$el.removeData('blockUI.timeout');}
opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);var els;if(full)
els=$('body').children().filter('.blockUI').add('body > .blockUI');else
els=$('.blockUI',el);if(full)
pageBlock=pageBlockEls=null;if(opts.fadeOut){els.fadeOut(opts.fadeOut);setTimeout(function(){reset(els,data,opts,el);},opts.fadeOut);}
else
reset(els,data,opts,el);};function reset(els,data,opts,el){els.each(function(i,o){if(this.parentNode)
this.parentNode.removeChild(this);});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;if(data.parent)
data.parent.appendChild(data.el);$(el).removeData('blockUI.history');}
if(typeof opts.onUnblock=='function')
opts.onUnblock(el,opts);};function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked')))
return;if(!full)
$el.data('blockUI.isBlocked',b);if(!opts.bindEvents||(b&&!opts.showOverlay))
return;var events='mousedown mouseup keydown keypress';b?$(document).bind(events,opts,handler):$(document).unbind(events,handler);};function handler(e){if(e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target==els[els.length-1];var back=e.shiftKey&&e.target==els[0];if(fwd||back){setTimeout(function(){focus(back)},10);return false;}}}
if($(e.target).parents('div.blockMsg').length>0)
return true;return $(e.target).parents().children().filter('div.blockUI').length==0;};function focus(back){if(!pageBlockEls)
return;var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e)
e.focus();};function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,'borderLeftWidth');var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,'borderTopWidth');if(x)s.left=l>0?(l+'px'):'0';if(y)s.top=t>0?(t+'px'):'0';};function sz(el,p){return parseInt($.css(el,p))||0;};})(jQuery);
