(function(){var A=YAHOO.util;
A.Selector={_foundCache:[],_regexCache:{},_re:{nth:/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/,attr:/(\[.*\])/g,urls:/^(?:href|src)/},document:window.document,attrAliases:{},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[class~=$1]"},operators:{"=":function(B,C){return B===C
},"!=":function(B,C){return B!==C
},"~=":function(B,D){var C=" ";
return(C+B+C).indexOf((C+D+C))>-1
},"|=":function(B,C){return B===C||B.slice(0,C.length+1)===C+"-"
},"^=":function(B,C){return B.indexOf(C)===0
},"$=":function(B,C){return B.slice(-C.length)===C
},"*=":function(B,C){return B.indexOf(C)>-1
},"":function(B,C){return B
}},pseudos:{root:function(B){return B===B.ownerDocument.documentElement
},"nth-child":function(B,C){return A.Selector._getNth(B,C)
},"nth-last-child":function(B,C){return A.Selector._getNth(B,C,null,true)
},"nth-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName)
},"nth-last-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName,true)
},"first-child":function(B){return A.Selector._getChildren(B.parentNode)[0]===B
},"last-child":function(C){var B=A.Selector._getChildren(C.parentNode);
return B[B.length-1]===C
},"first-of-type":function(B,C){return A.Selector._getChildren(B.parentNode,B.tagName)[0]
},"last-of-type":function(C,D){var B=A.Selector._getChildren(C.parentNode,C.tagName);
return B[B.length-1]
},"only-child":function(C){var B=A.Selector._getChildren(C.parentNode);
return B.length===1&&B[0]===C
},"only-of-type":function(B){return A.Selector._getChildren(B.parentNode,B.tagName).length===1
},empty:function(B){return B.childNodes.length===0
},not:function(B,C){return !A.Selector.test(B,C)
},contains:function(B,D){var C=B.innerText||B.textContent||"";
return C.indexOf(D)>-1
},checked:function(B){return B.checked===true
}},test:function(F,D){F=A.Selector.document.getElementById(F)||F;
if(!F){return false
}var C=D?D.split(","):[];
if(C.length){for(var E=0,B=C.length;
E<B;
++E){if(A.Selector._test(F,C[E])){return true
}}return false
}return A.Selector._test(F,D)
},_test:function(D,G,F,E){F=F||A.Selector._tokenize(G).pop()||{};
if(!D.tagName||(F.tag!=="*"&&D.tagName!==F.tag)||(E&&D._found)){return false
}if(F.attributes.length){var B,H,C=A.Selector._re.urls;
if(!D.attributes||!D.attributes.length){return false
}for(var I=0,K;
K=F.attributes[I++];
){H=(C.test(K[0]))?2:0;
B=D.getAttribute(K[0],H);
if(B===null||B===undefined){return false
}if(A.Selector.operators[K[1]]&&!A.Selector.operators[K[1]](B,K[2])){return false
}}}if(F.pseudos.length){for(var I=0,J=F.pseudos.length;
I<J;
++I){if(A.Selector.pseudos[F.pseudos[I][0]]&&!A.Selector.pseudos[F.pseudos[I][0]](D,F.pseudos[I][1])){return false
}}}return(F.previous&&F.previous.combinator!==",")?A.Selector._combinators[F.previous.combinator](D,F):true
},filter:function(E,D){E=E||[];
var G,C=[],H=A.Selector._tokenize(D);
if(!E.item){for(var F=0,B=E.length;
F<B;
++F){if(!E[F].tagName){G=A.Selector.document.getElementById(E[F]);
if(G){E[F]=G
}else{}}}}C=A.Selector._filter(E,A.Selector._tokenize(D)[0]);
return C
},_filter:function(E,G,H,D){var C=H?null:[],I=A.Selector._foundCache;
for(var F=0,B=E.length;
F<B;
F++){if(!A.Selector._test(E[F],"",G,D)){continue
}if(H){return E[F]
}if(D){if(E[F]._found){continue
}E[F]._found=true;
I[I.length]=E[F]
}C[C.length]=E[F]
}return C
},query:function(C,D,E){var B=A.Selector._query(C,D,E);
return B
},_query:function(H,M,N,F){var P=(N)?null:[],E;
if(!H){return P
}var D=H.split(",");
if(D.length>1){var O;
for(var I=0,J=D.length;
I<J;
++I){O=arguments.callee(D[I],M,N,true);
P=N?O:P.concat(O)
}A.Selector._clearFoundCache();
return P
}if(M&&!M.nodeName){M=A.Selector.document.getElementById(M);
if(!M){return P
}}M=M||A.Selector.document;
if(M.nodeName!=="#document"){A.Dom.generateId(M);
H=M.tagName+"#"+M.id+" "+H;
E=M;
M=M.ownerDocument
}var L=A.Selector._tokenize(H);
var K=L[A.Selector._getIdTokenIndex(L)],B=[],C,G=L.pop()||{};
if(K){C=A.Selector._getId(K.attributes)
}if(C){E=E||A.Selector.document.getElementById(C);
if(E&&(M.nodeName==="#document"||A.Dom.isAncestor(M,E))){if(A.Selector._test(E,null,K)){if(K===G){B=[E]
}else{if(K.combinator===" "||K.combinator===">"){M=E
}}}}else{return P
}}if(M&&!B.length){B=M.getElementsByTagName(G.tag)
}if(B.length){P=A.Selector._filter(B,G,N,F)
}return P
},_clearFoundCache:function(){var E=A.Selector._foundCache;
for(var C=0,B=E.length;
C<B;
++C){try{delete E[C]._found
}catch(D){E[C].removeAttribute("_found")
}}E=[]
},_getRegExp:function(D,B){var C=A.Selector._regexCache;
B=B||"";
if(!C[D+B]){C[D+B]=new RegExp(D,B)
}return C[D+B]
},_getChildren:function(){if(document.documentElement.children){return function(C,B){return(B)?C.children.tags(B):C.children||[]
}
}else{return function(F,C){if(F._children){return F._children
}var E=[],G=F.childNodes;
for(var D=0,B=G.length;
D<B;
++D){if(G[D].tagName){if(!C||G[D].tagName===C){E[E.length]=G[D]
}}}F._children=E;
return E
}
}}(),_combinators:{" ":function(C,B){while((C=C.parentNode)){if(A.Selector._test(C,"",B.previous)){return true
}}return false
},">":function(C,B){return A.Selector._test(C.parentNode,null,B.previous)
},"+":function(D,C){var B=D.previousSibling;
while(B&&B.nodeType!==1){B=B.previousSibling
}if(B&&A.Selector._test(B,null,C.previous)){return true
}return false
},"~":function(D,C){var B=D.previousSibling;
while(B){if(B.nodeType===1&&A.Selector._test(B,null,C.previous)){return true
}B=B.previousSibling
}return false
}},_getNth:function(C,L,N,G){A.Selector._re.nth.test(L);
var K=parseInt(RegExp.$1,10),B=RegExp.$2,H=RegExp.$3,I=parseInt(RegExp.$4,10)||0,M=[],E;
var J=A.Selector._getChildren(C.parentNode,N);
if(H){K=2;
E="+";
B="n";
I=(H==="odd")?1:0
}else{if(isNaN(K)){K=(B)?1:0
}}if(K===0){if(G){I=J.length-I+1
}if(J[I-1]===C){return true
}else{return false
}}else{if(K<0){G=!!G;
K=Math.abs(K)
}}if(!G){for(var D=I-1,F=J.length;
D<F;
D+=K){if(D>=0&&J[D]===C){return true
}}}else{for(var D=J.length-I,F=J.length;
D>=0;
D-=K){if(D<F&&J[D]===C){return true
}}}return false
},_getId:function(C){for(var D=0,B=C.length;
D<B;
++D){if(C[D][0]=="id"&&C[D][1]==="="){return C[D][2]
}}},_getIdTokenIndex:function(D){for(var C=0,B=D.length;
C<B;
++C){if(A.Selector._getId(D[C].attributes)){return C
}}return -1
},_patterns:{tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/},_tokenize:function(B){var D={},H=[],I,G=false,F=A.Selector._patterns,C;
B=A.Selector._replaceShorthand(B);
do{G=false;
for(var E in F){if(YAHOO.lang.hasOwnProperty(F,E)){if(E!="tag"&&E!="combinator"){D[E]=D[E]||[]
}if((C=F[E].exec(B))){G=true;
if(E!="tag"&&E!="combinator"){if(E==="attributes"&&C[1]==="id"){D.id=C[3]
}D[E].push(C.slice(1))
}else{D[E]=C[1]
}B=B.replace(C[0],"");
if(E==="combinator"||!B.length){D.attributes=A.Selector._fixAttributes(D.attributes);
D.pseudos=D.pseudos||[];
D.tag=D.tag?D.tag.toUpperCase():"*";
H.push(D);
D={previous:D}
}}}}}while(G);
return H
},_fixAttributes:function(C){var D=A.Selector.attrAliases;
C=C||[];
for(var E=0,B=C.length;
E<B;
++E){if(D[C[E][0]]){C[E][0]=D[C[E][0]]
}if(!C[E][1]){C[E][1]=""
}}return C
},_replaceShorthand:function(C){var D=A.Selector.shorthand;
var E=C.match(A.Selector._re.attr);
if(E){C=C.replace(A.Selector._re.attr,"REPLACED_ATTRIBUTE")
}for(var G in D){if(YAHOO.lang.hasOwnProperty(D,G)){C=C.replace(A.Selector._getRegExp(G,"gi"),D[G])
}}if(E){for(var F=0,B=E.length;
F<B;
++F){C=C.replace("REPLACED_ATTRIBUTE",E[F])
}}return C
}};
if(YAHOO.env.ua.ie&&((!document.documentMode&&YAHOO.env.ua.ie<8)||document.documentMode<8)){A.Selector.attrAliases["class"]="className";
A.Selector.attrAliases["for"]="htmlFor"
}})();
YAHOO.register("selector",YAHOO.util.Selector,{version:"2.7.0",build:"1796"});
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};
(function(){var B=Date,A=B.prototype,D=B.CultureInfo,G=function(I,H){if(!H){H=2
}return("000"+I).slice(H*-1)
};
A.clearTime=function(){this.setHours(0);
this.setMinutes(0);
this.setSeconds(0);
this.setMilliseconds(0);
return this
};
A.setTimeToNow=function(){var H=new Date();
this.setHours(H.getHours());
this.setMinutes(H.getMinutes());
this.setSeconds(H.getSeconds());
this.setMilliseconds(H.getMilliseconds());
return this
};
B.today=function(){return new Date().clearTime()
};
B.compare=function(I,H){if(isNaN(I)||isNaN(H)){throw new Error(I+" - "+H)
}else{if(I instanceof Date&&H instanceof Date){return(I<H)?-1:(I>H)?1:0
}else{throw new TypeError(I+" - "+H)
}}};
B.equals=function(I,H){return(I.compareTo(H)===0)
};
B.getDayNumberFromName=function(I){var M=D.dayNames,H=D.abbreviatedDayNames,L=D.shortestDayNames,K=I.toLowerCase();
for(var J=0;
J<M.length;
J++){if(M[J].toLowerCase()==K||H[J].toLowerCase()==K||L[J].toLowerCase()==K){return J
}}return -1
};
B.getMonthNumberFromName=function(I){var L=D.monthNames,H=D.abbreviatedMonthNames,K=I.toLowerCase();
for(var J=0;
J<L.length;
J++){if(L[J].toLowerCase()==K||H[J].toLowerCase()==K){return J
}}return -1
};
B.isLeapYear=function(H){return((H%4===0&&H%100!==0)||H%400===0)
};
B.getDaysInMonth=function(H,I){return[31,(B.isLeapYear(H)?29:28),31,30,31,30,31,31,30,31,30,31][I]
};
B.getTimezoneAbbreviation=function(K){var J=D.timezones,I;
for(var H=0;
H<J.length;
H++){if(J[H].offset===K){return J[H].name
}}return null
};
B.getTimezoneOffset=function(H){var K=D.timezones,J;
for(var I=0;
I<K.length;
I++){if(K[I].name===H.toUpperCase()){return K[I].offset
}}return null
};
A.clone=function(){return new Date(this.getTime())
};
A.compareTo=function(H){return Date.compare(this,H)
};
A.equals=function(H){return Date.equals(this,H||new Date())
};
A.between=function(I,H){return this.getTime()>=I.getTime()&&this.getTime()<=H.getTime()
};
A.isAfter=function(H){return this.compareTo(H||new Date())===1
};
A.isBefore=function(H){return(this.compareTo(H||new Date())===-1)
};
A.isToday=function(){return this.isSameDay(new Date())
};
A.isSameDay=function(H){return this.clone().clearTime().equals(H.clone().clearTime())
};
A.addMilliseconds=function(H){this.setMilliseconds(this.getMilliseconds()+H);
return this
};
A.addSeconds=function(H){return this.addMilliseconds(H*1000)
};
A.addMinutes=function(H){return this.addMilliseconds(H*60000)
};
A.addHours=function(H){return this.addMilliseconds(H*3600000)
};
A.addDays=function(H){this.setDate(this.getDate()+H);
return this
};
A.addWeeks=function(H){return this.addDays(H*7)
};
A.addMonths=function(H){var I=this.getDate();
this.setDate(1);
this.setMonth(this.getMonth()+H);
this.setDate(Math.min(I,B.getDaysInMonth(this.getFullYear(),this.getMonth())));
return this
};
A.addYears=function(H){return this.addMonths(H*12)
};
A.add=function(I){if(typeof I=="number"){this._orient=I;
return this
}var H=I;
if(H.milliseconds){this.addMilliseconds(H.milliseconds)
}if(H.seconds){this.addSeconds(H.seconds)
}if(H.minutes){this.addMinutes(H.minutes)
}if(H.hours){this.addHours(H.hours)
}if(H.weeks){this.addWeeks(H.weeks)
}if(H.months){this.addMonths(H.months)
}if(H.years){this.addYears(H.years)
}if(H.days){this.addDays(H.days)
}return this
};
var E,F,C;
A.getWeek=function(){var O,N,M,L,K,J,I,H,Q,P;
E=(!E)?this.getFullYear():E;
F=(!F)?this.getMonth()+1:F;
C=(!C)?this.getDate():C;
if(F<=2){O=E-1;
N=(O/4|0)-(O/100|0)+(O/400|0);
M=((O-1)/4|0)-((O-1)/100|0)+((O-1)/400|0);
Q=N-M;
K=0;
J=C-1+(31*(F-1))
}else{O=E;
N=(O/4|0)-(O/100|0)+(O/400|0);
M=((O-1)/4|0)-((O-1)/100|0)+((O-1)/400|0);
Q=N-M;
K=Q+1;
J=C+((153*(F-3)+2)/5)+58+Q
}I=(O+N)%7;
L=(J+I-K)%7;
H=(J+3-L)|0;
if(H<0){P=53-((I-Q)/5|0)
}else{if(H>364+Q){P=1
}else{P=(H/7|0)+1
}}E=F=C=null;
return P
};
A.getISOWeek=function(){E=this.getUTCFullYear();
F=this.getUTCMonth()+1;
C=this.getUTCDate();
return G(this.getWeek())
};
A.setWeek=function(H){return this.moveToDayOfWeek(1).addWeeks(H-this.getWeek())
};
B._validate=function(K,J,H,I){if(typeof K=="undefined"){return false
}else{if(typeof K!="number"){throw new TypeError(K+" is not a Number.")
}else{if(K<J||K>H){throw new RangeError(K+" is not a valid value for "+I+".")
}}}return true
};
B.validateMillisecond=function(H){return B._validate(H,0,999,"millisecond")
};
B.validateSecond=function(H){return B._validate(H,0,59,"second")
};
B.validateMinute=function(H){return B._validate(H,0,59,"minute")
};
B.validateHour=function(H){return B._validate(H,0,23,"hour")
};
B.validateDay=function(I,H,J){return B._validate(I,1,B.getDaysInMonth(H,J),"day")
};
B.validateMonth=function(H){return B._validate(H,0,11,"month")
};
B.validateYear=function(H){return B._validate(H,0,9999,"year")
};
A.set=function(H){if(B.validateMillisecond(H.millisecond)){this.addMilliseconds(H.millisecond-this.getMilliseconds())
}if(B.validateSecond(H.second)){this.addSeconds(H.second-this.getSeconds())
}if(B.validateMinute(H.minute)){this.addMinutes(H.minute-this.getMinutes())
}if(B.validateHour(H.hour)){this.addHours(H.hour-this.getHours())
}if(B.validateMonth(H.month)){this.addMonths(H.month-this.getMonth())
}if(B.validateYear(H.year)){this.addYears(H.year-this.getFullYear())
}if(B.validateDay(H.day,this.getFullYear(),this.getMonth())){this.addDays(H.day-this.getDate())
}if(H.timezone){this.setTimezone(H.timezone)
}if(H.timezoneOffset){this.setTimezoneOffset(H.timezoneOffset)
}if(H.week&&B._validate(H.week,0,53,"week")){this.setWeek(H.week)
}return this
};
A.moveToFirstDayOfMonth=function(){return this.set({day:1})
};
A.moveToLastDayOfMonth=function(){return this.set({day:B.getDaysInMonth(this.getFullYear(),this.getMonth())})
};
A.moveToNthOccurrence=function(I,J){var H=0;
if(J>0){H=J-1
}else{if(J===-1){this.moveToLastDayOfMonth();
if(this.getDay()!==I){this.moveToDayOfWeek(I,-1)
}return this
}}return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(I,+1).addWeeks(H)
};
A.moveToDayOfWeek=function(H,I){var J=(H-this.getDay()+7*(I||+1))%7;
return this.addDays((J===0)?J+=7*(I||+1):J)
};
A.moveToMonth=function(J,H){var I=(J-this.getMonth()+12*(H||+1))%12;
return this.addMonths((I===0)?I+=12*(H||+1):I)
};
A.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/86400000)+1
};
A.getTimezone=function(){return B.getTimezoneAbbreviation(this.getUTCOffset())
};
A.setTimezoneOffset=function(J){var H=this.getTimezoneOffset(),I=Number(J)*-6/10;
return this.addMinutes(I-H)
};
A.setTimezone=function(H){return this.setTimezoneOffset(B.getTimezoneOffset(H))
};
A.hasDaylightSavingTime=function(){return(Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset())
};
A.isDaylightSavingTime=function(){return(this.hasDaylightSavingTime()&&new Date().getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset())
};
A.getUTCOffset=function(){var I=this.getTimezoneOffset()*-10/6,H;
if(I<0){H=(I-10000).toString();
return H.charAt(0)+H.substr(2)
}else{H=(I+10000).toString();
return"+"+H.substr(1)
}};
A.getElapsed=function(H){return(H||new Date())-this
};
if(!A.toISOString){A.toISOString=function(){function H(I){return I<10?"0"+I:I
}return'"'+this.getUTCFullYear()+"-"+H(this.getUTCMonth()+1)+"-"+H(this.getUTCDate())+"T"+H(this.getUTCHours())+":"+H(this.getUTCMinutes())+":"+H(this.getUTCSeconds())+'Z"'
}
}A._toString=A.toString;
A.toString=function(J){var H=this;
if(J&&J.length==1){var K=D.formatPatterns;
H.t=H.toString;
switch(J){case"d":return H.t(K.shortDate);
case"D":return H.t(K.longDate);
case"F":return H.t(K.fullDateTime);
case"m":return H.t(K.monthDay);
case"r":return H.t(K.rfc1123);
case"s":return H.t(K.sortableDateTime);
case"t":return H.t(K.shortTime);
case"T":return H.t(K.longTime);
case"u":return H.t(K.universalSortableDateTime);
case"y":return H.t(K.yearMonth)
}}var I=function(L){switch(L*1){case 1:case 21:case 31:return"st";
case 2:case 22:return"nd";
case 3:case 23:return"rd";
default:return"th"
}};
return J?J.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(L){if(L.charAt(0)==="\\"){return L.replace("\\","")
}H.h=H.getHours;
switch(L){case"hh":return G(H.h()<13?(H.h()===0?12:H.h()):(H.h()-12));
case"h":return H.h()<13?(H.h()===0?12:H.h()):(H.h()-12);
case"HH":return G(H.h());
case"H":return H.h();
case"mm":return G(H.getMinutes());
case"m":return H.getMinutes();
case"ss":return G(H.getSeconds());
case"s":return H.getSeconds();
case"yyyy":return G(H.getFullYear(),4);
case"yy":return G(H.getFullYear());
case"dddd":return D.dayNames[H.getDay()];
case"ddd":return D.abbreviatedDayNames[H.getDay()];
case"dd":return G(H.getDate());
case"d":return H.getDate();
case"MMMM":return D.monthNames[H.getMonth()];
case"MMM":return D.abbreviatedMonthNames[H.getMonth()];
case"MM":return G((H.getMonth()+1));
case"M":return H.getMonth()+1;
case"t":return H.h()<12?D.amDesignator.substring(0,1):D.pmDesignator.substring(0,1);
case"tt":return H.h()<12?D.amDesignator:D.pmDesignator;
case"S":return I(H.getDate());
default:return L
}}):this._toString()
}
}());
(function(){var Q=Date,G=Q.prototype,R=Q.CultureInfo,K=Number.prototype;
G._orient=+1;
G._nth=null;
G._is=false;
G._same=false;
G._isSecond=false;
K._dateElement="day";
G.next=function(){this._orient=+1;
return this
};
Q.next=function(){return Q.today().next()
};
G.last=G.prev=G.previous=function(){this._orient=-1;
return this
};
Q.last=Q.prev=Q.previous=function(){return Q.today().last()
};
G.is=function(){this._is=true;
return this
};
G.same=function(){this._same=true;
this._isSecond=false;
return this
};
G.today=function(){return this.same().day()
};
G.weekday=function(){if(this._is){this._is=false;
return(!this.is().sat()&&!this.is().sun())
}return false
};
G.at=function(V){return(typeof V==="string")?Q.parse(this.toString("d")+" "+V):this.set(V)
};
K.fromNow=K.after=function(V){var W={};
W[this._dateElement]=this;
return((!V)?new Date():V.clone()).add(W)
};
K.ago=K.before=function(V){var W={};
W[this._dateElement]=this*-1;
return((!V)?new Date():V.clone()).add(W)
};
var E=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),H=("january february march april may june july august september october november december").split(/\s/),J=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),L=("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/),B=("final first second third fourth fifth").split(/\s/),T;
G.toObject=function(){var W={};
for(var V=0;
V<J.length;
V++){W[J[V].toLowerCase()]=this["get"+L[V]]()
}return W
};
Q.fromObject=function(V){V.week=null;
return Date.today().set(V)
};
var S=function(V){return function(){if(this._is){this._is=false;
return this.getDay()==V
}if(this._nth!==null){if(this._isSecond){this.addSeconds(this._orient*-1)
}this._isSecond=false;
var X=this._nth;
this._nth=null;
var W=this.clone().moveToLastDayOfMonth();
this.moveToNthOccurrence(V,X);
if(this>W){throw new RangeError(Q.getDayName(V)+" does not occur "+X+" times in the month of "+Q.getMonthName(W.getMonth())+" "+W.getFullYear()+".")
}return this
}return this.moveToDayOfWeek(V,this._orient)
}
};
var F=function(V){return function(){var X=Q.today(),W=V-X.getDay();
if(V===0&&R.firstDayOfWeek===1&&X.getDay()!==0){W=W+7
}return X.addDays(W)
}
};
for(var P=0;
P<E.length;
P++){Q[E[P].toUpperCase()]=Q[E[P].toUpperCase().substring(0,3)]=P;
Q[E[P]]=Q[E[P].substring(0,3)]=F(P);
G[E[P]]=G[E[P].substring(0,3)]=S(P)
}var U=function(V){return function(){if(this._is){this._is=false;
return this.getMonth()===V
}return this.moveToMonth(V,this._orient)
}
};
var I=function(V){return function(){return Q.today().set({month:V,day:1})
}
};
for(var O=0;
O<H.length;
O++){Q[H[O].toUpperCase()]=Q[H[O].toUpperCase().substring(0,3)]=O;
Q[H[O]]=Q[H[O].substring(0,3)]=I(O);
G[H[O]]=G[H[O].substring(0,3)]=U(O)
}var C=function(V){return function(){if(this._isSecond){this._isSecond=false;
return this
}if(this._same){this._same=this._is=false;
var a=this.toObject(),Z=(arguments[0]||new Date()).toObject(),Y="",X=V.toLowerCase();
for(var W=(J.length-1);
W>-1;
W--){Y=J[W].toLowerCase();
if(a[Y]!=Z[Y]){return false
}if(X==Y){break
}}return true
}if(V.substring(V.length-1)!="s"){V+="s"
}return this["add"+V](this._orient)
}
};
var D=function(V){return function(){this._dateElement=V;
return this
}
};
for(var N=0;
N<J.length;
N++){T=J[N].toLowerCase();
G[T]=G[T+"s"]=C(J[N]);
K[T]=K[T+"s"]=D(T)
}G._ss=C("Second");
var A=function(V){return function(W){if(this._same){return this._ss(arguments[0])
}if(W||W===0){return this.moveToNthOccurrence(W,V)
}this._nth=V;
if(V===2&&(W===undefined||W===null)){this._isSecond=true;
return this.addSeconds(this._orient)
}return this
}
};
for(var M=0;
M<B.length;
M++){G[B[M]]=(M===0)?A(-1):A(M)
}}());
(function(){Date.Parsing={Exception:function(I){this.message="Parse error at '"+I.substring(0,10)+" ...'"
}};
var A=Date.Parsing;
var C=A.Operators={rtoken:function(I){return function(J){var K=J.match(I);
if(K){return([K[0],J.substring(K[0].length)])
}else{throw new A.Exception(J)
}}
},token:function(I){return function(J){return C.rtoken(new RegExp("^s*"+J+"s*"))(J)
}
},stoken:function(I){return C.rtoken(new RegExp("^"+I))
},until:function(I){return function(J){var K=[],M=null;
while(J.length){try{M=I.call(this,J)
}catch(L){K.push(M[0]);
J=M[1];
continue
}break
}return[K,J]
}
},many:function(I){return function(J){var M=[],K=null;
while(J.length){try{K=I.call(this,J)
}catch(L){return[M,J]
}M.push(K[0]);
J=K[1]
}return[M,J]
}
},optional:function(I){return function(J){var K=null;
try{K=I.call(this,J)
}catch(L){return[null,J]
}return[K[0],K[1]]
}
},not:function(I){return function(J){try{I.call(this,J)
}catch(K){return[null,J]
}throw new A.Exception(J)
}
},ignore:function(I){return I?function(J){var K=null;
K=I.call(this,J);
return[null,K[1]]
}:null
},product:function(){var J=arguments[0],K=Array.prototype.slice.call(arguments,1),L=[];
for(var I=0;
I<J.length;
I++){L.push(C.each(J[I],K))
}return L
},cache:function(K){var I={},J=null;
return function(L){try{J=I[L]=(I[L]||K.call(this,L))
}catch(M){J=I[L]=M
}if(J instanceof A.Exception){throw J
}else{return J
}}
},any:function(){var I=arguments;
return function(K){var L=null;
for(var J=0;
J<I.length;
J++){if(I[J]==null){continue
}try{L=(I[J].call(this,K))
}catch(M){L=null
}if(L){return L
}}throw new A.Exception(K)
}
},each:function(){var I=arguments;
return function(K){var N=[],L=null;
for(var J=0;
J<I.length;
J++){if(I[J]==null){continue
}try{L=(I[J].call(this,K))
}catch(M){throw new A.Exception(K)
}N.push(L[0]);
K=L[1]
}return[N,K]
}
},all:function(){var J=arguments,I=I;
return I.each(I.optional(J))
},sequence:function(I,J,K){J=J||C.rtoken(/^\s*/);
K=K||null;
if(I.length==1){return I[0]
}return function(O){var P=null,Q=null;
var S=[];
for(var N=0;
N<I.length;
N++){try{P=I[N].call(this,O)
}catch(R){break
}S.push(P[0]);
try{Q=J.call(this,P[1])
}catch(M){Q=null;
break
}O=Q[1]
}if(!P){throw new A.Exception(O)
}if(Q){throw new A.Exception(Q[1])
}if(K){try{P=K.call(this,P[1])
}catch(L){throw new A.Exception(P[1])
}}return[S,(P?P[1]:O)]
}
},between:function(J,K,I){I=I||J;
var L=C.each(C.ignore(J),K,C.ignore(I));
return function(M){var N=L.call(this,M);
return[[N[0][0],r[0][2]],N[1]]
}
},list:function(I,J,K){J=J||C.rtoken(/^\s*/);
K=K||null;
return(I instanceof Array?C.each(C.product(I.slice(0,-1),C.ignore(J)),I.slice(-1),C.ignore(K)):C.each(C.many(C.each(I,C.ignore(J))),px,C.ignore(K)))
},set:function(I,J,K){J=J||C.rtoken(/^\s*/);
K=K||null;
return function(X){var L=null,N=null,M=null,O=null,P=[[],X],W=false;
for(var R=0;
R<I.length;
R++){M=null;
N=null;
L=null;
W=(I.length==1);
try{L=I[R].call(this,X)
}catch(U){continue
}O=[[L[0]],L[1]];
if(L[1].length>0&&!W){try{M=J.call(this,L[1])
}catch(V){W=true
}}else{W=true
}if(!W&&M[1].length===0){W=true
}if(!W){var S=[];
for(var Q=0;
Q<I.length;
Q++){if(R!=Q){S.push(I[Q])
}}N=C.set(S,J).call(this,M[1]);
if(N[0].length>0){O[0]=O[0].concat(N[0]);
O[1]=N[1]
}}if(O[1].length<P[1].length){P=O
}if(P[1].length===0){break
}}if(P[0].length===0){return P
}if(K){try{M=K.call(this,P[1])
}catch(T){throw new A.Exception(P[1])
}P[1]=M[1]
}return P
}
},forward:function(I,J){return function(K){return I[J].call(this,K)
}
},replace:function(J,I){return function(K){var L=J.call(this,K);
return[I,L[1]]
}
},process:function(J,I){return function(K){var L=J.call(this,K);
return[I.call(this,L[0]),L[1]]
}
},min:function(I,J){return function(K){var L=J.call(this,K);
if(L[0].length<I){throw new A.Exception(K)
}return L
}
}};
var H=function(I){return function(){var J=null,M=[];
if(arguments.length>1){J=Array.prototype.slice.call(arguments)
}else{if(arguments[0] instanceof Array){J=arguments[0]
}}if(J){for(var L=0,K=J.shift();
L<K.length;
L++){J.unshift(K[L]);
M.push(I.apply(null,J));
J.shift();
return M
}}else{return I.apply(null,arguments)
}}
};
var G="optional not ignore cache".split(/\s/);
for(var D=0;
D<G.length;
D++){C[G[D]]=H(C[G[D]])
}var F=function(I){return function(){if(arguments[0] instanceof Array){return I.apply(null,arguments[0])
}else{return I.apply(null,arguments)
}}
};
var E="each any all".split(/\s/);
for(var B=0;
B<E.length;
B++){C[E[B]]=F(C[E[B]])
}}());
(function(){var E=Date,K=E.prototype,F=E.CultureInfo;
var G=function(M){var N=[];
for(var L=0;
L<M.length;
L++){if(M[L] instanceof Array){N=N.concat(G(M[L]))
}else{if(M[L]){N.push(M[L])
}}}return N
};
E.Grammar={};
E.Translator={hour:function(L){return function(){this.hour=Number(L)
}
},minute:function(L){return function(){this.minute=Number(L)
}
},second:function(L){return function(){this.second=Number(L)
}
},meridian:function(L){return function(){this.meridian=L.slice(0,1).toLowerCase()
}
},timezone:function(L){return function(){var M=L.replace(/[^\d\+\-]/g,"");
if(M.length){this.timezoneOffset=Number(M)
}else{this.timezone=L.toLowerCase()
}}
},day:function(L){var M=L[0];
return function(){this.day=Number(M.match(/\d+/)[0])
}
},month:function(L){return function(){this.month=(L.length==3)?"jan feb mar apr may jun jul aug sep oct nov dec".indexOf(L)/4:Number(L)-1
}
},year:function(L){return function(){var M=Number(L);
this.year=((L.length>2)?M:(M+(((M+2000)<F.twoDigitYearMax)?2000:1900)))
}
},rday:function(L){return function(){switch(L){case"yesterday":this.days=-1;
break;
case"tomorrow":this.days=1;
break;
case"today":this.days=0;
break;
case"now":this.days=0;
this.now=true;
break
}}
},finishExact:function(L){L=(L instanceof Array)?L:[L];
for(var N=0;
N<L.length;
N++){if(L[N]){L[N].call(this)
}}var M=new Date();
if((this.hour||this.minute)&&(!this.month&&!this.year&&!this.day)){this.day=M.getDate()
}if(!this.year){this.year=M.getFullYear()
}if(!this.month&&this.month!==0){this.month=M.getMonth()
}if(!this.day){this.day=1
}if(!this.hour){this.hour=0
}if(!this.minute){this.minute=0
}if(!this.second){this.second=0
}if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12
}else{if(this.meridian=="a"&&this.hour==12){this.hour=0
}}}if(this.day>E.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")
}var O=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);
if(this.timezone){O.set({timezone:this.timezone})
}else{if(this.timezoneOffset){O.set({timezoneOffset:this.timezoneOffset})
}}return O
},finish:function(L){L=(L instanceof Array)?G(L):[L];
if(L.length===0){return null
}for(var Q=0;
Q<L.length;
Q++){if(typeof L[Q]=="function"){L[Q].call(this)
}}var N=E.today();
if(this.now&&!this.unit&&!this.operator){return new Date()
}else{if(this.now){N=new Date()
}}var R=!!(this.days&&this.days!==null||this.orient||this.operator);
var S,P,O;
O=((this.orient=="past"||this.operator=="subtract")?-1:1);
if(!this.now&&"hour minute second".indexOf(this.unit)!=-1){N.setTimeToNow()
}if(this.month||this.month===0){if("year day hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;
this.month=null;
R=true
}}if(!R&&this.weekday&&!this.day&&!this.days){var M=Date[this.weekday]();
this.day=M.getDate();
if(!this.month){this.month=M.getMonth()
}this.year=M.getFullYear()
}if(R&&this.weekday&&this.unit!="month"){this.unit="day";
S=(E.getDayNumberFromName(this.weekday)-N.getDay());
P=7;
this.days=S?((S+(O*P))%P):(O*P)
}if(this.month&&this.unit=="day"&&this.operator){this.value=(this.month+1);
this.month=null
}if(this.value!=null&&this.month!=null&&this.year!=null){this.day=this.value*1
}if(this.month&&!this.day&&this.value){N.set({day:this.value*1});
if(!R){this.day=this.value*1
}}if(!this.month&&this.value&&this.unit=="month"&&!this.now){this.month=this.value;
R=true
}if(R&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";
S=(this.month-N.getMonth());
P=12;
this.months=S?((S+(O*P))%P):(O*P);
this.month=null
}if(!this.unit){this.unit="day"
}if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null){this[this.unit+"s"]=this[this.unit+"s"]+((this.operator=="add")?1:-1)+(this.value||0)*O
}else{if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1
}this[this.unit+"s"]=this.value*O
}}if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12
}else{if(this.meridian=="a"&&this.hour==12){this.hour=0
}}}if(this.weekday&&!this.day&&!this.days){var M=Date[this.weekday]();
this.day=M.getDate();
if(M.getMonth()!==N.getMonth()){this.month=M.getMonth()
}}if((this.month||this.month===0)&&!this.day){this.day=1
}if(!this.orient&&!this.operator&&this.unit=="week"&&this.value&&!this.day&&!this.month){return Date.today().setWeek(this.value)
}if(R&&this.timezone&&this.day&&this.days){this.day=this.days
}return(R)?N.add(this):N.set(this)
}};
var H=E.Parsing.Operators,D=E.Grammar,J=E.Translator,B;
D.datePartDelimiter=H.rtoken(/^([\s\-\.\,\/\x27]+)/);
D.timePartDelimiter=H.stoken(":");
D.whiteSpace=H.rtoken(/^\s*/);
D.generalDelimiter=H.rtoken(/^(([\s\,]|at|@|on)+)/);
var A={};
D.ctoken=function(P){var O=A[P];
if(!O){var Q=F.regexPatterns;
var N=P.split(/\s+/),M=[];
for(var L=0;
L<N.length;
L++){M.push(H.replace(H.rtoken(Q[N[L]]),N[L]))
}O=A[P]=H.any.apply(null,M)
}return O
};
D.ctoken2=function(L){return H.rtoken(F.regexPatterns[L])
};
D.h=H.cache(H.process(H.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),J.hour));
D.hh=H.cache(H.process(H.rtoken(/^(0[0-9]|1[0-2])/),J.hour));
D.H=H.cache(H.process(H.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),J.hour));
D.HH=H.cache(H.process(H.rtoken(/^([0-1][0-9]|2[0-3])/),J.hour));
D.m=H.cache(H.process(H.rtoken(/^([0-5][0-9]|[0-9])/),J.minute));
D.mm=H.cache(H.process(H.rtoken(/^[0-5][0-9]/),J.minute));
D.s=H.cache(H.process(H.rtoken(/^([0-5][0-9]|[0-9])/),J.second));
D.ss=H.cache(H.process(H.rtoken(/^[0-5][0-9]/),J.second));
D.hms=H.cache(H.sequence([D.H,D.m,D.s],D.timePartDelimiter));
D.t=H.cache(H.process(D.ctoken2("shortMeridian"),J.meridian));
D.tt=H.cache(H.process(D.ctoken2("longMeridian"),J.meridian));
D.z=H.cache(H.process(H.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),J.timezone));
D.zz=H.cache(H.process(H.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),J.timezone));
D.zzz=H.cache(H.process(D.ctoken2("timezone"),J.timezone));
D.timeSuffix=H.each(H.ignore(D.whiteSpace),H.set([D.tt,D.zzz]));
D.time=H.each(H.optional(H.ignore(H.stoken("T"))),D.hms,D.timeSuffix);
D.d=H.cache(H.process(H.each(H.rtoken(/^([0-2]\d|3[0-1]|\d)/),H.optional(D.ctoken2("ordinalSuffix"))),J.day));
D.dd=H.cache(H.process(H.each(H.rtoken(/^([0-2]\d|3[0-1])/),H.optional(D.ctoken2("ordinalSuffix"))),J.day));
D.ddd=D.dddd=H.cache(H.process(D.ctoken("sun mon tue wed thu fri sat"),function(L){return function(){this.weekday=L
}
}));
D.M=H.cache(H.process(H.rtoken(/^(1[0-2]|0\d|\d)/),J.month));
D.MM=H.cache(H.process(H.rtoken(/^(1[0-2]|0\d)/),J.month));
D.MMM=D.MMMM=H.cache(H.process(D.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),J.month));
D.y=H.cache(H.process(H.rtoken(/^(\d\d?)/),J.year));
D.yy=H.cache(H.process(H.rtoken(/^(\d\d)/),J.year));
D.yyy=H.cache(H.process(H.rtoken(/^(\d\d?\d?\d?)/),J.year));
D.yyyy=H.cache(H.process(H.rtoken(/^(\d\d\d\d)/),J.year));
B=function(){return H.each(H.any.apply(null,arguments),H.not(D.ctoken2("timeContext")))
};
D.day=B(D.d,D.dd);
D.month=B(D.M,D.MMM);
D.year=B(D.yyyy,D.yy);
D.orientation=H.process(D.ctoken("past future"),function(L){return function(){this.orient=L
}
});
D.operator=H.process(D.ctoken("add subtract"),function(L){return function(){this.operator=L
}
});
D.rday=H.process(D.ctoken("yesterday tomorrow today now"),J.rday);
D.unit=H.process(D.ctoken("second minute hour day week month year"),function(L){return function(){this.unit=L
}
});
D.value=H.process(H.rtoken(/^\d\d?(st|nd|rd|th)?/),function(L){return function(){this.value=L.replace(/\D/g,"")
}
});
D.expression=H.set([D.rday,D.operator,D.value,D.unit,D.orientation,D.ddd,D.MMM]);
B=function(){return H.set(arguments,D.datePartDelimiter)
};
D.mdy=B(D.ddd,D.month,D.day,D.year);
D.ymd=B(D.ddd,D.year,D.month,D.day);
D.dmy=B(D.ddd,D.day,D.month,D.year);
D.date=function(L){return((D[F.dateElementOrder]||D.mdy).call(this,L))
};
D.format=H.process(H.many(H.any(H.process(H.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(L){if(D[L]){return D[L]
}else{throw E.Parsing.Exception(L)
}}),H.process(H.rtoken(/^[^dMyhHmstz]+/),function(L){return H.ignore(H.stoken(L))
}))),function(L){return H.process(H.each.apply(null,L),J.finishExact)
});
var I={};
var C=function(L){return I[L]=(I[L]||D.format(L)[0])
};
D.formats=function(M){if(M instanceof Array){var N=[];
for(var L=0;
L<M.length;
L++){N.push(C(M[L]))
}return H.any.apply(null,N)
}else{return C(M)
}};
D._formats=D.formats(['"yyyy-MM-ddTHH:mm:ssZ"',"yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);
D._start=H.process(H.set([D.date,D.time,D.expression],D.generalDelimiter,D.whiteSpace),J.finish);
D.start=function(L){try{var M=D._formats.call({},L);
if(M[1].length===0){return M
}}catch(N){}return D._start.call({},L)
};
E._parse=E.parse;
E.parse=function(L){var M=null;
if(!L){return null
}if(L instanceof Date){return L
}try{M=E.Grammar.start.call({},L.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"))
}catch(N){return null
}return((M[1].length===0)?M[0]:null)
};
E.getParseFunction=function(M){var L=E.Grammar.formats(M);
return function(N){var O=null;
try{O=L.call({},N)
}catch(P){return null
}return((O[1].length===0)?O[0]:null)
}
};
E.parseExact=function(L,M){return E.getParseFunction(M)(L)
}
}());
var $C=YAHOO.util.Connect;
var $D=YAHOO.util.Dom;
var $E=YAHOO.util.Event;
var $EL=YAHOO.util.Element;
var $H=YAHOO.util.History;
var $L=YAHOO.log;
var $S=YAHOO.util.Selector;
var $Y=YAHOO.lang;
var $=$D.get;
var $$=$S.query;
if(typeof (console)=="undefined"){console={log:$L}
}var Logos=YAHOO.namespace("Logos");
var Global={ContentVersion:"1.0",DebugMode:false,CurrentVersion:"NIV",CurrentReference:"Ge 1",PrevReference:null,NextReference:null,LogReader:null,ReferenceLock:null,ScrollUpdateEvent:null,UpdateReferenceConnection:null,PrevChunkConnection:null,NextChunkConnection:null,LoadAdjacent:true,GAPageTracker:null,HighlightedReference:null,HighlightStateToken:",hi=",Init:function(C,B,A){if(A){Global.DebugMode=true
}if(Global.ContentServerPath==null){Global.ContentServerPath="http://common.logos.com/"+Global.ContentVersion
}Global.VersionChangeEvent=new YAHOO.util.CustomEvent("VersionChange");
Global.ContentBody=$("contentBody");
Search.Init();
Page.Init();
Page.UpdateContent(Global.ContentBody);
if(!Global.OnBodyScroll()){Global.RemoveSpacer()
}$E.on(Page.ScrollEventProvider,"scroll",Global.OnBodyScroll,null,true)
},RemoveSpacer:function(){var C=$("scrollSpacer");
if(C!=null&&$D.inDocument(C)){try{Global.ContentBody.removeChild(C)
}catch(B){var A="";
for(var D in B){A+=D+": "+B[D]+"\n"
}alert("error removing spacer:"+A);
$L(B,"error")
}}},UnlockReferenceWhenComplete:function(A){if(Global.ReferenceLock!=null){if(Global.NextChunkConnection==null&&Global.PrevChunkConnection==null&&Global.UpdateReferenceConnection==null){$L("UnlockReferenceWhenComplete: ReferenceLock = null");
if(Global.ScrollUpdateEvent!=null){clearTimeout(Global.ScrollUpdateEvent)
}Page.ScrollToReference(Global.ReferenceLock);
Global.SetDisplayReference(Global.ReferenceLock);
Global.RemoveSpacer();
setTimeout(function(){Global.ReferenceLock=null;
Page.SermonRetrievalTimerLock=false;
if(A){A()
}},100)
}else{setTimeout(function(){Global.UnlockReferenceWhenComplete(A)
},100)
}}},UpdateVersionCore:function(A){if(A==null){return 
}$L("UpdateVersionCore: ReferenceLock = "+Global.CurrentReference);
Global.ReferenceLock=Global.CurrentReference;
Global.UpdateReferenceCore(Global.ReferenceLock,A,Global.HighlightedReference)
},RetrieveReference:function(A,B,E,H,D,G){if(A==null){A=Global.CurrentReference
}if(B==null){B=Global.CurrentVersion
}$L("Retrieving reference: ("+B+") "+A);
var F=new Logos.Reference(A);
F.Verse=null;
F.IsRange=false;
var C="/passage/"+B+"/"+F.ToString()+".js"+(G?"?loadAdjacent=true":"");
return $C.asyncRequest("Get",C,{success:function(I){$L("Success retrieving reference: ("+B+") "+A);
if(E){E(I)
}H(I)
},failure:function(I){$L("Failure retrieving reference: ("+B+") "+A);
if(E){E(I)
}D(I)
}})
},SetDisplayReference:function(A){try{var C=new Logos.Reference(A);
var B=C.toString(true);
Page.SetDisplayReference(B)
}catch(D){$L(D,"warn")
}},CancelPendingRequests:function(){var A;
if(Global.UpdateReferenceConnection!=null){A=$C.abort(Global.UpdateReferenceConnection);
$L("UpdateReferenceConnection aborted, success: "+A,null,"Global.Connection");
Global.UpdateReferenceConnection=null
}if(Global.NextChunkConnection!=null){A=$C.abort(Global.NextChunkConnection);
$L("UpdateReferenceConnection aborted, success: "+A,null,"Global.Connection");
Global.NextChunkConnection=null
}if(Global.PrevChunkConnection!=null){A=$C.abort(Global.PrevChunkConnection);
$L("UpdateReferenceConnection aborted, success: "+A,null,"Global.Connection");
Global.PrevChunkConnection=null
}},UpdateReferenceCore:function(D,H,C,B,J){C=Global.ParseHighlight(C);
try{D=new Logos.Reference(D).toString()
}catch(I){$L("Bad reference: "+D,"error")
}var E=!/^\s*$/.test(Global.ContentBody.innerHTML);
if(D==Global.CurrentReference&&(H==null||H==Global.CurrentVersion)&&(C==null&&Global.HighlightedReference==null||(C!=null&&Global.HighlightedReference!=null&&(C.refStart==Global.HighlightedReference.refStart&&C.refEnd==Global.HighlightedReference.refEnd)))&&!E){$L("Not updating reference, requested state is same as current state");
return null
}var A=Global.CurrentVersion;
var G=true;
if(E&&(H==null||H==Global.CurrentVersion)){try{var F=new Logos.Reference(Global.CurrentReference);
var K=new Logos.Reference(D);
if(F.Book==K.Book&&F.Chapter==K.Chapter){G=false
}}catch(I){$L("Error parsing reference: "+I,"error")
}}Global.SetDisplayReference(D);
Global.CurrentReference=D;
if(H!=null){Global.CurrentVersion=H
}if(C!=null){Global.HighlightedReference=C
}if(G){if(Global.ReferenceLock==null){$L("UpdateReferenceCore: ReferenceLock = "+D);
Global.ReferenceLock=D;
Page.SermonRetrievalTimerLock=true
}Global.CancelPendingRequests();
Page.ShowLoading();
return Global.UpdateReferenceConnection=Global.RetrieveReference(D,H,function(L){if(B){B(L)
}},function(M){var N=YAHOO.lang.JSON.parse(M.responseText);
if(N.SuggestedVersion!=null&&J==true){Global.UpdateReferenceConnection=null;
Page.UpdateVersion(N.SuggestedVersion)
}else{var L=[N.BeforeReferenceBody,N.Body,N.AfterReferenceBody];
var R=[N.BeforeReference,N.CurrentReference,N.AfterReference];
var P=[];
for(var O=0;
O<L.length;
O++){var Q=null;
if(L[O]&&L[O]!=""){Q=document.createElement("div");
Q.setAttribute("reference",R[O]);
Q.className="referenceChunk";
Q.innerHTML=L[O]
}P.push(Q)
}Logos.Highlighter.Unhighlight();
for(var O=0;
O<P.length;
O++){if(P[O]!=null){Page.UpdateContent(P[O])
}}var S=0;
if(N.NextReference){var T=$D.getRegion(Global.ContentBody);
S=T.bottom-T.top
}Global.ContentBody.innerHTML='<div id="scrollSpacer" style="height: '+S+'px">&nbsp;</div>';
for(var O=0;
O<P.length;
O++){if(P[O]!=null){$D.insertBefore(P[O],"scrollSpacer")
}}Global.PrevReference=N.PreviousReference;
Global.NextReference=N.NextReference;
if(!Page.ScrollToReference(D)){Global.UpdateReferenceConnection=null;
Global.UnlockReferenceWhenComplete();
Page.UpdateReference(N.CurrentReference,N.Version,C)
}else{while(Global.OnBodyScroll()==true){}Global.UpdateReferenceConnection=null;
Global.UnlockReferenceWhenComplete(function(){Global.Highlight(C)
})
}}if(H!=A){Global.VersionChangeEvent.fire(H)
}},function(L){Global.UpdateReferenceConnection=null;
Global.OnReferenceRetriveFailed(L)
},Global.LoadAdjacent)
}else{Logos.Highlighter.Unhighlight();
if(Global.ReferenceLock==null){$L("UpdateReferenceCore: ReferenceLock = "+D);
Global.ReferenceLock=D
}Page.ScrollToReference(D);
Global.UnlockReferenceWhenComplete(function(){if(C!=null&&C.refStart!=null){var L=new Logos.Highlighter(C.refStart,C.refEnd);
L.DebugMode=Global.DebugMode;
L.Highlight(Global.ContentBody);
Page.UpdateContent(Global.ContentBody)
}});
if(H!=A){Global.VersionChangeEvent.fire(H)
}}},Highlight:function(A){if(A!=null&&A.refStart!=null){var B=new Logos.Highlighter(A.refStart,A.refEnd);
B.DebugMode=Global.DebugMode;
B.Highlight(Global.ContentBody)
}},TrackReferenceView:function(A,B){B=B||Global.CurrentVersion;
try{A=new Logos.Reference(A).ToString()
}catch(C){}Global.GAPageTracker._trackPageview("/passage/"+B+"/"+A)
},ClearReference:function(){Global.CurrentReference=null;
Global.PrevReference=null;
Global.NextReference=null;
Global.HighlightedReference=null
},UpdateLocation:function(){if(Global.ReferenceLock){return 
}var A=function(T){var S=new RegExp("(?:^|\\s+)verse|ch(?:\\s+|$)");
return T.getAttribute("rel")&&S.test(T.getAttribute("rel"))
};
var B=null;
var Q=null;
var N=Page.GetContentRegion();
var D=$D.getElementsByClassName("referenceChunk","div",Global.ContentBody);
for(var O in D){var H=D[O];
var J=$D.getRegion(H);
if(N.intersect(J)!=null){var E=$D.getElementsBy(A,"a",H);
for(var K in E){var M=E[K];
var C=$D.getRegion(M);
var L=M.offsetTop+M.offsetHeight;
if(N.intersect(C)!=null){if(K>0&&((C.left-N.left)>48||(C.top-N.top)>48)){B=E[K-1]
}else{B=M
}break
}}}if(B!=null&&!Global.NextChunkConnection&&!Global.PrevChunkConnection){var I=B.getAttribute("id");
var G=true;
try{var F=new Logos.Reference(I);
var R=new Logos.Reference(Global.CurrentReference);
F=F.IsRange?F.StartReference:F;
R=R.IsRange?R.StartReference:R;
if(F.Equals(R)){G=false
}}catch(P){$L(P,"warn")
}if(G){Page.SetDisplayReference(B.getAttribute("title"))
}Global.CurrentReference=I;
break
}}Global.ScrollUpdateEvent=null
},OnBodyScroll:function(){if(Page.SermonRetrievalTimer&&!Page.SermonRetrievalTimerLock){clearTimeout(Page.SermonRetrievalTimer)
}if(Global.ScrollUpdateEvent!=null){clearTimeout(Global.ScrollUpdateEvent)
}if(Global.ReferenceLock==null){Global.ScrollUpdateEvent=setTimeout(Global.UpdateLocation,125)
}var E=Page.GetContentRegion();
var C=$D.getRegion($D.getFirstChild(Global.ContentBody));
var A=$D.getRegion($D.getLastChildBy(Global.ContentBody,function(G){return $D.hasClass(G,"referenceChunk")
}));
var D=E.intersect(C)!=null;
var F=E.intersect(A)!=null;
var B=false;
if(Global.LoadAdjacent&&D){if(!Global.PrevChunkConnection&&Global.PrevReference!=null&&Global.PrevReference!=""){Global.PrevChunkConnection=Global.RetrieveReference(Global.PrevReference,null,null,function(G){var H=YAHOO.lang.JSON.parse(G.responseText);
var K=document.createElement("div");
K.setAttribute("reference",H.CurrentReference);
K.className="referenceChunk";
K.innerHTML=H.Body;
Page.UpdateContent(K);
var L=new $EL(K);
var I=YAHOO.env.ua.ie?0:-8;
if(Global.ContentBody.hasChildNodes()){var M=$D.getFirstChild(Global.ContentBody);
var J=$D.getRegion(M);
var N=$D.getRegion(Global.ContentBody);
I+=Page.ScrollableElement.scrollTop-(N.top-J.top);
L.appendTo(Global.ContentBody,M)
}else{L.appendTo(Global.ContentBody)
}var O=$D.getRegion(K);
Page.ScrollableElement.scrollTop+=I+(O.bottom-O.top);
Global.PrevReference=H.PreviousReference;
Global.RemoveExcessContent();
Global.Highlight(Global.HighlightedReference);
Global.PrevChunkConnection=null
},function(G){Global.PrevChunkConnection=null;
Global.OnReferenceRetriveFailed(G)
})
}}if(Global.LoadAdjacent&&F){if(!Global.NextChunkConnection&&Global.NextReference!=null&&Global.NextReference!=""){Global.NextChunkConnection=Global.RetrieveReference(Global.NextReference,null,null,function(I){var G=YAHOO.lang.JSON.parse(I.responseText);
var H=document.createElement("div");
H.setAttribute("reference",G.CurrentReference);
H.className="referenceChunk";
H.innerHTML=G.Body;
if($D.inDocument("scrollSpacer")){$D.insertBefore(H,"scrollSpacer")
}else{new $EL(H).appendTo(Global.ContentBody)
}var J=$D.getRegion(H);
Global.NextReference=G.NextReference;
Global.RemoveExcessContent();
Global.Highlight(Global.HighlightedReference);
Page.UpdateContent(H);
Global.NextChunkConnection=null
},function(G){Global.NextChunkConnection=null;
Global.OnReferenceRetriveFailed(G)
});
B=true
}}return B
},OnReferenceRetriveFailed:function(A){$L("Verse retrieval failed: "+A.statusText,"error","Global.js");
Global.UnlockReferenceWhenComplete();
alert(A.statusText)
},RemoveExcessContent:function(){var F=Page.GetContentRegion();
var H=$D.getChildrenBy(Global.ContentBody,function(I){return $D.hasClass(I,"referenceChunk")
});
var C=H.length-1;
var E=0;
var G;
var B;
for(var D=0;
D<H.length;
D++){B=H[D];
G=$D.getRegion(B);
if(F.intersect(G)!=null){C=Math.min(C,D);
E=Math.max(E,D)
}}var A=2;
if(E<H.length-1-A){B=H[H.length-1];
Global.NextReference=B.getAttribute("reference");
new $EL(Global.ContentBody).removeChild(B)
}if(C>A){B=H[0];
Global.PrevReference=B.getAttribute("reference");
G=$D.getRegion(B);
new $EL(Global.ContentBody).removeChild(B);
Page.ScrollableElement.scrollTop-=(G.bottom-G.top);
Global.Highlight(Global.HighlightedReference)
}Page.UpdateTooltips(Global.ContentBody)
},ParseHighlight:function(A){if(typeof A=="string"){var B=A.split(/-/);
if(B.length==2){A={refStart:B[0],refEnd:B[1]}
}else{if(B.length==1&&B[0]!=""){A={refStart:B[0],refEnd:B[0]}
}else{A=null
}}}else{if(typeof A!="object"){A=null
}}return A
},ToReferenceState:function(A,B){B=Global.ParseHighlight(B);
var C=A;
if(B!=null&&B.refStart!=null){if(B.refEnd!=null&&B.refStart!=B.refEnd){C=C+Global.HighlightStateToken+B.refStart+"-"+B.refEnd
}else{C=C+Global.HighlightStateToken+B.refStart
}}return C
},ParseReferenceState:function(D){var B=D.split(Global.HighlightStateToken);
var A=B[0];
var C=B.length>1?B[1]:null;
C=Global.ParseHighlight(C);
return[A,C]
}};
(function(){var A=YAHOO.namespace("Logos");
A.Tooltip=function(C,B){A.Tooltip.superclass.constructor.call(this,C,B)
};
YAHOO.extend(A.Tooltip,YAHOO.widget.Tooltip,{init:function(C,B){A.Tooltip.superclass.init.call(this,C,B);
this.subscribe("render",this.onRender2)
},onRender2:function(C,B){YAHOO.util.Event.on(this.element,"mouseover",this.onTooltipMouseOver,this,true);
YAHOO.util.Event.on(this.element,"mouseout",this.onTooltipMouseOut,this,true)
},onTooltipMouseOver:function(B){this.m_keepVisible=true
},onTooltipMouseOut:function(C){this.m_keepVisible=false;
if(this.hideProcId){clearTimeout(this.hideProcId);
this.hideProcId=null
}var B=this;
this.hideProcId=setTimeout(function(){B.hide()
},this.cfg.getProperty("hidedelay"))
},configVisible:function(C,B,D){var E=B[0];
if(!E){if(this.m_keepVisible){return 
}}A.Tooltip.superclass.configVisible.call(this,C,B,D)
}})
}());
if(typeof (Logos)!="object"){Logos={}
}Logos.Reference=function(C){if(C!=null){C=C.replace(/^\s+|\s+$/g,"");
var D=Logos.Reference.RefRegExp.exec(C);
if(D){var A=Logos.Reference.GetBookInfo(D[3]);
if(A==null){throw new Error("Not a reference: "+C)
}this.IsRange=false;
this.Book=A.ShortReference;
this.Chapter=D[4]?Number(D[4]):null;
this.IsSingleChapterBook=A.IsSingleChapterBook;
this.Section=A.Section;
if(D[5]){var E=Logos.Reference.VerseSuffixRegExp.exec(D[5]);
if(E){this.Verse=Number(E[1]);
if(E[3]){this.IsRange=true;
this.StartReference=new Logos.Reference();
this.StartReference.Book=this.Book;
this.StartReference.Chapter=this.Chapter;
this.StartReference.Verse=this.Verse;
this.EndReference=new Logos.Reference();
this.EndReference.Book=this.Book;
this.EndReference.Chapter=this.Chapter;
if(E[3]=="f"){this.EndReference.Verse=this.Verse+1
}else{if(E[3]=="ff"){this.EndReference.Verse=this.Verse+10
}}}}else{this.Verse=Number(D[5])
}}else{this.Verse=null
}if(this.IsSingleChapterBook){if(this.Chapter!=null&&this.Verse==null){this.Verse=this.Chapter;
this.Chapter=1
}}if(D[6]){var B=Logos.Reference.RefRangeRegExp.exec(D[6]);
if(B){this.IsRange=true;
this.StartReference=new Logos.Reference();
this.StartReference.Book=this.Book;
this.StartReference.Chapter=this.Chapter;
this.StartReference.Verse=this.Verse;
this.EndReference=new Logos.Reference();
this.EndReference.Book=this.Book;
if(B[2]){this.EndReference.Chapter=Number(B[1]);
this.EndReference.Verse=Number(B[2])
}else{this.EndReference.Chapter=this.Chapter;
this.EndReference.Verse=Number(B[1])
}}}}else{var A=Logos.Reference.GetBookInfo(C);
if(A==null){throw new Error("Not a reference: "+C)
}this.Book=A.ShortReference;
this.Chapter=null;
this.Verse=null;
this.IsRange=false;
this.IsSingleChapterBook=A.IsSingleChapterBook;
this.Section=A.Section
}}};
Logos.Reference.RefRegExp=new RegExp("(\\W|^)((Z(?:e(?:p(?:h(?:aniah)?)?|c(?:h(?:ariah)?)?)|[pc])|W(?:is(?:d(?:om(?:\\s+of\\s+(?:Ben\\s+Sirah?|Solomon))?|\\.?\\s+of\\s+Sol))?|s)|T(?:ob(?:it)?|i?t(?:us)?|he(?:\\s+(?:Song\\s+of\\s+(?:Three\\s+(?:Youth|Jew)s|the\\s+Three\\s+Holy\\s+Children)|Re(?:velation|st\\s+of\\s+Esther))|ssalonians)|b)|S(?:us(?:anna)?|o(?:ng(?:\\s+(?:of\\s+(?:Thr(?:ee(?:\\s+(?:(?:Youth|Jew)s|Children))?)?|So(?:l(?:omon)?|ngs)|the\\s+Three\\s+Holy\\s+Children)|Thr))?)?|ir(?:a(?:c?h)?)?|OS)|R(?:u(?:th)?|o(?:m(?:ans)?)?|e(?:v(?:elation)?|st\\s+of\\s+Esther)?|[vm]|th)|Qoh(?:eleth)?|P(?:s(?:\\s+Sol(?:omon)?|a(?:lm(?:s(?:\\s+(?:of\\s+)?Solomon)?)?)?|Sol|s|l?m)?|r(?:ov(?:erbs)?|\\s+(?:(?:of\\s+)?Man|Az)|ayer\\s+of\\s+(?:Manasse[sh]|Azariah)|v)?|h(?:il(?:e(?:m(?:on)?)?|ippians)?|[pm])|p|Ma)|O(?:b(?:ad(?:iah)?)?|des)|N(?:u(?:m(?:bers)?)?|e(?:h(?:emiah)?)?|a(?:h(?:um)?)?|[mb])|M(?:rk?|ic(?:ah)?|a(?:t(?:t(?:hew)?)?|l(?:achi)?|rk)|[tlk])|L(?:uke?|e(?:v(?:iticus)?|t(?:ter\\s+of\\s+Jeremiah|\\s+Jer))?|a(?:od(?:iceans)?|m(?:entations)?)?|[vk]|tr\\s+Jer|Je)|J(?:u?d(?:g(?:es)?|ith|e)?|o(?:s(?:h(?:ua)?)?|n(?:ah)?|el?|hn|b)|nh?|e(?:r(?:emiah)?)?|d(?:th?|gs?)|a(?:me)?s|[ts]h|[rmlgb]|hn)|Is(?:a(?:iah)?)?|H(?:o(?:s(?:ea)?)?|e(?:b(?:rews)?)?|a(?:g(?:gai)?|b(?:akkuk)?)|g)|G(?:e(?:n(?:esis)?)?|a(?:l(?:atians)?)?|n)|E(?:z(?:ra?|e(?:k(?:iel)?)?|k)|x(?:o(?:d(?:us)?)?)?|s(?:th(?:er)?)?|p(?:ist(?:le\\s+(?:to\\s+(?:the\\s+)?Laodiceans|Laodiceans)|\\s+Laodiceans)|h(?:es(?:ians)?)?|\\s+Laod)?|c(?:cl(?:es(?:iast(?:icu|e)s)?|us)?)?|noch)|D(?:eut(?:eronomy)?|a(?:n(?:iel)?)?|[tn])|C(?:ol?(?:ossians)?|anticle(?:\\s+of\\s+Canticle)?s)|B(?:el(?:\\s+and\\s+the\\s+Dragon)?|ar(?:uch)?)|A(?:m(?:os)?|dd(?:\\s+(?:Ps(?:alm)?|Es(?:th)?)|ition(?:s\\s+to\\s+Esther|al\\s+Psalm)|Esth)|c(?:ts)?|zariah|Es)|\\u03C8|(?:4(?:th\\s)?|[Ff]ourth\\s|(?:IIII|IV)\\s)\\s*(?:Ma(?:c(?:c(?:abees)?)?)?)|(?:3(?:rd\\s)?|[Tt]hird\\s|III\\s)\\s*(?:Ma(?:c(?:c(?:abees)?)?)?|Jo(?:h(?:n)?)?|Jn\\.?|Jhn|J)|(?:(?:2(?:nd\\s)?|[Ss]econd\\s|II\\s)|(?:1(?:st\\s)?|[Ff]irst\\s|I\\s))\\s*(?:T(?:i(?:m(?:othy)?)?|h(?:es(?:s(?:alonians)?)?)?)|S(?:a(?:m(?:uel)?)?|m)?|P(?:e(?:t(?:er)?)?|t)?|Ma(?:c(?:c(?:abees)?)?)?|K(?:i(?:n(?:gs)?)?|(?:gs)?)|J(?:o(?:hn?)?|h?n?)|Es(?:d(?:r(?:as)?)?)?|C(?:o(?:r(?:inthians)?)?|h(?:r(?:on(?:icles)?)?)?)))(?:\\.?\\s*(\\d{1,3})(?:\\s?\\:\\s?|\\.)?(?:(\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?)(\\s?(?:-|--|\\u2013|\\u2014)\\s?\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?((?:\\s?\\:\\s?|\\.)\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?)?(?!\\s*(?:T(?:i(?:m(?:othy)?)?|h(?:es(?:s(?:alonians)?)?)?)|S(?:a(?:m(?:uel)?)?|m)?|P(?:e(?:t(?:er)?)?|t)?|Ma(?:c(?:c(?:abees)?)?)?|K(?:i(?:n(?:gs)?)?|(?:gs)?)|J(?:o(?:hn?)?|h?n)|Es(?:d(?:r(?:as)?)?)?|C(?:o(?:r(?:inthians)?)?|h(?:r(?:on(?:icles)?)?)?))(?:\\W)))?)?)|(Ob(?:ad(?:iah)?)?|P(?:h(?:ile(?:m(?:on)?)?|m)|m)|(?:(?:2(?:nd\\s)?|[Ss]econd\\s|II\\s)|(?:3(?:rd\\s)?|[Tt]hird\\s|III\\s))\\s*J(?:o(?:hn?)?|h?n?)|Ju?de?)\\s*\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?(?:\\s?(?:-|--|\\u2013|\\u2014)\\s?\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?)?)","i");
Logos.Reference.RefRangeRegExp=new RegExp("(?:\\s?(?:-|--|\\u2013|\\u2014)\\s?(\\d{1,3}))\\s?:?\\s?(\\d{1,3})?");
Logos.Reference.VerseSuffixRegExp=new RegExp("^(\\d+)\\s*([a-e])?(f{1,2})?");
Logos.Reference.prototype.CompareTo=function(B){if(this.Book==null||B.Book==null){return null
}if(this.Book.toLowerCase()==B.Book.toLowerCase()){if(this.Chapter==B.Chapter||this.Chapter==null||B.Chapter==null){if(this.Verse==B.Verse||this.Verse==null||B.Verse==null){return 0
}else{if(this.Verse<B.Verse){return -1
}else{if(this.Verse>B.Verse){return 1
}}}}else{if(this.Chapter<B.Chapter){return -1
}else{if(this.Chapter>B.Chapter){return 1
}}}}else{if(this.Book!=null&&B.Book!=null){var E=null;
var D=null;
for(var A=0;
A<Logos.Reference.BookInfoTable.length;
A++){var C=Logos.Reference.BookInfoTable[A];
if(this.Book==C.ShortReference){E=A
}if(B.Book==C.ShortReference){D=A
}}if(E!=null&&D!=null){return(E<D)?-1:1
}}}return null
};
Logos.Reference.prototype.Equals=function(C){var B=this.Book!=null?this.Book.toLowerCase():null;
var A=C.Book!=null?C.Book.toLowerCase():null;
if(B==A&&this.Chapter==C.Chapter&&this.Verse==C.Verse){return true
}return false
};
Logos.Reference.prototype.ToString=function(B){var C=this.Book;
if(B){var A=Logos.Reference.GetBookInfo(this.Book);
C=A.DisplayReference
}if(!this.IsSingleChapterBook){if(this.Chapter!=null){C+=" "+this.Chapter
}if(this.Verse!=null){C+=":"+this.Verse
}if(this.IsRange){C+="-";
if(this.EndReference.Chapter==this.Chapter){C+=this.EndReference.Verse
}else{C+=this.EndReference.Chapter+":"+this.EndReference.Verse
}}}else{if(this.Verse!=null){C+=" "+this.Verse;
if(this.IsRange){C+="-"+this.EndReference.Verse
}}}return C
};
Logos.Reference.prototype.ToShortestString=function(){var A=Logos.Reference.GetBookInfo(this.Book);
var B=A.ShortestReference;
if(!this.IsSingleChapterBook){if(this.Chapter!=null){B+=this.Chapter
}if(this.Verse!=null){B+="."+this.Verse
}if(this.IsRange){if(this.EndReference.Chapter==this.Chapter){if(this.EndReference.Verse==this.Verse+1){B+="f"
}else{B+="-"+this.EndReference.Verse
}}else{B+=this.EndReference.Chapter+"."+this.EndReference.Verse
}}}else{if(this.Verse!=null){B+=this.Verse;
if(this.IsRange){B+="-"+this.EndReference.Verse
}}}return B
};
Logos.Reference.prototype.toString=Logos.Reference.prototype.ToString;
Logos.Reference.IsReference=function(A){return Logos.Reference.RefRegExp.test(A)
};
Logos.Reference.IsBook=function(A){return Logos.Reference.GetBookInfo(A)!=null
};
Logos.Reference.ToShortForm=function(B){var A=Logos.Reference.GetBookInfo(B);
if(A!=null){return A.ShortReference
}return B
};
Logos.Reference.GetBookInfo=function(B){for(var A=0;
A<Logos.Reference.BookInfoTable.length;
A++){var C=Logos.Reference.BookInfoTable[A];
if(C.RE.test(B)){return C
}}return null
};
Logos.Reference.BookInfoTable=[{RE:new RegExp("^\\s*(G(?:e(?:n(?:esis)?)?|n))\\s*$","i"),ShortReference:"Ge",ShortestReference:"Ge",DisplayReference:"Genesis",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ex(?:o(?:d(?:us)?)?)?)\\s*$","i"),ShortReference:"Ex",ShortestReference:"Ex",DisplayReference:"Exodus",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(L(?:e(?:v(?:iticus)?)?|v))\\s*$","i"),ShortReference:"Le",ShortestReference:"Le",DisplayReference:"Leviticus",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(N(?:u(?:m(?:b(?:ers)?)?)?|[mb]))\\s*$","i"),ShortReference:"Nu",ShortestReference:"Nu",DisplayReference:"Numbers",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(D(?:e(?:ut(?:eronomy)?)?|t))\\s*$","i"),ShortReference:"Dt",ShortestReference:"Dt",DisplayReference:"Deuteronomy",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(J(?:os(?:h(?:ua)?)?|sh))\\s*$","i"),ShortReference:"Jos",ShortestReference:"Jos",DisplayReference:"Joshua",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(J(?:dgs?|udg(?:es)?|g))\\s*$","i"),ShortReference:"Jdg",ShortestReference:"Jg",DisplayReference:"Judges",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(R(?:u(?:th)?|th))\\s*$","i"),ShortReference:"Ru",ShortestReference:"Ru",DisplayReference:"Ruth",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:1(?: ?S(?:a(?:muel)?|m)?|st S(?:a(?:m(?:uel)?)?|m)?| Sam)|I(?: S(?:a(?:m(?:uel)?)|m)| S| Sa|Sam|Samuel)|First S(?:a(?:m(?:uel)?)?|m)?))\\s*$","i"),ShortReference:"1 Sa",ShortestReference:"1S",DisplayReference:"1 Samuel",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:2(?: ?S(?:a(?:m(?:uel)?)?|m)?|nd S(?:a(?:m(?:uel)?)?|m)?)|II ?S(?:a(?:m(?:uel)?)?|m)?|Second S(?:a(?:m(?:uel)?)?|m)?))\\s*$","i"),ShortReference:"2 Sa",ShortestReference:"2S",DisplayReference:"2 Samuel",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:1(?: ?K(?:i(?:n(?:gs)?)?|gs)?|st K(?:i(?:n(?:gs)?)?|gs)?)|I ?K(?:i(?:n(?:gs)?)?|gs)?|First K(?:i(?:n(?:gs)?)?|gs)?))\\s*$","i"),ShortReference:"1 Ki",ShortestReference:"1K",DisplayReference:"1 Kings",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:2(?: ?K(?:i(?:n(?:gs)?)?|gs)?|nd K(?:i(?:n(?:gs)?)?|gs)?)|II ?K(?:i(?:n(?:gs)?)?|gs)?|Second K(?:i(?:n(?:gs)?)?|gs)?))\\s*$","i"),ShortReference:"2 Ki",ShortestReference:"2K",DisplayReference:"2 Kings",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:1(?: ?Ch(?:r(?:on(?:icles)?)?)?|st Ch(?:r(?:on(?:icles)?)?)?)|I ?Ch(?:r(?:on(?:icles)?)?)?|First Ch(?:r(?:on(?:icles)?)?)?))\\s*$","i"),ShortReference:"1 Ch",ShortestReference:"1Ch",DisplayReference:"1 Chronicles",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:2(?: ?Ch(?:r(?:on(?:icles)?)?)?|nd Ch(?:r(?:on(?:icles)?)?)?)|II ?Ch(?:r(?:on(?:icles)?)?)?|Second Ch(?:r(?:on(?:icles)?)?)?))\\s*$","i"),ShortReference:"2 Ch",ShortestReference:"2Ch",DisplayReference:"2 Chronicles",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ez(?:ra?)?)\\s*$","i"),ShortReference:"Ezr",ShortestReference:"Ezr",DisplayReference:"Ezra",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ne(?:h(?:em(?:iah)?)?)?)\\s*$","i"),ShortReference:"Ne",ShortestReference:"Ne",DisplayReference:"Nehemiah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Es(?:th(?:er)?)?)\\s*$","i"),ShortReference:"Es",ShortestReference:"Es",DisplayReference:"Esther",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Jo?b)\\s*$","i"),ShortReference:"Job",ShortestReference:"Jb",DisplayReference:"Job",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ps(?:alms?|lm|a|m|s)?)\\s*$","i"),ShortReference:"Ps",ShortestReference:"Ps",DisplayReference:"Psalm",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Pr(?:ov(?:erbs?)?|v)?)\\s*$","i"),ShortReference:"Pr",ShortestReference:"Pr",DisplayReference:"Proverbs",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:Ec(?:c(?:l(?:es(?:iastes)?)?)?)?|Qoh(?:eleth)?))\\s*$","i"),ShortReference:"Ec",ShortestReference:"Ec",DisplayReference:"Ecclesiastes",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*((?:S(?:o(?:ng(?: of So(?:l(?:omon)?|ngs))?)?|OS)|Canticle(?: of Canticle)?s))\\s*$","i"),ShortReference:"So",ShortestReference:"So",DisplayReference:"Song of Solomon",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Is(?:a(?:i(?:ah)?)?)?)\\s*$","i"),ShortReference:"Is",ShortestReference:"Is",DisplayReference:"Isaiah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(J(?:e(?:r(?:em(?:iah)?)?)?|r))\\s*$","i"),ShortReference:"Je",ShortestReference:"Je",DisplayReference:"Jeremiah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(La(?:m(?:entations)?)?)\\s*$","i"),ShortReference:"La",ShortestReference:"La",DisplayReference:"Lamentations",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ez(?:e(?:k(?:iel)?)?|k))\\s*$","i"),ShortReference:"Eze",ShortestReference:"Eze",DisplayReference:"Ezekiel",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(D(?:a(?:n(?:iel)?)?|n))\\s*$","i"),ShortReference:"Da",ShortestReference:"Da",DisplayReference:"Daniel",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ho(?:s(?:ea)?)?)\\s*$","i"),ShortReference:"Ho",ShortestReference:"Ho",DisplayReference:"Hosea",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(J(?:oel?|l))\\s*$","i"),ShortReference:"Joe",ShortestReference:"Jl",DisplayReference:"Joel",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Am(?:os)?)\\s*$","i"),ShortReference:"Am",ShortestReference:"Am",DisplayReference:"Amos",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ob(?:ad(?:iah)?)?)\\s*$","i"),ShortReference:"Ob",ShortestReference:"Ob",DisplayReference:"Obadiah",IsSingleChapterBook:true,Section:"old"},{RE:new RegExp("^\\s*(J(?:on(?:ah)?|nh))\\s*$","i"),ShortReference:"Jon",ShortestReference:"Jon",DisplayReference:"Jonah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Mi?c(?:ah)?)\\s*$","i"),ShortReference:"Mic",ShortestReference:"Mc",DisplayReference:"Micah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Na(?:h(?:um)?)?)\\s*$","i"),ShortReference:"Na",ShortestReference:"Na",DisplayReference:"Nahum",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Ha?b(?:akkuk)?)\\s*$","i"),ShortReference:"Hab",ShortestReference:"Hb",DisplayReference:"Habakkuk",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Z(?:ep(?:h(?:aniah)?)?|p))\\s*$","i"),ShortReference:"Zep",ShortestReference:"Zp",DisplayReference:"Zephaniah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(H(?:ag(?:gai)?|g))\\s*$","i"),ShortReference:"Hag",ShortestReference:"Hg",DisplayReference:"Haggai",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(Z(?:ec(?:h(?:ariah)?)?|c))\\s*$","i"),ShortReference:"Zec",ShortestReference:"Zc",DisplayReference:"Zechariah",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(M(?:al(?:achi)?|l))\\s*$","i"),ShortReference:"Mal",ShortestReference:"Ml",DisplayReference:"Malachi",IsSingleChapterBook:false,Section:"old"},{RE:new RegExp("^\\s*(T(?:ob(?:it)?|b))\\s*$","i"),ShortReference:"Tob",ShortestReference:"Tb",DisplayReference:"Tobit",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(J(?:dth?|(?:udi)?th))\\s*$","i"),ShortReference:"Jdt",ShortestReference:"Jdt",DisplayReference:"Judith",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:A(?:dd(?: ?Esth| Es|itions to Esther)|Es)|(?:The )?Rest of Esther))\\s*$","i"),ShortReference:"Add Es",ShortestReference:"AEs",DisplayReference:"Additions to Esther",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(W(?:is(?:d(?:om(?: of Solomon)?|.? of Sol))?|s))\\s*$","i"),ShortReference:"Wis",ShortestReference:"Wis",DisplayReference:"Wisdom of Solomon",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:Sir(?:a(?:c?h)?)?|Wisdom of Ben Sirah?|Ben Sirah?|Eccl(?:esiastic)?us))\\s*$","i"),ShortReference:"Sir",ShortestReference:"Sr",DisplayReference:"Sirach",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(Bar(?:uch)?)\\s*$","i"),ShortReference:"Bar",ShortestReference:"Bar",DisplayReference:"Baruch",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(L(?:et(?: Jer|ter of Jeremiah)|Je|tr Jer))\\s*$","i"),ShortReference:"Let Jer",ShortestReference:"LJ",DisplayReference:"Letter of Jeremiah",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:Song (?:of (?:Thr(?:ee(?: (?:(?:Youth|Jew)s|Children))?)?|the Three Holy Children)|Thr)|The Song of (?:Three (?:Youth|Jew)s|the Three Holy Children)|Pr(?: Az|ayer of Azariah)|Azariah))\\s*$","i"),ShortReference:"Song Thr",ShortestReference:"ST",DisplayReference:"Song of Three Youths",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(Sus(?:anna)?)\\s*$","i"),ShortReference:"Sus",ShortestReference:"Su",DisplayReference:"Susanna",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(Bel(?: and the Dragon)?)\\s*$","i"),ShortReference:"Bel",ShortestReference:"Bl",DisplayReference:"Bel and the Dragon",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:1(?: ?M(?:a(?:cc(?:abees)?)?)?|st M(?:a(?:c(?:c(?:abees)?)?)?)?| Mac)|I ?M(?:a(?:c(?:c(?:abees)?)?)?)?|First M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),ShortReference:"1 Mac",ShortestReference:"1M",DisplayReference:"1 Maccabees",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:2(?: ?M(?:a(?:c(?:c(?:abees)?)?)?)?|nd M(?:a(?:c(?:c(?:abees)?)?)?)?)|II ?M(?:a(?:c(?:c(?:abees)?)?)?)?|Second M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),ShortReference:"2 Mac",ShortestReference:"2M",DisplayReference:"2 Maccabees",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:1(?: ?Es(?:d(?:r(?:as)?)?)?|st Es(?:d(?:r(?:as)?)?)?)|I ?Es(?:d(?:r(?:as)?)?)?|First Es(?:d(?:r(?:as)?)?)?))\\s*$","i"),ShortReference:"1 Esd",ShortestReference:"1E",DisplayReference:"1 Esdras",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(P(?:r(?: (?:of )?Man|ayer of Manasse[hs])|Ma))\\s*$","i"),ShortReference:"Pr Man",ShortestReference:"PMa",DisplayReference:"Prayer of Manasseh",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(Add(?: Ps(?:alm)?|itional Psalm))\\s*$","i"),ShortReference:"Add Ps",ShortestReference:"APs",DisplayReference:"Additional Psalm",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:3(?: ?M(?:a(?:c(?:c(?:abees)?)?)?)?|rd M(?:a(?:c(?:c(?:abees)?)?)?)?)|III ?M(?:a(?:c(?:c(?:abees)?)?)?)?|Third M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),ShortReference:"3 Mac",ShortestReference:"3M",DisplayReference:"3 Maccabees",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:2(?: ?Es(?:d(?:r(?:as)?)?)?|nd Es(?:d(?:r(?:as)?)?)?)|I(?:I(?: ?Es(?:d(?:r(?:as)?)?)?|II ?Ez(?:ra?)?)|V ?Ez(?:ra?)?)|4(?: ?Ez(?:ra?)?|th Ez(?:ra?)?)|Second Es(?:d(?:r(?:as)?)?)?|Fourth Ez(?:ra?)?))\\s*$","i"),ShortReference:"2 Esd",ShortestReference:"2E",DisplayReference:"2 Esdras",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:4(?: ?M(?:a(?:c(?:c(?:abees)?)?)?)?|th M(?:a(?:c(?:c(?:abees)?)?)?)?)|I(?:V ?M(?:a(?:c(?:c(?:abees)?)?)?)?|III ?M(?:a(?:c(?:c(?:abees)?)?)?)?)|Fourth M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),ShortReference:"4 Mac",ShortestReference:"4M",DisplayReference:"4 Maccabees",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(Odes?)\\s*$","i"),ShortReference:"Ode",ShortestReference:"Od",DisplayReference:"Odes",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(Ps(?:alms (?:of )?Solomon| ?Sol| Solomon))\\s*$","i"),ShortReference:"Ps Sol",ShortestReference:"PsSo",DisplayReference:"Psalms of Solomon",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((?:Laod(?:iceans)?|Ep(?:ist(?:le (?:to (?:the )?Laodiceans|Laodiceans)| Laodiceans)| Laod)))\\s*$","i"),ShortReference:"Laod",ShortestReference:"Ld",DisplayReference:"Epistle to the Laodiceans",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*((Enoch))\\s*$","i"),ShortReference:"Enoch",ShortestReference:"En",DisplayReference:"Enoch",IsSingleChapterBook:false,Section:"apocrypha"},{RE:new RegExp("^\\s*(M(?:at(?:t(?:h(?:ew)?)?)?|t))\\s*$","i"),ShortReference:"Mt",ShortestReference:"Mt",DisplayReference:"Matthew",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(M(?:rk?|(?:ar)?k))\\s*$","i"),ShortReference:"Mk",ShortestReference:"Mk",DisplayReference:"Mark",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(L(?:ke?|uke?))\\s*$","i"),ShortReference:"Lk",ShortestReference:"Lk",DisplayReference:"Luke",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(J(?:no?|o?hn))\\s*$","i"),ShortReference:"Jn",ShortestReference:"Jn",DisplayReference:"John",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(Ac(?:ts)?)\\s*$","i"),ShortReference:"Ac",ShortestReference:"Ac",DisplayReference:"Acts",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(R(?:o(?:m(?:ans)?)?|m))\\s*$","i"),ShortReference:"Ro",ShortestReference:"Ro",DisplayReference:"Romans",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?Co(?:r(?:inthians)?)?|st Co(?:r(?:inthians)?)?)|I ?Co(?:r(?:inthians)?)?|First Co(?:r(?:inthians)?)?))\\s*$","i"),ShortReference:"1 Co",ShortestReference:"1Co",DisplayReference:"1 Corinthians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?Co(?:r(?:inthians)?)?|nd Co(?:r(?:inthians)?)?)|II ?Co(?:r(?:inthians)?)?|Second Co(?:r(?:inthians)?)?))\\s*$","i"),ShortReference:"2 Co",ShortestReference:"2Co",DisplayReference:"2 Corinthians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(Ga(?:l(?:atians)?)?)\\s*$","i"),ShortReference:"Ga",ShortestReference:"Ga",DisplayReference:"Galatians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(Ep(?:h(?:es(?:ians)?)?)?)\\s*$","i"),ShortReference:"Eph",ShortestReference:"Ep",DisplayReference:"Ephesians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(P(?:h(?:il(?:ippians)?|p)|p))\\s*$","i"),ShortReference:"Php",ShortestReference:"Pp",DisplayReference:"Philippians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(Co(?:l(?:ossians)?)?)\\s*$","i"),ShortReference:"Col",ShortestReference:"Co",DisplayReference:"Colossians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?Th(?:es(?:s(?:alonians)?)?)?|st Th(?:es(?:s(?:alonians)?)?)?)|I ?Th(?:es(?:s(?:alonians)?)?)?|First Th(?:es(?:s(?:alonians)?)?)?))\\s*$","i"),ShortReference:"1 Th",ShortestReference:"1Th",DisplayReference:"1 Thessalonians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?Th(?:es(?:s(?:alonians)?)?)?|nd Th(?:es(?:s(?:alonians)?)?)?)|II ?Th(?:es(?:s(?:alonians)?)?)?|Second Th(?:es(?:s(?:alonians)?)?)?))\\s*$","i"),ShortReference:"2 Th",ShortestReference:"2Th",DisplayReference:"2 Thessalonians",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?Ti(?:m(?:othy)?)?|st Ti(?:m(?:othy)?)?)|I ?Ti(?:m(?:othy)?)?|First Ti(?:m(?:othy)?)?))\\s*$","i"),ShortReference:"1 Ti",ShortestReference:"1Ti",DisplayReference:"1 Timothy",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?Ti(?:m(?:othy)?)?|nd Ti(?:m(?:othy)?)?)|II ?Ti(?:m(?:othy)?)?|Second Ti(?:m(?:othy)?)?))\\s*$","i"),ShortReference:"2 Ti",ShortestReference:"2Ti",DisplayReference:"2 Timothy",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(Ti?t(?:us)?)\\s*$","i"),ShortReference:"Tt",ShortestReference:"Tt",DisplayReference:"Titus",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(P(?:h(?:ile(?:m(?:on)?)?|m)|m))\\s*$","i"),ShortReference:"Phm",ShortestReference:"Pm",DisplayReference:"Philemon",IsSingleChapterBook:true,Section:"new"},{RE:new RegExp("^\\s*(He(?:b(?:rews)?)?)\\s*$","i"),ShortReference:"Heb",ShortestReference:"He",DisplayReference:"Hebrews",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*(J(?:a(?:me?)?s?|m))\\s*$","i"),ShortReference:"Jas",ShortestReference:"Jm",DisplayReference:"James",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?P(?:e(?:t(?:er)?)?|t)?|st P(?:e(?:t(?:er)?)?|t)?)|I ?P(?:e(?:t(?:er)?)?|t)?|First P(?:e(?:t(?:er)?)?|t)?))\\s*$","i"),ShortReference:"1 Pe",ShortestReference:"1P",DisplayReference:"1 Peter",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?P(?:e(?:t(?:er)?)?|t)?|nd P(?:e(?:t(?:er)?)?|t)?)|II ?P(?:e(?:t(?:er)?)?|t)?|Second P(?:e(?:t(?:er)?)?|t)?))\\s*$","i"),ShortReference:"2 Pe",ShortestReference:"2P",DisplayReference:"2 Peter",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?J(?:o(?:hn?)?|h?n)?|st J(?:o(?:hn?)?|h?n)?)|I ?J(?:o(?:hn?)?|h?n)?|First J(?:o(?:hn?)?|h?n)?))\\s*$","i"),ShortReference:"1 Jn",ShortestReference:"1J",DisplayReference:"1 John",IsSingleChapterBook:false,Section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?J(?:o(?:hn?)?|h?n)?|nd J(?:o(?:hn?)?|h?n)?)|II ?J(?:o(?:hn?)?|h?n)?|Second J(?:o(?:hn?)?|h?n)?))\\s*$","i"),ShortReference:"2 Jn",ShortestReference:"2J",DisplayReference:"2 John",IsSingleChapterBook:true,Section:"new"},{RE:new RegExp("^\\s*((?:3(?: ?J(?:o(?:hn?)?|h?n)?|rd J(?:o(?:hn?)?|h?n)?)|III ?J(?:o(?:hn?)?|h?n)?|Third J(?:o(?:hn?)?|h?n)?))\\s*$","i"),ShortReference:"3 Jn",ShortestReference:"3J",DisplayReference:"3 John",IsSingleChapterBook:true,Section:"new"},{RE:new RegExp("^\\s*(Ju?de?)\\s*$","i"),ShortReference:"Jud",ShortestReference:"Jd",DisplayReference:"Jude",IsSingleChapterBook:true,Section:"new"},{RE:new RegExp("^\\s*((?:R(?:e(?:v(?:elation)?)?|v)|The Revelation))\\s*$","i"),ShortReference:"Re",ShortestReference:"Re",DisplayReference:"Revelation",IsSingleChapterBook:false,Section:"new"}];
var Logos=YAHOO.namespace("Logos");
Logos.Highlighter=function(A,B){this.m_strRefStart=A;
this.m_strRefEnd=B;
this.m_bPastEnd=false;
this.m_nDpi=96;
this.m_nDepth=0;
this.m_nElementOffset=-1;
this.ReferenceStart=new Logos.Reference(A);
this.ReferenceEnd=new Logos.Reference(B);
this.Highlighting=false;
this.Done=false;
this.Highlighted=new Array();
this.DebugMode=false;
this.FirstReferenceElement=null;
this.LastReferenceElement=null;
this.AfterLastReferenceElement=null
};
Logos.Highlighter.prototype.Highlight=function(B){for(var S=0;
S<B.childNodes.length&&!this.Done;
S++){var Q=B.childNodes[S];
if(Q.nodeType==1){var X=Q.nodeName=="A";
var Y=null;
var D=Q.getAttribute("rel");
if(X&&(/^book|chapter|verse$/).test(D)){try{Y=new Logos.Reference(Q.getAttribute("id"))
}catch(T){YAHOO.log("Bad reference: "+T,"warn")
}}if(Y){if(this.m_bPastEnd){if(this.DebugMode){YAHOO.log("Next milestone after last reference found, stop highlighting",null,"Highlighter")
}this.Highlighting=false;
this.Done=true;
this.AfterLastReferenceElement=Q;
break
}if(!this.Highlighting){if(Y.Chapter!=null){var O=Y.CompareTo(this.ReferenceStart);
if(Y.Equals(this.ReferenceStart)||(O!=null&&(O>0||(this.ReferenceStart.Verse==null&&O>=0)))){if(this.DebugMode){YAHOO.log("Start reference found, start highlighting",null,"Highlighter")
}this.Highlighting=true;
this.FirstReferenceElement=Q
}}}}this.m_nDepth++;
this.Highlight(Q);
this.m_nDepth--;
if(Y){if(this.ReferenceEnd.Verse!=null&&Y.Equals(this.ReferenceEnd)){if(this.DebugMode){YAHOO.log("End reference found",null,"Highlighter")
}this.m_bPastEnd=true;
this.LastReferenceElement=Q
}else{var M=Y.CompareTo(this.ReferenceEnd);
if(M!=null&&M>0){if(this.DebugMode){YAHOO.log("Reference after end reference found",null,"Highlighter")
}this.m_bPastEnd=true;
this.Highlighting=false;
this.Done=true;
this.AfterLastReferenceElement=Q
}}}}}if(this.m_nDepth>0){return 
}if(this.m_elHighlighter==null){this.m_elHighlighter=YAHOO.util.Dom.get("highlightBar");
if(this.m_elHighlighter==null){var A=document.createElement("div");
A.style.height="1in";
A.style.padding="0";
A.style.visibility="hidden";
document.body.appendChild(A);
this.m_nDpi=A.offsetHeight;
document.body.removeChild(A);
this.m_elHighlighter=document.createElement("div");
this.m_elHighlighter.id="highlightBar";
$("contentBody").appendChild(this.m_elHighlighter)
}}if(this.FirstReferenceElement||this.AfterLastReferenceElement){if(!$D.inDocument("highlightBar")){$("contentBody").appendChild(this.m_elHighlighter)
}var C=(12*(1/72))*this.m_nDpi;
this.m_elHighlighter.title=this.ReferenceStart.toString(true)+" - "+this.ReferenceEnd.toString(true);
var H=this.FirstReferenceElement==null?$D.getFirstChildBy(Global.ContentBody,function(a){return $D.hasClass(a,"referenceChunk")
}):$D.getAncestorByTagName(this.FirstReferenceElement,"p");
var P=this.LastReferenceElement==null?$D.getLastChildBy(Global.ContentBody,function(a){return $D.hasClass(a,"referenceChunk")
}):$D.getAncestorByTagName(this.LastReferenceElement,"p");
var U=this.AfterLastReferenceElement==null?$D.getLastChildBy(Global.ContentBody,function(a){return $D.hasClass(a,"referenceChunk")
}):$D.getAncestorByTagName(this.AfterLastReferenceElement,"p");
var K=YAHOO.util.Dom.getRegion(this.FirstReferenceElement==null?H:this.FirstReferenceElement);
var I=YAHOO.util.Dom.getRegion(this.LastReferenceElement==null?P:this.LastReferenceElement);
var L=YAHOO.util.Dom.getRegion(this.AfterLastReferenceElement==null?U:this.AfterLastReferenceElement);
var J=YAHOO.util.Dom.getRegion(H);
var V=YAHOO.util.Dom.getRegion(P);
var N=YAHOO.util.Dom.getRegion(U);
var G=YAHOO.util.Dom.getRegion("contentBody");
var E=$("contentBody").scrollTop;
var F=J.top-G.top+E;
var W=Math.max(L.top-K.top,C);
var Z=K.top-J.top;
var R=L.left-G.left;
F+=Z;
F+=Page.GetHighlightBarOffset();
if(R>64&&L.top!=K.top){W+=C
}this.m_elHighlighter.style.top=F+"px";
this.m_elHighlighter.style.height=W+"px"
}else{if($D.inDocument("highlightBar")){$("contentBody").removeChild($("highlightBar"))
}}};
Logos.Highlighter.Unhighlight=function(){if($D.inDocument("highlightBar")){var A=$("highlightBar");
$("contentBody").removeChild(A);
A.style.height="";
A.style.top=""
}};
var $L=YAHOO.log;
if(typeof (console)=="undefined"){var console={log:$L}
}var Search={SelectedElement:null,SelectedResultIndex:null,CurrentRequest:null,SearchQuery:null,QueryStateDelimeter:"/",NextPageConnection:null,ResultCount:0,LastResult:0,PageSize:15,Init:function(){var E=(YAHOO.env.ua.webkit!=0)?250:0;
var H=new $EL("txtSearch");
Search.SetSearchValue("");
$L("Adding search box focus handler",null,"Search");
H.on("focus",function(){Search.FocusItem=this;
if(this.value=="Find verses..."){this.value="";
this.style.color="black";
this.style.fontStyle="normal"
}$D.setStyle("go","display","inline")
},$("txtSearch"),true);
$L("Adding search box blur handler",null,"Search");
H.on("blur",function(){Search.FocusItem=null;
if(this.value==""){this.style.color="gray";
this.style.fontStyle="italic";
this.value="Find verses..."
}setTimeout(function(){if(Search.FocusItem==null){$D.setStyle("go","display","none")
}},E)
},$("txtSearch"),true);
$E.on("go","focus",function(I){Search.FocusItem=this
},$("go"),true);
$E.on("go","mousedown",function(I){Search.FocusItem=this
},$("go"),true);
$E.on("go","blur",function(I){Search.FocusItem=null;
setTimeout(function(){if(Search.FocusItem==null){$D.setStyle("go","display","none")
}},E)
},$("go"),true);
$E.on("go","click",Search.OnFormSubmit);
$L("Adding search submit handler",null,"Search");
$E.on("searchForm","submit",Search.OnFormSubmit);
$L("Adding command pane scroll handler",null,"Search");
var C=new $("commandsPane");
$E.on(C,"scroll",Search.OnResultsScroll,C,true);
Global.VersionChangeEvent.subscribe(Search.OnVersionChange);
var A="";
var D=Search.ParseQueryState($H.getBookmarkedState("q"));
var F=D.Query;
var G=D.SearchResult;
if(F!=null){A=F
}var B="";
if(G!=null){B=G
}$H.register("q",A,Search.OnQueryStateChange);
setTimeout(Search.OnResultsScroll,250)
},OnFormSubmit:function(C){$E.stopEvent(C);
var A=$("txtSearch");
var B=A.value;
A.blur();
$("go").blur();
if(B!="Find verses..."&&B!=""){Search.UpdateSearch(B)
}},OnQueryStateChange:function(F,E){if(F==null||F==""){return 
}E=E||false;
var C=Search.ParseQueryState(F);
var D=C.Query;
var A=C.SearchResult;
Search.SetSearchValue(D);
var B;
if(D!=Search.SearchQuery){B=Search.PageSize;
if(A>Search.PageSize-2){B=Math.ceil((A+2)/Search.PageSize)*Search.PageSize
}Search.UpdateSearchCore(D,0,B,false,{q:F},E)
}else{if(A!=null&&A>Search.LastResult){if(Search.LastResult>-1){B=(Math.ceil(A/Search.PageSize)-1)*Search.PageSize;
Search.UpdateSearchCore(Search.SearchQuery,Search.LastResult+1,B,false,{q:F,tab:"results"})
}}else{Search.SelectResult(A);
Search.ScrollToSelection("Result"+A)
}}},OnVersionChange:function(B,A){setTimeout(function(){Search.UpdateSearchCore(Search.ParseQueryState($H.getCurrentState("q")).Query,null,null,true,null)
},250)
},SetSearchValue:function(B){var A=$("txtSearch");
if(B==null||B==""){A.style.color="gray";
A.style.fontStyle="italic";
A.value="Find verses..."
}else{A.style.color="black";
A.style.fontStyle="normal";
A.value=B
}},ProcessViewData:function(D,C,A,K){Search.ResultCount=D.ArticleCount;
Search.LastResult=D.Start+D.SearchHits.length-1;
A=A||{};
var E=$("results");
if(D.Start==0){E.innerHTML=""
}if(D.Phrases!=null){if(D.Phrases.length>0){E.innerHTML+="Common phrases not in the Bible:";
for(var L=0;
L<D.Phrases.length;
L++){var F=D.Phrases[L];
var O=document.createElement("div");
O.className="phrase";
O.innerHTML='"'+F.Content+'"<br/>Source: '+F.Source;
new $EL(O).appendTo(E)
}E.innerHTML+="<br/>Results in the Bible:"
}}var N;
if(D.SearchHits.length==0&&D.Start==0){E.innerHTML+="<em>No search results found.</em>";
if(A.q!=null&&A.q!=""){N=Search.ParseQueryState(A.q);
A.q=N.Query;
$H.multiNavigate(A)
}}else{var H=document.createElement("div");
var J=document.createDocumentFragment();
N=Search.ParseQueryState(A.q);
var I=N.SearchResult||0;
var G=null;
var B=null;
for(var M=0;
M<D.SearchHits.length;
++M){(function(){var U=D.SearchHits[M];
var Q=(D.Start+M);
var R=document.createElement("a");
R.id="Result"+Q;
R.title=U.DisplayReference;
var P=Global.ToReferenceState(U.ShortReference,{refStart:U.ReferenceStart,refEnd:U.ReferenceEnd});
R.href="#q="+D.SearchTerms+"/"+Q+"&ref="+escape(P)+"&ver="+Global.CurrentVersion;
R.onclick=function(){Search.OnClickResult(Q,U.ShortReference,U.ReferenceStart,U.ReferenceEnd,N.Query);
return false
};
J.appendChild(R);
if(!C){if((I!=""&&Q==Number(I)||Q==0&&I=="0")){B=function(){if(K){Search.SelectResult(Q)
}else{Search.OnClickResult(Q,U.ShortReference,U.ReferenceStart,U.ReferenceEnd,D.SearchTerms)
}};
G=function(){Search.ScrollToSelection($("Result"+Q))
}
}}var T=document.createElement("span");
T.className="ref";
T.innerHTML=U.MediumReference;
new $EL(T).appendTo(R);
R.innerHTML+="|";
var S=document.createElement("span");
S.className="preview";
S.innerHTML=U.Preview;
new $EL(S).appendTo(R)
})()
}E.appendChild(J);
if(B){B()
}if(G){G()
}}},OnResultsScroll:function(E){if(Search.CurrentRequest!=null){return 
}var C=$D.getLastChild("results");
var A=$D.getLastChild(C);
var D=$D.getRegion(A);
var B=$D.getRegion("commandsPane");
if(Search.LastResult+1<Search.ResultCount&&B.intersect(D)!=null){Search.UpdateSearchCore(Search.SearchQuery,(Search.LastResult+1))
}},SelectResult:function(A){var D="Result"+A;
if(Search.SelectedElement!=null){Search.SelectedElement.removeClass("selected")
}if(D!=null&&D!=""){var B=$(D);
if(B!=null){B.blur()
}var C=new $EL(D);
C.addClass("selected");
Search.SelectedElement=C;
Search.SelectedResultIndex=A
}else{Search.SelectedElement=null;
Search.SelectedResultIndex=null
}},OnClickResult:function(B,A,C,E,D){D=D||Search.SearchQuery;
states={q:Search.ToQueryState(D,B),content:""};
Search.SelectResult(B);
Page.UpdateReference(A,null,{refStart:C,refEnd:E},null,states)
},UpdateSearch:function(A){Search.OnQueryStateChange(Search.ToQueryState(A));
if(A!=null&&A!=""){Global.GAPageTracker._trackPageview("/search/?query="+escape(A)+"&version="+Global.CurrentVersion)
}},UpdateSearchCore:function(I,B,J,C,A,G){G=G||false;
if(I==null||I==""){return 
}B=B||0;
J=J||Search.PageSize;
if(Search.CurrentRequest!=null){$C.abort(Search.CurrentRequest);
Search.CurrentRequest=null
}if(B==0){try{var D=new Logos.Reference(I);
if(D.Chapter!=null){var K=D.ToString();
var F=K;
if(D.IsRange){F={refStart:D.StartReference.ToString(),refEnd:D.EndReference.ToString()}
}else{if(D.Verse==null){F=null
}}Search.SetSearchValue(Search.SearchQuery);
$("txtSearch").blur();
Page.UpdateReference(K,null,F);
return 
}}catch(H){}Search.SetSearchValue(I);
$("results").innerHTML=""
}Page.SwitchSidebar("search");
$D.setStyle("resultsLoading","display","block");
Search.SearchQuery=I;
var E="/search/js?query="+escape(Search.SearchQuery)+"&start="+B+"&pageSize="+J+"&version="+Global.CurrentVersion;
Search.CurrentRequest=$C.asyncRequest("Get",E,{success:function(O){var L=YAHOO.lang.JSON.parse(O.responseText);
$D.setStyle("resultsLoading","display","none");
Search.ProcessViewData(L,C,A,G);
Search.CurrentRequest=null;
Search.OnResultsScroll();
if(Search.ResultCount==0){try{var N=new Logos.Reference(I);
Page.UpdateReference(N.ToString(),null,null)
}catch(M){}}},failure:function(L){$("results").innerHTML="<div>Error retreiving search results.</div>";
$D.setStyle("resultsLoading","display","none");
Search.CurrentRequest=null
}});
$("commandsPane").scrollTop=$("commandsPane").scrollHeight
},ScrollToSelection:function(A){if(A==null||A==""){A="Result"+Search.ParseQueryState($H.getCurrentState("q")).SearchResult
}var B=new $EL(A);
var D=$D.getRegion(A);
if(!D){return 
}var C=$D.getRegion("commandsPane");
if(!C.intersect(D)||C.intersect(D).getArea()<D.getArea()){if(D.top>C.top){$("commandsPane").scrollTop+=D.bottom-C.bottom+20
}else{$("commandsPane").scrollTop-=C.top-D.top+20
}}},ToQueryState:function(C,A){var B=C;
if(A==null){A=0
}B=B+Search.QueryStateDelimeter+A;
return B
},ParseQueryState:function(D){if(D==null||D.length==0){return{Query:"",SearchResult:""}
}var B=D.split(Search.QueryStateDelimeter);
var C=B[0];
var A=B.length>1?Number(B[1]):null;
return{Query:C,SearchResult:A}
}};
var $L=YAHOO.log;
if(typeof (console)=="undefined"){var console={log:$L}
}var Logos=YAHOO.namespace("Logos");
var Page={ScrollableElement:null,ScrollEventProvider:null,TooltipElements:null,CurrentTooltip:null,CurrentContent:null,ContentScriptCount:0,Init:function(){Page.ScrollableElement=$("contentBody");
Page.ScrollEventProvider=Page.ScrollableElement;
$E.on("banner","click",function(){document.location="/"
},null,true);
Page.OnResize();
$E.on(document,"scroll",function(M){$E.stopEvent(M);
window.scrollTo(document.body.scrollLeft,0)
});
VersionList.OnInit();
Global.VersionChangeEvent.subscribe(Page.OnVersionChange);
$("txtVersion").value=Global.CurrentVersion;
var L=Global.CurrentReference||".";
var I=$H.getBookmarkedState("ref");
if(I!=null){L=I
}var K=Global.CurrentVersion;
var C=$H.getBookmarkedState("ver");
if(C!=null){if($("versionImage_"+C.toUpperCase().replace(/ /,""))){K=C.toUpperCase()
}}var E=$H.getBookmarkedState("q");
var B=Search.ParseQueryState(E);
var J="home";
var F=$H.getBookmarkedState("tab");
if(F!=null){J=F
}var A="";
var G=$H.getBookmarkedState("content");
if(G!=null){A=G
}$H.register("ref",L,Page.OnReferenceStateChange);
$H.register("ver",K,Page.OnVersionStateChange);
$H.register("tab",J,Page.OnTabStateChange);
$H.register("content",A,Page.OnContentStateChange);
$H.onReady(function(){if((K!=Global.CurrentVersion)&&I==null){Global.CurrentVersion=C;
Global.VersionChangeEvent.fire(C)
}if(I!=null&&(G==null||G==".")){var N=I.split(Global.HighlightStateToken);
var M=N[0];
var O=N.length>1?N[1]:Global.HighlightedReference;
Global.UpdateReferenceCore(M.replace(/(\d)(?:\s?[a-z]|ff)$/,"$1"),K,O);
Page.ShowVersionCopyright(K);
Page.SetContentHeaderVisible(false)
}if(E!=null){if(B!=null&&B!=""){Search.OnQueryStateChange(E,I!=null)
}}if(F){Page.SetTabState(F)
}if(G){Page.OnContentStateChange(G)
}});
try{$H.initialize("yui-history-field","yui-history-iframe")
}catch(H){$L("Could not initialize YUI Browser History Manager: "+H,"error")
}Logos.Loader.Load("InfoBar","1.0",function(){Logos.Chrome.InfoBar.resizeHandler=Page.OnResize
});
Logos.Loader.Load("SermonsWidget","1.0",function(){Logos.Chrome.SermonsWidget.Init("Sermons",0);
var M=Global.CurrentReference;
if(M&&M!="."){try{M=new Logos.Reference(M).ToString(true)
}catch(N){}Logos.Chrome.SermonsWidget.Update("passage:<"+M+">",M,3,null)
}Page.SermonsWidgetLoaded=true
});
Logos.Loader.Load("AdRotator","1.0",Page.LoadAds);
var D=!/^\s*$/.test(Global.ContentBody.innerHTML);
if(!D){Global.UpdateReferenceCore(Global.CurrentReference)
}},OnResize:function(){var D=$("scrollSpacer");
if(D!=null){var J=$D.getRegion("contentBody");
$D.setStyle(D,"height",J.bottom-J.top+"px")
}var C=$D.getRegion("hd");
var E=C.bottom-C.top;
var H=["commandsPane","contentBody","infoPane"];
var F=[0,8,0];
var I=[283,0,0];
var A=$("banner");
var B=$("searchBox");
for(ixElement in H){var G=$(H[ixElement]);
if(G!=null){G.style.height=Math.max(I[ixElement],($D.getViewportHeight()-A.clientHeight-B.clientHeight-F[ixElement]-E))+"px"
}}if($("myReadingInfo")){ReadingPlan.OnResize()
}if(Global.HighlightedReference){Global.Highlight(Global.HighlightedReference)
}},GetContentRegion:function(){return $D.getRegion("contentBody")
},GetHighlightBarOffset:function(){return 0
},SermonRetrievalTimer:null,SermonRetrievalTimerLock:false,CurrentSermonsRequestId:null,SermonsWidgetLoaded:false,RequestSermonsUpdate:function(A){if(Page.SermonsWidgetLoaded&&Logos.Chrome.SermonsWidget.initialized){if(Page.SermonRetrievalTimer){clearTimeout(Page.SermonRetrievalTimer)
}if(Page.CurrentSermonsRequestId){Logos.Chrome.SermonsWidget.Abort(Page.CurrentSermonsRequestId);
Page.CurrentSermonsRequestId=null
}Page.SermonRetrievalTimer=setTimeout(function(){Page.CurrentSermonsRequestId=Logos.Chrome.SermonsWidget.Update("passage:<"+A+">",A,3,function(){Page.CurrentSermonsRequestId=null
})
},1000)
}},SetDisplayReference:function(A){$("txtVerse").value=A;
document.title=A+" ("+Global.CurrentVersion+") - Bible.Logos.com";
Page.RequestSermonsUpdate(A);
try{var D=new Logos.Reference(A);
var B="http://ref.ly/"+D.ToShortestString();
$("shortUrl").value=B
}catch(C){}},Tweet:function(){var A=$("shortUrl").value;
Global.GAPageTracker._trackEvent("outgoing","tweet",A);
setTimeout(function(){document.location="http://twitter.com/?status="+encodeURI(A)
},10)
},SelectPane:function(A,D){$D.batch($$("#commandsPane div.active"),function(F){var E=new $EL(F);
E.removeClass("active");
E.addClass("inactive")
});
$D.batch($$("ul#paneList li.current"),function(E){var F=new $EL(E);
F.removeClass("current")
});
var C=new $EL(A);
C.addClass("current");
var B=new $EL(D);
B.removeClass("inactive");
B.addClass("active");
if(D=="readingsPane"&&typeof (ReadingPlan)!="undefined"&&$("myReadingInfo")){ReadingPlan.OnActivated()
}},OnVersionChange:function(C,B){var A=B[0].toUpperCase();
Page.ShowVersionCopyright(A);
$("txtVersion").value=A
},ShowVersionCopyright:function(A){A=A.toUpperCase();
var E=A.replace(/ /,"");
var D=$("versionImage_"+E);
if(/pixel\.gif(\?.*)?$/.test(D.src)){D.src="/versions/"+A+".img"
}var B=$S.query("div.versionInfo");
for(var C=0;
C<B.length;
C++){$D.setStyle(B[C],"display","none")
}$D.setStyle("version_"+E,"display","block")
},GetLocation:function(){var C=window.location;
var B=C.protocol+"//"+C.host+"/";
var A=$H.getCurrentState("content");
if(A&&A!="."){B+="content/"+A
}else{if(Global.CurrentReference){B+="passage/"+Global.CurrentVersion+"/"+escape(Global.CurrentReference.replace(/:/,".").replace("–","-"))
}}return B
},ShowLinkToPage:function(){if(Page.LinkToPageOverlay==null){Page.LinkToPageOverlay=new YAHOO.widget.Overlay("linkToPageOverlay",{context:["linkToPage","tr","br"],width:"350px"});
Page.LinkToPageOverlay.render()
}var C=Page.GetLocation();
var B;
var A=$H.getCurrentState("content");
if(A&&A!="."){C+="#content="+escape(A);
B='<a target="_blank" href="'+C+'">'+(Page.GetContentTitle()||"Bible.Logos.com")+"</a>"
}else{C+="#q="+escape($H.getCurrentState("q"))+"&ref="+escape(Global.ToReferenceState(Global.CurrentReference,Global.HighlightedReference))+"&ver="+Global.CurrentVersion;
B='<a target="_blank" href="'+C+'">'+$("txtVerse").value+'</a><a title="Jump to Passage in Logos Bible Software Series X" href="libronixdls:keylink|ref=[en]bible:'+Global.CurrentReference+"|res=LLS:"+Global.CurrentVersion+'"><img border="0" src="http://www.logos.com/images/Corporate/LibronixLink_light.png" title="Open in Libronix (if available)" style="margin-left:4px" align="bottom"></a>'
}$("linkToPageLink").value=C;
$("linkToPageLongLink").value=B;
Page.LinkToPageOverlay.show()
},ShowExtendedCopyright:function(B){var C=Math.min($D.getViewportWidth()-30,600);
var A=Math.min($D.getViewportHeight()-30,600);
if(Page.ExtendedCopyrightPanel==null){Page.ExtendedCopyrightPanel=new YAHOO.widget.Panel("extendedCopyrightPanel",{fixedcenter:true,constraintoviewport:true,draggable:false,width:C+"px",height:A+"px",underlay:"none"});
Page.ExtendedCopyrightPanel.render();
Page.ExtendedCopyrightPanel.resizeTo=function(E,D){$D.setStyle(this.innerElement,"width",E);
$D.setStyle(this.innerElement,"height",D);
this.resizeBody(E,D)
};
Page.ExtendedCopyrightPanel.resizeBody=function(D,I){var E=(YAHOO.env.ua.ie&&document.compatMode=="BackCompat");
var G=(YAHOO.env.ua.ie==6||(YAHOO.env.ua.ie==7&&E));
var L=(10*2);
var H=this.header?this.header.offsetHeight:0;
var J=this.footer?this.footer.offsetHeight:0;
var K=(I-H-J);
var F=(E)?K:K-L;
$D.setStyle(this.body,"height",F+"px");
this.sizeUnderlay();
if(G){this.syncIframe()
}}
}Page.ExtendedCopyrightPanel.setHeader(B);
Page.ExtendedCopyrightPanel.setBody($("copyright_"+B).innerHTML);
Page.ExtendedCopyrightPanel.resizeTo(C,A);
Page.ExtendedCopyrightPanel.center();
Page.ExtendedCopyrightPanel.show()
},ShowLogin:function(){$("login").style.display="block";
$$("#login input",null,true).focus()
},ShowLoading:function(){},UpdateContent:function(A){$D.getElementsByClassName("bibleref","A",A,Page.UpdateReferenceLink);
Page.UpdateTooltips(A)
},UpdateReferenceLink:function(D){var E=/(?:#|&)ref=(.*)(?:$|&)/.exec(unescape(D.href));
if(E){var F=E[1];
var B=Global.ParseReferenceState(F);
var A=B[0];
var C=B[1];
D.onclick=function(G){Page.UpdateReference(A,null,C);
return false
};
D.lbsReference=A+"|"+C.refStart+"|"+C.refEnd;
D.onmouseover=ToolTip.lbsTooltipMouseOver;
D.onmouseout=ToolTip.lbsTooltipMouseOut
}},UpdateTooltips:function(C){var B=function(E){var D=new RegExp("(?:^|\\s+)popup(?:\\s+|$)");
return E.getAttribute("rel")&&D.test(E.getAttribute("rel"))
};
var A=$D.getElementsBy(B,"a",C);
if(Page.TooltipElements==null||C==Global.ContentBody){Page.TooltipElements=A
}else{Page.TooltipElements=Page.TooltipElements.concat(A)
}if(Page.CurrentTooltip!=null){Page.CurrentTooltip.cfg.setProperty("context",Page.TooltipElements,false)
}else{Page.CurrentTooltip=new Logos.Tooltip("tooltip",{context:Page.TooltipElements});
Page.CurrentTooltip.beforeShowEvent.subscribe(function(D){$D.getElementsByClassName("bibleref","A",Page.CurrentTooltip.element,Page.UpdateReferenceLink)
})
}},UpdateReference:function(A,B,D,E,C){ToolTip.HideAll();
D=Global.ParseHighlight(D);
C=C||{};
C.ref=Global.ToReferenceState(A,D);
if(B!=null){C.ver=B
}if(C.ref==$H.getCurrentState("ref")&&(B==Global.CurrentVersion||B==null)){Page.ScrollToReference(A);
Global.SetDisplayReference(A);
Page.RequestSermonsUpdate(A)
}C.content=".";
$H.multiNavigate(C);
Global.TrackReferenceView(A,B)
},OnReferenceStateChange:function(E){$L("ref state changed","info","Global.State");
if(E&&E!="."){var C=Global.ParseReferenceState(E);
var A=C[0];
var D=C[1]||Global.HighlightedReference;
var B=Global.CurrentVersion;
Global.UpdateReferenceCore(A,B,D,function(){Page.SetContentHeaderVisible(false)
},true)
}else{Global.ClearReference()
}},UpdateVersion:function(A){if(A==null||A==Global.CurrentVersion){return 
}$H.navigate("ver",A);
Global.TrackReferenceView(Global.CurrentReference,A)
},OnVersionStateChange:function(A){$L("ver state changed","info","Global.State");
Global.UpdateVersionCore(A)
},OnTabStateChange:function(A){$L("tab state changed","info","Global.State");
Page.SetTabState(A)
},ScrollToReference:function(A){var C=A.split(/[^\w\d\s:.]+/,1);
A=C[0];
var D=$D.getRegion(A);
if(!D){return false
}var B=Page.GetContentRegion();
Page.ScrollableElement.scrollTop+=D.top-B.top-15;
return true
},SetTabState:function(A){switch(A){case"home":Page.SelectPane("paneTabHome","homePane");
break;
case"search":Page.SelectPane("paneTabResults","resultsPane");
break;
case"readings":Page.SelectPane("paneTabReadings","readingsPane");
break;
default:break
}},SwitchSidebar:function(A){if(A==null){return 
}$H.navigate("tab",A)
},ShowContent:function(A){$H.multiNavigate({content:A,ref:"."})
},OnContentStateChange:function(A){if(A&&A!="."&&A!=Page.CurrentContent){Global.ClearReference();
Global.CancelPendingRequests();
$("customContentHeader").innerHTML="";
Page.CurrentContent=A;
var B="/content/"+A+".js";
Global.GAPageTracker._trackPageview("/content/"+A);
$C.asyncRequest("GET",B,{success:function(G){var C=YAHOO.lang.JSON.parse(G.responseText);
for(var D=0;
D<C.length;
D++){var E=$(C[D].Key);
if(E!=null){E.innerHTML=C[D].Value;
E.scrollTop=0;
$D.batch(E.getElementsByTagName("script"),Page.RunScript)
}}Page.SetContentHeaderVisible(true);
var F=Page.GetContentTitle();
if(F){document.title=F+" - Bible.Logos.com"
}},failure:function(C){if(C.status==404){this.success(C)
}else{Logos.Chrome.InfoBar.Show("infoBar","Sorry, there was an error processing your request. The development team has been notified of the problem.",true)
}}})
}},GetContentTitle:function(){var A=new $("customContentHeader");
return $Y.trim(A.innerText||A.textContent||"")
},SetContentHeaderVisible:function(A){$D.setStyle("customContentHeader","display",A?"block":"none");
$D.setStyle("referenceVersionHeader","display",A?"none":"block")
},RunScript:function(A){if(!/^contentScript\d+$/.test(A.id)){var C=document.createElement("script");
C.id="contentScript"+Page.ContentScriptCount++;
C.type="text/javascript";
C.src=A.src;
C.text=A.text;
var B=A.parentNode;
B.replaceChild(C,A)
}}};
function restorePackageText(){swapPackageText("basePackage")
}function swapPackageText(B){var A=document.getElementById("packageImage");
A.src="http://www.logos.com/images/bible.logos.com/img_"+B+"Text.gif"
}var ToolTip=ToolTip?ToolTip:{};
ToolTip.constShowTooltip=300;
ToolTip.constHideTooltip=400;
ToolTip.lbsTooltipMouseOver=function(E){var F;
if(!E){var E=window.event
}F=E.target||E.srcElement;
if(F.nodeType===3){F=F.parentNode
}while(!F.lbsReference){F=F.parentNode
}if(ToolTip.lbsTooltipToHide){clearTimeout(ToolTip.lbsTmrHideTooltip);
if(F!==ToolTip.lbsTooltipToHide){ToolTip.lbsHideTooltip(ToolTip.lbsTooltipToHide)
}}var B=document.getElementById(F.lbsReference);
ToolTip.lbsTooltipToDisplay=F;
if(B){var C=ToolTip.lbsGetWindowInfo();
var A=ToolTip.lbsGetElementLocation(F);
var D=ToolTip.lbsGetTooltipLocation(B,C,A);
B.style.left=D.x+"px";
B.style.top=D.y+"px";
ToolTip.lbsTmrShowTooltip=setTimeout(function(){ToolTip.lbsShowTooltip(B)
},ToolTip.constShowTooltip)
}else{ToolTip.lbsTmrShowTooltip=setTimeout(function(){var G=ToolTip.lbsCreateTooltip(F);
ToolTip.lbsShowTooltip(G)
},ToolTip.constShowTooltip)
}};
ToolTip.lbsTooltipMouseOut=function(A){var B;
if(!A){var A=window.event
}B=A.target||A.srcElement;
if(B.nodeType===3){B=B.parentNode
}while(!B.lbsReference){B=B.parentNode
}clearTimeout(ToolTip.lbsTmrShowTooltip);
divTooltip=document.getElementById(B.lbsReference);
if(divTooltip){ToolTip.lbsTooltipToHide=divTooltip;
ToolTip.lbsTmrHideTooltip=setTimeout(function(){ToolTip.lbsHideTooltip(ToolTip.lbsTooltipToHide)
},ToolTip.constHideTooltip)
}};
ToolTip.lbsCreateTooltip=function(G){var F=350;
var E=150;
var A=ToolTip.lbsGetElementLocation(G);
var B=document.createElement("div");
B.style.position="absolute";
B.style.width=F+"px";
B.style.height=E+"px";
B.className="lbsTooltip";
B.innerHTML='<div style="position: absolute; background: transparent url(http://bible.logos.com/content/images/refTaggerDropShadow.png) no-repeat; width: 364px; height: 164px; left: -7px; top: -7px;"></div><div class="lbsTooltipHeader">Loading...</div>';
B.id=G.lbsReference;
var D=ToolTip.lbsGetWindowInfo();
var C=ToolTip.lbsGetTooltipLocation(B,D,A);
B.style.top=C.y+"px";
B.style.left=C.x+"px";
if(B.addEventListener){B.addEventListener("mouseover",ToolTip.lbsMouseInTooltip,false);
B.addEventListener("mouseout",ToolTip.lbsMouseLeavesTooltip,false)
}else{if(B.attachEvent){B.attachEvent("onmouseover",ToolTip.lbsMouseInTooltip);
B.attachEvent("onmouseout",ToolTip.lbsMouseLeavesTooltip)
}else{B.onmouseover=ToolTip.lbsMouseInTooltip;
B.onmouseout=ToolTip.lbsMouseLeavesTooltip
}}return B
};
ToolTip.lbsGetTooltipLocation=function(D,G,A){var C=15;
var B=25;
var H=parseInt(D.style.width);
var F=parseInt(D.style.height);
var E=[];
E.x=A.x+C;
E.y=A.y-F;
if(H>G.width||F>G.height){return E
}E.x+=H;
if(E.x>G.width+G.offX){E.x=G.width+G.offX-C
}if(E.x<0){E.x=0
}if(E.y<G.offY){if(A.y+F+B>G.height+G.offY){E.y=G.offY
}else{E.y=A.y+B
}}E.x-=H+3;
return E
};
ToolTip.lbsGetElementLocation=function(E){var C=[];
var B;
var D=E;
var A=[];
A.offX=0;
A.offY=0;
C.x=0;
C.y=0;
if(typeof (E.offsetLeft)==="number"){while(E){C.x+=E.offsetLeft;
C.y+=E.offsetTop;
E=E.offsetParent
}if(!window.opera){while(D&&D!==document.body&&D!==document.documentElement){A.offY+=D.scrollTop||0;
A.offX+=D.scrollLeft||0;
D=D.parentNode
}C.x-=A.offX;
C.y-=A.offY
}}else{if(E.x){C.x=E.x;
C.y=E.y
}}return C
};
ToolTip.lbsGetWindowInfo=function(){var B=[];
if(typeof (window.innerHeight)==="number"){B.width=window.innerWidth;
B.height=window.innerHeight
}else{if(document.documentElement&&(document.documentElement.clientHeight||document.documentElement.clientWidth)){B.width=document.documentElement.clientWidth;
B.height=document.documentElement.clientHeight
}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B.width=document.body.clientWidth;
B.height=document.body.clientHeight
}}}var A=ToolTip.lbsGetOffsets();
if(A){B.offX=A.offX;
B.offY=A.offY
}return B
};
ToolTip.lbsGetOffsets=function(B){var A=[];
if(!B){A.offX=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;
A.offY=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop
}else{if(typeof (B.scrollLeft)==="number"&&(B.scrollLeft||B.scrollTop)){A.offX=B.scrollLeft;
A.offY=B.scrollTop
}else{A=null
}}return A
};
ToolTip.lbsHideTooltip=function(A){if(A&&A.style){A.style.visibility="hidden"
}ToolTip.lbsTooltipToHide=null
};
ToolTip.lbsShowTooltip=function(A){if(document.getElementById(A.id)){A.style.visibility="visible"
}else{if(document.body.appendChild){document.body.appendChild(A)
}else{if(document.body.innerHTML){document.body.innerHTML+=A.innerHTML
}}ToolTip.lbsMakeRequest(A)
}A=null
};
ToolTip.lbsMouseInTooltip=function(){clearTimeout(ToolTip.lbsTmrHideTooltip)
};
ToolTip.lbsMouseLeavesTooltip=function(A){ToolTip.lbsTmrHideTooltip=setTimeout(function(){ToolTip.lbsHideTooltip(ToolTip.lbsTooltipToHide)
},ToolTip.constHideTooltip)
};
ToolTip.lbsMakeRequest=function(C){var A=C.id.split("|")[0];
var B=window.location.protocol+"//"+window.location.host+"/passage/"+Global.CurrentVersion+"/"+encodeURIComponent(A.replace(/:/g,".").replace(/\u2013|\u2014|\u00E2/,"-")).replace(/%80|%93|%C2/gi,"")+"?target=reftagger&callback=ToolTip.dstCallback";
var D=document.createElement("script");
D.setAttribute("type","text/javascript");
D.setAttribute("charset","utf-8");
D.setAttribute("src",B);
ToolTip.currentDstRequest=D;
ToolTip.currentRequestTooltip=C;
document.getElementsByTagName("head").item(0).appendChild(D)
};
ToolTip.dstCallback=function(F){var C=ToolTip.currentRequestTooltip.id.split("|");
var A=C[0];
var D={};
if(C.length>1){D.refStart=C[1];
if(C.length>2){D.refEnd=C[2]
}}var B=Global.ToReferenceState(escape(A),D);
D=YAHOO.lang.JSON.stringify(D);
var E=ToolTip.currentRequestTooltip.currentStyle?ToolTip.currentRequestTooltip.currentStyle.backgroundColor:"inherit";
verseBody=F.Body.replace('<span class="verse-ref" />',"");
var G='<div style="float: left; margin-left: 8px;"><a href="#ref='+B+'" onclick=\'Page.UpdateReference("'+A+'",null,'+D+");return false'>More &raquo;</a></div>";
ToolTip.currentRequestTooltip.innerHTML='<div style="position: absolute; background: transparent url(http://bible.logos.com/content/images/refTaggerDropShadow.png) no-repeat; width: 364px; height: 164px; left: -7px; top: -7px; z-index: -1"></div><div class="lbsContainer" style="height:150px; background-color:'+E+';"><div class="lbsTooltipHeader">'+F.Header+" ("+F.Version+')</div><div class="lbsTooltipBody" style="width:335px;">'+verseBody+'</div><div class="lbsTooltipFooter" style="width:345px;">'+G+'<div><a href="http://www.logos.com/reftagger" target="_blank">Powered by RefTagger</a></div></div></div>';
document.getElementsByTagName("head").item(0).removeChild(ToolTip.currentDstRequest);
ToolTip.currentDstRequest=null;
ToolTip.currentRequestTooltip=null
};
ToolTip.HideAll=function(){$D.batch($$("div.lbsTooltip"),function(B){var A=new $EL(B);
A.setStyle("visibility","hidden")
})
};
var VersionList={Menu:null,MenuCloseDelay:500,CloseTimeout:null,DisplayVersions:function(){if(VersionList.Menu!=null){if(VersionList.CloseTimeout!=null){clearTimeout(VersionList.CloseTimeout)
}$E.on("linkMoreVersions","mouseout",function(){if(VersionList.CloseTimeout!=null){clearTimeout(VersionList.CloseTimeout)
}VersionList.CloseTimeout=setTimeout(VersionList.HideVersions,VersionList.MenuCloseDelay)
});
var B=$D.getRegion("linkMoreVersions");
var A=(B.right-B.left)/2;
VersionList.Menu.moveTo(B.left+A,B.bottom);
VersionList.Menu.show()
}},HideVersions:function(){VersionList.Menu.hide()
},UpdateElements:function(){var B=$S.query("li.versionLink");
for(var C=0;
C<B.length;
C++){var A=B[C];
var D=VersionList.GetVersion(A);
if(D==Global.CurrentVersion.toUpperCase()){$D.addClass(A,"current");
$E.removeListener(A,"click")
}else{$D.removeClass(A,"current");
$E.removeListener(A,"click");
$E.addListener(A,"click",function(){Page.UpdateVersion(VersionList.GetVersion(this));
VersionList.UpdateElements()
})
}}},GetVersion:function(A){var B=$D.getFirstChild(A);
var C=B.innerHTML;
return YAHOO.lang.trim(C.toUpperCase())
},OnInit:function(){VersionList.UpdateElements();
VersionList.Menu=new YAHOO.widget.Menu("menuVersions",{scrollincrement:2,maxheight:350});
$C.asyncRequest("Get","/versions",{success:function(C){var B=YAHOO.lang.JSON.parse(C.responseText);
for(ixItem in B){B[ixItem].url='javascript:VersionList.OnVersionClick("'+B[ixItem].url+'");'
}VersionList.Menu.addItems(B);
VersionList.Menu.render(document.body);
var A=$S.query("#menuVersions a.yuimenuitemlabel");
for(ixLink in A){A[ixLink].title=B[ixLink].title;
A[ixLink].innerHTML=B[ixLink].title
}$E.on("menuVersions","mousemove",function(){clearTimeout(VersionList.CloseTimeout)
});
$E.on("menuVersions","mouseout",function(){VersionList.CloseTimeout=setTimeout(VersionList.HideVersions,VersionList.MenuCloseDelay)
})
}});
Global.VersionChangeEvent.subscribe(VersionList.UpdateElements)
},OnVersionClick:function(A){Page.UpdateVersion(A)
}};
var VerseLookup={OnFocusChange:function(A){if(A.className=="hiddenInput"){A.className="hiddenInputOutline";
A.focus();
A.select()
}else{A.className="hiddenInput"
}},OnKeyPress:function(C){var A;
if(window.event){A=window.event.keyCode
}else{if(C.which){A=C.which
}}switch(A){case 13:var B=$("txtVerse");
B.blur();
VerseLookup.LookupVerse(B.value);
break
}},LookupVerse:function(A){try{var E=new Logos.Reference(A);
var D=true;
if(E.Chapter==null){E.Chapter=1;
D=false
}A=E.ToString();
var B=D?A:null;
if(E.IsRange){B={refStart:E.StartReference.ToString(),refEnd:E.EndReference.ToString()}
}else{if(E.Verse==null){B=null
}}Page.UpdateReference(A,null,B);
return 
}catch(C){$L(C);
Search.UpdateSearch(A)
}}};
var $L=YAHOO.log;
if(typeof (console)=="undefined"){console={log:$L}
}var ReadingPlan={ActiveSchedules:null,ActiveReadings:null,LastCompletedReadingStart:null,OnActivated:function(){var B=$("selReadingSchedules");
var A="/readingplan/schedules";
if(ReadingPlan.ActiveSchedules==null){$C.asyncRequest("Get",A,{success:function(D){var I=YAHOO.lang.JSON.parse(D.responseText);
var J=null;
var E=$H.getBookmarkedState("scheduleId");
B.options.length=0;
for(var G in I){var K=I[G];
var C=document.createElement("option");
var H=Date.parse(K.FirstReadingStartTime).clearTime(),F=Date.parse(K.LastReadingStartTime).clearTime();
C.text=K.DisplayName+"; "+H.toString("MMM yy")+" - "+F.toString("MMM yy");
C.value=K.Id;
B.options.add(C);
if(K.Id==E){C.selected="selected"
}if(E==null&&K.DisplayName=="Bible in a Year"&&H.compareTo(Date.today())<0){J=C
}}if(J!=null){J.selected="selected"
}ReadingPlan.ActiveSchedules=I;
ReadingPlan.OnScheduleChanged()
},failure:function(C){Logos.Chrome.InfoBar.Show("infoBar","There was an error retrieving available reading plans.")
}})
}ReadingPlan.OnResize()
},OnScheduleChanged:function(){var E=$("selReadingSchedules");
var B=$("selReadings");
var C=$("lnkReadingScheduleFeed");
var D=E.value;
var A="/readingplan/schedules/"+D+".js";
$C.asyncRequest("Get",A,{success:function(G){var M=YAHOO.lang.JSON.parse(G.responseText);
var H=$("scheduleInfo");
H.innerHTML=M.ReadersTotalCount+'&nbsp;Readers&nbsp;(<span title="On Schedule" style="color: #009900">'+(M.ReadersTotalCount-M.ReadersBehindScheduleCount)+'</span>/<span title="Behind Schedule" style="color: #CC0000">'+M.ReadersBehindScheduleCount+"</span>)";
ReadingPlan.UpdateReadingInfo(M.ReadingsCompleted,M.ReadingsBehind);
C.href="http://"+document.location.host+"/readingplan/schedules/"+D+"/"+Global.EncodedUserId+".xml";
var P=$("selReadings");
P.options.length=0;
var I=null;
for(var O in ReadingPlan.ActiveSchedules){var L=ReadingPlan.ActiveSchedules[O];
if(L.Id==E.value){I=L
}}var N=$H.getBookmarkedState("readingId");
P.options.length=0;
for(var F in M.ActiveReadings){var J=M.ActiveReadings[F];
var K=Date.parse(J.StartTime).clearTime();
optDate=document.createElement("option");
optDate.text=K.toString("dddd, MMMM dS, yyyy");
optDate.value=J.ReadingId;
if(J.ReadingId==N){optDate.selected="selected"
}if(N==null&&K.compareTo(Date.today())==0){optDate.selected="selected"
}P.options.add(optDate)
}ReadingPlan.ActiveReadings=M.ActiveReadings;
ReadingPlan.LastCompletedReadingStart=Date.parse(M.LastCompletedReadingStart);
ReadingPlan.OnReadingChanged()
},failure:function(F){Logos.Chrome.InfoBar.Show("infoBar","There was an error retrieving information for your selected schedule.")
}});
A="/readingplan/journals/"+E.value+".js";
$C.asyncRequest("Get",A,{success:function(G){var F=YAHOO.lang.JSON.parse(G.responseText);
ReadingPlan.UpdateJournals(F)
},failure:function(F){Logos.Chrome.InfoBar.Show("infoBar","There was an error retrieving comments for your selected schedule.")
}})
},ActiveReading:null,OnReadingChanged:function(){var B=$("selReadings");
var F=$("selReadingSchedules");
var E=ReadingPlan.ActiveReadings[B.selectedIndex];
var A=ReadingPlan.ActiveSchedules[F.selectedIndex];
var D=$("readingPassages");
var H=Date.parse(E.StartTime);
var C=Date.compare(H,ReadingPlan.LastCompletedReadingStart)<=0;
D.innerHTML="";
for(var G in E.Passages){(function(){var J=E.Passages[G];
var I=document.createElement("a");
I.onclick=function(){Page.UpdateReference(J.Reference,null,{refStart:J.ReferenceStart,refEnd:J.ReferenceEnd})
};
I.innerHTML=J.Reference;
D.appendChild(I);
D.appendChild(document.createElement("br"))
})()
}ReadingPlan.ActiveReading=E;
$("readingIncomplete").className="show";
$("readingComplete").className=C?"show":"hide";
if(C){$D.replaceClass($("btnDoneReading"),"show","hide")
}else{$D.replaceClass($("btnDoneReading"),"hide","show")
}ReadingPlan.OnResize()
},OnDoneReading:function(){var B=$("selReadingSchedules");
var C=Date.parse(ReadingPlan.ActiveReading.StartTime);
var A="/readingplan/complete/"+B.value+"/"+escape(C.toString("yyyyMMdd"));
$C.asyncRequest("Get",A,{success:function(E){var D=YAHOO.lang.JSON.parse(E.responseText);
ReadingPlan.UpdateReadingInfo(D.ReadingsCompleted,D.ReadingsBehind);
$D.replaceClass($("btnDoneReading"),"show","hide");
$("readingComplete").className="show";
ReadingPlan.LastCompletedReadingStart=C;
ReadingPlan.OnResize()
},failure:function(D){Logos.Chrome.InfoBar.Show("infoBar","There was an error marking your reading as complete.")
}})
},OnAddJournal:function(){var A=$("txtComment").value;
var C=$("selReadingSchedules");
var B="/readingplan/journals/post";
if(A!=""&&A!="Type comment..."){$C.asyncRequest("Post",B,{success:function(E){var D=YAHOO.lang.JSON.parse(E.responseText);
ReadingPlan.UpdateJournals(D)
},failure:function(D){Logos.Chrome.InfoBar.Show("infoBar","There was an error posting your comment.")
}},"scheduleId="+C.value+"&journalContent="+A)
}},OnResize:function(){var J=$("commandsPane");
var H=$("readingsPane");
var D=$("commentsPane");
var I=$("commentsList");
var B=$D.getRegion("myReadingInfo");
var E=$D.getRegion("commentsForm");
var A=$D.getRegion("commentsTab");
var K=E.bottom-E.top;
var F=B.bottom-B.top;
var G=A.bottom-A.top;
var C=(YAHOO.env.ua.webkit!=0)?2:0;
H.style.height=C?(J.clientHeight-C+"px"):J.style.height;
I.style.height=Math.max(50,parseInt(J.style.height)-(B?F:0)-K-G)-C+"px"
},OnCommentChange:function(){var B="Type comment...";
var A=$("txtComment");
var C=A.value;
if(C==null||C==""){A.style.color="gray";
A.style.fontStyle="italic";
A.value=B
}else{if(C==B){A.value=""
}A.style.color="black";
A.style.fontStyle="normal"
}},UpdateReadingInfo:function(A,C){var B=$("readingInfo");
B.innerHTML="Completed:&nbsp;"+A+"&nbsp;&nbsp;&nbsp;"+(C>0?'<span style="color: #CC0000">Behind:&nbsp;'+C+"</span>":"Behind:&nbsp;"+C)
},UpdateJournals:function(L){var I=$("commentsList");
I.innerHTML="";
var D=null;
for(var F in L){var C=L[F];
var E=document.createElement("div");
E.className="readingComment";
E.style.margin="4px";
var H=document.createElement("div");
H.className="commentHeader";
H.style.backgroundImage="url('"+C.ProfileImageUrl+"')";
var A=document.createElement("div");
A.className="commentTime";
A.innerHTML=ReadingPlan.RenderFriendlyDate(C.TimePosted);
var J=document.createElement("div");
J.className="commentName";
J.innerHTML=C.UserDisplayName;
var K=document.createElement("div");
K.style.clear="both";
K.style.color="#6D6D6D";
if(C.UserDisplayLocation.City.length>0||C.UserDisplayLocation.State.length>0||C.UserDisplayLocation.CountryCode.length>0){K.innerHTML=C.UserDisplayLocation.City+", "+C.UserDisplayLocation.State+" "+C.UserDisplayLocation.CountryCode
}else{K.innerHTML="&nbsp;"
}var B=/(\r\n|\r|\n)/g;
var G=document.createElement("div");
G.className="commentText";
G.innerHTML=C.MessageText.replace(B,"<br />");
H.appendChild(A);
H.appendChild(J);
H.appendChild(K);
E.appendChild(H);
E.appendChild(G);
I.appendChild(E);
D=E
}if(D!=null){I.scrollTop=I.scrollHeight
}},RenderFriendlyDate:function(C){var E=Date.parse(C).setTimezoneOffset(0);
var D=E.toString("h:mm tt");
var B=E.clearTime();
var A=Date.today();
if(Date.compare(B,A)==0){return"Today "+D
}else{if(Date.compare(B,A.addDays(-1))==0){return"Yesterday "+D
}else{if(Date.compare(B,A)<0&&Date.compare(B,A.addDays(-6))>=0){return E.toString("dddd ")+D
}else{if(B.getYear()==A.getYear()){return E.toString("MMMM d")
}else{return E.toString("yyyy MMMM")
}}}}}};