if("undefined"===typeof Recite||!Recite)var Recite={};
Recite=function(){function d(c,b){"undefined"===typeof b&&(b=Recite);Recite.Util.each(c,function(c,e){var a=b[c];"undefined"!==typeof a&&(a.setOptions?a.setOptions(e):d(e,a))})}function a(e){Recite.Debug.log("Recite","(Version "+Recite.version+") Load called with options:",e);var a={persist:!0,autoEnable:!1,observeDom:!0,selectionMethod:"tooltip",rootNode:document.body,css:Recite.baseUrl+"/assets/"+Recite.version+"/css/recite.css",enableButton:".recite-enable",enableFragment:"#recite-enable",enableButtonToggle:!1,
buttonDeactivateContent:"Deactivate Recite",buttonDeactivateContentElement:".recite-enable",parser:Recite.Parser.Html,autoCache:!0,defaultLanguage:null,classname:null,button:null,wrapTag:null,mode:null},e=e||{},e=Recite.Util.merge(a,e);d(e);b=e;a=Recite.Sizzle(b.enableButton);Recite.Event.publish("Recite:load");e=Recite.Storage.Cookie.load("Recite.Persist");null!==b.enableFragment&&window.location.hash===b.enableFragment&&(b.autoEnable=!0);(b.autoEnable||b.persist&&!0===e)&&Recite.enable();null!==
b.enableButton&&Recite.DomEvent.add(a,"click",function(){b.enableButtonToggle?c?Recite.disable():Recite.enable():Recite.enable()});!1!==b.trackModuleEvents&&Recite.Event.subscribe("Recite:ModuleEvent",function(c,b){Recite.Tracker.track(b.name+":"+b.event)})}var c=!1,b={};return{namespace:function(){var b=arguments,c=null,a,d,i;for(a=0;a<b.length;a+=1){i=(""+b[a]).split(".");c=Recite;for(d="Recite"===i[0]?1:0;d<i.length;d+=1)c[i[d]]=c[i[d]]||{},c=c[i[d]]}return c},load:function(c){"complete"===document.readyState||
"interactive"===document.readyState?a(c):Recite.DomEvent.add(window,"load",function(){a(c)})},enable:function(){if(c)Recite.Debug.log("Recite","Already enabled, not re-enabling.");else{b.persist&&Recite.Storage.Cookie.save("Recite.Persist",!0);Recite.Api.call("token","GET",{authRequired:!1,success:function(){Recite.Debug.log("Recite","Valid token found.")},error:function(){alert("Recite: Error, the API Key provided for this site is invalid.");window.location.reload()}});if(b.enableButtonToggle){var e=
Recite.Sizzle(b.buttonDeactivateContentElement);Recite.Util.each(e,function(c,e){e.innerHTML=b.buttonDeactivateContent})}Recite.AssetLoader.css(b.css,function(){Recite.Debug.log("Recite","Recite CSS loaded");Recite.Controls.load(document)});Recite.Event.subscribe("Controls:loaded",function(){Recite.Preferences.load()});Recite.Event.subscribe("Preferences:load",function(){null!==b.defaultLanguage&&null===Recite.Preferences.get("language")&&Recite.Preferences.set("language",b.defaultLanguage)});"tooltip"===
b.selectionMethod?window.setTimeout(function(){if(null!==b.rootNode){var c=b.parser.parse(b.rootNode);Recite.PlayerControls.invoke(c);b.observeDom&&Recite.Dom.Observer.observe(b.rootNode)}},0):"highlight"===b.selectionMethod&&(b.observeDom=!1,Recite.Selection.setOptions({playOnSelection:!0}));Recite.Docreader.enabled()&&Recite.Docreader.load();Recite.Event.publish("Recite:enable");Recite.Debug.log("Recite","Recite enabled");Recite.Tracker.track("enable",{width:screen.width,height:screen.height});
c=!0}},disable:function(){Recite.Storage.Cookie.clear("Recite.Persist");Recite.Event.publish("Recite:disable");window.location.reload()},getOptions:function(c){if("undefined"===typeof c)return b;var a,d,c=c.split(".");a=b;for(d=0;d<c.length;d++)if(a=a[c[d]],"undefined"===typeof a)return null;return a},version:"3.1.11",baseUrl:"http://api.reciteme.com"}}();null!==null&&null();Recite.namespace("Recite.Util");
Recite.Util=function(){var d=[],a=Object.prototype.toString;d["[object Boolean]"]="boolean";d["[object Number]"]="number";d["[object String]"]="string";d["[object Function]"]="function";d["[object Array]"]="array";d["[object Date]"]="date";d["[object RegExp]"]="regexp";d["[object Object]"]="object";String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},String.prototype.ltrim=function(){return this.replace(/^\s+/,"")},String.prototype.rtrim=
function(){return this.replace(/\s+$/,"")},String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ")});return{isFunction:function(c){return"function"===Recite.Util.type(c)},isArray:Array.isArray||function(c){return"array"===Recite.Util.type(c)},isWindow:function(c){return c&&"object"===typeof c&&"setInterval"in c},isNumeric:function(c){return!isNaN(parseFloat(c))&&isFinite(c)},type:function(c){return null==c?String(c):d[a.call(c)]||"object"},clone:function(c){return JSON.parse(JSON.stringify(c))},
guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var b=16*Math.random()|0;return("x"==c?b:b&3|8).toString(16)})},each:function(c,b,a){var d,f=0,j=c.length,i=void 0===j;if(a)if(i)for(d in c){if(!1===b.apply(c[d],a))break}else for(;f<j&&!1!==b.apply(c[f++],a););else if(i)for(d in c){if(!1===b.call(c[d],d,c[d]))break}else for(;f<j&&!1!==b.call(c[f],f,c[f++]););return c},merge:function(c,b){for(var a in b)try{c[a]=b[a].constructor===Object?MergeRecursive(c[a],b[a]):
b[a]}catch(d){c[a]=b[a]}return c},inArray:function(c,b,a){var d;if(b){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(b,c,a);d=b.length;for(a=a?0>a?Math.max(0,d+a):a:0;a<d;a++)if(a in b&&b[a]===c)return a}return-1},getWindowLocationOrigin:function(c){return c.location.origin||c.location.protocol+"//"+c.location.host},buildQueryString:function(c){var b="";Recite.Util.each(c,function(c,a){b+="&"+c+"="+encodeURIComponent(a)});return b="?"+b.substring(1)}}}();Recite.namespace("Event");
Recite.Event=function(){var d={},a=-1;return{publish:function(c,b){if(!d[c])return!1;setTimeout(function(){for(var a=d[c],h=a?a.length:0;h--;)a[h].func(c,b)},0);return!0},subscribe:function(c,b){d[c]||(d[c]=[]);var e=(++a).toString();d[c].push({token:e,func:b});return e},unsubscribe:function(c){for(var b in d)if(d[b])for(var a=0,h=d[b].length;a<h;a++)if(d[b][a].token===c)return d[b].splice(a,1),c;return!1}}}();Recite.namespace("Debug");
Recite.Debug=function(){var d={log:!0};return{setOptions:function(a){d=Recite.Util.merge(d,a)},log:function(a){d.log&&(null===a&&(a="Recite.Debug"),arguments[0]="["+a+"]",window.console&&Function.apply.call(console.log,console,arguments))}}}();Recite.namespace("Recite.DomEvent");
Recite.DomEvent=function(){return{add:function(d,a,c){d=Recite.Util.isArray(d)?d:[d];Recite.Util.each(d,function(b,d){d.addEventListener?d.addEventListener(a,c,!1):d.attachEvent&&(d["e"+a+c]=c,d[a+c]=function(){var b=window.event;b.target=b.target||b.srcElement;d["e"+a+c](b)},d.attachEvent("on"+a,d[a+c]))})},remove:function(d,a,c){d=Recite.Util.isArray(d)?d:[d];Recite.Util.each(d,function(b,d){d.removeEventListener?d.removeEventListener(a,c,!1):d.detachEvent&&"undefined"!==typeof d[a+c]&&(d.detachEvent("on"+
a,d[a+c]),d[a+c]=null,d["e"+a+c]=null)})}}}();Recite.namespace("XDM");
Recite.XDM=function(){var d,a,c=1,b;return{postMessage:function(b,a,d){a&&(d=d||parent,window.postMessage?d.postMessage(b,a.replace(/([^:]+:\/\/[^\/]+).*/,"$1")):a&&(d.location=a.replace(/#.*$/,"")+"#"+ +new Date+c++ +"&"+b))},receiveMessage:function(c,h){window.postMessage?(c&&(b=function(a){if("string"===typeof h&&a.origin!==h||"[object Function]"===Object.prototype.toString.call(h)&&!1===h(a.origin))return!1;c(a)}),Recite.DomEvent.add(window,"message",b)):(d&&clearInterval(d),d=null,c&&(d=setInterval(function(){var b=
document.location.hash,d=/^#?\d+&/;b!==a&&d.test(b)&&(a=b,c({data:b.replace(d,"")}))},100)))}}}();
(function(){function d(c,a,d,e,f,h){for(var f=0,g=e.length;f<g;f++){var l=e[f];if(l){for(var i=!1,l=l[c];l;){if(l[b]===d){i=e[l.sizset];break}1===l.nodeType&&!h&&(l[b]=d,l.sizset=f);if(l.nodeName.toLowerCase()===a){i=l;break}l=l[c]}e[f]=i}}}function a(c,a,d,e,f,h){for(var f=0,l=e.length;f<l;f++){var g=e[f];if(g){for(var i=!1,g=g[c];g;){if(g[b]===d){i=e[g.sizset];break}if(1===g.nodeType)if(h||(g[b]=d,g.sizset=f),"string"!==typeof a){if(g===a){i=!0;break}}else if(0<m.filter(a,[g]).length){i=g;break}g=
g[c]}e[f]=i}}}var c=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,b="sizcache"+(Math.random()+"").replace(".",""),e=0,h=Object.prototype.toString,f=!1,j=!0,i=/\\/g,g=/\r\n/g,p=/\W/;[0,0].sort(function(){j=!1;return 0});var m=function(a,b,d,e){var d=d||[],f=b=b||document;if(1!==b.nodeType&&9!==b.nodeType)return[];if(!a||"string"!==typeof a)return d;var g,i,q,j,r,p=!0,H=m.isXML(b),n=[],w=a;do if(c.exec(""),g=c.exec(w))if(w=
g[3],n.push(g[1]),g[2]){j=g[3];break}while(g);if(1<n.length&&t.exec(a))if(2===n.length&&k.relative[n[0]])i=K(n[0]+n[1],b,e);else for(i=k.relative[n[0]]?[b]:m(n.shift(),b);n.length;)a=n.shift(),k.relative[a]&&(a+=n.shift()),i=K(a,i,e);else if(!e&&(1<n.length&&9===b.nodeType&&!H&&k.match.ID.test(n[0])&&!k.match.ID.test(n[n.length-1]))&&(g=m.find(n.shift(),b,H),b=g.expr?m.filter(g.expr,g.set)[0]:g.set[0]),b){g=e?{expr:n.pop(),set:l(e)}:m.find(n.pop(),1===n.length&&("~"===n[0]||"+"===n[0])&&b.parentNode?
b.parentNode:b,H);i=g.expr?m.filter(g.expr,g.set):g.set;for(0<n.length?q=l(i):p=!1;n.length;)g=r=n.pop(),k.relative[r]?g=n.pop():r="",null==g&&(g=b),k.relative[r](q,g,H)}else q=[];q||(q=i);q||m.error(r||a);if("[object Array]"===h.call(q))if(p)if(b&&1===b.nodeType)for(a=0;null!=q[a];a++)q[a]&&(!0===q[a]||1===q[a].nodeType&&m.contains(b,q[a]))&&d.push(i[a]);else for(a=0;null!=q[a];a++)q[a]&&1===q[a].nodeType&&d.push(i[a]);else d.push.apply(d,q);else l(q,d);j&&(m(j,f,d,e),m.uniqueSort(d));return d};
m.uniqueSort=function(a){if(y&&(f=j,a.sort(y),f))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};m.matches=function(a,b){return m(a,null,null,b)};m.matchesSelector=function(a,b){return 0<m(b,null,null,[a]).length};m.find=function(a,b,c){var d,e,f,h,g,l;if(!a)return[];e=0;for(f=k.order.length;e<f;e++)if(g=k.order[e],h=k.leftMatch[g].exec(a))if(l=h[1],h.splice(1,1),"\\"!==l.substr(l.length-1)&&(h[1]=(h[1]||"").replace(i,""),d=k.find[g](h,b,c),null!=d)){a=a.replace(k.match[g],"");
break}d||(d="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};m.filter=function(a,b,c,d){for(var e,f,h,g,l,i,q,j,r=a,t=[],p=b,n=b&&b[0]&&m.isXML(b[0]);a&&b.length;){for(h in k.filter)if(null!=(e=k.leftMatch[h].exec(a))&&e[2])if(i=k.filter[h],l=e[1],f=!1,e.splice(1,1),"\\"!==l.substr(l.length-1)){p===t&&(t=[]);if(k.preFilter[h])if(e=k.preFilter[h](e,p,c,t,d,n)){if(!0===e)continue}else f=g=!0;if(e)for(q=0;null!=(l=p[q]);q++)l&&(g=i(l,e,q,p),j=d^g,c&&null!=
g?j?f=!0:p[q]=!1:j&&(t.push(l),f=!0));if(void 0!==g){c||(p=t);a=a.replace(k.match[h],"");if(!f)return[];break}}if(a===r)if(null==f)m.error(a);else break;r=a}return p};m.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var n=m.getText=function(a){var b,c;b=a.nodeType;var d="";if(b)if(1===b||9===b||11===b){if("string"===typeof a.textContent)return a.textContent;if("string"===typeof a.innerText)return a.innerText.replace(g,"");for(a=a.firstChild;a;a=a.nextSibling)d+=n(a)}else{if(3===
b||4===b)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(d+=n(c));return d},k=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"===typeof b,d=c&&!p.test(b),c=c&&!d;d&&(b=b.toLowerCase());for(var d=0,e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&1!==f.nodeType;);
a[d]=c||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}c&&m.filter(b,a,!0)},">":function(a,b){var c,d="string"===typeof b,e=0,f=a.length;if(d&&!p.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e])c=c.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<f;e++)(c=a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(b,c,f){var h,g=e++,l=a;"string"===typeof c&&!p.test(c)&&(h=c=c.toLowerCase(),l=d);l("parentNode",c,g,b,h,f)},"~":function(b,c,f){var h,g=e++,l=a;"string"===
typeof c&&!p.test(c)&&(h=c=c.toLowerCase(),l=d);l("previousSibling",c,g,b,h,f)}},find:{ID:function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return 0===c.length?null:c}},TAG:function(a,b){if("undefined"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},
preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var f=0,h;null!=(h=b[f]);f++)h&&(e^(h.className&&0<=(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?c||d.push(h):c&&(b[f]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||m.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||
!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){b=a[1]=a[1].replace(i,"");!f&&k.attrMap[b]&&(a[1]=k.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(i,"");"~="===a[2]&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,d,e,f){if("not"===a[1])if(1<(c.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=m(a[3],null,null,b);else return a=m.filter(a[3],b,d,1^f),d||e.push.apply(e,a),!1;else if(k.match.POS.test(a[0])||k.match.CHILD.test(a[0]))return!0;
return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return!0===a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),
c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},
image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-
1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=k.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return 0<=(a.textContent||a.innerText||n([a])||"").indexOf(b[3]);if("not"===e){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}m.error(e)},CHILD:function(a,c){var d,
e,f,h,g,l;d=c[1];l=a;switch(d){case "only":case "first":for(;l=l.previousSibling;)if(1===l.nodeType)return!1;if("first"===d)return!0;l=a;case "last":for(;l=l.nextSibling;)if(1===l.nodeType)return!1;return!0;case "nth":d=c[2];e=c[3];if(1===d&&0===e)return!0;f=c[0];if((h=a.parentNode)&&(h[b]!==f||!a.nodeIndex)){g=0;for(l=h.firstChild;l;l=l.nextSibling)1===l.nodeType&&(l.nodeIndex=++g);h[b]=f}l=a.nodeIndex-e;return 0===d?0===l:0===l%d&&0<=l/d}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===
b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var c=b[1],c=m.attr?m.attr(a,c):k.attrHandle[c]?k.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),d=c+"",e=b[2],f=b[4];return null==c?"!="===e:!e&&m.attr?null!=c:"="===e?d===f:"*="===e?0<=d.indexOf(f):"~="===e?0<=(" "+d+" ").indexOf(f):!f?d&&!1!==c:"!="===e?d!==f:"^="===e?0===d.indexOf(f):"$="===
e?d.substr(d.length-f.length)===f:"|="===e?d===f||d.substr(0,f.length+1)===f+"-":!1},POS:function(a,b,c,d){var e=k.setFilters[b[2]];if(e)return e(a,c,b,d)}}},t=k.match.POS,q=function(a,b){return"\\"+(b-0+1)},r;for(r in k.match)k.match[r]=RegExp(k.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),k.leftMatch[r]=RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[r].source.replace(/\\(\d+)/g,q));k.match.globalPOS=t;var l=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(document.documentElement.childNodes,
0)[0].nodeType}catch(s){l=function(a,b){var c=0,d=b||[];if("[object Array]"===h.call(a))Array.prototype.push.apply(d,a);else if("number"===typeof a.length)for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var y,u;document.documentElement.compareDocumentPosition?y=function(a,b){return a===b?(f=!0,0):!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1}:(y=function(a,b){if(a===b)return f=!0,0;if(a.sourceIndex&&
b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],h=[];c=a.parentNode;d=b.parentNode;var g=c;if(c===d)return u(a,b);if(c){if(!d)return 1}else return-1;for(;g;)e.unshift(g),g=g.parentNode;for(g=d;g;)h.unshift(g),g=g.parentNode;c=e.length;d=h.length;for(g=0;g<c&&g<d;g++)if(e[g]!==h[g])return u(e[g],h[g]);return g===c?u(a,h[g],-1):u(e[g],b,1)},u=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});q=document.createElement("div");r="script"+
(new Date).getTime();var A=document.documentElement;q.innerHTML="<a name='"+r+"'/>";A.insertBefore(q,A.firstChild);document.getElementById(r)&&(k.find.ID=function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(b=b.getElementById(a[1]))?b.id===a[1]||"undefined"!==typeof b.getAttributeNode&&b.getAttributeNode("id").nodeValue===a[1]?[b]:void 0:[]},k.filter.ID=function(a,b){var c="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b});
A.removeChild(q);A=q=null;q=document.createElement("div");q.appendChild(document.createComment(""));0<q.getElementsByTagName("*").length&&(k.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c});q.innerHTML="<a href='#'></a>";q.firstChild&&("undefined"!==typeof q.firstChild.getAttribute&&"#"!==q.firstChild.getAttribute("href"))&&(k.attrHandle.href=function(a){return a.getAttribute("href",2)});q=null;if(document.querySelectorAll){var B=
m,q=document.createElement("div");q.innerHTML="<p class='TEST'></p>";if(!(q.querySelectorAll&&0===q.querySelectorAll(".TEST").length)){var m=function(a,b,c,d){b=b||document;if(!d&&!m.isXML(b)){var e=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(a);if(e&&(1===b.nodeType||9===b.nodeType)){if(e[1])return l(b.getElementsByTagName(a),c);if(e[2]&&k.find.CLASS&&b.getElementsByClassName)return l(b.getElementsByClassName(e[2]),c)}if(9===b.nodeType){if("body"===a&&b.body)return l([b.body],c);if(e&&e[3]){var f=
b.getElementById(e[3]);if(f&&f.parentNode){if(f.id===e[3])return l([f],c)}else return l([],c)}try{return l(b.querySelectorAll(a),c)}catch(h){}}else if(1===b.nodeType&&"object"!==b.nodeName.toLowerCase()){var e=b,g=(f=b.getAttribute("id"))||"__sizzle__",i=b.parentNode,q=/^\s*[+~]/.test(a);f?g=g.replace(/'/g,"\\$&"):b.setAttribute("id",g);q&&i&&(b=b.parentNode);try{if(!q||i)return l(b.querySelectorAll("[id='"+g+"'] "+a),c)}catch(j){}finally{f||e.removeAttribute("id")}}}return B(a,b,c,d)},z;for(z in B)m[z]=
B[z];q=null}}z=document.documentElement;var H=z.matchesSelector||z.mozMatchesSelector||z.webkitMatchesSelector||z.msMatchesSelector;if(H){var L=!H.call(document.createElement("div"),"div"),w=!1;try{H.call(document.documentElement,"[test!='']:sizzle")}catch(M){w=!0}m.matchesSelector=function(a,b){b=b.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(w||!k.match.PSEUDO.test(b)&&!/!=/.test(b)){var c=H.call(a,b);if(c||!L||a.document&&11!==a.document.nodeType)return c}}catch(d){}return 0<
m(b,null,null,[a]).length}}z=document.createElement("div");z.innerHTML="<div class='test e'></div><div class='test'></div>";z.getElementsByClassName&&0!==z.getElementsByClassName("e").length&&(z.lastChild.className="e",1!==z.getElementsByClassName("e").length&&(k.order.splice(1,0,"CLASS"),k.find.CLASS=function(a,b,c){if("undefined"!==typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},z=null));m.contains=document.documentElement.contains?function(a,b){return a!==b&&(a.contains?
a.contains(b):!0)}:document.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};m.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var K=function(a,b,c){for(var d,e=[],f="",b=b.nodeType?[b]:b;d=k.match.PSEUDO.exec(a);)f+=d[0],a=a.replace(k.match.PSEUDO,"");a=k.relative[a]?a+"*":a;d=0;for(var h=b.length;d<h;d++)m(a,b[d],e,c);return m.filter(f,e)};window.Recite.Sizzle=m})();
(function(d){function a(d,r){var w,s,u,y,x,d=d?d:"",r=r||{};if("object"==typeof d&&d.hasOwnProperty("_tc_id"))return d;s=d;x=y=u=0;var A=1,G=w=!1;if("string"==typeof s)a:{s=s.replace(g,"").replace(p,"").toLowerCase();var I=!1;if(l[s])s=l[s],I=!0;else if("transparent"==s){s={r:0,g:0,b:0,a:0,format:"name"};break a}var v;s=(v=z.rgb.exec(s))?{r:v[1],g:v[2],b:v[3]}:(v=z.rgba.exec(s))?{r:v[1],g:v[2],b:v[3],a:v[4]}:(v=z.hsl.exec(s))?{h:v[1],s:v[2],l:v[3]}:(v=z.hsla.exec(s))?{h:v[1],s:v[2],l:v[3],a:v[4]}:
(v=z.hsv.exec(s))?{h:v[1],s:v[2],v:v[3]}:(v=z.hex6.exec(s))?{r:parseInt(v[1],16),g:parseInt(v[2],16),b:parseInt(v[3],16),format:I?"name":"hex"}:(v=z.hex3.exec(s))?{r:parseInt(v[1]+""+v[1],16),g:parseInt(v[2]+""+v[2],16),b:parseInt(v[3]+""+v[3],16),format:I?"name":"hex"}:!1}"object"==typeof s&&(s.hasOwnProperty("r")&&s.hasOwnProperty("g")&&s.hasOwnProperty("b")?(u=255*f(s.r,255),y=255*f(s.g,255),x=255*f(s.b,255),w=!0,G="%"===String(s.r).substr(-1)?"prgb":"rgb"):s.hasOwnProperty("h")&&s.hasOwnProperty("s")&&
s.hasOwnProperty("v")?(s.s=i(s.s),s.v=i(s.v),w=s.h,y=s.s,x=s.v,w=6*f(w,360),y=f(y,100),x=f(x,100),u=n.floor(w),v=w-u,w=x*(1-y),G=x*(1-v*y),v=x*(1-(1-v)*y),I=u%6,u=255*[x,G,w,w,v,x][I],y=255*[v,x,x,G,w,w][I],x=255*[w,w,v,x,x,G][I],w=!0,G="hsv"):s.hasOwnProperty("h")&&(s.hasOwnProperty("s")&&s.hasOwnProperty("l"))&&(s.s=i(s.s),s.l=i(s.l),u=s.h,w=s.s,x=s.l,y=function(a,b,c){0>c&&(c+=1);1<c&&(c-=1);return c<1/6?a+6*(b-a)*c:0.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a},u=f(u,360),w=f(w,100),x=f(x,100),0===w?w=x=
G=x:(G=0.5>x?x*(1+w):x+w-x*w,v=2*x-G,w=y(v,G,u+1/3),x=y(v,G,u),G=y(v,G,u-1/3)),u=255*w,y=255*x,x=255*G,w=!0,G="hsl"),s.hasOwnProperty("a")&&(A=s.a));A=h(A);s=s.format||G;u=t(255,q(u,0));y=t(255,q(y,0));x=t(255,q(x,0));var C=u,D=y,E=x,F=A,J=k(100*F)/100,A=r.format||s;1>C&&(C=k(C));1>D&&(D=k(D));1>E&&(E=k(E));return{ok:w,format:A,_tc_id:m++,alpha:F,getAlpha:function(){return F},setAlpha:function(a){F=h(a);J=k(100*F)/100},toHsv:function(){var a=b(C,D,E);return{h:360*a.h,s:a.s,v:a.v,a:F}},toHsvString:function(){var a=
b(C,D,E),c=k(360*a.h),d=k(100*a.s),a=k(100*a.v);return 1==F?"hsv("+c+", "+d+"%, "+a+"%)":"hsva("+c+", "+d+"%, "+a+"%, "+J+")"},toHsl:function(){var a=c(C,D,E);return{h:360*a.h,s:a.s,l:a.l,a:F}},toHslString:function(){var a=c(C,D,E),b=k(360*a.h),d=k(100*a.s),a=k(100*a.l);return 1==F?"hsl("+b+", "+d+"%, "+a+"%)":"hsla("+b+", "+d+"%, "+a+"%, "+J+")"},toHex:function(a){return e(C,D,E,a)},toHexString:function(a){return"#"+e(C,D,E,a)},toRgb:function(){return{r:k(C),g:k(D),b:k(E),a:F}},toRgbString:function(){return 1==
F?"rgb("+k(C)+", "+k(D)+", "+k(E)+")":"rgba("+k(C)+", "+k(D)+", "+k(E)+", "+J+")"},toPercentageRgb:function(){return{r:k(100*f(C,255))+"%",g:k(100*f(D,255))+"%",b:k(100*f(E,255))+"%",a:F}},toPercentageRgbString:function(){return 1==F?"rgb("+k(100*f(C,255))+"%, "+k(100*f(D,255))+"%, "+k(100*f(E,255))+"%)":"rgba("+k(100*f(C,255))+"%, "+k(100*f(D,255))+"%, "+k(100*f(E,255))+"%, "+J+")"},toName:function(){return 0===F?"transparent":B[e(C,D,E,!0)]||!1},toFilter:function(b){var c=e(C,D,E),d=c,f=Math.round(255*
parseFloat(F)).toString(16),h=f,g=r&&r.gradientType?"GradientType = 1, ":"";b&&(b=a(b),d=b.toHex(),h=Math.round(255*parseFloat(b.alpha)).toString(16));return"progid:DXImageTransform.Microsoft.gradient("+g+"startColorstr=#"+j(f)+c+",endColorstr=#"+j(h)+d+")"},toString:function(a){var b=!!a,a=a||this.format,c=!1,b=!b&&(1>F&&0<F)&&("hex"===a||"hex6"===a||"hex3"===a||"name"===a);"rgb"===a&&(c=this.toRgbString());"prgb"===a&&(c=this.toPercentageRgbString());if("hex"===a||"hex6"===a)c=this.toHexString();
"hex3"===a&&(c=this.toHexString(!0));"name"===a&&(c=this.toName());"hsl"===a&&(c=this.toHslString());"hsv"===a&&(c=this.toHsvString());return b?this.toRgbString():c||this.toHexString()}}}function c(a,b,c){var a=f(a,255),b=f(b,255),c=f(c,255),d=q(a,b,c),e=t(a,b,c),h,g=(d+e)/2;if(d==e)h=e=0;else{var l=d-e,e=0.5<g?l/(2-d-e):l/(d+e);switch(d){case a:h=(b-c)/l+(b<c?6:0);break;case b:h=(c-a)/l+2;break;case c:h=(a-b)/l+4}h/=6}return{h:h,s:e,l:g}}function b(a,b,c){var a=f(a,255),b=f(b,255),c=f(c,255),d=q(a,
b,c),e=t(a,b,c),h,g=d-e;if(d==e)h=0;else{switch(d){case a:h=(b-c)/g+(b<c?6:0);break;case b:h=(c-a)/g+2;break;case c:h=(a-b)/g+4}h/=6}return{h:h,s:0===d?0:g/d,v:d}}function e(a,b,c,d){a=[j(k(a).toString(16)),j(k(b).toString(16)),j(k(c).toString(16))];return d&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function h(a){a=parseFloat(a);if(isNaN(a)||0>a||1<a)a=1;return a}function f(a,b){"string"==
typeof a&&(-1!=a.indexOf(".")&&1===parseFloat(a))&&(a="100%");var c="string"===typeof a&&-1!=a.indexOf("%"),a=t(b,q(0,parseFloat(a)));c&&(a=parseInt(a*b,10)/100);return 1E-6>n.abs(a-b)?1:a%b/parseFloat(b)}function j(a){return 1==a.length?"0"+a:""+a}function i(a){1>=a&&(a=100*a+"%");return a}var g=/^[\s,#]+/,p=/\s+$/,m=0,n=Math,k=n.round,t=n.min,q=n.max,r=n.random;a.fromRatio=function(b,c){if("object"==typeof b){var d={},e;for(e in b)b.hasOwnProperty(e)&&(d[e]="a"===e?b[e]:i(b[e]));b=d}return a(b,
c)};a.equals=function(b,c){return!b||!c?!1:a(b).toRgbString()==a(c).toRgbString()};a.random=function(){return a.fromRatio({r:r(),g:r(),b:r()})};a.desaturate=function(b,c){var c=0===c?0:c||10,d=a(b).toHsl();d.s-=c/100;d.s=t(1,q(0,d.s));return a(d)};a.saturate=function(b,c){var c=0===c?0:c||10,d=a(b).toHsl();d.s+=c/100;d.s=t(1,q(0,d.s));return a(d)};a.greyscale=function(b){return a.desaturate(b,100)};a.lighten=function(b,c){var c=0===c?0:c||10,d=a(b).toHsl();d.l+=c/100;d.l=t(1,q(0,d.l));return a(d)};
a.darken=function(b,c){var c=0===c?0:c||10,d=a(b).toHsl();d.l-=c/100;d.l=t(1,q(0,d.l));return a(d)};a.complement=function(b){b=a(b).toHsl();b.h=(b.h+180)%360;return a(b)};a.triad=function(b){var c=a(b).toHsl(),d=c.h;return[a(b),a({h:(d+120)%360,s:c.s,l:c.l}),a({h:(d+240)%360,s:c.s,l:c.l})]};a.tetrad=function(b){var c=a(b).toHsl(),d=c.h;return[a(b),a({h:(d+90)%360,s:c.s,l:c.l}),a({h:(d+180)%360,s:c.s,l:c.l}),a({h:(d+270)%360,s:c.s,l:c.l})]};a.splitcomplement=function(b){var c=a(b).toHsl(),d=c.h;return[a(b),
a({h:(d+72)%360,s:c.s,l:c.l}),a({h:(d+216)%360,s:c.s,l:c.l})]};a.analogous=function(b,c,d){var c=c||6,d=d||30,e=a(b).toHsl(),d=360/d,b=[a(b)];for(e.h=(e.h-(d*c>>1)+720)%360;--c;)e.h=(e.h+d)%360,b.push(a(e));return b};a.monochromatic=function(b,c){for(var c=c||6,d=a(b).toHsv(),e=d.h,f=d.s,d=d.v,h=[],g=1/c;c--;)h.push(a({h:e,s:f,v:d})),d=(d+g)%1;return h};a.readability=function(b,c){var d=a(b).toRgb(),e=a(c).toRgb(),f=(299*d.r+587*d.g+114*d.b)/1E3,h=(299*e.r+587*e.g+114*e.b)/1E3,d=Math.max(d.r,e.r)-
Math.min(d.r,e.r)+Math.max(d.g,e.g)-Math.min(d.g,e.g)+Math.max(d.b,e.b)-Math.min(d.b,e.b);return{brightness:Math.abs(f-h),color:d}};a.readable=function(b,c){var d=a.readability(b,c);return 125<d.brightness&&500<d.color};a.mostReadable=function(b,c){for(var d=null,e=0,f=!1,h=0;h<c.length;h++){var g=a.readability(b,c[h]),l=125<g.brightness&&500<g.color,g=3*(g.brightness/125)+g.color/500;if(l&&!f||l&&f&&g>e||!l&&!f&&g>e)f=l,e=g,d=a(c[h])}return d};var l=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",
aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",
darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",
grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",
lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",
palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",
tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},s=a,y=l,u={},A;for(A in y)y.hasOwnProperty(A)&&(u[y[A]]=A);var B=s.hexNames=u,z;z={rgb:RegExp("rgb[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),rgba:RegExp("rgba[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
hsl:RegExp("hsl[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),hsla:RegExp("hsla[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),hsv:RegExp("hsv[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};"undefined"!==typeof module&&module.exports?module.exports=a:"undefined"!==typeof define?define(function(){return a}):d.Tinycolor=a})(Recite);
(function(d){function a(a,b){for(var c=a.length;c--;)if(a[c]===b)return c;return-1}function c(c){var d,f,h,j,r,k;d=c.keyCode;-1==a(t,d)&&t.push(d);if(93==d||224==d)d=91;if(d in p)for(h in p[d]=!0,n)n[h]==d&&(b[h]=!0);else{for(i in p)p[i]=c[q[i]];if(b.filter.call(this,c)&&d in g){k=e();for(j=0;j<g[d].length;j++)if(f=g[d][j],f.scope==k||"all"==f.scope){r=0<f.mods.length;for(h in p)if(!p[h]&&-1<a(f.mods,+h)||p[h]&&-1==a(f.mods,+h))r=!1;if((0==f.mods.length&&!p[16]&&!p[18]&&!p[17]&&!p[91]||r)&&!1===f.method(c,
f))c.preventDefault?c.preventDefault():c.returnValue=!1,c.stopPropagation&&c.stopPropagation(),c.cancelBubble&&(c.cancelBubble=!0)}}}}function b(a,b,c){var d,e;d=h(a);void 0===c&&(c=b,b="all");for(var i=0;i<d.length;i++)e=[],a=d[i].split("+"),1<a.length&&(e=f(a),a=[a[a.length-1]]),a=a[0],a=k[a]||a.toUpperCase().charCodeAt(0),a in g||(g[a]=[]),g[a].push({shortcut:d[i],scope:b,method:c,key:d[i],mods:e})}function e(){return m||"all"}function h(a){a=a.replace(/\s/g,"");a=a.split(",");""==a[a.length-1]&&
(a[a.length-2]+=",");return a}function f(a){for(var a=a.slice(0,a.length-1),b=0;b<a.length;b++)a[b]=n[a[b]];return a}function j(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,function(){c(window.event)})}var i,g={},p={16:!1,18:!1,17:!1,91:!1},m="all",n={"\u21e7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,command:91},k={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,
down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},t=[];for(i=1;20>i;i++)k["f"+i]=111+i;var q={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(i in n)b[i]=!1;j(document,"keydown",function(a){c(a)});j(document,"keyup",function(c){var c=c.keyCode,d,e=a(t,c);0<=e&&t.splice(e,1);if(93==c||224==c)c=91;if(c in p)for(d in p[c]=!1,n)n[d]==c&&(b[d]=!1)});j(window,"focus",function(){for(i in p)p[i]=
!1;for(i in n)b[i]=!1});var r=d.key;d.key=b;d.key.setScope=function(a){m=a||"all"};d.key.getScope=e;d.key.deleteScope=function(a){var b,c,d;for(b in g){c=g[b];for(d=0;d<c.length;)c[d].scope===a?c.splice(d,1):d++}};d.key.filter=function(a){a=(a.target||a.srcElement).tagName;return!("INPUT"==a||"SELECT"==a||"TEXTAREA"==a)};d.key.isPressed=function(b){"string"==typeof b&&(b=k[b]||b.toUpperCase().charCodeAt(0));return-1!=a(t,b)};d.key.getPressedKeyCodes=function(){return t.slice(0)};d.key.noConflict=
function(){var a=d.key;d.key=r;return a};d.key.unbind=function(a,b){var c,d,i=[],q,j;c=h(a);for(j=0;j<c.length;j++){d=c[j].split("+");1<d.length&&(i=f(d),a=d[d.length-1]);a=k[a]||a.toUpperCase().charCodeAt(0);void 0===b&&(b=e());if(!g[a])break;for(q in g[a]){d=g[a][q];var r;if(r=d.scope===b)a:if(d=d.mods,d.length!=i.length)r=!1;else{for(r=0;r<d.length;r++)if(d[r]!==i[r]){r=!1;break a}r=!0}r&&(g[a][q]={})}}};"undefined"!==typeof module&&(module.exports=key);window.Recite.Key=key})(this);
Recite.AssetLoader=function(d){function a(a,b){var c=d.createElement(a),e;for(e in b)b.hasOwnProperty(e)&&c.setAttribute(e,b[e]);c.setAttribute("data-recite-skip","true");return c}function c(a){var c=i[a],d,e;c&&(d=c.callback,e=c.urls,e.shift(),g=0,e.length||(d&&d.call(c.context,c.obj),i[a]=null,p[a].length&&b(a)))}function b(b,g,t,q,r){var l=function(){c(b)},m="css"===b,y=[],u,A,B,z;f||(u=navigator.userAgent,f={async:!0===d.createElement("script").async},(f.webkit=/AppleWebKit\//.test(u))||(f.ie=
/MSIE|Trident/.test(u))||(f.opera=/Opera/.test(u))||(f.gecko=/Gecko\//.test(u))||(f.unknown=!0));if(g)if(g="string"===typeof g?[g]:g.concat(),m||f.async||f.gecko||f.opera)p[b].push({urls:g,callback:t,obj:q,context:r});else{u=0;for(A=g.length;u<A;++u)p[b].push({urls:[g[u]],callback:u===A-1?t:null,obj:q,context:r})}if(!i[b]&&(z=i[b]=p[b].shift())){j||(j=d.head||d.getElementsByTagName("head")[0]);g=z.urls;u=0;for(A=g.length;u<A;++u)t=g[u],m?B=f.gecko?a("style"):a("link",{href:t,rel:"stylesheet"}):(B=
a("script",{src:t}),B.async=!1),B.className="lazyload",B.setAttribute("charset","utf-8"),f.ie&&!m&&"onreadystatechange"in B&&!("draggable"in B)?B.onreadystatechange=function(){/loaded|complete/.test(B.readyState)&&(B.onreadystatechange=null,l())}:m&&(f.gecko||f.webkit)?f.webkit?(z.urls[u]=B.href,h()):(B.innerHTML='@import "'+t+'";',e(B)):B.onload=B.onerror=l,y.push(B);u=0;for(A=y.length;u<A;++u)j.appendChild(y[u])}}function e(a){var b;try{b=!!a.sheet.cssRules}catch(d){g+=1;200>g?setTimeout(function(){e(a)},
50):b&&c("css");return}c("css")}function h(){var a=i.css,b;if(a){for(b=m.length;0<=--b;)if(m[b].href===a.urls[0]){c("css");break}g+=1;a&&(200>g?setTimeout(h,50):c("css"))}}var f,j,i={},g=0,p={css:[],js:[]},m=d.styleSheets;return{css:function(a,c,d,e){b("css",a,c,d,e)},js:function(a,c,d,e){b("js",a,c,d,e)}}}(this.document);Recite.namespace("Preset");Recite.namespace("preset");
Recite.Preset=Recite.preset=function(){return{square24:{background:Recite.baseUrl+"img/buttons/square24.gif",width:"24px",height:"24px"},square36:{background:Recite.baseUrl+"img/buttons/square36.gif",width:"36px",height:"36px"},hor24_recite:{background:Recite.baseUrl+"img/buttons/recite_hor24.gif",width:"83px",height:"24px"},hor24_recite_red:{background:Recite.baseUrl+"img/buttons/recite_hor24_red.gif",width:"83px",height:"24px"},hor48_recite:{background:Recite.baseUrl+"img/buttons/recite_hor48.gif",
width:"166px",height:"48px"},hor48_recite_red:{background:Recite.baseUrl+"img/buttons/recite_hor48_red.gif",width:"166px",height:"48px"},ver24_recite:{background:Recite.baseUrl+"img/buttons/recite_ver24.gif",width:"24px",height:"109px"},ver24_recite_red:{background:Recite.baseUrl+"img/buttons/recite_ver24_red.gif",width:"24px",height:"109px"},ver48_recite:{background:Recite.baseUrl+"img/buttons/recite_ver48.gif",width:"48px",height:"217px"},ver48_recite_red:{background:Recite.baseUrl+"img/buttons/recite_ver48_red.gif",
width:"48px",height:"217px"},hor24_speak:{background:Recite.baseUrl+"img/buttons/speak_hor24.gif",width:"79px",height:"24px"},hor24_speak_red:{background:Recite.baseUrl+"img/buttons/speak_hor24_red.gif",width:"79px",height:"24px"},hor48_speak:{background:Recite.baseUrl+"img/buttons/speak_hor48.gif",width:"158px",height:"48px"},hor48_speak_red:{background:Recite.baseUrl+"img/buttons/speak_hor48_red.gif",width:"158px",height:"48px"},ver24_speak:{background:Recite.baseUrl+"img/buttons/speak_ver24.gif",
width:"24px",height:"109px"},ver24_speak_red:{background:Recite.baseUrl+"img/buttons/speak_ver24_red.gif",width:"24px",height:"109px"},ver48_speak:{background:Recite.baseUrl+"img/buttons/speak_ver48.gif",width:"48px",height:"217px"},ver48_speak_red:{background:Recite.baseUrl+"img/buttons/speak_ver48_red.gif",width:"48px",height:"217px"},square24_png:{background:Recite.baseUrl+"img/buttons/24x24.png",width:"24px",height:"24px"},square36_png:{background:Recite.baseUrl+"img/buttons/36x36.png",width:"36px",
height:"36px"},hor24_recite_png:{background:Recite.baseUrl+"img/buttons/recite_hor24.png",width:"83px",height:"24px"},hor24_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_hor24_red.png",width:"83px",height:"24px"},hor48_recite_png:{background:Recite.baseUrl+"img/buttons/recite_hor48.png",width:"166px",height:"48px"},hor48_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_hor48_red.png",width:"166px",height:"48px"},ver24_recite_png:{background:Recite.baseUrl+"img/buttons/recite_ver24.png",
width:"24px",height:"109px"},ver24_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_ver24_red.png",width:"24px",height:"109px"},ver48_recite_png:{background:Recite.baseUrl+"img/buttons/recite_ver48.png",width:"48px",height:"217px"},ver48_recite_red_png:{background:Recite.baseUrl+"img/buttons/recite_ver48_red.png",width:"48px",height:"217px"},hor24_speak_png:{background:Recite.baseUrl+"img/buttons/speak_hor24.png",width:"79px",height:"24px"},hor24_speak_red_png:{background:Recite.baseUrl+
"img/buttons/speak_hor24_red.png",width:"79px",height:"24px"},hor48_speak_png:{background:Recite.baseUrl+"img/buttons/speak_hor48.png",width:"158px",height:"48px"},hor48_speak_red_png:{background:Recite.baseUrl+"img/buttons/speak_hor48_red.png",width:"158px",height:"48px"},ver24_speak_png:{background:Recite.baseUrl+"img/buttons/speak_ver24.png",width:"24px",height:"109px"},ver24_speak_red_png:{background:Recite.baseUrl+"img/buttons/speak_ver24_red.png",width:"24px",height:"109px"},ver48_speak_png:{background:Recite.baseUrl+
"img/buttons/speak_ver48.png",width:"48px",height:"217px"},ver48_speak_red_png:{background:Recite.baseUrl+"img/buttons/speak_ver48_red.png",width:"48px",height:"217px"}}}();Recite.namespace("Ajax");
Recite.Ajax=function(){function d(a){var b=Recite.Util.clone(e);return Recite.Util.merge(b,a)}function a(a){var b="";if(a.getResponseHeader)b=/^application\/json/.test(a.getResponseHeader("Content-Type"))?JSON.parse(a.responseText):a.responseText;else if(0<a.responseText.length)try{b=JSON.parse(a.responseText)}catch(c){b=a.responseText}return b}function c(b,c){var c=d(c),e=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");"GET"===c.method&&(null!==c.data&&"undefined"!==
typeof c.data)&&(b+=Recite.Util.buildQueryString(c.data));e.open(c.method,b,c.async,c.user,c.password);e.timeout=c.timeout;e.setRequestHeader("Content-Type",c.contentType);e.onreadystatechange=function(){if(4===e.readyState){var b=a(e);200===e.status?c.success(e,b):c.error(e,b)}};null!==c.beforeSend&&c.beforeSend(e);e.send(c.data)}function b(b,c){var d=new flensed.flXHR({autoUpdatePlayer:!1,instanceId:"recite-proxy",xmlResponseText:!1,onreadystatechange:function(b){if(4===b.readyState){var d=a(b);
200===b.status?c.success(b,d):c.error(b,d)}}});d.open(c.method,b);null!==c.beforeSend&&c.beforeSend(d);d.send(c.data)}var e={method:"POST",contentType:"application/x-www-form-urlencoded",async:!0,username:null,password:null,success:function(){},error:function(){},beforeSend:null,data:null,timeout:1E4};return{get:function(a,b,c){Recite.Debug.log("Recite.Ajax","Making AJAX request to: "+a);this.ajax(a,{method:"GET",data:b,success:c})},post:function(a,b,c){this.ajax(a,{method:"POST",data:b,success:c})},
ajax:function(e,f){"undefined"!==typeof f.data&&("POST"==f.method&&"object"==Recite.Util.type(f.data))&&(f.data=JSON.stringify(f.data));if(String(window.location).substr(0,Recite.baseUrl.length)==Recite.baseUrl)return c(e,f);if("withCredentials"in(window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP")))c(e,f);else if("undefined"!==typeof window.XDomainRequest){var j=e,i=f,i=d(i),g=new XDomainRequest;"GET"===i.method&&(null!==i.data&&"undefined"!==typeof i.data)&&(j+=
Recite.Util.buildQueryString(i.data));g.onload=function(){var b=a(g);i.success(g,b)};g.onerror=function(){var b=a(g);i.error(g,b)};g.open(i.method,j);g.timeout=i.timeout;null!==i.beforeSend&&i.beforeSend(g);g.send(i.data)}else"undefined"===typeof window.flensed?Recite.AssetLoader.js(Recite.baseUrl+"/js/flxhr/flXHR.js",function(){b(f)}):b(e,f)},nativeXDomainSupported:function(){return"undefined"!==typeof(new XMLHttpRequest).withCredentials||"undefined"!==typeof window.XDomainRequest?!0:!1}}}();Recite.namespace("Api");
Recite.Api=function(){function d(a,d){var h=c.endpoint+a,f=Recite.Util.merge({access_token:d.access_token,v:Recite.version},d.data);return h+Recite.Util.buildQueryString(f)}function a(a,d,h){var f=c.endpoint+a,f=f+Recite.Util.buildQueryString({access_token:h.access_token,v:Recite.version});Recite.Ajax.ajax(f,{method:d,data:h.data,contentType:h.contentType,success:function(a,b){h.success&&h.success(b)},error:function(c,i){Recite.Debug.log("Recite.Api","Error occured during API call to: "+f,i);if("undefined"!==
typeof i.error)if("invalid_grant"===i.error)Recite.Debug.log("Recite.Api","Requesting a new token."),Recite.Auth.clear(),Recite.Api.call(a,d,h);else{if("invalid_token"===i.error||"invalid_referrer"===i.error||"invalid_ip"===i.error)alert("We have detected invalid usage of Recite and we have disabled future access. If you think this is an error please contact support@reciteme.com"),window.location.reload();h.error&&h.error(i)}}})}var c={endpoint:Recite.baseUrl+"/api/"};return{setOptions:function(a){c=
Recite.Util.merge(c,a)},call:function(b,c,d){d.contentType=d.contentType||"application/x-www-form-urlencoded";"undefined"===typeof d.authRequired&&(d.authRequired=!0);d.authRequired?Recite.Auth.getStatus(function(f){"authorized"===f.state&&(d.access_token=f.access_token,a(b,c,d))}):a(b,c,d)},getUri:function(a,c){"undefined"===typeof c.authRequired&&(c.authRequired=!0);c.authRequired?Recite.Auth.getStatus(function(h){"authorized"===h.state&&(c.access_token=h.access_token,c.success&&c.success(d(a,c)))}):
c.success&&c.success(d(a,c))}}}();Recite.namespace("Recite.Dom");
Recite.Dom=function(){return{getPosition:function(d){var a=0,c=0;if(d.offsetParent){do"BODY"!==d.tagName&&(a+=d.offsetLeft,c+=d.offsetTop);while(d=d.offsetParent)}return{left:a,top:c}},isCurrent:function(d){var a=Recite.Dom.getPosition(d),d=d.currentStyle;return 0!==a.left&&0!==a.top&&0<d.width&&0<d.height?!0:!1},getScroll:function(d){"undefined"===typeof d&&(d=window);var a=d.document,c,b;d.pageYOffset?(b=d.pageYOffset,c=d.pageXOffset):a.documentElement&&a.documentElement.scrollTop?(b=a.documentElement.scrollTop,
c=a.documentElement.scrollLeft):a.body&&(b=a.body.scrollTop,c=a.body.scrollLeft);return{x:c,y:b}},getStyle:function(d,a){var c;d.currentStyle?(a=a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")}),c=d.currentStyle[a]):window.getComputedStyle&&(c=document.defaultView.getComputedStyle(d,null).getPropertyValue(a));return c},getStyles:function(d){var a;d.currentStyle?a=d.currentStyle:window.getComputedStyle&&(a=document.defaultView.getComputedStyle(d,null));return a},getText:function(d,
a){var c="";if("undefined"!==typeof a)return 0===d.childNodes.length&&(c+=a.call(d)),Recite.Util.each(d.childNodes,function(b,d){c+=a.call(d)}),c.trim();c="IMG"===d.tagName?d.getAttribute("alt"):3===d.nodeType?d.data:d.textContent||d.innerText||"";return c.trim()},getAllWindows:function(d,a){a||(a=[]);d||(d=window);0===a.length&&a.push(d);for(var c=d.frames,b=0;b<c.length;b++)try{c[b].document.body,a.push(c[b]),0<c[b].frames.length&&a.concat(a,Recite.Dom.getAllWindows(c[b],a))}catch(e){}return a},
prepend:function(d,a){if("string"===Recite.Util.type(d)){var c=a.ownerDocument.createElement("div");c.innerHTML=d;for(var b=0;b<c.childNodes.length;b++)a.insertBefore(c.childNodes[0],a.childNodes[0])}else a.insertBefore(d,a.childNodes[0])},append:function(d,a){if("string"===Recite.Util.type(d)){var c=a.ownerDocument.createElement("div");c.innerHTML=d;for(var b=0;b<c.childNodes.length;b++)a.appendChild(c.childNodes[b])}else a.appendChild(d)},getSelected:function(){var d="";"undefined"!==typeof window.getSelection?
d=window.getSelection().toString():"undefined"!==typeof document.selection&&"Text"===document.selection.type&&(d=document.selection.createRange().text);return d.replace(/^\s+|\s+$/g,"")},isDescendant:function(d,a){for(;d;){if(d===a)return!0;d=d.parentNode}return!1},getAncestors:function(d){for(var a=null,c=[];null!==(a=d.parentNode)&&1===a.nodeType;)c.push(a),d=a;return c},getWindowDimensions:function(d){var a=d.document,c,b;if("number"===typeof d.innerWidth)c=d.innerWidth,b=d.innerHeight;else if(a.documentElement&&
(a.documentElement.clientWidth||a.documentElement.clientHeight))c=a.documentElement.clientWidth,b=a.documentElement.clientHeight;else if(a.body&&(a.body.clientWidth||a.body.clientHeight))c=a.body.clientWidth,b=a.body.clientHeight;return{width:c,height:b}},getLanguage:function(d){var a=null;if("undefined"!==d&&1===d.nodeType&&""!==d.lang)return d.lang;var c=d.childNodes;if(0<c.length&&(Recite.Util.each(c,function(b,c){for(;null!==c;){if(3!==c.nodeType&&"undefined"!==c.lang&&""!==c.lang){a=c.lang;break}c=
0<c.childNodes.length?c.childNodes[0]:null}}),null!==a))return a;var d=Recite.Dom.getAncestors(d),b;for(b in d){c=d[b];if(c.lang&&0!==c.lang.length){a=c.lang;break}if(1===c.nodeType&&null!==c.getAttribute("xml:lang")&&""!==c.getAttribute("xml:lang")){a=c.getAttribute("xml:lang");break}}null===a&&(b=Recite.Sizzle('meta[http-equiv="Content-Language"]'),0<b.length&&(a=b[0].getAttribute("content")));return null!==a&&"string"===typeof a?a.toLowerCase():null},detectLanguage:function(d,a){Recite.Debug.log("Recite.Dom",
"Auto detecting language");Recite.Api.call("language-detect","POST",{data:{q:d},contentType:"application/json",success:function(c){Recite.Debug.log("Recite.Dom","Language detected: "+c.lang);a(null!=c.lang?c.lang.toLowerCase():null)},error:function(){a(null)}})},getNextElement:function(d){var a=Recite.Sizzle("recite");if("undefined"===d||null===d)return Recite.Debug.log("Recite.DOM","Current element is null - probably been removed from DOM"),a[0];for(var c=null,b=0;b<a.length;b++)if(a[b]===d||null===
d||null!==c)if(c=null===d?a[0]:"undefined"!==typeof a[b+1]?a[b+1]:a[0],d=Recite.Dom.getPosition(c),0>d.left||0>d.top||0==d.top&&0==d.left)d=c;else return c;return a[0]},getPreviousElement:function(d){var a=Recite.Sizzle("recite");if("undefined"===d||null===d)return Recite.Debug.log("Recite.DOM","getPreviousElement return 1st ele"),a[0];for(var c=null,b=a.length;0<b;b--)if(a[b]==d||null==d||null!==c){if(null==d)c=a[0];else if("undefined"!==typeof a[b-1])c=a[b-1];else break;d=Recite.Dom.getPosition(c);
if(0>d.left||0>d.top||0==d.top&&0==d.left)d=c;else return c}return a[0]}}}();Recite.namespace("Dom.Traverser");Recite.Dom.Traverser=function(){return{traverse:function(d,a){for(var c=d.childNodes[0];null!==c;){var b=a(c);if(c.hasChildNodes()&&b)c=c.firstChild;else{for(;null===c.nextSibling&&c!==d;)c=c.parentNode;c=c===d?null:c.nextSibling}}}}};Recite.namespace("Recite.Dom.Observer");
Recite.Dom.Observer=function(){var d=null,a=[],c={pollTime:1500};return{setOptions:function(a){c=Recite.Util.merge(c,a)},observe:function(b){a.push(b);null===d&&(Recite.Debug.log("Recite.Dom.Observer","Setting up body length polling."),d=setInterval(function(){Recite.Util.each(a,function(a,b){var c=b.innerHTML.length;"undefined"===typeof b.prevLength&&(b.prevLength=c);b.prevLength!==c&&(c=Recite.Parser.Html.parse(b),Recite.PlayerControls.invoke(c),Recite.PlayerControls.invalidate(),b.prevLength=b.innerHTML.length)})},
c.pollTime))}}}();var JSON;JSON||(JSON={});
(function(){function d(a){return 10>a?"0"+a:a}function a(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=j[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(b,d){var e,j,k,t,q=h,r,l=d[b];l&&("object"===typeof l&&"function"===typeof l.toJSON)&&(l=l.toJSON(b));"function"===typeof i&&(l=i.call(d,b,l));switch(typeof l){case "string":return a(l);case "number":return isFinite(l)?String(l):"null";case "boolean":case "null":return String(l);
case "object":if(!l)return"null";h+=f;r=[];if("[object Array]"===Object.prototype.toString.apply(l)){t=l.length;for(e=0;e<t;e+=1)r[e]=c(e,l)||"null";k=0===r.length?"[]":h?"[\n"+h+r.join(",\n"+h)+"\n"+q+"]":"["+r.join(",")+"]";h=q;return k}if(i&&"object"===typeof i){t=i.length;for(e=0;e<t;e+=1)"string"===typeof i[e]&&(j=i[e],(k=c(j,l))&&r.push(a(j)+(h?": ":":")+k))}else for(j in l)Object.prototype.hasOwnProperty.call(l,j)&&(k=c(j,l))&&r.push(a(j)+(h?": ":":")+k);k=0===r.length?"{}":h?"{\n"+h+r.join(",\n"+
h)+"\n"+q+"}":"{"+r.join(",")+"}";h=q;return k}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+d(this.getUTCMonth()+1)+"-"+d(this.getUTCDate())+"T"+d(this.getUTCHours())+":"+d(this.getUTCMinutes())+":"+d(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,f,j={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;f=h="";if("number"===typeof d)for(e=0;e<d;e+=1)f+=" ";else"string"===typeof d&&(f=d);if((i=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,c){function d(a,b){var e,f,g=a[b];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=d(g,e),void 0!==f?g[e]=f:delete g[e]);return c.call(a,b,g)}var e,a=String(a);b.lastIndex=0;b.test(a)&&(a=a.replace(b,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse");})})();Recite.namespace("Auth");
Recite.Auth=function(){function d(a,c){"undefined"===typeof c&&(c={});var d=b.authorization_endpoint+"?response_type="+a+"&client_id="+b.client_id;null!==b.redirect_uri&&(d+="&redirect_uri="+encodeURIComponent(b.redirect_uri));null!==b.required_scope&&(d+="&scope="+b.required_scope);Recite.Util.each(c,function(a,b){d+="&"+a+"="+b});return d}var a=!1,c={state:null,access_token:null,expires:null},b={authorization_endpoint:Recite.baseUrl+"/oauth/authorize",token_endpoint:Recite.baseUrl+"/oauth/token",
client_id:"4b66fe7f1b772d7dcd46a63528abec8412b96724",redirect_uri:Recite.baseUrl+"/oauth/callback/?uri="+Recite.Util.getWindowLocationOrigin(window),required_scope:null,type:"iframe",popup:{status:"yes",toolbar:"no",location:"no",menubar:"no",directories:"no",resizable:"no",scrollbars:"no",width:850,height:600,top:"120"}},e=[],h=[],f=[],j=!1,i=[];Recite.XDM.receiveMessage(function(b){Recite.Debug.log("Recite.Auth","Message received:",b);b=JSON.parse(b.data);if(null!==b&&"undefined"!==typeof b.access_token&&-1!==Recite.Util.inArray(b.state,
i)){i.splice(Recite.Util.inArray(b.state,i),1);var d=new Date;c.access_token=b.access_token;c.expires=Math.ceil(d.getTime()/1E3)+parseInt(b.expires_in,10);c.state="authorized";Recite.Event.publish("Auth:authorize",c);a&&Recite.Event.publish("Auth:reauthorize",c);a=!0;Recite.Util.each(f,function(a,b){b(c)});f=[];j=!1;"undefined"!==typeof h[b.state]&&(d=h[b.state],d.parentNode.removeChild(d),delete h[b.state]);"undefined"!==typeof e[b.state]&&(e[b.state].close(),delete e[b.state])}},Recite.baseUrl);
return{setOptions:function(a){b=Recite.Util.merge(b,a)},isAuthorized:function(){return"authorized"===c.state},clear:function(){c.state=null;c.access_token=null;c.expires=null},getStatus:function(a,b){if(!b&&this.isAuthorized())a(c);else if(f.push(a),!j){j=!0;var e=Recite.Util.guid();i.push(e);var n=d("token",{createGuest:1,display:0,state:e}),k=document.createElement("iframe");k.id=e;k.src=n;k.frameborder=0;k.width=0;k.height=0;h[e]=k;document.body.appendChild(k)}},authPopup:function(){var a=Recite.Util.guid();
i.push(a);var c=d("token",{state:a});if("iframe"===b.type){var f=document.createElement("div");f.setAttribute("class","recite_auth_iframe_wrapper");f.style.top=parseInt(b.popup.top)+"px";f.style.left="50%";f.style.marginLeft=0-parseInt(b.popup.width)/2+"px";f.style.height=Recite.Dom.getWindowDimensions(window).height/1.5;f.style.width=b.popup.width;var j=document.createElement("iframe");j.src=c;j.frameborder=0;j.width=b.popup.width;j.style.border=0;j.height=Recite.Dom.getWindowDimensions(window).height/
1.5;c=document.createElement("div");c.setAttribute("class","recite_auth_iframe_close recite-sprite-auth-close");c.setAttribute("data-recite-state",a);f.appendChild(c);f.appendChild(j);document.body.appendChild(f);Recite.DomEvent.add(j,"load",function(){Recite.DomEvent.add(Recite.Sizzle(".recite_auth_iframe_close")[0],"click",function(a){a=a.target.getAttribute("data-recite-state");h[a].parentNode.removeChild(h[a]);delete h[a]})});h[a]=f}else{var k="";Recite.Util.each(b.popup,function(a,b){k+=a+"="+
b+","});k=k.substr(0,k.length-1);f=Math.ceil(screen.width/2)-b.popup.width/2;j=Math.ceil(screen.height/2)-b.popup.height/2;k+=",left="+f+",top="+j;e[a]=window.open(c,a,k)}}}}();Recite.namespace("Storage.Cookie");
Recite.Storage.Cookie=function(){function d(a,c,b){if(b){var d=new Date;d.setTime(d.getTime()+864E5*b);b="; expires="+d.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"}return{save:function(a,c){var b=JSON.stringify(c);d(a,b)},load:function(a,c){var b;a:{b=a+"=";for(var d=document.cookie.split(";"),h=0;h<d.length;h++){for(var f=d[h];" "==f.charAt(0);)f=f.substring(1,f.length);if(0==f.indexOf(b)){b=f.substring(b.length,f.length);break a}}b=null}b=JSON.parse(b);c&&c(b);return b},clear:function(a){d(a,
"",-1)},supported:function(){return!0}}}();Recite.namespace("Storage.LocalStorage");Recite.Storage.LocalStorage=function(){return{save:function(d,a){_supported()&&window.localStorage.setItem(d,a)},load:function(d,a){if(_supported()){var c=window.localStorage.getItem(d);"undefined"!==typeof a&&a(c);return c}return null},clear:function(d){_supported()&&window.localStorage.removeItem(d)},supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(d){return!1}}}}();Recite.namespace("Storage.Api");
Recite.Storage.Api=function(){var d=["Recite.Preferences"];return{save:function(a,c){if(!a in d)throw{name:"InvalidNamespace",message:"The provided namespace is invalid."};"Recite.Preferences"===a?Recite.Api.call("preferences","POST",{data:c,contentType:"application/json",success:function(){Recite.Debug.log("Recite.Storage.Api","Preferences Saved.")}}):Recite.Storage.Cookie.save(a,c)},load:function(a,c){!a in d||("Recite.Preferences"===a?Recite.Api.call("preferences","GET",{success:c,error:c}):Recite.Storage.Cookie.load(a,
c))},clear:function(){},supported:function(){return!0}}}();Recite.namespace("Preferences");
Recite.Preferences=function(){var d={storageEngine:Recite.Storage.Api,autoSave:!0},a={style:{backgroundColor:null,font:{color:null,face:null,size:null},link:{color:null},marginSize:null,ruler:{enabled:!1,color:null}},dictionary:{enabled:!1},player:{autoplay:!0},textMode:{enabled:!1},playerControls:{enabled:!0},language:null,voices:{en:"Serena"}},c=Recite.Util.clone(a);Recite.Event.subscribe("Auth:reauthorize",function(){d.storageEngine===Recite.Storage.Api&&Recite.Preferences.load()});return{setOptions:function(a){d=
Recite.Util.merge(d,a)},save:function(){Recite.Debug.log("Recite.Preferences","Saving preferences.");d.storageEngine.save("Recite.Preferences",a);Recite.Gui.Notification.show("Your preferences have been saved.  To reset them press the reset button",{read:!1})},load:function(){Recite.Debug.log("Recite.Preferences","Loading preferences.");d.storageEngine.load("Recite.Preferences",function(b){if(null!==b){var d=Recite.Util.clone(c);Recite.Debug.log("Recite.Preferences","Found user preferences");a=Recite.Util.merge(d,
b)}Recite.Event.publish("Preferences:load",b)})},get:function(b){if("undefined"===typeof b)return a;var c,d,b=b.split(".");c=a;for(d=0;d<b.length;d++)if(c=c[b[d]],"undefined"===typeof c)return null;return c},set:function(b,c){var h={};"object"===Recite.Util.type(b)?h=b:h[b]=c;Recite.Util.each(h,function(b,c){var d,e,h;d=b.split(".");e=a;for(h=0;h<d.length-1;h++)if(e=e[d[h]],"undefined"===typeof e)return null;e[d[h]]=c});Recite.Event.publish("Preferences:set",h);d.autoSave&&Recite.Preferences.save();
return null},reset:function(b){var e,h,f,j;e=b.split(".");h=a;j=c;for(f=0;f<e.length-1;f++)h=h[e[f]],j=j[e[f]];var i=j[e[f]];"object"===Recite.Util.type(i)&&(i=Recite.Util.clone(i));h[e[f]]=i;Recite.Event.publish("Preferences:reset",{key:b,value:j});d.autoSave&&Recite.Preferences.save()},resetAll:function(){a=c;Recite.Event.publish("Preferences:reset");Recite.Debug.log("Recite.Preferences","Saving preferences.");d.storageEngine.save("Recite.Preferences",c);Recite.Gui.Notification.show("Your preferences have been reset.")}}}();
Recite.namespace("UI.Toggle");
Recite.UI.Toggle=function(){return{invoke:function(d){d=Recite.Util.isArray(d)?d:[d];Recite.Util.each(d,function(a,c){var b=c.ownerDocument?c.ownerDocument:document;c.setAttribute("class","recite-ui-toggle");b=b.createElement("div");b.setAttribute("class","recite-ui-toggle-slider");c.appendChild(b);Object.defineProperty?Object.defineProperty(c,"checked",{get:function(){return this._checked},set:function(a){(this._checked=a)?this.setAttribute("class",this.getAttribute("class")+" recite-ui-toggle-active"):
this.setAttribute("class",this.getAttribute("class").replace(" recite-ui-toggle-active",""));this.fireEvent?this.fireEvent("onClick"):(a=document.createEvent("Event"),a.initEvent("change",!0,!0),this.dispatchEvent(a))}}):Recite.Debug.log("Recite.UI.Toggle","defineProperty not found");c.checked=!0;Recite.DomEvent.add(c.childNodes[0],"click",function(a){a=a.target.parentNode;a.checked=!a.checked})})}}}();Recite.namespace("UI.Dropdown");
Recite.UI.Dropdown=function(){function d(a,d){if(!(1!==a.nodeType&&3!==a.nodeType)){var h=a.getAttribute("class")||"";for(a.setAttribute("class",h.replace(" recite-active",""));-1!==(h=Recite.Util.inArray(a,c[d]));)c[d].splice(h,1);h=Recite.Sizzle(".recite-dropdown-invoke",document);Recite.Util.each(h,function(a,b){b.setAttribute("class",b.getAttribute("class").replace(" active",""))})}}function a(){for(var a in c)for(var e in c[a])d(c[a][e],a)}var c={};return{invoke:function(b){Recite.DomEvent.add(document.body,
"click",a);b=Recite.Util.isArray(b)?b:[b];Recite.Util.each(b,function(a,b){Recite.DomEvent.add(b,"click",function(a){var b=a.target,e=Recite.Sizzle(b.getAttribute("data-target"))[0],h=b.getAttribute("data-group")||"default";if("undefined"!==typeof e){Recite.DomEvent.add(e,"click",function(a){"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0});if(/recite-active/g.test(e.getAttribute("class")))d(e,h),b.setAttribute("class",b.getAttribute("class").replace(" active",""));else{var p=
h,p=p||"default";"undefined"===typeof c[p]&&(c[p]=[]);h=e.getAttribute("class")||"";e.setAttribute("class",h+" recite-active");var h=Recite.Sizzle(".recite-controls")[0],m=Recite.Dom.getPosition(b);e.style.left=m.left-h.scrollLeft+"px";c[p].push(e);"default"!==p&&Recite.Util.each(c[p],function(a,b){"undefined"!==typeof b&&b!==e&&d(b,p)});b.setAttribute("class",b.getAttribute("class")+" active")}"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}})})},hideGroup:function(a){var a=
a||null,e;for(e in c)null!==a&&a!==e||Recite.Util.each(c[e],function(a,b){d(b)})}}}();Recite.namespace("UI.ColorPicker");
Recite.UI.ColorPicker=function(){function d(a){var b=a.clientY-(t+p.offsetTop),b=255<b?255:b,a=Math.abs(360*(b-0)/255+0-360);m.style.top=b+"px";b=Recite.Tinycolor("hsl("+Math.ceil(a)+", 100%, 50%)");n.style.backgroundColor=b.toRgbString();b=j.getColor().toHsv();b.h=Math.ceil(a);j.setColor(b)}function a(a){var b=a.clientY-(t+n.offsetTop),a=a.clientX-(q+n.offsetLeft),b=252<b?252:b,a=252<a?252:a,b=3>b?3:b,a=3>a?3:a,c=j.getColor().toHsv();c.v=Math.ceil(100*(Math.abs(b-255)/255));c.s=Math.ceil(100*(a/
255));j.setColor(c);k.style.top=b+r.selectorAdjust.top+"px";k.style.left=a+r.selectorAdjust.left+"px"}function c(a){var b=100*(Math.abs(a-360)/360);m.style.top=b+"%";a=Recite.Tinycolor("hsl("+Math.ceil(a)+", 100%, 50%)");n.style.backgroundColor=a.toRgbString()}function b(a){var b=parseInt(Recite.Dom.getStyle(n,"width")),a=Math.ceil(b/100*100*a);k.style.left=a+r.selectorAdjust.left+"px"}function e(a){var a=Math.abs(100*a-100),b=parseInt(Recite.Dom.getStyle(n,"height")),a=Math.ceil(b/100*a);k.style.top=
a+r.selectorAdjust.top+"px"}function h(){Recite.UI.ColorPicker.hide()}var f=!1,j=null,i=!1,g=null,p=null,m=null,n=null,k=null,t=0,q=0,r={selectorAdjust:{left:-5,top:-5},markup:'<div id="recite-ui-colorpicker">                    <div class="recite-colorbox recite-sprite-colorpicker-mask">                        <div class="recite-colorselector recite-sprite-colorpicker-selector"></div>                    </div>                    <div class="recite-huebox recite-sprite-colorpicker-hue">                        <div class="recite-hueslider"></div>                    </div>                </div>'};
return{setOptions:function(a){r=Recite.Util.merge(r,a)},init:function(){Recite.DomEvent.add(document.body,"mousedown",function(){f=!0});Recite.DomEvent.add(document.body,"mouseup",function(){f=!1});Recite.DomEvent.add(document.body,"click",h);Recite.Dom.append(r.markup,document.body);g=Recite.Sizzle("#recite-ui-colorpicker")[0];n=Recite.Sizzle(".recite-colorbox")[0];k=Recite.Sizzle(".recite-colorselector")[0];p=Recite.Sizzle(".recite-huebox")[0];m=Recite.Sizzle(".recite-hueslider")[0];Recite.DomEvent.add(g,
"click",function(a){"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0});i=!0;Recite.DomEvent.add(n,"mousedown",a);Recite.DomEvent.add(n,"mousemove",function(b){f&&a(b)});Recite.DomEvent.add(p,"mousedown",d);Recite.DomEvent.add(p,"mousemove",function(a){f&&d(a)})},invoke:function(a,d){d=d||{};a=Recite.Util.isArray(a)?a:[a];i||this.init();Recite.Util.each(a,function(a,f){var h="INPUT"===f.tagName?"focus":"click";f.colorPicker={};f.setColor=function(a,d,f){Recite.Tinycolor.equals(a,
this.getColor())||(d=!1===d?!1:!0,f=!1===f?!1:!0,a=Recite.Tinycolor(a),a.ok&&(this.colorPicker.color=a,this.style.backgroundColor=a.toHexString(),this.style.color=Recite.Tinycolor.mostReadable(a,["#000","#FFF"]),"INPUT"===this.tagName?d&&(this.value=this.colorPicker.color.toHexString()):this.innerText=this.colorPicker.color.toHexString(),"undefined"!==typeof this.colorPicker.callback&&f&&this.colorPicker.callback(j,a),j===this&&(d=this.colorPicker.color.toHsv(),c(d.h),b(d.s),e(d.v))))};f.getColor=
function(){return this.colorPicker.color};var i=Recite.Tinycolor(f.style.backgroundColor);i.ok?f.setColor(i):f.setColor(Recite.Tinycolor("#000"));Recite.DomEvent.add(f,h,function(a){Recite.UI.ColorPicker.show();j=a.target;var b=Recite.Dom.getPosition(j),c=Recite.Dom.getStyle(j,"width");t=b.top;q=parseInt(b.left)+parseInt(c);g.style.top=t+"px";g.style.left=q+"px";Recite.UI.ColorPicker.invalidate();"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0});"undefined"!==typeof d.callback&&
(f.colorPicker.callback=d.callback);"INPUT"===f.tagName&&Recite.DomEvent.add(f,"keyup",function(a){this.setColor(a.target.value,!1,!0);"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0})})},show:function(){g.style.display="block"},hide:function(){g.style.display="none"},invalidate:function(){var a=j.colorPicker.color.toHsv();c(a.h);b(a.s);e(a.v)}}}();Recite.namespace("Controls");
Recite.Controls=function(){var d={enabled:!0,url:Recite.baseUrl+"/assets/"+Recite.version+"/html/header.htm",modules:[]};return{setOptions:function(a){d=Recite.Util.merge(d,a);Recite.Controls.Core.setOptions(a.Core);Recite.Controls.Desktop.setOptions(a.Desktop)},load:function(a){d.enabled&&(0===d.modules.length&&(d.modules=[Recite.Controls.Desktop,Recite.Controls.Core]),Recite.Debug.log("Recite.Controls","Loading controls"),Recite.Debug.log("Recite.Controls","Getting controls content"),Recite.Ajax.get(d.url,
null,function(c,b){var e=document.createElement("div");e.innerHTML=b;var h=e.childNodes[0],e=Recite.Sizzle("body",a)[0];Recite.Dom.prepend(h,e);Recite.Util.each(d.modules,function(a,b){b.init();b.invoke(h)});Recite.Debug.log("Recite.Controls","Controls loaded");Recite.Controls.loaded=!0;Recite.Event.publish("Controls:loaded")}))},loaded:!1}}();Recite.namespace("Controls.Core");
Recite.Controls.Core=function(){function d(){b();Recite.Util.each(Recite.Sizzle(".recite-ui-toggle",document),function(a,b){var c=b.getAttribute("data-preference");"undefined"!==Recite.Preferences.get(c)&&(Recite.Preferences.get(c)?b.setAttribute("class",b.getAttribute("class").replace("recite-ui-toggle-active","")+" recite-ui-toggle-active"):b.setAttribute("class",b.getAttribute("class").replace("recite-ui-toggle-active","")))});var a=Recite.Preferences.get("voices");"undefined"!=typeof a.en&&null!=
a.en&&Recite.Util.each(Recite.Sizzle(".recite-voice",document),function(b,c){var d=c.getAttribute("data-value");c.setAttribute("class",c.getAttribute("class").replace("active",""));a.en===d&&c.setAttribute("class",c.getAttribute("class")+" active");c})}function a(){Recite.Api.call("user","GET",{success:function(a){f.user=a;b()}})}function c(a){if("undefined"===typeof a)return f;var b,c,a=a.split(".");b=f;for(c=0;c<a.length;c++)if(b=b[a[c]],"undefined"===typeof b)return null;return b}function b(){Recite.Util.each(h,
function(a,b){if("undefined"!==typeof b.text){var d=b.text,f;e.tagPattern.lastIndex=0;for(var h=d;null!==(f=e.tagPattern.exec(d));)var n=c(f[1])||"",h=h.replace(f[0],n);b.node.nodeValue=h}"undefined"!==typeof b.attributes&&Recite.Util.each(b.attributes,function(a,d){var f;e.tagPattern.lastIndex=0;for(var h=d.value;null!==(f=e.tagPattern.exec(d.value));){var g=c(f[1]);"undefined"===typeof g&&(g=null);h=h.replace(f[0],g)}b.node.setAttribute(d.name,h)})})}var e={tagPattern:/{{([A-Za-z._]+)}}/g},h=[],
f={links:{logout:Recite.baseUrl+"/user/logout"},preferences:null};return{setOptions:function(a){e=Recite.Util.merge(e,a)},init:function(){Recite.Debug.log("Recite.Controls.Core","Core controls invoked");Recite.Event.subscribe("Preferences:load",d);Recite.Event.subscribe("Preferences:set",d);Recite.Event.subscribe("Preferences:reset",d);Recite.Event.subscribe("Auth:reauthorize",a)},invoke:function(b){for(var d=b;null!==d;){if(3===d.nodeType&&0<d.nodeValue.trim().length){var f=d.nodeValue;if(e.tagPattern.test(f)){var p;
e.tagPattern.lastIndex=0;for(var m=f;null!==(p=e.tagPattern.exec(f));)var n=c(p[1])||"",m=m.replace(p[0],n);d.nodeValue=m;h.push({node:d,text:f})}}if(1===d.nodeType){var k=[];Recite.Util.each(d.attributes,function(a,b){var d=b.value;if(e.tagPattern.test(d)){var f;e.tagPattern.lastIndex=0;for(k.push({name:b.name,value:b.value});null!==(f=e.tagPattern.exec(d));)d=c(f[1]),"undefined"===typeof d&&(d=null),b.value=b.value.replace(f[0],d)}});0<k.length&&h.push({node:d,attributes:k})}if(d.hasChildNodes())d=
d.firstChild;else{for(;null===d.nextSibling&&d!==b;)d=d.parentNode;d=d===b?null:d.nextSibling}}Recite.Util.each(Recite.Sizzle(".recite-ui-toggle",b),function(a,b){Recite.UI.Toggle.invoke(b);Recite.DomEvent.add(b,"click",function(a){a=a.currentTarget?a.currentTarget:a.srcElement;Recite.Preferences.set(a.getAttribute("data-preference"),a.checked)})});d=Recite.Sizzle(".recite-preference-set",b);Recite.DomEvent.add(d,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;var b=a.currentTarget?
a.currentTarget:a.srcElement,a=b.getAttribute("data-key").split(" "),c=b.getAttribute("data-value").split(" ");if(a.length!==c.length)Recite.Debug.log("Recite.Controls.Core","Warning: Number of \n                    keys does not match number of values.",b);else{for(var b={},d=0;d<a.length;d++){var e=a[d],f=("-"===c[d].charAt(0)?"-":"")+c[d].replace(/-/g," ");"toggle"===f&&(f=!Recite.Preferences.get(e));if(/\+|\-/.test(f[0])){var h="+"===f[0],f=parseInt(f.replace(/[^0-9]/g,""),10),g=Recite.Preferences.get(e),
g=null===g?100:g,f=h?g+f:g-f;250<f&&(f=250);50>f&&(f=50)}if(0===f.length||"null"===f)f=null;b[e]=f}Recite.Preferences.set(b)}});d=Recite.Sizzle(".recite-save",b);Recite.DomEvent.add(d,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Preferences.save()});d=Recite.Sizzle(".recite-reset",b);Recite.DomEvent.add(d,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Preferences.resetAll()});Recite.DomEvent.add(Recite.Sizzle(".recite-language-set",
b),"click",function(a){var b=(a.currentTarget?a.currentTarget:a.srcElement).getAttribute("data-language");"default"===b?(Recite.Language.Translate.restore(),Recite.Preferences.set("language",null)):(Recite.Language.Translate.translate(Recite.Sizzle("#recite-wrapper"),b),Recite.Preferences.set("language",b));Recite.Util.each(Recite.Sizzle(".recite-language-set"),function(a,c){c.getAttribute("data-language")===b?c.setAttribute("class",c.getAttribute("class")+" recite-active"):c.setAttribute("class",
c.getAttribute("class").replace(" recite-active",""))})});a()}}}();Recite.namespace("Controls.Desktop");
Recite.Controls.Desktop=function(){function d(a,b){if("play"===b||"stopped"===a.getAttribute("data-status")&&"undefined"===b)return a.setAttribute("class",a.getAttribute("class").replace("recite-sprite-button-play","recite-sprite-button-stop")),a.setAttribute("data-status","playing"),"playing";if("stop"===b||"playing"===a.getAttribute("data-status")&&"undefined"===b)return a.setAttribute("class",a.getAttribute("class").replace("recite-sprite-button-stop","recite-sprite-button-play")),a.setAttribute("data-status",
"stopped"),"stopped"}var a={fonts:"Default Arial Verdana Comic-Sans-MS Georgia Tahoma Trebuchet Tiresias Open-Dyslexic".split(" "),swatches:[{backgroundColor:null,color:null,linkColor:null},{backgroundColor:"#000",color:"#fff",linkColor:"#C00"},{backgroundColor:"#000",color:"#FCED20",linkColor:"#C00"},{backgroundColor:"#343A3F",color:"#CACFD3",linkColor:"#C00"},{backgroundColor:"#CACFD3",color:"#343A3F",linkColor:"#C00"},{backgroundColor:"#C3272A",color:"#FFF",linkColor:"#00C"},{backgroundColor:"#F05924",
color:"#FFF",linkColor:"#00C"},{backgroundColor:"#37B64B",color:"#fff",linkColor:"#2fc2ef"},{backgroundColor:"#0201FF",color:"#fff",linkColor:"#9c0001"},{backgroundColor:"#0000FE",color:"#FCED20",linkColor:"#2fc2ef"},{backgroundColor:"#fff",color:"#C3272A",linkColor:"#2fc2ef"},{backgroundColor:"#fff",color:"#F05924",linkColor:"#2fc2ef"},{backgroundColor:"#fff",color:"#37B64B",linkColor:"#C00"},{backgroundColor:"#fff",color:"#0201FF",linkColor:"#C00"},{backgroundColor:"#1DFF16",color:"#F4EED9",linkColor:"#C00"},
{backgroundColor:"#F4EED9",color:"#1D1916",linkColor:"#C00"},{backgroundColor:"#fff",color:"#000",linkColor:"#C00"},{backgroundColor:"#FCED20",color:"#000",linkColor:"#C00"}],languages:{"default":{name:"Default",flag:null},af:{name:"Afrikaans",flag:"sa"},sq:{name:"Albanian",flag:"al"},ar:{name:"Arabic",flag:"dz"},az:{name:"Azerbaijani",flag:"az"},eu:{name:"Basque",flag:null},bn:{name:"Bengali",flag:"bd"},be:{name:"Belarusian",flag:"by"},bg:{name:"Bulgarian",flag:"bg"},ca:{name:"Catalan",flag:"ad"},
"zh-CN":{name:"Chinese Simplified",flag:"cn"},"zh-TW":{name:"Chinese Traditional",flag:"cn"},hr:{name:"Croatian",flag:"hr"},cs:{name:"Czech",flag:"cz"},da:{name:"Danish",flag:"dk"},nl:{name:"Dutch",flag:"nl"},en:{name:"English",flag:"gb"},eo:{name:"Esperanto",flag:null},et:{name:"Estonian",flag:"ee"},tl:{name:"Filipino",flag:"ph"},fi:{name:"Finnish",flag:"fi"},fr:{name:"French",flag:"fr"},gl:{name:"Galician",flag:"gl"},ka:{name:"Georgian",flag:"ge"},de:{name:"German",flag:"de"},el:{name:"Greek",flag:"gr"},
gu:{name:"Gujarati",flag:"gu"},ht:{name:"Haitian Creole",flag:"ht"},iw:{name:"Hebrew",flag:"il"},hi:{name:"Hindi",flag:"in"},hu:{name:"Hungarian",flag:"hu"},is:{name:"Icelandic",flag:"is"},id:{name:"Indonesian",flag:"id"},ga:{name:"Irish",flag:"ie"},it:{name:"Italian",flag:"it"},ja:{name:"Japanese",flag:"jp"},kn:{name:"Kannada",flag:"id"},ko:{name:"Korean",flag:"kr"},la:{name:"Latin",flag:"va"},lv:{name:"Latvian",flag:"lv"},lt:{name:"Lithuanian",flag:"lt"},mk:{name:"Macedonian",flag:"mk"},ms:{name:"Malay",
flag:"my"},mt:{name:"Maltese",flag:"mt"},no:{name:"Norwegian",flag:"no"},fa:{name:"Persian",flag:"ir"},pl:{name:"Polish",flag:"pl"},pt:{name:"Portuguese",flag:"pt"},ro:{name:"Romanian",flag:"ro"},ru:{name:"Russian",flag:"ru"},sr:{name:"Serbian",flag:"rs"},sk:{name:"Slovak",flag:"sk"},sl:{name:"Slovenian",flag:"sk"},es:{name:"Spanish",flag:"es"},sw:{name:"Swahili",flag:"ke"},sv:{name:"Swedish",flag:"se"},ta:{name:"Tamil",flag:"in"},te:{name:"Telugu",flag:"in"},th:{name:"Thai",flag:"th"},tr:{name:"Turkish",
flag:"tr"},uk:{name:"Ukrainian",flag:"ua"},ur:{name:"Urdu",flag:"pk"},vi:{name:"Vietnamese",flag:"vn"},cy:{name:"Welsh",flag:"wales"},yi:{name:"Yiddish",flag:"ua"}},margins:[{name:"Default",value:null,icon:null},{name:"Large",value:"5%",icon:"recite-sprite-margin-large"},{name:"Medium",value:"15%",icon:"recite-sprite-margin-medium"},{name:"Small",value:"30%",icon:"recite-sprite-margin-small"}],advancedColorSettings:!0,simplifiedControls:!0,showLogo:!0,customLogo:!1,customLogoLink:!1,customLogoTitle:!1,
repositionBackground:!0};return{setOptions:function(c){a=Recite.Util.merge(a,c)},init:function(){},invoke:function(c){var b=document.body;a.simplifiedControls&&(c.setAttribute("class",c.getAttribute("class")+" recite-controls-simplified"),Recite.Sizzle(".recite-sprite-logo")[0].setAttribute("class","recite-sprite-logo-small"));var e=Recite.Dom.getStyle(c,"height"),e=parseInt(e.replace("px",""),10);if("tooltip"===Recite.getOptions().selectionMethod)try{Recite.PlayerControls.getProvider().setTopProtection(e)}catch(h){}if(a.repositionBackground){var f=
Recite.Dom.getStyle(b,"background-position-y");if("0%"===f)b.setAttribute("style","background-position-y:"+e+" px !important");else if(f.match(/px/i)||"top"===f)f=f.replace("px",""),f=parseInt(f,10)+parseInt(e,10),b.setAttribute("style","background-position-y:"+f+" px !important")}b.style.position="absolute";b.style.top=e+"px";b.style.width="100%";Recite.Util.each(Recite.Sizzle("*"),function(a,b){!/recite/.test(b.getAttribute("id"))&&!/recite/.test(b.getAttribute("class"))&&"fixed"===Recite.Dom.getStyle(b,
"position")&&(b.style.top=e+b.offsetTop+"px")});var j=Recite.Sizzle("#recite-fonts")[0];Recite.Util.each(a.fonts,function(a,b){var c=document.createElement("div");c.setAttribute("class","recite-font recite-preference-set");c.setAttribute("data-key","style.font.face");"Default"!==b?(c.setAttribute("data-value",b),c.style.fontFamily=b):c.setAttribute("data-value","null");c.innerText=b;c.textContent=b;j.appendChild(c)});var i=Recite.Sizzle("#recite-swatches")[0];Recite.Util.each(a.swatches,function(a,
b){var c=document.createElement("div");c.setAttribute("class","recite-swatch recite-preference-set");null===b.backgroundColor&&null===b.color&&null===b.linkColor?(c.setAttribute("class",c.getAttribute("class")+" recite-swatch-default"),c.textContent="Default",c.innerText="Default"):(c.textContent="A",c.innerText="A");c.setAttribute("data-key","style.backgroundColor style.font.color style.link.color");c.setAttribute("data-value",b.backgroundColor+" "+b.color+" "+b.linkColor);c.style.color=b.color;
c.style.backgroundColor=b.backgroundColor;i.appendChild(c)});var g=Recite.Sizzle("#recite-languages")[0];Recite.Util.each(a.languages,function(a,b){var c=document.createElement("li"),d=document.createTextNode(b.name);c.appendChild(d);c.setAttribute("class","recite-language-set");c.setAttribute("data-language",a);null!==b.flag&&(d=document.createElement("span"),d.setAttribute("class","recite-sprite-flag-"+b.flag),c.appendChild(d));g.appendChild(c)});var p=Recite.Sizzle("#recite-margins")[0];Recite.Util.each(a.margins,
function(a,b){var c=document.createElement("div");c.setAttribute("class","recite-margin recite-preference-set");c.setAttribute("data-key","style.marginSize");c.setAttribute("data-value",b.value);var d=b.icon||null;if(null!==d){var e=document.createElement("div");e.setAttribute("class",d);e.style.margin="0 auto";c.appendChild(e)}else c.textContent=b.name,c.innerText=b.name;p.appendChild(c)});var m=Recite.Sizzle(".recite-sprite-button-margin")[0];m.style.display="none";Recite.Event.subscribe("TextMode:enabled",
function(){m.style.display="block"});Recite.Event.subscribe("TextMode:disabled",function(){m.style.display="none"});c=Recite.Sizzle(".recite-button",c);Recite.UI.Dropdown.invoke(c);var n=Recite.Sizzle(".recite-sprite-button-play")[0];Recite.DomEvent.add(n,"click",function(){"stopped"===n.getAttribute("data-status")?Recite.PlayerControls.play():Recite.PlayerControls.stop()});Recite.Event.subscribe("Audio:ended",function(){d(n,"stop")});Recite.Event.subscribe("Audio:started",function(){d(n,"play")});
a.showLogo||Recite.Sizzle(".recite-logo")[0].setAttribute("class","custom-logo");!1!=a.customLogo&&(c=Recite.Sizzle(".recite-logo")[0],c.setAttribute("class","custom-logo"),c.innerHTML='<img src="'+a.customLogo+'" height="80" />',!1!=a.customLogoLink&&(c.href=a.customLogoLink),!1!=a.customLogoTitle&&(c.title=a.customLogoTitle));!1===Recite.AudioDownload.getOptions().enabled&&(c=Recite.Sizzle(".recite-sprite-button-mp3")[0],c.outerHTML="")}}}();Recite.namespace("Recite.Parser.Html");
Recite.Parser.Html=function(){function d(a){if(0<a.length){var b=0;Recite.Util.each(a,function(a,c){b+=Recite.Dom.getText(c).trim().length});if(b>=c.minCharacters){var d=a[0].ownerDocument.createElement(c.wrapTag);d.className="recite-ele";d.style.display="inline";if(c.debug.highlightElements){var j=Math.floor(256*Math.random()),i=Math.floor(256*Math.random()),g=Math.floor(256*Math.random());try{d.style.backgroundColor="rgba("+j+","+i+","+g+",0.4)"}catch(p){d.style.backgroundColor="rgb("+j+","+i+","+
g+")"}}a[0].parentNode.insertBefore(d,a[0]);for(j=0;j<a.length;j++)i=a[j].parentNode.removeChild(a[j]),d.appendChild(i);return d}}return null}function a(d,h,f){"undefined"===typeof f&&(f=[[]]);var j=!1,i=!1;if(1===d.nodeType&&/recite-ele/g.test(d.getAttribute("class")))return f;if(d){if(1===d.nodeType&&(0<=Recite.Util.inArray(d.tagName,c.skipElements)||"true"===d.getAttribute("data-recite-skip"))||1===d.nodeType&&0<b.length&&"BR"===d.tagName&&"BR"===b[b.length-1].tagName)return f;3===d.nodeType&&
Recite.Dom.getText(d).replace(/^\s*/,"").replace(/\s*$/,"");if(1===d.nodeType){var g;if(g=0<=Recite.Util.inArray(Recite.Dom.getStyle(d,"display"),c.concatenateTypes)){a:{if(1===d.nodeType){g=d.getElementsByTagName("*");for(var p=0;p<g.length;p++)if("block"===Recite.Dom.getStyle(g[p],"display")){g=!0;break a}}g=!1}g=!g}g&&(j=!0)}else 3===d.nodeType&&(j=!0);!0===j&&(b[b.length-1]!==d.previousSibling&&(f.push(b),b=[]),b.push(d),i=!0);j=0;g=d.childNodes[j];if(!i)for(;g;)a(g,h+1,f),j++,g=d.childNodes[j]}return f}
var c={maxCharacters:1E3,minCharacters:1,wrapTag:"recite",concatenateTypes:["inline","inline-block"],skipElements:"SCRIPT STYLE SELECT OPTION IMG FRAMESET FRAME IFRAME NOSCRIPT".split(" "),parseImgAltAttribute:!0,bubbleEvents:!0,bubbleStyles:!0,debug:{highlightElements:!1}},b=[];return{setOptions:function(a){Recite.Debug.log("Recite.Parser.Html","Setting options");c=Recite.Util.merge(c,a)},parse:function(e){Recite.Debug.log("Recite.Parser.Html","Parser invoked on element:",e);var h=new Date,f=a(e,
1);0<b.length&&f.push(b);0===f[f.length-1].length&&f.pop();var j=[];Recite.Util.each(f,function(a,b){if(0!==b.length){var c=d(b);null!==c&&j.push(c)}});if(c.parseImgAltAttribute){var i=Recite.Sizzle("img[data-recite-skip!=true]",e);Recite.Util.each(i,function(a,b){if(b)if(null===b.getAttribute("alt")||0===b.getAttribute("alt").length)i.splice(a,1);else if(c.debug.highlightElements){var d=Math.floor(256*Math.random()),e=Math.floor(256*Math.random()),f=Math.floor(256*Math.random());try{b.style.backgroundColor=
"rgba("+d+","+e+","+f+",0.4)"}catch(h){b.style.backgroundColor="rgb("+d+","+e+","+f+")"}}});Recite.PlayerControls.invoke(i)}Recite.Debug.log("Recite.Parser.Html","Parsed "+j.length+" elements in: "+((new Date).getTime()-h.getTime())+"ms");!1!==c.bubbleEvents&&(e=Recite.Sizzle(".recite-ele"),Recite.DomEvent.add(e,"click",function(a){a.target.parentNode.click()}));return j},wrapElements:function(a){Recite.Util.each(a,function(a,b){d(b)})}}}();Recite.namespace("Recite.Parser.Selector");
Recite.Parser.Selector=function(){var d={maxCharacters:1E3,minCharacters:1,selector:".recite"};return{setOptions:function(a){Recite.Debug.log("Recite.Parser.Selector","Setting options");d=Recite.Util.merge(d,a)},parse:function(a){Recite.Debug.log("Recite.Parser.Selector","Parser invoked on element:",a);var c=Recite.Sizzle(d.selector,a);Recite.Util.each(c,function(a,e){var h=Recite.Dom.getText(e);(h.length<d.minCharacters||h.length>d.maxCharacters)&&c.splice(a)});return c}}}();Recite.namespace("PlayerControls");
Recite.PlayerControls=function(){function d(){null===c.provider?c.provider=c.enableMobileControls&&Recite.Browser.isMobile()?Recite.PlayerControls.Fixed:Recite.PlayerControls.Tooltip:"none"===c.provider&&(c.provider=Recite.PlayerControls.NoGUI);c.provider.init&&c.provider.init()}function a(){Recite.Preferences.get("playerControls.enabled")?Recite.PlayerControls.enable():Recite.PlayerControls.disable()}var c={provider:null,enableMobileControls:!0};Recite.Event.subscribe("Recite:load",d);Recite.Event.subscribe("Preferences:load",
a);Recite.Event.subscribe("Preferences:set",a);Recite.Event.subscribe("Preferences:reset",a);return{init:d,setOptions:function(a){a.provider&&c.provider&&c.provider.destroy();c=Recite.Util.merge(c,a);Recite.PlayerControls.Tooltip.setOptions(a.Tooltip);Recite.PlayerControls.Fixed.setOptions(a.Fixed);Recite.PlayerControls.NoGUI.setOptions(a.NoGUI);a.provider&&a.provider.init&&c.provider.init()},invoke:function(a){c.provider.invoke(a)},enable:function(){c.provider.enable()},disable:function(){c.provider.disable()},
invalidate:function(){c.provider.invalidate()},getControls:function(){return c.provider.getControls()},getProvider:function(){return c.provider},play:function(){return c.provider.play()},stop:function(){return c.provider.stop()},next:function(){Recite.Debug.log("Recite.PlayerControls","next");return c.provider.next()},previous:function(){Recite.Debug.log("Recite.PlayerControls","prev");return c.provider.previous()}}}();Recite.namespace("PlayerControls.Tooltip");
Recite.PlayerControls.Tooltip=function(){function d(a){Recite.Util.each(i,function(c,d){!Recite.Dom.isDescendant(a.target,d)&&(a.target!==d&&!Recite.Dom.isDescendant(a.target,g)&&a.target!==g&&!Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0]))&&b(d)})}function a(){if(f){clearTimeout(h.timeout);var a=this;g!==this&&(h.timeout=setTimeout(function(){c(a)},h.intent))}}function c(a){null!==a&&(null!==g&&(g.setAttribute("class",g.getAttribute("class").replace("recite-selected","")),
Recite.Event.publish("Recite.Tooltip:hide",{target:g})),g=a,e(a),g.setAttribute("class",g.getAttribute("class")+" recite-selected"),Recite.Event.publish("Recite.Tooltip:show",{target:g}),Recite.Preferences.get("player.autoplay")&&Recite.PlayerControls.Tooltip.play())}function b(a){a.style.display="none";null!==g&&(g.setAttribute("class",g.getAttribute("class").replace("recite-selected","")),Recite.Event.publish("Recite.Tooltip:hide",{target:g}));g=null}function e(a){var b,c=Recite.Sizzle("#recite-tooltip",
j)[0];if("undefined"===typeof c){Recite.Debug.log("Recite.Tooltip","Adding tooltip to document");c=j.createElement("div");c.setAttribute("class","recite-tooltip small");c.setAttribute("id","recite-tooltip");c.style.position="absolute";c.innerHTML='<div class="recite-tooltip-content">'+h.content+'</div>                         <div class="recite-sprite-tip-bottomleft" id="recite-tip"></div>';Recite.Sizzle("body",j)[0].appendChild(c);b=Recite.getOptions();if(void 0==b.Controls||!1!==b.Controls.Desktop.showLogo&&
!1==b.Controls.Desktop.customLogo)document.getElementById("recite-tooltip-logo").setAttribute("class","recite-sprite-tooltip-logo"),c.setAttribute("class","recite-tooltip");Recite.Debug.log("Recite.Tooltip","Binding buttons for tooltip");b=j.getElementById("recite-play");Recite.DomEvent.add(b,"click",function(){Recite.PlayerControls.Tooltip.play()});b=j.getElementById("recite-stop");Recite.DomEvent.add(b,"click",function(){Recite.Player.stop()});b=j.getElementById("recite-back");Recite.DomEvent.add(b,
"click",function(){Recite.Player.rewind()});b=j.getElementById("recite-forward");Recite.DomEvent.add(b,"click",function(){Recite.Player.forward()});i.push(c)}b=c;b.style.display="block";for(var d=0;d<i.length;d++)i[d]!==b&&(i[d].style.display="none");var e=j.body,f=Recite.Dom.getPosition(a),d=Recite.Dom.getScroll(a.ownerDocument.defaultView),g=f.top-b.offsetHeight-h.adjust.y,k=f.left+("right"==h.position?a.offsetWidth:0),c="recite-sprite-tip-bottom-left",p=g-d.y-h.adjust.y,m=k+b.offsetWidth-d.x;b.style.position=
"absolute";for(var n=Recite.Dom.getAncestors(a),d=0;d<n.length;d++)"fixed"===Recite.Dom.getStyle(n[d],"position")&&(b.style.position="fixed",p=g-h.adjust.y);p<h.protect.top-h.adjust.y?(g=f.top+a.offsetHeight+h.adjust.y,c="recite-sprite-tip-top-left",m>e.clientWidth-h.protect.right&&(k=f.left-b.offsetWidth+h.adjust.x,c="recite-sprite-tip-top-right")):m>e.clientWidth&&(k=f.left-b.offsetWidth+h.adjust.x,c="recite-sprite-tip-bottom-right");b.style.top=g+"px";b.style.left=k+"px";a=j.getElementById("recite-tip");
a.setAttribute("class",c);a.setAttribute("className",c)}var h={adjust:{x:0,y:15},protect:{top:40,right:0,bottom:0,left:0},position:"left",intent:500,timeout:null,content:'<div id="recite-tooltip-logo" data-recite-skip="true"></div>               <a id="recite-play" class="recite-sprite-tooltip-btn recite-sprite-tooltip-play"></a><a id="recite-stop" class="recite-sprite-tooltip-btn recite-sprite-tooltip-stop"></a>               <a id="recite-back" class="recite-sprite-tooltip-btn recite-sprite-tooltip-back"></a><a id="recite-forward" class="recite-sprite-tooltip-btn recite-sprite-tooltip-forward"></a>'},
f=!0,j,i=[],g=null,p=!1,m=null,n,k;n=k=function(){g&&e(g)};return{init:function(){if(!p){m=Recite.Event.subscribe("Style:updated",Recite.PlayerControls.Tooltip.invalidate);for(var a=[window],b=0;b<a.length;b++)Recite.DomEvent.add(a[b],"resize",k),Recite.DomEvent.add(a[b],"scroll",n),Recite.DomEvent.add(a[b],"click",d);p=!0}},destroy:function(){Recite.Event.unsubscribe(m);Recite.Util.each([window],function(a,b){Recite.DomEvent.remove(b,"resize",k);Recite.DomEvent.remove(b,"scroll",n);Recite.DomEvent.remove(b,
"click",d)});p=!1},enable:function(){f=!0},disable:function(){f=!1;Recite.Util.each(i,function(a,c){b(c)})},setOptions:function(a){h=Recite.Util.merge(h,a)},getOptions:function(){return h},invoke:function(b){this.init();Recite.Debug.log("Recite.PlayerControls.Tooltip","Invoking tooltip controls.");j=b.ownerDocument?b.ownerDocument:document;Recite.DomEvent.add(b,"mouseover",a);Recite.DomEvent.add(b,"mouseout",function(){clearTimeout(h.timeout)})},invalidate:function(){g&&e(g)},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),
c(a)):null===g?this.next():Recite.PlayerDispatcher.dispatch(g)},stop:function(){Recite.Player.stop()},seekingSupported:function(){return!0},next:function(){var a=Recite.Dom.getNextElement(g);a===g?Recite.Debug.log("Recite.PlayerControls.Tooltip","next element same as current, halting"):c(a)},previous:function(){var a=Recite.Dom.getPreviousElement(g);c(a)},current:g}}();Recite.namespace("PlayerControls.Fixed");
Recite.PlayerControls.Fixed=function(){function d(){m=Recite.Event.subscribe("Style:updated",Recite.PlayerControls.Tooltip.invalidate);for(var a=[window],b=0;b<a.length;b++)Recite.DomEvent.add(a[b],"resize",k),Recite.DomEvent.add(a[b],"scroll",n),Recite.DomEvent.add(a[b],"click",t)}function a(){Recite.Event.unsubscribe(m);Recite.Util.each([window],function(a,b){Recite.DomEvent.remove(b,"resize",k);Recite.DomEvent.remove(b,"scroll",n);Recite.DomEvent.remove(b,"click",t)})}function c(){if(f){clearTimeout(h.timeout);
var a=this;g!==this&&(h.timeout=setTimeout(function(){b(a)},h.intent))}}function b(a){null!==g&&g.setAttribute("class",g.getAttribute("class").replace("recite-selected",""));g=a;e(a);Recite.Preferences.get("player.autoplay")&&Recite.PlayerDispatcher.dispatch(g);g.setAttribute("class",g.getAttribute("class")+" recite-selected")}function e(){var a;a=Recite.Sizzle("#recite-tooltip",j)[0];if("undefined"===typeof a){Recite.Debug.log("Recite.PlayerControls.Fixed","Adding fixed controls to document");a=
j.createElement("div");a.setAttribute("class","recite-tooltip-fixed");a.setAttribute("id","recite-tooltip");a.style.position="absolute";a.innerHTML='<div class="recite-tooltip-content">'+h.content+'</div>               <div class="recite-tip-bottomleft" id="recite-tip"></div>';Recite.Sizzle("body",j)[0].appendChild(a);Recite.Debug.log("Recite.PlayerControls.Fixed","Binding buttons for fixed controls");var b=j.getElementById("recite-play");Recite.DomEvent.add(b,"click",function(){Recite.PlayerDispatcher.dispatch(g)});
b=j.getElementById("recite-stop");Recite.DomEvent.add(b,"click",function(){Recite.Player.stop()});b=j.getElementById("recite-back");Recite.DomEvent.add(b,"click",function(){Recite.PlayerControls.previous()});b=j.getElementById("recite-forward");Recite.DomEvent.add(b,"click",function(){Recite.PlayerControls.next()});i.push(a)}Recite.Debug.log("Recite.PlayerControls.Fixed","Fixed controls added to document: "+a);a.style.display="block";a.style.position="fixed";for(b=0;b<i.length;b++)i[b]!==a&&(i[b].style.display=
"none");Recite.Sizzle("body",document)[0].style.paddingBottom=h.dimensions.height+"px"}var h={dimensions:{height:98},intent:500,timeout:null,content:'<a id="recite-play" class="recite-sprite-fixed-play"></a><a id="recite-stop" class="recite-sprite-fixed-stop"></a>               <a id="recite-back" class="recite-sprite-fixed-previous"></a><a id="recite-forward" class="recite-sprite-fixed-next"></a>'},f=!0,j,i=[],g=null,p=!1,m=null,n,k;n=k=function(){g&&e(g)};var t=function(a){Recite.Util.each(i,function(b,
c){!Recite.Dom.isDescendant(a.target,c)&&(a.target!==c&&!Recite.Dom.isDescendant(a.target,g)&&a.target!==g&&!Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0]))&&(c.style.display="none",null!==g&&g.setAttribute("class",g.getAttribute("class").replace("recite-selected","")),Recite.Sizzle("body",document)[0].style.paddingBottom="0px",g=null)})};return{init:function(){p||(d(),p=!0)},destroy:function(){a();p=!1},enable:function(){f||d();f=!0},disable:function(){f&&a();f=!1},setOptions:function(a){h=
Recite.Util.merge(h,a)},getOptions:function(){return h},invoke:function(a){Recite.Debug.log("Recite.Tooltop.Desktop","Invoking fixed playerControls");j=a.ownerDocument?a.ownerDocument:document;Recite.DomEvent.add(a,"mouseover",c);Recite.DomEvent.add(a,"mouseout",function(){clearTimeout(h.timeout)})},invalidate:function(){g&&e(g)},seekingSupported:function(){return!0},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),b(a)):null===g?this.next():Recite.PlayerDispatcher.dispatch(g)},stop:function(){Recite.Player.stop()},
next:function(){var a=Recite.Dom.getNextElement(g);a===g||null===a?Recite.Debug.log("Recite.PlayerControls.Fixed","next element same as current, halting"):b(a)},previous:function(){var a=Recite.Dom.getPreviousElement(g);b(a)},current:g}}();Recite.namespace("PlayerControls.NoGUI");
Recite.PlayerControls.NoGUI=function(){function d(a){null!==a&&(null!==e&&e.setAttribute("class",e.getAttribute("class").replace("recite-selected","")),e=a,e.setAttribute("class",e.getAttribute("class")+" recite-selected"),Recite.Preferences.get("player.autoplay")&&Recite.PlayerControls.NoGUI.play())}function a(){if(b){clearTimeout(c.timeout);var a=this;e!==this&&(c.timeout=setTimeout(function(){d(a)},c.intent))}}var c={timeout:null},b=!0,e=null,h=!1;return{init:function(){h||(Recite.Event.subscribe("Style:updated",
Recite.PlayerControls.Tooltip.invalidate),h=!0)},destroy:function(){h=!1},enable:function(){b=!0},disable:function(){b=!1},setOptions:function(a){c=Recite.Util.merge(c,a)},getOptions:function(){return c},invoke:function(b){this.init();Recite.Debug.log("Recite.PlayerControls.NoGUI","Invoking NoGUI controls.");Recite.DomEvent.add(b,"mouseover",a);Recite.DomEvent.add(b,"mouseout",function(){clearTimeout(c.timeout)})},invalidate:function(){},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),d(a)):
null===e?this.next():Recite.PlayerDispatcher.dispatch(e)},stop:function(){Recite.Player.stop()},seekingSupported:function(){return!0},next:function(){var a=Recite.Dom.getNextElement(e);a===e||null===a?Recite.Debug.log("Recite.PlayerControls.NoGUI","next element same as current, halting"):d(a)},previous:function(){var a=Recite.Dom.getPreviousElement(e);d(a)},current:e}}();Recite.namespace("PlayerDispatcher");
Recite.PlayerDispatcher=function(){function d(a){var b=Recite.Dom.getText(a);Recite.Util.each(c.readElements,function(c,d){a.tagName===c&&""!==b&&(b=d+". "+b)});return b}function a(a,c){var f=null,j=null;"string"===typeof a?f=a:(f=d(a),j=a.getAttribute("data-recite-voice")||null);null!==c&&"undefined"!==typeof c&&(c=c.split("-")[0]);try{if(Recite.Player.play(f,c,j),Recite.getOptions().autoCache&&"string"!==typeof a){var i=Recite.Dom.getNextElement(a);i!==a&&setTimeout(function(){b===a&&Recite.Player.cache(d(i),
c,j)},500)}}catch(g){if(g instanceof Recite.Player.PlayerException)switch(g.code){case 400:Recite.Gui.Notification.show("This language is not supported by Recite",{play:!0})}}}var c={readElements:{A:"Link",IMG:"Image"}},b=null;return{setOptions:function(a){c=Recite.Util.merge(c,a)},dispatch:function(c){(null===Recite.Player.getPlayer()||Recite.Player.getPlayer().getOptions().prepareAudio)&&Recite.Player.prepare();var d=null,f=null;"string"===typeof c?d=c:(f=Recite.Dom.getLanguage(c),b=c,d=Recite.Dom.getText(c));
var j=Recite.Player.getOptions().languageDetection;2===j||null===f&&1<=j?f=Recite.Dom.detectLanguage(d,function(b){"und"===b&&(b=null);a(c,b)}):a(c,f)}}}();Recite.namespace("Player");
Recite.Player=function(){function d(){if(b)return b;Recite.Audio.HTML5.support()?(Recite.Debug.log("Recite.Player","HTML5 Audio support detected, using Recite.Audio.HTML5 as backend."),Recite.Audio.HTML5.init(),b=Recite.Audio.HTML5):Recite.Audio.SoundManager.support()?(Recite.Debug.log("Recite.Player","HTML5 Audio not supported, using Recite.Audio.SoundManager as backend."),Recite.Audio.SoundManager.init(),b=Recite.Audio.SoundManager):alert("Sorry, Recite requires either an HTML5 compatible browser or Flash support. Please upgrade your browser or install Flash to use Recite.");
return b}function a(a,b,j,i,g){b=b||e.language;j=j||null;if(!Recite.Player.languageSupported(b))throw Recite.Debug.log("Recite.Player","Language not supported:"+b),new Recite.Player.PlayerException(400,"Unsupported Language");var p=d().format(),m={q:a,f:p};if(null!==b){m.l=b;var j=c(b)||j,n=Recite.Preferences.get("voices");"undefined"!==typeof n[b]&&(null!=n[b]&&null===c(b))&&(j=n[b]);null!==j&&(m.vo=j)}Recite.Debug.log("Recite.Player","Audio request: "+a);0>a.length&&!i.cache?(Recite.Debug.log("Recite.Player",
"GET Request"),Recite.Api.getUri("tts",{authRequired:!0,data:m,success:function(a){Recite.Debug.log("Recite.Player","Request url: "+a);g&&g(a)}})):(Recite.Debug.log("Recite.Player","POST Request"),Recite.Api.call("tts","POST",{data:m,contentType:"application/json; charset=UTF-8",success:function(a){var b=a.data;Recite.Debug.log("Recite.Player","POST Callback: "+b.id);Recite.Auth.getStatus(function(a){a=Recite.baseUrl+"/api/tts/"+b.id+"?f="+p+"&access_token="+a.access_token;g&&g(a)})}}))}function c(a){return"undefined"!==
typeof e.voices[a]?e.voices[a]:null}var b=null,e={language:null,voices:{},languages:["en","ar","tr","it","ko","zh","th","ja","id","eu","ca","cs","da","nl","fi","fr","de","el","hi","hu","no","pl","pt","ro","ru","sk","es","sv"],languageDetection:1};return{setOptions:function(a){e=Recite.Util.merge(e,a)},getOptions:function(){return e},init:function(){if(null===e.language){var a=document.documentElement.lang;0<a.length&&this.setOptions({language:a})}},prepare:function(){d().play(Recite.baseUrl+"/audio/blank.mp3")},play:function(b,c,e){a(b,c,e,{},function(a){d().play(a);Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Player",
event:"play"})})},cache:function(b,c,d){a(b,c,d,{cache:!0},function(a){Recite.Debug.log("Recite.Player","Cached audio for element: "+a)})},stop:function(){Recite.Preferences.get("player.continuePlay")&&Recite.Event.unsubscribe(null);d().stop()},rewind:function(){d().rewind()},forward:function(){d().forward()},setPlayer:function(a){b=a},getPlayer:function(){return b},getSupportedLanguauges:function(){return e.languages},languageSupported:function(a){return-1<Recite.Util.inArray(a,e.languages)||null===
a}}}();Recite.Player.PlayerException=function(d,a){this.code=d;this.message=a};Recite.namespace("Audio.HTML5");
Recite.Audio.HTML5=function(){var d=null,a="",c={prepareAudio:!0};return{setOptions:function(a){c=Recite.Util.merge(c,a)},init:function(){Recite.Debug.log("Recite.Audio.HTML5","Init");d=document.createElement("audio");a=Recite.Audio.HTML5.format();d.addEventListener("ended",function(){Recite.Preferences.get("player.continuePlay")?Recite.PlayerControls.next():Recite.Event.publish("Audio:ended")},!1);Recite.Debug.log("Recite.Audio.HTML5","Preferred format detected as:"+a);Recite.Debug.log("Recite.Audio.Html5",
a)},play:function(a){Recite.Event.publish("Audio:started");d.setAttribute("src",a);d.load();var c=setInterval(function(){3<=d.readyState&&(d.play(),clearInterval(c))},5)},stop:function(){d.pause();Recite.Event.publish("Audio:ended")},rewind:function(){d.currentTime-=1},forward:function(){d.currentTime+=1},support:function(){var a=document.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),
c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},format:function(){var a=Recite.Audio.HTML5.support();return a.mp3?"mp3":a.ogg?"ogg":a.wav?"wav":a.m4a?"m4a":!1},getOptions:function(){return c}}}();Recite.namespace("Audio.SoundManager");
Recite.Audio.SoundManager=function(){function d(){Recite.Event.publish("Audio:ended");Recite.Preferences.get("player.continuePlay")&&Recite.PlayerControls.next()}var a=null,c={prepareAudio:!0},c={path:Recite.baseUrl+"/common/js/soundmanager/soundmanager2-jsmin.js",soundmanager:{debugMode:!1,debug:!1,url:Recite.baseUrl+"/common/swf/"}};return{setOptions:function(a){c=Recite.Util.merge(c,a)},init:function(){},play:function(b){window.soundManager?((a=soundManager.getSoundById(b))||(a=soundManager.createSound({id:b,
url:b})),soundManager.stopAll(),a.play({onfinish:function(){d()}})):Recite.AssetLoader.js(c.path,function(){window.soundManager=new SoundManager;Recite.Util.each(c.soundmanager,function(a,b){soundManager[a]=b});soundManager.beginDelayedInit();soundManager.stopAll();soundManager.onready(function(){a=soundManager.createSound({id:b,url:b}).play({onfinish:function(){d()}})})});Recite.Event.publish("Audio:started")},stop:function(){a&&a.stop();Recite.Event.publish("Audio:ended")},rewind:function(){a&&
(Recite.Debug.log("Recite.Sudio.Soundmanager","Skiping backwards"),a.setPosition(a.position-500))},forward:function(){a?(Recite.Debug.log("Recite.Sudio.Soundmanager","Skiping forward"),a.setPosition(a.position+500)):Recite.Debug.log("Recite.Sudio.Soundmanager","No sound object!?")},support:function(){return!0},format:function(){return"mp3"},getOptions:function(){return c}}}();Recite.namespace("Audio.Download");
Recite.Audio.Download=function(){var d={prepareAudio:!1};return{setOptions:function(a){d=Recite.Util.merge(d,a)},init:function(){},play:function(a){Recite.Player.setPlayer(null);Recite.Debug.log("Recite.Audio.Download","PLAY");window.location.href=a+"&download=true"},stop:function(){},rewind:function(){},forward:function(){},support:function(){return!0},format:function(){return"mp3"},getOptions:function(){return d}}}();Recite.namespace("Style");
Recite.Style=function(){function d(){var a="",b=Recite.Preferences.get("style"),d=Recite.Preferences.get("textMode.enabled");null!==b.marginSize&&d&&(a+="#recite-wrapper { padding: 0 "+b.marginSize+"; } body { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; } ");null!==b.font.color&&(a+="#recite-wrapper, #recite-wrapper * { color: "+b.font.color+" !important; text-shadow: none !important; }");null!==b.font.face&&(a+="#recite-wrapper, #recite-wrapper * { font-family: "+
b.font.face+" !important; }");null!==b.font.size&&(a+=".recite-ele { font-size: "+b.font.size+"% !important; } #recite-wrapper *, .recite-ele { line-height: normal !important; }");null!==b.link.color&&(a+="#recite-wrapper a { color: "+b.link.color+" !important; }");null!==b.backgroundColor&&(a=a+"#recite-wrapper * { background: transparent !important; box-shadow: none !important; }"+("body, html, #recite-wrapper { background: "+b.backgroundColor+" !important; }"));null!==b.ruler.color&&(a+="#recite-ruler { background-color: "+
b.ruler.color+" }");return a}function a(){var a;a=window.document;var b=Recite.Sizzle("style[id=recite-style]");0===b.length?(b=a.createElement("style"),b.type="text/css",b.id="recite-style",b.setAttribute("data-recite-skip","true"),Recite.Sizzle("head",a)[0].appendChild(b)):b=b[0];a=b;if(a.styleSheet)a.styleSheet.cssText=d();else{for(b=window.document.createTextNode(d());a.hasChildNodes();)a.removeChild(a.lastChild);a.appendChild(b)}Recite.Event.publish("Style:updated",{origin:"Recite.Style"})}Recite.Event.subscribe("Preferences:load",
function(){a()});Recite.Event.subscribe("Preferences:set",function(){a()});Recite.Event.subscribe("Preferences:reset",function(){a()});Recite.Event.subscribe("Recite:enable",function(){var a=Recite.Sizzle("body > *",document),b=Recite.Sizzle("body",document)[0];Recite.Debug.log("Recite.Style","Wrapping body elements in a recite-wrapper.");var d=document.createElement("div");d.id="recite-wrapper";Recite.Util.each(a,function(a,b){"true"!==b.getAttribute("data-recite-skipwrap")&&(b.parentNode.removeChild(b),
d.appendChild(b))});b.appendChild(d)});return{update:a}}();Recite.namespace("Ruler");
Recite.Ruler=function(){function d(){Recite.Preferences.get("style.ruler.enabled")?Recite.Ruler.enable():Recite.Ruler.disable()}function a(a){var b=Recite.Sizzle("#recite-ruler",a);if(0==b.length){var c=Recite.Sizzle("body",a)[0],b=a.createElement("div");b.id="recite-ruler";c.appendChild(b)}else b=b[0];return b}function c(c){var d=a(document);switch(b.mode){case "bottom":d.style.bottom=0;d.style.top=c.screenY+b.modes.bottom.yOffset+"px";break;case "top":d.style.top=0;d.style.bottom=c.screenY+b.modes.top.yOffset+
"px";break;case "bar":d.style.bottom="auto",d.style.height=b.modes.bar.height+"px",d.style.top=c.screenY+b.modes.bar.yOffset+"px"}}var b={enabled:!1,mode:"bar",modes:{top:{yOffset:-80},bottom:{yOffset:-80},bar:{yOffset:-80,height:160}}};Recite.Event.subscribe("Preferences:load",d);Recite.Event.subscribe("Preferences:set",d);Recite.Event.subscribe("Preferences:reset",d);return{setOptions:function(a){b=Recite.Util.merge(b,a)},enable:function(){if(!b.enabled){Recite.Debug.log("Recite.Ruler","Enabled ruler");
Recite.PlayerControls.disable();Recite.Player.stop();var d=Recite.Sizzle("body",document)[0];a(document);Recite.DomEvent.add(d,"mousemove",c);b.enabled=!0;Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Ruler",event:"enable"})}},disable:function(){if(b.enabled){Recite.Debug.log("Recite.Ruler","Disabled ruler");Recite.PlayerControls.enable();var d=Recite.Sizzle("body",document)[0];Recite.DomEvent.remove(d,"mousemove",c);d=a(document);d.parentNode.removeChild(d);b.enabled=!1;Recite.Event.publish("Recite:ModuleEvent",
{name:"Recite.Ruler",event:"disable"})}}}}();Recite.namespace("Browser");
Recite.Browser=function(){function d(){b=a(j)||"unknown browser";e=c(navigator.userAgent)||c(navigator.appVersion)||"unknown version";h=a(i)||"unknown OS"}function a(a){for(var b=0;b<a.length;b++){var c=a[b].string,d=a[b].prop;f=a[b].versionSearch||a[b].identity;if(c){if(-1!==c.indexOf(a[b].subString))return a[b].subString}else if(d)return a[b].subString}return!1}function c(a){var b=a.indexOf(f);return-1===b?!1:parseFloat(a.substring(b+f.length+1))}var b,e,h,f,j=[{string:navigator.userAgent,subString:"Chrome",
identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,subString:"Opera",identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",
identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Internet Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],i=[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,
subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.userAgent,subString:"Android",identity:"Andriod"},{string:navigator.platform,subString:"Linux",identity:"Linux"},{string:navigator.platform,subString:"Andriod",identity:"Andriod"}];return{getName:function(){d();return b},getVersion:function(){d();return e},getOS:function(){d();return h},getData:function(){d();return{name:b,version:e,OS:h}},isMobile:function(){return"Android"===Recite.Browser.getOS()||"iPhone"===Recite.Browser.getOS()?!0:
!1}}}();Recite.namespace("Selection");
Recite.Selection=function(){function d(){var a="";"undefined"!==typeof window.getSelection?a=window.getSelection().toString():"undefined"!==typeof document.selection&&"Text"===document.selection.type&&(a=document.selection.createRange().text);return a.replace(/^\s+|\s+$/g,"")}var a={playOnSelection:!1};Recite.DomEvent.add(document,"mouseup",function(){var c=d();0<c.length&&(Recite.Event.publish("Selection:textSelection",{method:"selection",text:c}),a.playOnSelection&&Recite.Player.play(c))});return{setOptions:function(c){a=
Recite.Util.merge(a,c)},getOptions:function(){return a},getTextSelection:d}}();Recite.namespace("AudioDownload");
Recite.AudioDownload=function(){var d={enabled:!0},a=null;Recite.Event.subscribe("Selection:textSelection",function(c,b){"selection"===b.method&&d.enabled&&(a=b.text)});return{setOptions:function(a){d=Recite.Util.merge(d,a)},getOptions:function(){return d},getEnabled:function(){return d.enabled},generateDownload:function(c){d.enabled?(c||(c=a),c?(Recite.Player.stop(),Recite.Gui.Notification.show("Your download file is being created.  It will be automatically downloaded once created",{read:!1}),Recite.Player.setPlayer(Recite.Audio.Download),
Recite.PlayerDispatcher.dispatch(c),Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Audio",event:"download"})):Recite.Gui.Notification.show("Please select some text.",{read:!0})):Recite.Gui.Notification.show("MP3 download functionality currently disabled",{read:!0})},init:function(){}}}();Recite.namespace("TextMode");
Recite.TextMode=function(){function d(a,c){Recite.Util.each(a.styleSheets,function(a,b){if(c){if("true"!==(b.ownerNode||b.owningElement).getAttribute("data-recite-skip"))b.prevState=b.disabled,b.disabled=!0}else"undefined"!==typeof b.prevState?(b.disabled=b.prevState,b.prevState=null):b.disabled=!1})}var a={disableInlineStyles:!0,disableStylesheets:!0,hideElements:["img","iframe","object","embed"]},c=[];Recite.Event.subscribe("Preferences:load",function(){if(Recite.Preferences.get("textMode.enabled")){var a=
Recite.Sizzle("#recite-wrapper")[0];Recite.TextMode.transform(a)}});Recite.Event.subscribe("Preferences:set",function(){var a=Recite.Preferences.get("textMode.enabled"),c=Recite.Sizzle("#recite-wrapper")[0];a?Recite.TextMode.transform(c):Recite.TextMode.restore(c)});Recite.Event.subscribe("Preferences:reset",function(){var a=Recite.Preferences.get("textMode.enabled"),c=Recite.Sizzle("#recite-wrapper")[0];!0===a?Recite.TextMode.transform(c):Recite.TextMode.restore(c)});return{setOptions:function(b){a=
Recite.Util.merge(a,b)},transform:function(b){if(!(0<=Recite.Util.inArray(b,c))){c.push(b);var e=b.ownerDocument;a.disableStylesheets&&d(e,!0);e=Recite.Sizzle("*",b);a.disableInlineStyles&&Recite.Util.each(e,function(a,b){null!==b.getAttribute("style")&&(b.setAttribute("data-recite-restore-style",b.getAttribute("style")),b.setAttribute("style",null))});Recite.Util.each(a.hideElements,function(a,c){var d=Recite.Sizzle(c,b);Recite.Util.each(d,function(a,b){b.setAttribute("data-recite-restore-display",
Recite.Dom.getStyle(b,"display"));b.style.display="none"})});Recite.Event.publish("TextMode:enabled");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.TextMode",event:"enable"})}},restore:function(b){var e=Recite.Util.inArray(b,c);if(!(0>e)){var h=b.ownerDocument;a.disableStylesheets&&d(h,!1);h=Recite.Sizzle("*",b);a.disableInlineStyles&&Recite.Util.each(h,function(a,b){null!==b.getAttribute("data-recite-restore-style")&&(b.setAttribute("style",b.getAttribute("data-recite-restore-style")),
b.setAttribute("data-recite-restore-style",null))});Recite.Util.each(a.hideElements,function(a,c){var d=Recite.Sizzle(c,b);Recite.Util.each(d,function(a,b){null!==b.getAttribute("data-recite-restore-display")&&(b.style.display=b.getAttribute("data-recite-restore-display"),b.setAttribute("data-recite-restore-display",null))})});c.splice(e,1);Recite.Event.publish("TextMode:disabled");Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.TextMode",event:"disable"})}}}}();Recite.namespace("Recite.Dictionary");
Recite.Dictionary=function(){function d(){Recite.Preferences.get("dictionary.enabled")?Recite.Dictionary.enable():Recite.Dictionary.disable()}function a(a){Recite.Sizzle("#recite-dictionary-inner-words",document)[0].innerHTML=a?a:"<strong>Recite Dictionary</strong> <br /> Select one or more words to get definition";Recite.DomEvent.add(Recite.Sizzle(".recite-dictionary-synonym"),"click",function(a){b({text:a.target.innerHTML})})}function c(a,c){if("selection"===c.method){if(!f||""===c.text||!1===c.text||
c.text===j)return!1;b(c);j=c.text}return!0}function b(b){a("Getting definition...");b=b.text.replace(/ /g,",");Recite.Debug.log("Recite.Dictionary","Start ajax");Recite.Api.call("dictionary","POST",{data:{words:escape(b)},contentType:"application/json",success:function(b){a("");var c="";Recite.Util.each(b,function(a,b){c+="<strong>"+unescape(b.word)+"</strong><br />"+unescape(b.definition)+"<br /><br />";b.synonyms&&(c+="<strong>Synonyms</strong><br />",Recite.Util.each(b.synonyms,function(a,b){c+=
"<span class='recite-dictionary-synonym'>"+unescape(b)+"</span>,<br />"}),c+="<hr />")});a(c)}})}var e={offsets:{height:140},position:"top-left",dimensions:{width:"250px",height:"400px"},content:'<div id="recite-dictionary-inner">                        <div id="recite-dictionary-inner-words">                        </div>                  </div>                  <div id="recite-dictionary-inner-reveal">                  </div>'},h=null,f=!1,j=null;Recite.Event.subscribe("Recite.disable",function(){Recite.Dictionary.disable()});
Recite.Event.subscribe("Preferences:load",d);Recite.Event.subscribe("Preferences:set",d);Recite.Event.subscribe("Preferences:reset",d);return{enable:function(){if(!f){var b=document.createElement("div");b.id="recite-dictionary";b.setAttribute("data-recite-skip","true");b.innerHTML=e.content;document.body.appendChild(b);b.className="recite-dictionary-"+e.position;"header"!==e.position&&(b.style.width=e.dimensions.width,b.style.height=e.dimensions.height);(function(){Recite.Sizzle("#recite-dictionary",
document)[0].style.display="block";Recite.DomEvent.add(Recite.Sizzle("#recite-dictionary-inner-reveal",document)[0],"click",function(){if(""===Recite.Sizzle("#recite-dictionary-inner",document)[0].style.height){var a=Recite.Sizzle("#recite-dictionary-inner",document)[0],b=Recite.Dom.getWindowDimensions(window).height-e.offsets.height;a.style.height=b+"px";a.style.overflow="auto";Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"enable"})}else a=Recite.Sizzle("#recite-dictionary-inner",
document)[0],a.style.height="",a.style.overflow="hidden",Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Dictionary",event:"disable"})});a()}).call();h=Recite.Event.subscribe("Selection:textSelection",c);f=!0;Recite.PlayerControls.disable();Recite.Player.stop();Recite.Debug.log("Recite.Dictionary","Dictionary enabled");Recite.Gui.Notification.show("Recite dictionary enabled.  Select any word on the page to view it's definition");Recite.Event.publish("Recite.Dictionary.enabled")}},disable:function(){f&&
(Recite.Sizzle("#recite-dictionary",document)[0].style.display="none",Recite.Event.unsubscribe(h),f=!1,Recite.PlayerControls.enable(),Recite.Gui.Notification.show("Dictionary disabled"),Recite.Event.publish("Recite.Dictionary.disabled"))},isEnabled:function(){return f},setOptions:function(a){e=Recite.Util.merge(e,a)}}}();Recite.namespace("Docreader");
Recite.Docreader=function(){function d(b){b.setAttribute("href",e.endpoint+encodeURI(a(b.getAttribute("href"))))}function a(a){var b=document.createElement("span");b.innerHTML='<a href="'+a.split("&").join("&amp;").split('"').join("&quot;").split("<").join("&lt;")+'">&nbsp;</a>';return b.firstChild.href}var c=[],b=["pdf"],e={enabled:!0,selector:"docreader",urlMatches:[],endpoint:"http://docreader.reciteme.com/doc/url?q="};return{setOptions:function(a){e=Recite.Util.merge(e,a)},enabled:function(){return e.enabled},setEnabled:function(a){e.enabled=
a},load:function(){if(e.enabled){c=document.getElementsByTagName("a");for(var a=0;a<c.length;a++){var f=c[a];if(null!==f.getAttribute("href")){for(var j=f,i=0;i<e.urlMatches.length;i++)null!==j.getAttribute("href").match(e.urlMatches[i])&&d(j);for(var j=f,i=j.getAttribute("href").split(".").pop(),g=0;g<b.length;g++)i===b[g]&&d(j);(f.className===e.selector||f.getAttribute("id")===e.selector)&&d(f)}}}}}}();Recite.namespace("Keyboard");
Recite.Keyboard=function(){function d(){Recite.Debug.log("Recite.Keyboard","Binding keyboard keys");a.enabled&&Recite.Util.each(a.key_bindings,function(a,b){Recite.Key(a,b)})}var a={enabled:!0,key_bindings:{"ctrl+right":function(){Recite.PlayerControls.next();return!1},"ctrl+left":function(){Recite.PlayerControls.previous();return!1},"ctrl+alt+p":function(){Recite.PlayerControls.play();return!1},"ctrl+alt+f":function(){Recite.Sizzle(".recite-sprite-button-font")[0].click();return!1},"ctrl+alt+c":function(){Recite.Sizzle(".recite-sprite-button-themes")[0].click();
return!1},"ctrl+r":function(){Recite.Sizzle(".recite-sprite-button-ruler")[0].click();return!1},"ctrl+d":function(){Recite.Sizzle(".recite-sprite-button-dictionary")[0].click();return!1},"ctrl+l":function(){Recite.Sizzle(".recite-sprite-button-translate")[0].click();return!1},"ctrl+x":function(){Recite.Sizzle(".recite-sprite-button-textmode")[0].click();return!1},"ctrl+m":function(){Recite.Sizzle(".recite-sprite-button-margin")[0].click();return!1},"ctrl+shift+o":function(){Recite.Sizzle(".recite-sprite-button-settings")[0].click();
return!1},"ctrl+s":function(){Recite.Sizzle(".recite-sprite-button-save")[0].click();return!1}}};Recite.Event.subscribe("Recite:enable",d);return{setOptions:function(c){a=Recite.Util.merge(a,c)},enabled:function(){return a.enabled},setEnabled:function(c){a.enabled=c},load:function(){d()}}}();Recite.namespace("Tracker");
Recite.Tracker=function(){var d={enabled:!0};return{setOptions:function(a){d=Recite.Util.merge(d,a)},track:function(a,c){d.enabled&&(c=c||{},c.type=a,c.uri=window.location.toString(),c.referrer=window.document.referrer||null,Recite.Api.call("tracker","POST",{data:c,success:function(){Recite.Debug.log("Recite.Tracker","Tracked event type: "+a)}}))}}}();Recite.namespace("Language.Translate");
Recite.Language.Translate=function(){function d(){var a=Recite.Preferences.get("language");null!==a?Recite.Language.Translate.translate(document,a):Recite.Language.Translate.restore()}var a=[],c=[];Text.prototype.originalContent=null;Text.prototype.originalLang=null;Text.prototype.originalParentLang=null;var b={sourceLanguage:"en",maxChunkSize:100,maxCharacterLimit:3E3,disallowedTags:["SCRIPT","STYLE"],translateableAttributes:[]};Recite.Event.subscribe("Preferences:load",d);Recite.Event.subscribe("Preferences:reset",
d);return{setOptions:function(a){b=Recite.Util.merge(b,a)},translate:function(d,h){if(h===b.sourceLanguage)Recite.Language.Translate.restore();else{var d=Recite.Util.isArray(d)?d:[d],f={};Recite.Util.each(d,function(a,c){for(var d=c.childNodes[0];null!==d;){if(3===d.nodeType&&0<d.nodeValue.trim().length){if("undefined"===typeof d.originalContent||null===d.originalContent)d.originalContent=d.nodeValue,d.originalLang=null!==Recite.Dom.getLanguage(d)?Recite.Dom.getLanguage(d):b.sourceLanguage,d.originalParentLang=
d.parentNode.lang;if(d.originalLang===h||d.originalLang.split("-")[0]===h)d.nodeValue=d.originalContent,d.parentNode.lang=d.originalParentLang||null;else{var e=d.originalLang.split("-")[0];"undefined"===typeof f[e]&&(f[e]=[]);f[e].push(d)}}if(d.hasChildNodes()&&0>Recite.Util.inArray(d.tagName,b.disallowedTags))d=d.firstChild;else{for(;null===d.nextSibling&&d!==c;)d=d.parentNode;d=d===c?null:d.nextSibling}}});var j={};0!==b.translateableAttributes.length&&Recite.Util.each(d,function(a,c){for(var d=
c.childNodes[0];null!==d;){d.affectedAttributes=[];var e=!1;if("undefined"!==typeof d.attributes&&null!==d.attributes){for(var f=0;f<b.translateableAttributes.length;f++)for(a=0;a<d.attributes.length;a++)if(d.attributes[a].nodeName===b.translateableAttributes[f]){d.affectedAttributes.push(d.attributes[a].nodeName);"undefined"===typeof d.originalContent&&(d.originalContent=[]);if("undefined"===typeof d.originalContent[b.translateableAttributes[f]]||null===d.originalContent[b.translateableAttributes[f]])d.originalContent[b.translateableAttributes[f]]=
d.getAttribute(b.translateableAttributes[f]),d.originalLang=null!==Recite.Dom.getLanguage(d)?Recite.Dom.getLanguage(d):b.sourceLanguage,d.originalParentLang=d.parentNode.lang;if(d.originalLang===h||d.originalLang.split("-")[0]===h)d.setAttribute(d.attributes[a].nodeName,d.originalContent[b.translateableAttributes[f]]),d.parentNode.lang=d.originalParentLang||null,e=!0}!e&&"undefined"!==typeof d.originalLang&&(e=d.originalLang.split("-")[0],"undefined"===typeof j[e]&&(j[e]=[]),j[e].push(d))}if(d.hasChildNodes()&&
0>Recite.Util.inArray(d.tagName,b.disallowedTags))d=d.firstChild;else{for(;null===d.nextSibling&&d!==c;)d=d.parentNode;d=d===c?null:d.nextSibling}}});for(var i in j){var g=[];Recite.Util.each(j[i],function(a,b){for(var c=0;c<b.affectedAttributes.length;c++)g.push(b.originalContent[b.affectedAttributes[c]])});var p={target:h,source:i,text:g};Recite.Api.call("translate","POST",{data:p,contentType:"application/json",success:function(a){for(var b in j)Recite.Util.each(j[b],function(b,d){for(var e=0;e<
d.affectedAttributes.length;e++)d.setAttribute(d.affectedAttributes[e],a[0]),a.shift();c.push(d)})}})}for(i in f){var m=[],n=0,k=[];Recite.Util.each(f[i],function(a,c){if(null!==b.maxChunkSize&&k.length>=b.maxChunkSize||null!==b.maxCharacterLimit&&n>=b.maxCharacters)m.push(k),k=[],n=0;k.push(c.originalContent);n+=c.originalContent.length});m.push(k);Recite.Util.each(m,function(c,d){var e=i;p={target:h,source:e,text:d};Recite.Api.call("translate","POST",{data:p,contentType:"application/json",success:function(d){Recite.Util.each(d,
function(d,g){var i=f[e][c*b.maxChunkSize+d];3===i.nodeType?(i.nodeValue=g,i.parentNode.lang=h):(i.innerHTML=g,i.lang=h);a.push(i)})}})})}Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Language",event:"translate:"+h})}},restore:function(){Recite.Debug.log("Language","Restoring source language");Recite.Util.each(a,function(a,c){c.nodeValue=c.originalContent;c.parentNode.lang=null!==c.originalParentLang?c.originalParentLang:b.sourceLanguage});Recite.Util.each(c,function(a,c){for(a=0;a<c.attributes.length;a++)for(var d=
0;d<b.translateableAttributes.length;d++)b.translateableAttributes[d]===c.attributes[a].nodeName&&(c.setAttribute(c.attributes[a].nodeName,c.originalContent[c.attributes[a].nodeName]),c.lang=null!==c.originalLang?c.originalLang:b.sourceLanguage)});a=[];c=[]}}}();Recite.namespace("Gui.Notification");
Recite.Gui.Notification=function(){function d(a){try{document.body.removeChild(a),c.splice(c.indexOf(a.id),1)}catch(b){}}var a={position:"top-right",timeout:4E3,read:!0,elementTopMgn:5,surpress:!1},c=[],b=0;return{show:function(e,h){if(!a.surpress&&!Recite.Browser.isMobile()){Recite.Gui.Notification.setOptions(h);var f=document.createElement("div");f.innerHTML=e;f.id=b;f.content=e;b++;var j=!1;Recite.Util.each(c,function(a,b){b.content==f.content&&(j=!0)});j||(c.push(f),document.body.appendChild(f));
f.className="recite-notification recite-notification-"+a.position;var i=Recite.Sizzle(".recite-notification");1<i.length&&(i=i[i.length-2],i=parseInt(i.offsetTop+i.offsetHeight+a.elementTopMgn,10),f.style.top=i+"px");f.style.display="block";a.timeout&&setTimeout(function(){d(f)},a.timeout);if(a.read)try{Recite.Player.play(f.innerHTML)}catch(g){}Recite.DomEvent.add(f,"click",function(){d(f)})}},destroy:function(a){d(a)},setOptions:function(b){a=Recite.Util.merge(a,b)}}}();
