if("undefined"===typeof Recite||!Recite)var Recite={};
Recite=function(){function c(b,d){"undefined"===typeof d&&(d=Recite);Recite.Util.each(b,function(b,e){var a=d[b];"undefined"!==typeof a&&(a.setOptions?a.setOptions(e):c(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);c(e);d=e;a=Recite.Sizzle(d.enableButton);Recite.Event.publish("Recite:load");e=Recite.Storage.Cookie.load("Recite.Persist");null!==d.enableFragment&&window.location.hash===d.enableFragment&&(d.autoEnable=!0);(d.autoEnable||d.persist&&!0===e)&&Recite.enable();null!==
d.enableButton&&Recite.DomEvent.add(a,"click",function(){d.enableButtonToggle?b?Recite.disable():Recite.enable():Recite.enable()});!1!==d.trackModuleEvents&&Recite.Event.subscribe("Recite:ModuleEvent",function(b,d){Recite.Tracker.track(d.name+":"+d.event)})}var b=!1,d={};return{namespace:function(){var b=arguments,d=null,a,c,i;for(a=0;a<b.length;a+=1){i=(""+b[a]).split(".");d=Recite;for(c="Recite"===i[0]?1:0;c<i.length;c+=1)d[i[c]]=d[i[c]]||{},d=d[i[c]]}return d},load:function(b){"complete"===document.readyState||
"interactive"===document.readyState?a(b):Recite.DomEvent.add(window,"load",function(){a(b)})},enable:function(){if(b)Recite.Debug.log("Recite","Already enabled, not re-enabling.");else{d.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(d.enableButtonToggle){var a=
Recite.Sizzle(d.buttonDeactivateContentElement);Recite.Util.each(a,function(b,a){a.innerHTML=d.buttonDeactivateContent})}Recite.AssetLoader.css(d.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!==d.defaultLanguage&&null===Recite.Preferences.get("language")&&Recite.Preferences.set("language",d.defaultLanguage)});"tooltip"===
d.selectionMethod?window.setTimeout(function(){if(null!==d.rootNode){var b=d.parser.parse(d.rootNode);Recite.PlayerControls.invoke(b);d.observeDom&&Recite.Dom.Observer.observe(d.rootNode)}},0):"highlight"===d.selectionMethod&&(d.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});
b=!0}},disable:function(){Recite.Storage.Cookie.clear("Recite.Persist");Recite.Event.publish("Recite:disable");window.location.reload()},getOptions:function(b){if("undefined"===typeof b)return d;var a,c,b=b.split(".");a=d;for(c=0;c<b.length;c++)if(a=a[b[c]],"undefined"===typeof a)return null;return a},version:"3.1.12",baseUrl:"http://api.reciteme.com"}}();null!==null&&null();Recite.namespace("Recite.Util");
Recite.Util=function(){var c=[],a=Object.prototype.toString;c["[object Boolean]"]="boolean";c["[object Number]"]="number";c["[object String]"]="string";c["[object Function]"]="function";c["[object Array]"]="array";c["[object Date]"]="date";c["[object RegExp]"]="regexp";c["[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(b){return"function"===Recite.Util.type(b)},isArray:Array.isArray||function(b){return"array"===Recite.Util.type(b)},isWindow:function(b){return b&&"object"===typeof b&&"setInterval"in b},isNumeric:function(b){return!isNaN(parseFloat(b))&&isFinite(b)},type:function(b){return null==b?String(b):c[a.call(b)]||"object"},clone:function(b){return JSON.parse(JSON.stringify(b))},
guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var d=16*Math.random()|0;return("x"==b?d:d&3|8).toString(16)})},each:function(b,d,a){var c,f=0,j=b.length,i=void 0===j;if(a)if(i)for(c in b){if(!1===d.apply(b[c],a))break}else for(;f<j&&!1!==d.apply(b[f++],a););else if(i)for(c in b){if(!1===d.call(b[c],c,b[c]))break}else for(;f<j&&!1!==d.call(b[f],f,b[f++]););return b},merge:function(b,d){for(var a in d)try{b[a]=d[a].constructor===Object?MergeRecursive(b[a],d[a]):
d[a]}catch(c){b[a]=d[a]}return b},inArray:function(b,d,a){var c;if(d){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(d,b,a);c=d.length;for(a=a?0>a?Math.max(0,c+a):a:0;a<c;a++)if(a in d&&d[a]===b)return a}return-1},getWindowLocationOrigin:function(b){return b.location.origin||b.location.protocol+"//"+b.location.host},buildQueryString:function(b){var d="";Recite.Util.each(b,function(b,a){d+="&"+b+"="+encodeURIComponent(a)});return d="?"+d.substring(1)}}}();Recite.namespace("Event");
Recite.Event=function(){var c={},a=-1;return{publish:function(b,d){if(!c[b])return!1;setTimeout(function(){for(var a=c[b],g=a?a.length:0;g--;)a[g].func(b,d)},0);return!0},subscribe:function(b,d){c[b]||(c[b]=[]);var e=(++a).toString();c[b].push({token:e,func:d});return e},unsubscribe:function(b){for(var a in c)if(c[a])for(var e=0,g=c[a].length;e<g;e++)if(c[a][e].token===b)return c[a].splice(e,1),b;return!1}}}();Recite.namespace("Debug");
Recite.Debug=function(){var c={log:!1};return{setOptions:function(a){c=Recite.Util.merge(c,a)},log:function(a){c.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(c,a,b){c=Recite.Util.isArray(c)?c:[c];Recite.Util.each(c,function(d,c){c.addEventListener?c.addEventListener(a,b,!1):c.attachEvent&&(c["e"+a+b]=b,c[a+b]=function(){var d=window.event;d.target=d.target||d.srcElement;c["e"+a+b](d)},c.attachEvent("on"+a,c[a+b]))})},remove:function(c,a,b){c=Recite.Util.isArray(c)?c:[c];Recite.Util.each(c,function(d,c){c.removeEventListener?c.removeEventListener(a,b,!1):c.detachEvent&&"undefined"!==typeof c[a+b]&&(c.detachEvent("on"+
a,c[a+b]),c[a+b]=null,c["e"+a+b]=null)})}}}();Recite.namespace("XDM");
Recite.XDM=function(){var c,a,b=1,d;return{postMessage:function(a,d,c){d&&(c=c||parent,window.postMessage?c.postMessage(a,d.replace(/([^:]+:\/\/[^\/]+).*/,"$1")):d&&(c.location=d.replace(/#.*$/,"")+"#"+ +new Date+b++ +"&"+a))},receiveMessage:function(b,g){window.postMessage?(b&&(d=function(a){if("string"===typeof g&&a.origin!==g||"[object Function]"===Object.prototype.toString.call(g)&&!1===g(a.origin))return!1;b(a)}),Recite.DomEvent.add(window,"message",d)):(c&&clearInterval(c),c=null,b&&(c=setInterval(function(){var d=
document.location.hash,c=/^#?\d+&/;d!==a&&c.test(d)&&(a=d,b({data:d.replace(c,"")}))},100)))}}}();
(function(){function c(b,a,c,e,f,g){for(var f=0,h=e.length;f<h;f++){var l=e[f];if(l){for(var i=!1,l=l[b];l;){if(l[d]===c){i=e[l.sizset];break}1===l.nodeType&&!g&&(l[d]=c,l.sizset=f);if(l.nodeName.toLowerCase()===a){i=l;break}l=l[b]}e[f]=i}}}function a(b,a,c,e,f,g){for(var f=0,l=e.length;f<l;f++){var h=e[f];if(h){for(var i=!1,h=h[b];h;){if(h[d]===c){i=e[h.sizset];break}if(1===h.nodeType)if(g||(h[d]=c,h.sizset=f),"string"!==typeof a){if(h===a){i=!0;break}}else if(0<m.filter(a,[h]).length){i=h;break}h=
h[b]}e[f]=i}}}var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,f=!1,j=!0,i=/\\/g,h=/\r\n/g,p=/\W/;[0,0].sort(function(){j=!1;return 0});var m=function(a,d,c,e){var c=c||[],f=d=d||document;if(1!==d.nodeType&&9!==d.nodeType)return[];if(!a||"string"!==typeof a)return c;var h,i,q,j,r,p=!0,H=m.isXML(d),n=[],w=a;do if(b.exec(""),h=b.exec(w))if(w=
h[3],n.push(h[1]),h[2]){j=h[3];break}while(h);if(1<n.length&&t.exec(a))if(2===n.length&&k.relative[n[0]])i=K(n[0]+n[1],d,e);else for(i=k.relative[n[0]]?[d]:m(n.shift(),d);n.length;)a=n.shift(),k.relative[a]&&(a+=n.shift()),i=K(a,i,e);else if(!e&&(1<n.length&&9===d.nodeType&&!H&&k.match.ID.test(n[0])&&!k.match.ID.test(n[n.length-1]))&&(h=m.find(n.shift(),d,H),d=h.expr?m.filter(h.expr,h.set)[0]:h.set[0]),d){h=e?{expr:n.pop(),set:l(e)}:m.find(n.pop(),1===n.length&&("~"===n[0]||"+"===n[0])&&d.parentNode?
d.parentNode:d,H);i=h.expr?m.filter(h.expr,h.set):h.set;for(0<n.length?q=l(i):p=!1;n.length;)h=r=n.pop(),k.relative[r]?h=n.pop():r="",null==h&&(h=d),k.relative[r](q,h,H)}else q=[];q||(q=i);q||m.error(r||a);if("[object Array]"===g.call(q))if(p)if(d&&1===d.nodeType)for(a=0;null!=q[a];a++)q[a]&&(!0===q[a]||1===q[a].nodeType&&m.contains(d,q[a]))&&c.push(i[a]);else for(a=0;null!=q[a];a++)q[a]&&1===q[a].nodeType&&c.push(i[a]);else c.push.apply(c,q);else l(q,c);j&&(m(j,f,c,e),m.uniqueSort(c));return c};
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,d){var c,e,f,g,h,l;if(!a)return[];e=0;for(f=k.order.length;e<f;e++)if(h=k.order[e],g=k.leftMatch[h].exec(a))if(l=g[1],g.splice(1,1),"\\"!==l.substr(l.length-1)&&(g[1]=(g[1]||"").replace(i,""),c=k.find[h](g,b,d),null!=c)){a=a.replace(k.match[h],"");
break}c||(c="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:c,expr:a}};m.filter=function(a,b,d,c){for(var e,f,g,h,l,i,q,j,r=a,t=[],p=b,n=b&&b[0]&&m.isXML(b[0]);a&&b.length;){for(g in k.filter)if(null!=(e=k.leftMatch[g].exec(a))&&e[2])if(i=k.filter[g],l=e[1],f=!1,e.splice(1,1),"\\"!==l.substr(l.length-1)){p===t&&(t=[]);if(k.preFilter[g])if(e=k.preFilter[g](e,p,d,t,c,n)){if(!0===e)continue}else f=h=!0;if(e)for(q=0;null!=(l=p[q]);q++)l&&(h=i(l,e,q,p),j=c^h,d&&null!=
h?j?f=!0:p[q]=!1:j&&(t.push(l),f=!0));if(void 0!==h){d||(p=t);a=a.replace(k.match[g],"");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,d;b=a.nodeType;var c="";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(h,"");for(a=a.firstChild;a;a=a.nextSibling)c+=n(a)}else{if(3===
b||4===b)return a.nodeValue}else for(b=0;d=a[b];b++)8!==d.nodeType&&(c+=n(d));return c},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 d="string"===typeof b,c=d&&!p.test(b),d=d&&!c;c&&(b=b.toLowerCase());for(var c=0,e=a.length,f;c<e;c++)if(f=a[c]){for(;(f=f.previousSibling)&&1!==f.nodeType;);
a[c]=d||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}d&&m.filter(b,a,!0)},">":function(a,b){var d,c="string"===typeof b,e=0,f=a.length;if(c&&!p.test(b))for(b=b.toLowerCase();e<f;e++){if(d=a[e])d=d.parentNode,a[e]=d.nodeName.toLowerCase()===b?d:!1}else{for(;e<f;e++)(d=a[e])&&(a[e]=c?d.parentNode:d.parentNode===b);c&&m.filter(b,a,!0)}},"":function(b,d,f){var g,h=e++,l=a;"string"===typeof d&&!p.test(d)&&(g=d=d.toLowerCase(),l=c);l("parentNode",d,h,b,g,f)},"~":function(b,d,f){var g,h=e++,l=a;"string"===
typeof d&&!p.test(d)&&(g=d=d.toLowerCase(),l=c);l("previousSibling",d,h,b,g,f)}},find:{ID:function(a,b,d){if("undefined"!==typeof b.getElementById&&!d)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){for(var d=[],c=b.getElementsByName(a[1]),e=0,f=c.length;e<f;e++)c[e].getAttribute("name")===a[1]&&d.push(c[e]);return 0===d.length?null:d}},TAG:function(a,b){if("undefined"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},
preFilter:{CLASS:function(a,b,d,c,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var f=0,g;null!=(g=b[f]);f++)g&&(e^(g.className&&0<=(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?d||c.push(g):d&&(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,d,c,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,d,c,e,f){if("not"===a[1])if(1<(b.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=m(a[3],null,null,d);else return a=m.filter(a[3],d,c,1^f),c||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,d){return!!m(d[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),
d=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===d&&(b===d||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,d,c){return b===c.length-
1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,d){return b<d[3]-0},gt:function(a,b,d){return b>d[3]-0},nth:function(a,b,d){return d[3]-0===b},eq:function(a,b,d){return d[3]-0===b}},filter:{PSEUDO:function(a,b,d,c){var e=b[1],f=k.filters[e];if(f)return f(a,d,b,c);if("contains"===e)return 0<=(a.textContent||a.innerText||n([a])||"").indexOf(b[3]);if("not"===e){b=b[3];d=0;for(c=b.length;d<c;d++)if(b[d]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,
e,f,g,h,l;c=b[1];l=a;switch(c){case "only":case "first":for(;l=l.previousSibling;)if(1===l.nodeType)return!1;if("first"===c)return!0;l=a;case "last":for(;l=l.nextSibling;)if(1===l.nodeType)return!1;return!0;case "nth":c=b[2];e=b[3];if(1===c&&0===e)return!0;f=b[0];if((g=a.parentNode)&&(g[d]!==f||!a.nodeIndex)){h=0;for(l=g.firstChild;l;l=l.nextSibling)1===l.nodeType&&(l.nodeIndex=++h);g[d]=f}l=a.nodeIndex-e;return 0===c?0===l:0===l%c&&0<=l/c}},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 d=b[1],d=m.attr?m.attr(a,d):k.attrHandle[d]?k.attrHandle[d](a):null!=a[d]?a[d]:a.getAttribute(d),c=d+"",e=b[2],f=b[4];return null==d?"!="===e:!e&&m.attr?null!=d:"="===e?c===f:"*="===e?0<=c.indexOf(f):"~="===e?0<=(" "+c+" ").indexOf(f):!f?c&&!1!==d:"!="===e?c!==f:"^="===e?0===c.indexOf(f):"$="===
e?c.substr(c.length-f.length)===f:"|="===e?c===f||c.substr(0,f.length+1)===f+"-":!1},POS:function(a,b,d,c){var e=k.setFilters[b[2]];if(e)return e(a,d,b,c)}}},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 d=0,c=b||[];if("[object Array]"===g.call(a))Array.prototype.push.apply(c,a);else if("number"===typeof a.length)for(var e=a.length;d<e;d++)c.push(a[d]);else for(;a[d];d++)c.push(a[d]);return c}}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 d,c,e=[],g=[];d=a.parentNode;c=b.parentNode;var h=d;if(d===c)return u(a,b);if(d){if(!c)return 1}else return-1;for(;h;)e.unshift(h),h=h.parentNode;for(h=c;h;)g.unshift(h),h=h.parentNode;d=e.length;c=g.length;for(h=0;h<d&&h<c;h++)if(e[h]!==g[h])return u(e[h],g[h]);return h===d?u(a,g[h],-1):u(e[h],b,1)},u=function(a,b,d){if(a===b)return d;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,d){if("undefined"!==typeof b.getElementById&&!d)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 d="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&d&&d.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 d=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var c=[],e=0;d[e];e++)1===d[e].nodeType&&c.push(d[e]);d=c}return d});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,d,c){b=b||document;if(!c&&!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),d);if(e[2]&&k.find.CLASS&&b.getElementsByClassName)return l(b.getElementsByClassName(e[2]),d)}if(9===b.nodeType){if("body"===a&&b.body)return l([b.body],d);if(e&&e[3]){var f=
b.getElementById(e[3]);if(f&&f.parentNode){if(f.id===e[3])return l([f],d)}else return l([],d)}try{return l(b.querySelectorAll(a),d)}catch(g){}}else if(1===b.nodeType&&"object"!==b.nodeName.toLowerCase()){var e=b,h=(f=b.getAttribute("id"))||"__sizzle__",i=b.parentNode,q=/^\s*[+~]/.test(a);f?h=h.replace(/'/g,"\\$&"):b.setAttribute("id",h);q&&i&&(b=b.parentNode);try{if(!q||i)return l(b.querySelectorAll("[id='"+h+"'] "+a),d)}catch(j){}finally{f||e.removeAttribute("id")}}}return B(a,b,d,c)},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 d=H.call(a,b);if(d||!L||a.document&&11!==a.document.nodeType)return d}}catch(c){}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,d){if("undefined"!==typeof b.getElementsByClassName&&!d)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,d){for(var c,e=[],f="",b=b.nodeType?[b]:b;c=k.match.PSEUDO.exec(a);)f+=c[0],a=a.replace(k.match.PSEUDO,"");a=k.relative[a]?a+"*":a;c=0;for(var g=b.length;c<g;c++)m(a,b[c],e,d);return m.filter(f,e)};window.Recite.Sizzle=m})();
(function(c){function a(c,r){var w,s,u,y,x,c=c?c:"",r=r||{};if("object"==typeof c&&c.hasOwnProperty("_tc_id"))return c;s=c;x=y=u=0;var A=1,G=w=!1;if("string"==typeof s)a:{s=s.replace(h,"").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,d){0>d&&(d+=1);1<d&&(d-=1);return d<1/6?a+6*(b-a)*d:0.5>d?b:d<2/3?a+6*(b-a)*(2/3-d):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=g(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=g(a);J=k(100*F)/100},toHsv:function(){var a=d(C,D,E);return{h:360*a.h,s:a.s,v:a.v,a:F}},toHsvString:function(){var a=
d(C,D,E),b=k(360*a.h),c=k(100*a.s),a=k(100*a.v);return 1==F?"hsv("+b+", "+c+"%, "+a+"%)":"hsva("+b+", "+c+"%, "+a+"%, "+J+")"},toHsl:function(){var a=b(C,D,E);return{h:360*a.h,s:a.s,l:a.l,a:F}},toHslString:function(){var a=b(C,D,E),d=k(360*a.h),c=k(100*a.s),a=k(100*a.l);return 1==F?"hsl("+d+", "+c+"%, "+a+"%)":"hsla("+d+", "+c+"%, "+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 d=e(C,D,E),c=d,f=Math.round(255*
parseFloat(F)).toString(16),g=f,h=r&&r.gradientType?"GradientType = 1, ":"";b&&(b=a(b),c=b.toHex(),g=Math.round(255*parseFloat(b.alpha)).toString(16));return"progid:DXImageTransform.Microsoft.gradient("+h+"startColorstr=#"+j(f)+d+",endColorstr=#"+j(g)+c+")"},toString:function(a){var b=!!a,a=a||this.format,d=!1,b=!b&&(1>F&&0<F)&&("hex"===a||"hex6"===a||"hex3"===a||"name"===a);"rgb"===a&&(d=this.toRgbString());"prgb"===a&&(d=this.toPercentageRgbString());if("hex"===a||"hex6"===a)d=this.toHexString();
"hex3"===a&&(d=this.toHexString(!0));"name"===a&&(d=this.toName());"hsl"===a&&(d=this.toHslString());"hsv"===a&&(d=this.toHsvString());return b?this.toRgbString():d||this.toHexString()}}}function b(a,b,d){var a=f(a,255),b=f(b,255),d=f(d,255),c=q(a,b,d),e=t(a,b,d),g,h=(c+e)/2;if(c==e)g=e=0;else{var l=c-e,e=0.5<h?l/(2-c-e):l/(c+e);switch(c){case a:g=(b-d)/l+(b<d?6:0);break;case b:g=(d-a)/l+2;break;case d:g=(a-b)/l+4}g/=6}return{h:g,s:e,l:h}}function d(a,b,d){var a=f(a,255),b=f(b,255),d=f(d,255),c=q(a,
b,d),e=t(a,b,d),g,h=c-e;if(c==e)g=0;else{switch(c){case a:g=(b-d)/h+(b<d?6:0);break;case b:g=(d-a)/h+2;break;case d:g=(a-b)/h+4}g/=6}return{h:g,s:0===c?0:h/c,v:c}}function e(a,b,d,c){a=[j(k(a).toString(16)),j(k(b).toString(16)),j(k(d).toString(16))];return c&&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 g(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 d="string"===typeof a&&-1!=a.indexOf("%"),a=t(b,q(0,parseFloat(a)));d&&(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 h=/^[\s,#]+/,p=/\s+$/,m=0,n=Math,k=n.round,t=n.min,q=n.max,r=n.random;a.fromRatio=function(b,d){if("object"==typeof b){var c={},e;for(e in b)b.hasOwnProperty(e)&&(c[e]="a"===e?b[e]:i(b[e]));b=c}return a(b,
d)};a.equals=function(b,d){return!b||!d?!1:a(b).toRgbString()==a(d).toRgbString()};a.random=function(){return a.fromRatio({r:r(),g:r(),b:r()})};a.desaturate=function(b,d){var d=0===d?0:d||10,c=a(b).toHsl();c.s-=d/100;c.s=t(1,q(0,c.s));return a(c)};a.saturate=function(b,d){var d=0===d?0:d||10,c=a(b).toHsl();c.s+=d/100;c.s=t(1,q(0,c.s));return a(c)};a.greyscale=function(b){return a.desaturate(b,100)};a.lighten=function(b,d){var d=0===d?0:d||10,c=a(b).toHsl();c.l+=d/100;c.l=t(1,q(0,c.l));return a(c)};
a.darken=function(b,d){var d=0===d?0:d||10,c=a(b).toHsl();c.l-=d/100;c.l=t(1,q(0,c.l));return a(c)};a.complement=function(b){b=a(b).toHsl();b.h=(b.h+180)%360;return a(b)};a.triad=function(b){var d=a(b).toHsl(),c=d.h;return[a(b),a({h:(c+120)%360,s:d.s,l:d.l}),a({h:(c+240)%360,s:d.s,l:d.l})]};a.tetrad=function(b){var d=a(b).toHsl(),c=d.h;return[a(b),a({h:(c+90)%360,s:d.s,l:d.l}),a({h:(c+180)%360,s:d.s,l:d.l}),a({h:(c+270)%360,s:d.s,l:d.l})]};a.splitcomplement=function(b){var d=a(b).toHsl(),c=d.h;return[a(b),
a({h:(c+72)%360,s:d.s,l:d.l}),a({h:(c+216)%360,s:d.s,l:d.l})]};a.analogous=function(b,d,c){var d=d||6,c=c||30,e=a(b).toHsl(),c=360/c,b=[a(b)];for(e.h=(e.h-(c*d>>1)+720)%360;--d;)e.h=(e.h+c)%360,b.push(a(e));return b};a.monochromatic=function(b,d){for(var d=d||6,c=a(b).toHsv(),e=c.h,f=c.s,c=c.v,g=[],h=1/d;d--;)g.push(a({h:e,s:f,v:c})),c=(c+h)%1;return g};a.readability=function(b,d){var c=a(b).toRgb(),e=a(d).toRgb(),f=(299*c.r+587*c.g+114*c.b)/1E3,g=(299*e.r+587*e.g+114*e.b)/1E3,c=Math.max(c.r,e.r)-
Math.min(c.r,e.r)+Math.max(c.g,e.g)-Math.min(c.g,e.g)+Math.max(c.b,e.b)-Math.min(c.b,e.b);return{brightness:Math.abs(f-g),color:c}};a.readable=function(b,d){var c=a.readability(b,d);return 125<c.brightness&&500<c.color};a.mostReadable=function(b,d){for(var c=null,e=0,f=!1,g=0;g<d.length;g++){var h=a.readability(b,d[g]),l=125<h.brightness&&500<h.color,h=3*(h.brightness/125)+h.color/500;if(l&&!f||l&&f&&h>e||!l&&!f&&h>e)f=l,e=h,c=a(d[g])}return c};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}):c.Tinycolor=a})(Recite);
(function(c){function a(a,b){for(var d=a.length;d--;)if(a[d]===b)return d;return-1}function b(b){var c,f,g,j,r,k;c=b.keyCode;-1==a(t,c)&&t.push(c);if(93==c||224==c)c=91;if(c in p)for(g in p[c]=!0,n)n[g]==c&&(d[g]=!0);else{for(i in p)p[i]=b[q[i]];if(d.filter.call(this,b)&&c in h){k=e();for(j=0;j<h[c].length;j++)if(f=h[c][j],f.scope==k||"all"==f.scope){r=0<f.mods.length;for(g in p)if(!p[g]&&-1<a(f.mods,+g)||p[g]&&-1==a(f.mods,+g))r=!1;if((0==f.mods.length&&!p[16]&&!p[18]&&!p[17]&&!p[91]||r)&&!1===f.method(b,
f))b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),b.cancelBubble&&(b.cancelBubble=!0)}}}}function d(a,b,d){var c,e;c=g(a);void 0===d&&(d=b,b="all");for(var i=0;i<c.length;i++)e=[],a=c[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 h||(h[a]=[]),h[a].push({shortcut:c[i],scope:b,method:d,key:c[i],mods:e})}function e(){return m||"all"}function g(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,d){a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent&&a.attachEvent("on"+b,function(){d(window.event)})}var i,h={},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)d[i]=!1;j(document,"keydown",function(a){b(a)});j(document,"keyup",function(b){var b=b.keyCode,c,e=a(t,b);0<=e&&t.splice(e,1);if(93==b||224==b)b=91;if(b in p)for(c in p[b]=!1,n)n[c]==b&&(d[c]=!1)});j(window,"focus",function(){for(i in p)p[i]=
!1;for(i in n)d[i]=!1});var r=c.key;c.key=d;c.key.setScope=function(a){m=a||"all"};c.key.getScope=e;c.key.deleteScope=function(a){var b,d,c;for(b in h){d=h[b];for(c=0;c<d.length;)d[c].scope===a?d.splice(c,1):c++}};c.key.filter=function(a){a=(a.target||a.srcElement).tagName;return!("INPUT"==a||"SELECT"==a||"TEXTAREA"==a)};c.key.isPressed=function(b){"string"==typeof b&&(b=k[b]||b.toUpperCase().charCodeAt(0));return-1!=a(t,b)};c.key.getPressedKeyCodes=function(){return t.slice(0)};c.key.noConflict=
function(){var a=c.key;c.key=r;return a};c.key.unbind=function(a,b){var d,c,i=[],q,j;d=g(a);for(j=0;j<d.length;j++){c=d[j].split("+");1<c.length&&(i=f(c),a=c[c.length-1]);a=k[a]||a.toUpperCase().charCodeAt(0);void 0===b&&(b=e());if(!h[a])break;for(q in h[a]){c=h[a][q];var r;if(r=c.scope===b)a:if(c=c.mods,c.length!=i.length)r=!1;else{for(r=0;r<c.length;r++)if(c[r]!==i[r]){r=!1;break a}r=!0}r&&(h[a][q]={})}}};"undefined"!==typeof module&&(module.exports=key);window.Recite.Key=key})(this);
Recite.AssetLoader=function(c){function a(a,b){var d=c.createElement(a),e;for(e in b)b.hasOwnProperty(e)&&d.setAttribute(e,b[e]);d.setAttribute("data-recite-skip","true");return d}function b(a){var b=i[a],c,e;b&&(c=b.callback,e=b.urls,e.shift(),h=0,e.length||(c&&c.call(b.context,b.obj),i[a]=null,p[a].length&&d(a)))}function d(d,h,t,q,r){var l=function(){b(d)},m="css"===d,y=[],u,A,B,z;f||(u=navigator.userAgent,f={async:!0===c.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(h)if(h="string"===typeof h?[h]:h.concat(),m||f.async||f.gecko||f.opera)p[d].push({urls:h,callback:t,obj:q,context:r});else{u=0;for(A=h.length;u<A;++u)p[d].push({urls:[h[u]],callback:u===A-1?t:null,obj:q,context:r})}if(!i[d]&&(z=i[d]=p[d].shift())){j||(j=c.head||c.getElementsByTagName("head")[0]);h=z.urls;u=0;for(A=h.length;u<A;++u)t=h[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,g()):(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 d;try{d=!!a.sheet.cssRules}catch(c){h+=1;200>h?setTimeout(function(){e(a)},
50):d&&b("css");return}b("css")}function g(){var a=i.css,d;if(a){for(d=m.length;0<=--d;)if(m[d].href===a.urls[0]){b("css");break}h+=1;a&&(200>h?setTimeout(g,50):b("css"))}}var f,j,i={},h=0,p={css:[],js:[]},m=c.styleSheets;return{css:function(a,b,c,e){d("css",a,b,c,e)},js:function(a,b,c,e){d("js",a,b,c,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 c(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(d){b=a.responseText}return b}function b(b,d){var d=c(d),e=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");"GET"===d.method&&(null!==d.data&&"undefined"!==
typeof d.data)&&(b+=Recite.Util.buildQueryString(d.data));e.open(d.method,b,d.async,d.user,d.password);e.timeout=d.timeout;e.setRequestHeader("Content-Type",d.contentType);e.onreadystatechange=function(){if(4===e.readyState){var b=a(e);200===e.status?d.success(e,b):d.error(e,b)}};null!==d.beforeSend&&d.beforeSend(e);e.send(d.data)}function d(b,d){var c=new flensed.flXHR({autoUpdatePlayer:!1,instanceId:"recite-proxy",xmlResponseText:!1,onreadystatechange:function(b){if(4===b.readyState){var c=a(b);
200===b.status?d.success(b,c):d.error(b,c)}}});c.open(d.method,b);null!==d.beforeSend&&d.beforeSend(c);c.send(d.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,d){Recite.Debug.log("Recite.Ajax","Making AJAX request to: "+a);this.ajax(a,{method:"GET",data:b,success:d})},post:function(a,b,d){this.ajax(a,{method:"POST",data:b,success:d})},
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 b(e,f);if("withCredentials"in(window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP")))b(e,f);else if("undefined"!==typeof window.XDomainRequest){var j=e,i=f,i=c(i),h=new XDomainRequest;"GET"===i.method&&(null!==i.data&&"undefined"!==typeof i.data)&&(j+=
Recite.Util.buildQueryString(i.data));h.onload=function(){var b=a(h);i.success(h,b)};h.onerror=function(){var b=a(h);i.error(h,b)};h.open(i.method,j);h.timeout=i.timeout;null!==i.beforeSend&&i.beforeSend(h);h.send(i.data)}else"undefined"===typeof window.flensed?Recite.AssetLoader.js(Recite.baseUrl+"/js/flxhr/flXHR.js",function(){d(f)}):d(e,f)},nativeXDomainSupported:function(){return"undefined"!==typeof(new XMLHttpRequest).withCredentials||"undefined"!==typeof window.XDomainRequest?!0:!1}}}();Recite.namespace("Api");
Recite.Api=function(){function c(a,c){var g=b.endpoint+a,f=Recite.Util.merge({access_token:c.access_token,v:Recite.version},c.data);return g+Recite.Util.buildQueryString(f)}function a(a,c,g){var f=b.endpoint+a,f=f+Recite.Util.buildQueryString({access_token:g.access_token,v:Recite.version});Recite.Ajax.ajax(f,{method:c,data:g.data,contentType:g.contentType,success:function(a,b){g.success&&g.success(b)},error:function(b,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,c,g);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();g.error&&g.error(i)}}})}var b={endpoint:Recite.baseUrl+"/api/"};return{setOptions:function(a){b=
Recite.Util.merge(b,a)},call:function(b,c,g){g.contentType=g.contentType||"application/x-www-form-urlencoded";"undefined"===typeof g.authRequired&&(g.authRequired=!0);g.authRequired?Recite.Auth.getStatus(function(f){"authorized"===f.state&&(g.access_token=f.access_token,a(b,c,g))}):a(b,c,g)},getUri:function(a,b){"undefined"===typeof b.authRequired&&(b.authRequired=!0);b.authRequired?Recite.Auth.getStatus(function(g){"authorized"===g.state&&(b.access_token=g.access_token,b.success&&b.success(c(a,b)))}):
b.success&&b.success(c(a,b))}}}();Recite.namespace("Recite.Dom");
Recite.Dom=function(){return{getPosition:function(c){var a=0,b=0;if(c.offsetParent){do"BODY"!==c.tagName&&(a+=c.offsetLeft,b+=c.offsetTop);while(c=c.offsetParent)}return{left:a,top:b}},isCurrent:function(c){var a=Recite.Dom.getPosition(c),c=c.currentStyle;return 0!==a.left&&0!==a.top&&0<c.width&&0<c.height?!0:!1},getScroll:function(c){"undefined"===typeof c&&(c=window);var a=c.document,b,d;c.pageYOffset?(d=c.pageYOffset,b=c.pageXOffset):a.documentElement&&a.documentElement.scrollTop?(d=a.documentElement.scrollTop,
b=a.documentElement.scrollLeft):a.body&&(d=a.body.scrollTop,b=a.body.scrollLeft);return{x:b,y:d}},getStyle:function(c,a){var b;c.currentStyle?(a=a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")}),b=c.currentStyle[a]):window.getComputedStyle&&(b=document.defaultView.getComputedStyle(c,null).getPropertyValue(a));return b},getStyles:function(c){var a;c.currentStyle?a=c.currentStyle:window.getComputedStyle&&(a=document.defaultView.getComputedStyle(c,null));return a},getText:function(c,
a){var b="";if("undefined"!==typeof a)return 0===c.childNodes.length&&(b+=a.call(c)),Recite.Util.each(c.childNodes,function(d,c){b+=a.call(c)}),b.trim();b="IMG"===c.tagName?c.getAttribute("alt"):3===c.nodeType?c.data:c.textContent||c.innerText||"";return b.trim()},getAllWindows:function(c,a){a||(a=[]);c||(c=window);0===a.length&&a.push(c);for(var b=c.frames,d=0;d<b.length;d++)try{b[d].document.body,a.push(b[d]),0<b[d].frames.length&&a.concat(a,Recite.Dom.getAllWindows(b[d],a))}catch(e){}return a},
prepend:function(c,a){if("string"===Recite.Util.type(c)){var b=a.ownerDocument.createElement("div");b.innerHTML=c;for(var d=0;d<b.childNodes.length;d++)a.insertBefore(b.childNodes[0],a.childNodes[0])}else a.insertBefore(c,a.childNodes[0])},append:function(c,a){if("string"===Recite.Util.type(c)){var b=a.ownerDocument.createElement("div");b.innerHTML=c;for(var d=0;d<b.childNodes.length;d++)a.appendChild(b.childNodes[d])}else a.appendChild(c)},getSelected:function(){var c="";"undefined"!==typeof window.getSelection?
c=window.getSelection().toString():"undefined"!==typeof document.selection&&"Text"===document.selection.type&&(c=document.selection.createRange().text);return c.replace(/^\s+|\s+$/g,"")},isDescendant:function(c,a){for(;c;){if(c===a)return!0;c=c.parentNode}return!1},getAncestors:function(c){for(var a=null,b=[];null!==(a=c.parentNode)&&1===a.nodeType;)b.push(a),c=a;return b},getWindowDimensions:function(c){var a=c.document,b,d;if("number"===typeof c.innerWidth)b=c.innerWidth,d=c.innerHeight;else if(a.documentElement&&
(a.documentElement.clientWidth||a.documentElement.clientHeight))b=a.documentElement.clientWidth,d=a.documentElement.clientHeight;else if(a.body&&(a.body.clientWidth||a.body.clientHeight))b=a.body.clientWidth,d=a.body.clientHeight;return{width:b,height:d}},getLanguage:function(c){var a=null;if("undefined"!==c&&1===c.nodeType&&""!==c.lang)return c.lang;var b=c.childNodes;if(0<b.length&&(Recite.Util.each(b,function(b,d){for(;null!==d;){if(3!==d.nodeType&&"undefined"!==d.lang&&""!==d.lang){a=d.lang;break}d=
0<d.childNodes.length?d.childNodes[0]:null}}),null!==a))return a;var c=Recite.Dom.getAncestors(c),d;for(d in c){b=c[d];if(b.lang&&0!==b.lang.length){a=b.lang;break}if(1===b.nodeType&&null!==b.getAttribute("xml:lang")&&""!==b.getAttribute("xml:lang")){a=b.getAttribute("xml:lang");break}}null===a&&(d=Recite.Sizzle('meta[http-equiv="Content-Language"]'),0<d.length&&(a=d[0].getAttribute("content")));return null!==a&&"string"===typeof a?a.toLowerCase():null},detectLanguage:function(c,a){Recite.Debug.log("Recite.Dom",
"Auto detecting language");Recite.Api.call("language-detect","POST",{data:{q:c},contentType:"application/json",success:function(b){Recite.Debug.log("Recite.Dom","Language detected: "+b.lang);a(null!=b.lang?b.lang.toLowerCase():null)},error:function(){a(null)}})},getNextElement:function(c){var a=Recite.Sizzle("recite");if("undefined"===c||null===c)return Recite.Debug.log("Recite.DOM","Current element is null - probably been removed from DOM"),a[0];for(var b=null,d=0;d<a.length;d++)if(a[d]===c||null===
c||null!==b)if(b=null===c?a[0]:"undefined"!==typeof a[d+1]?a[d+1]:a[0],c=Recite.Dom.getPosition(b),0>c.left||0>c.top||0==c.top&&0==c.left)c=b;else return b;return a[0]},getPreviousElement:function(c){var a=Recite.Sizzle("recite");if("undefined"===c||null===c)return Recite.Debug.log("Recite.DOM","getPreviousElement return 1st ele"),a[0];for(var b=null,d=a.length;0<d;d--)if(a[d]==c||null==c||null!==b){if(null==c)b=a[0];else if("undefined"!==typeof a[d-1])b=a[d-1];else break;c=Recite.Dom.getPosition(b);
if(0>c.left||0>c.top||0==c.top&&0==c.left)c=b;else return b}return a[0]}}}();Recite.namespace("Dom.Traverser");Recite.Dom.Traverser=function(){return{traverse:function(c,a){for(var b=c.childNodes[0];null!==b;){var d=a(b);if(b.hasChildNodes()&&d)b=b.firstChild;else{for(;null===b.nextSibling&&b!==c;)b=b.parentNode;b=b===c?null:b.nextSibling}}}}};Recite.namespace("Recite.Dom.Observer");
Recite.Dom.Observer=function(){var c=null,a=[],b={pollTime:1500};return{setOptions:function(a){b=Recite.Util.merge(b,a)},observe:function(d){a.push(d);null===c&&(Recite.Debug.log("Recite.Dom.Observer","Setting up body length polling."),c=setInterval(function(){Recite.Util.each(a,function(a,b){var d=b.innerHTML.length;"undefined"===typeof b.prevLength&&(b.prevLength=d);b.prevLength!==d&&(d=Recite.Parser.Html.parse(b),Recite.PlayerControls.invoke(d),Recite.PlayerControls.invalidate(),b.prevLength=b.innerHTML.length)})},
b.pollTime))}}}();var JSON;JSON||(JSON={});
(function(){function c(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 b(d,c){var e,j,k,t,q=g,r,l=c[d];l&&("object"===typeof l&&"function"===typeof l.toJSON)&&(l=l.toJSON(d));"function"===typeof i&&(l=i.call(c,d,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";g+=f;r=[];if("[object Array]"===Object.prototype.toString.apply(l)){t=l.length;for(e=0;e<t;e+=1)r[e]=b(e,l)||"null";k=0===r.length?"[]":g?"[\n"+g+r.join(",\n"+g)+"\n"+q+"]":"["+r.join(",")+"]";g=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=b(j,l))&&r.push(a(j)+(g?": ":":")+k))}else for(j in l)Object.prototype.hasOwnProperty.call(l,j)&&(k=b(j,l))&&r.push(a(j)+(g?": ":":")+k);k=0===r.length?"{}":g?"{\n"+g+r.join(",\n"+
g)+"\n"+q+"}":"{"+r.join(",")+"}";g=q;return k}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+c(this.getUTCMonth()+1)+"-"+c(this.getUTCDate())+"T"+c(this.getUTCHours())+":"+c(this.getUTCMinutes())+":"+c(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var d=/[\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,g,f,j={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,d,c){var e;f=g="";if("number"===typeof c)for(e=0;e<c;e+=1)f+=" ";else"string"===typeof c&&(f=c);if((i=d)&&"function"!==typeof d&&("object"!==typeof d||"number"!==typeof d.length))throw Error("JSON.stringify");return b("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,h=a[d];if(h&&"object"===typeof h)for(e in h)Object.prototype.hasOwnProperty.call(h,e)&&(f=c(h,e),void 0!==f?h[e]=f:delete h[e]);return b.call(a,d,h)}var e,a=String(a);d.lastIndex=0;d.test(a)&&(a=a.replace(d,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 b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();Recite.namespace("Auth");
Recite.Auth=function(){function c(a,b){"undefined"===typeof b&&(b={});var c=d.authorization_endpoint+"?response_type="+a+"&client_id="+d.client_id;null!==d.redirect_uri&&(c+="&redirect_uri="+encodeURIComponent(d.redirect_uri));null!==d.required_scope&&(c+="&scope="+d.required_scope);Recite.Util.each(b,function(a,b){c+="&"+a+"="+b});return c}var a=!1,b={state:null,access_token:null,expires:null},d={authorization_endpoint:Recite.baseUrl+"/oauth/authorize",token_endpoint:Recite.baseUrl+"/oauth/token",
client_id:"fa2ef28f3d584b7d243a37e31df0641c08fd8a2b",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=[],g=[],f=[],j=!1,i=[];Recite.XDM.receiveMessage(function(d){Recite.Debug.log("Recite.Auth","Message received:",d);d=JSON.parse(d.data);if(null!==d&&"undefined"!==typeof d.access_token&&-1!==Recite.Util.inArray(d.state,
i)){i.splice(Recite.Util.inArray(d.state,i),1);var c=new Date;b.access_token=d.access_token;b.expires=Math.ceil(c.getTime()/1E3)+parseInt(d.expires_in,10);b.state="authorized";Recite.Event.publish("Auth:authorize",b);a&&Recite.Event.publish("Auth:reauthorize",b);a=!0;Recite.Util.each(f,function(a,d){d(b)});f=[];j=!1;"undefined"!==typeof g[d.state]&&(c=g[d.state],c.parentNode.removeChild(c),delete g[d.state]);"undefined"!==typeof e[d.state]&&(e[d.state].close(),delete e[d.state])}},Recite.baseUrl);
return{setOptions:function(a){d=Recite.Util.merge(d,a)},isAuthorized:function(){return"authorized"===b.state},clear:function(){b.state=null;b.access_token=null;b.expires=null},getStatus:function(a,d){if(!d&&this.isAuthorized())a(b);else if(f.push(a),!j){j=!0;var e=Recite.Util.guid();i.push(e);var n=c("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;g[e]=k;document.body.appendChild(k)}},authPopup:function(){var a=Recite.Util.guid();
i.push(a);var b=c("token",{state:a});if("iframe"===d.type){var f=document.createElement("div");f.setAttribute("class","recite_auth_iframe_wrapper");f.style.top=parseInt(d.popup.top)+"px";f.style.left="50%";f.style.marginLeft=0-parseInt(d.popup.width)/2+"px";f.style.height=Recite.Dom.getWindowDimensions(window).height/1.5;f.style.width=d.popup.width;var j=document.createElement("iframe");j.src=b;j.frameborder=0;j.width=d.popup.width;j.style.border=0;j.height=Recite.Dom.getWindowDimensions(window).height/
1.5;b=document.createElement("div");b.setAttribute("class","recite_auth_iframe_close recite-sprite-auth-close");b.setAttribute("data-recite-state",a);f.appendChild(b);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");g[a].parentNode.removeChild(g[a]);delete g[a]})});g[a]=f}else{var k="";Recite.Util.each(d.popup,function(a,b){k+=a+"="+
b+","});k=k.substr(0,k.length-1);f=Math.ceil(screen.width/2)-d.popup.width/2;j=Math.ceil(screen.height/2)-d.popup.height/2;k+=",left="+f+",top="+j;e[a]=window.open(b,a,k)}}}}();Recite.namespace("Storage.Cookie");
Recite.Storage.Cookie=function(){function c(a,b,d){if(d){var c=new Date;c.setTime(c.getTime()+864E5*d);d="; expires="+c.toGMTString()}else d="";document.cookie=a+"="+b+d+"; path=/"}return{save:function(a,b){var d=JSON.stringify(b);c(a,d)},load:function(a,b){var d;a:{d=a+"=";for(var c=document.cookie.split(";"),g=0;g<c.length;g++){for(var f=c[g];" "==f.charAt(0);)f=f.substring(1,f.length);if(0==f.indexOf(d)){d=f.substring(d.length,f.length);break a}}d=null}d=JSON.parse(d);b&&b(d);return d},clear:function(a){c(a,
"",-1)},supported:function(){return!0}}}();Recite.namespace("Storage.LocalStorage");Recite.Storage.LocalStorage=function(){return{save:function(c,a){_supported()&&window.localStorage.setItem(c,a)},load:function(c,a){if(_supported()){var b=window.localStorage.getItem(c);"undefined"!==typeof a&&a(b);return b}return null},clear:function(c){_supported()&&window.localStorage.removeItem(c)},supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(c){return!1}}}}();Recite.namespace("Storage.Api");
Recite.Storage.Api=function(){var c=["Recite.Preferences"];return{save:function(a,b){if(!a in c)throw{name:"InvalidNamespace",message:"The provided namespace is invalid."};"Recite.Preferences"===a?Recite.Api.call("preferences","POST",{data:b,contentType:"application/json",success:function(){Recite.Debug.log("Recite.Storage.Api","Preferences Saved.")}}):Recite.Storage.Cookie.save(a,b)},load:function(a,b){!a in c||("Recite.Preferences"===a?Recite.Api.call("preferences","GET",{success:b,error:b}):Recite.Storage.Cookie.load(a,
b))},clear:function(){},supported:function(){return!0}}}();Recite.namespace("Preferences");
Recite.Preferences=function(){var c={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"}},b=Recite.Util.clone(a);Recite.Event.subscribe("Auth:reauthorize",function(){c.storageEngine===Recite.Storage.Api&&Recite.Preferences.load()});return{setOptions:function(a){c=
Recite.Util.merge(c,a)},save:function(){Recite.Debug.log("Recite.Preferences","Saving preferences.");c.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.");c.storageEngine.load("Recite.Preferences",function(d){if(null!==d){var c=Recite.Util.clone(b);Recite.Debug.log("Recite.Preferences","Found user preferences");a=Recite.Util.merge(c,
d)}Recite.Event.publish("Preferences:load",d)})},get:function(b){if("undefined"===typeof b)return a;var c,g,b=b.split(".");c=a;for(g=0;g<b.length;g++)if(c=c[b[g]],"undefined"===typeof c)return null;return c},set:function(b,e){var g={};"object"===Recite.Util.type(b)?g=b:g[b]=e;Recite.Util.each(g,function(b,d){var c,e,g;c=b.split(".");e=a;for(g=0;g<c.length-1;g++)if(e=e[c[g]],"undefined"===typeof e)return null;e[c[g]]=d});Recite.Event.publish("Preferences:set",g);c.autoSave&&Recite.Preferences.save();
return null},reset:function(d){var e,g,f,j;e=d.split(".");g=a;j=b;for(f=0;f<e.length-1;f++)g=g[e[f]],j=j[e[f]];var i=j[e[f]];"object"===Recite.Util.type(i)&&(i=Recite.Util.clone(i));g[e[f]]=i;Recite.Event.publish("Preferences:reset",{key:d,value:j});c.autoSave&&Recite.Preferences.save()},resetAll:function(){a=b;Recite.Event.publish("Preferences:reset");Recite.Debug.log("Recite.Preferences","Saving preferences.");c.storageEngine.save("Recite.Preferences",b);Recite.Gui.Notification.show("Your preferences have been reset.")}}}();
Recite.namespace("UI.Toggle");
Recite.UI.Toggle=function(){return{invoke:function(c){c=Recite.Util.isArray(c)?c:[c];Recite.Util.each(c,function(a,b){var d=b.ownerDocument?b.ownerDocument:document;b.setAttribute("class","recite-ui-toggle");d=d.createElement("div");d.setAttribute("class","recite-ui-toggle-slider");b.appendChild(d);Object.defineProperty?Object.defineProperty(b,"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");b.checked=!0;Recite.DomEvent.add(b.childNodes[0],"click",function(a){a=a.target.parentNode;a.checked=!a.checked})})}}}();Recite.namespace("UI.Dropdown");
Recite.UI.Dropdown=function(){function c(a,c){if(!(1!==a.nodeType&&3!==a.nodeType)){var g=a.getAttribute("class")||"";for(a.setAttribute("class",g.replace(" recite-active",""));-1!==(g=Recite.Util.inArray(a,b[c]));)b[c].splice(g,1);g=Recite.Sizzle(".recite-dropdown-invoke",document);Recite.Util.each(g,function(a,b){b.setAttribute("class",b.getAttribute("class").replace(" active",""))})}}function a(){for(var a in b)for(var e in b[a])c(b[a][e],a)}var b={};return{invoke:function(d){Recite.DomEvent.add(document.body,
"click",a);d=Recite.Util.isArray(d)?d:[d];Recite.Util.each(d,function(a,d){Recite.DomEvent.add(d,"click",function(a){var d=a.target,e=Recite.Sizzle(d.getAttribute("data-target"))[0],g=d.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")))c(e,g),d.setAttribute("class",d.getAttribute("class").replace(" active",""));else{var p=
g,p=p||"default";"undefined"===typeof b[p]&&(b[p]=[]);g=e.getAttribute("class")||"";e.setAttribute("class",g+" recite-active");var g=Recite.Sizzle(".recite-controls")[0],m=Recite.Dom.getPosition(d);e.style.left=m.left-g.scrollLeft+"px";b[p].push(e);"default"!==p&&Recite.Util.each(b[p],function(a,b){"undefined"!==typeof b&&b!==e&&c(b,p)});d.setAttribute("class",d.getAttribute("class")+" active")}"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}})})},hideGroup:function(a){var a=
a||null,e;for(e in b)null!==a&&a!==e||Recite.Util.each(b[e],function(a,b){c(b)})}}}();Recite.namespace("UI.ColorPicker");
Recite.UI.ColorPicker=function(){function c(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,d=j.getColor().toHsv();d.v=Math.ceil(100*(Math.abs(b-255)/255));d.s=Math.ceil(100*(a/
255));j.setColor(d);k.style.top=b+r.selectorAdjust.top+"px";k.style.left=a+r.selectorAdjust.left+"px"}function b(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 d(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 g(){Recite.UI.ColorPicker.hide()}var f=!1,j=null,i=!1,h=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",g);Recite.Dom.append(r.markup,document.body);h=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(h,
"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",c);Recite.DomEvent.add(p,"mousemove",function(a){f&&c(a)})},invoke:function(a,c){c=c||{};a=Recite.Util.isArray(a)?a:[a];i||this.init();Recite.Util.each(a,function(a,f){var g="INPUT"===f.tagName?"focus":"click";f.colorPicker={};f.setColor=function(a,c,f){Recite.Tinycolor.equals(a,
this.getColor())||(c=!1===c?!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?c&&(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&&(c=this.colorPicker.color.toHsv(),b(c.h),d(c.s),e(c.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,g,function(a){Recite.UI.ColorPicker.show();j=a.target;var b=Recite.Dom.getPosition(j),d=Recite.Dom.getStyle(j,"width");t=b.top;q=parseInt(b.left)+parseInt(d);h.style.top=t+"px";h.style.left=q+"px";Recite.UI.ColorPicker.invalidate();"undefined"!==typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0});"undefined"!==typeof c.callback&&
(f.colorPicker.callback=c.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(){h.style.display="block"},hide:function(){h.style.display="none"},invalidate:function(){var a=j.colorPicker.color.toHsv();b(a.h);d(a.s);e(a.v)}}}();Recite.namespace("Controls");
Recite.Controls=function(){var c={enabled:!0,url:Recite.baseUrl+"/assets/"+Recite.version+"/html/header.htm",modules:[]};return{setOptions:function(a){c=Recite.Util.merge(c,a);Recite.Controls.Core.setOptions(a.Core);Recite.Controls.Desktop.setOptions(a.Desktop)},load:function(a){c.enabled&&(0===c.modules.length&&(c.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(c.url,
null,function(b,d){var e=document.createElement("div");e.innerHTML=d;var g=e.childNodes[0],e=Recite.Sizzle("body",a)[0];Recite.Dom.prepend(g,e);Recite.Util.each(c.modules,function(a,b){b.init();b.invoke(g)});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 c(){d();Recite.Util.each(Recite.Sizzle(".recite-ui-toggle",document),function(a,b){var d=b.getAttribute("data-preference");"undefined"!==Recite.Preferences.get(d)&&(Recite.Preferences.get(d)?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,d){var c=d.getAttribute("data-value");d.setAttribute("class",d.getAttribute("class").replace("active",""));a.en===c&&d.setAttribute("class",d.getAttribute("class")+" active");d})}function a(){Recite.Api.call("user","GET",{success:function(a){f.user=a;d()}})}function b(a){if("undefined"===typeof a)return f;var b,d,a=a.split(".");b=f;for(d=0;d<a.length;d++)if(b=b[a[d]],"undefined"===typeof b)return null;return b}function d(){Recite.Util.each(g,
function(a,d){if("undefined"!==typeof d.text){var c=d.text,f;e.tagPattern.lastIndex=0;for(var g=c;null!==(f=e.tagPattern.exec(c));)var n=b(f[1])||"",g=g.replace(f[0],n);d.node.nodeValue=g}"undefined"!==typeof d.attributes&&Recite.Util.each(d.attributes,function(a,c){var f;e.tagPattern.lastIndex=0;for(var g=c.value;null!==(f=e.tagPattern.exec(c.value));){var h=b(f[1]);"undefined"===typeof h&&(h=null);g=g.replace(f[0],h)}d.node.setAttribute(c.name,g)})})}var e={tagPattern:/{{([A-Za-z._]+)}}/g},g=[],
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",c);Recite.Event.subscribe("Preferences:set",c);Recite.Event.subscribe("Preferences:reset",c);Recite.Event.subscribe("Auth:reauthorize",a)},invoke:function(d){for(var c=d;null!==c;){if(3===c.nodeType&&0<c.nodeValue.trim().length){var f=c.nodeValue;if(e.tagPattern.test(f)){var p;
e.tagPattern.lastIndex=0;for(var m=f;null!==(p=e.tagPattern.exec(f));)var n=b(p[1])||"",m=m.replace(p[0],n);c.nodeValue=m;g.push({node:c,text:f})}}if(1===c.nodeType){var k=[];Recite.Util.each(c.attributes,function(a,d){var c=d.value;if(e.tagPattern.test(c)){var f;e.tagPattern.lastIndex=0;for(k.push({name:d.name,value:d.value});null!==(f=e.tagPattern.exec(c));)c=b(f[1]),"undefined"===typeof c&&(c=null),d.value=d.value.replace(f[0],c)}});0<k.length&&g.push({node:c,attributes:k})}if(c.hasChildNodes())c=
c.firstChild;else{for(;null===c.nextSibling&&c!==d;)c=c.parentNode;c=c===d?null:c.nextSibling}}Recite.Util.each(Recite.Sizzle(".recite-ui-toggle",d),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)})});c=Recite.Sizzle(".recite-preference-set",d);Recite.DomEvent.add(c,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;var b=a.currentTarget?
a.currentTarget:a.srcElement,a=b.getAttribute("data-key").split(" "),d=b.getAttribute("data-value").split(" ");if(a.length!==d.length)Recite.Debug.log("Recite.Controls.Core","Warning: Number of \n                    keys does not match number of values.",b);else{for(var b={},c=0;c<a.length;c++){var e=a[c],f=("-"===d[c].charAt(0)?"-":"")+d[c].replace(/-/g," ");"toggle"===f&&(f=!Recite.Preferences.get(e));if(/\+|\-/.test(f[0])){var g="+"===f[0],f=parseInt(f.replace(/[^0-9]/g,""),10),h=Recite.Preferences.get(e),
h=null===h?100:h,f=g?h+f:h-f;250<f&&(f=250);50>f&&(f=50)}if(0===f.length||"null"===f)f=null;b[e]=f}Recite.Preferences.set(b)}});c=Recite.Sizzle(".recite-save",d);Recite.DomEvent.add(c,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Preferences.save()});c=Recite.Sizzle(".recite-reset",d);Recite.DomEvent.add(c,"click",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;Recite.Preferences.resetAll()});Recite.DomEvent.add(Recite.Sizzle(".recite-language-set",
d),"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,d){d.getAttribute("data-language")===b?d.setAttribute("class",d.getAttribute("class")+" recite-active"):d.setAttribute("class",
d.getAttribute("class").replace(" recite-active",""))})});a()}}}();Recite.namespace("Controls.Desktop");
Recite.Controls.Desktop=function(){function c(a,d){if("play"===d||"stopped"===a.getAttribute("data-status")&&"undefined"===d)return a.setAttribute("class",a.getAttribute("class").replace("recite-sprite-button-play","recite-sprite-button-stop")),a.setAttribute("data-status","playing"),"playing";if("stop"===d||"playing"===a.getAttribute("data-status")&&"undefined"===d)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(b){a=Recite.Util.merge(a,b)},init:function(){},invoke:function(b){var d=document.body;a.simplifiedControls&&(b.setAttribute("class",b.getAttribute("class")+" recite-controls-simplified"),Recite.Sizzle(".recite-sprite-logo")[0].setAttribute("class","recite-sprite-logo-small"));var e=Recite.Dom.getStyle(b,"height"),e=parseInt(e.replace("px",""),10);if("tooltip"===Recite.getOptions().selectionMethod)try{Recite.PlayerControls.getProvider().setTopProtection(e)}catch(g){}if(a.repositionBackground){var f=
Recite.Dom.getStyle(d,"background-position-y");if("0%"===f)d.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),d.setAttribute("style","background-position-y:"+f+" px !important")}d.style.position="absolute";d.style.top=e+"px";d.style.width="100%";Recite.Util.each(Recite.Sizzle("*"),function(a,b){if(!/recite/.test(b.getAttribute("id"))&&!/recite/.test(b.getAttribute("class"))&&"fixed"===Recite.Dom.getStyle(b,
"position")){var d=b.offsetTop;d<e&&(b.style.top=e+d+"px")}});var j=Recite.Sizzle("#recite-fonts")[0];Recite.Util.each(a.fonts,function(a,b){var d=document.createElement("div");d.setAttribute("class","recite-font recite-preference-set");d.setAttribute("data-key","style.font.face");"Default"!==b?(d.setAttribute("data-value",b),d.style.fontFamily=b):d.setAttribute("data-value","null");d.innerText=b;d.textContent=b;j.appendChild(d)});var i=Recite.Sizzle("#recite-swatches")[0];Recite.Util.each(a.swatches,
function(a,b){var d=document.createElement("div");d.setAttribute("class","recite-swatch recite-preference-set");null===b.backgroundColor&&null===b.color&&null===b.linkColor?(d.setAttribute("class",d.getAttribute("class")+" recite-swatch-default"),d.textContent="Default",d.innerText="Default"):(d.textContent="A",d.innerText="A");d.setAttribute("data-key","style.backgroundColor style.font.color style.link.color");d.setAttribute("data-value",b.backgroundColor+" "+b.color+" "+b.linkColor);d.style.color=
b.color;d.style.backgroundColor=b.backgroundColor;i.appendChild(d)});var h=Recite.Sizzle("#recite-languages")[0];Recite.Util.each(a.languages,function(a,b){var d=document.createElement("li"),c=document.createTextNode(b.name);d.appendChild(c);d.setAttribute("class","recite-language-set");d.setAttribute("data-language",a);null!==b.flag&&(c=document.createElement("span"),c.setAttribute("class","recite-sprite-flag-"+b.flag),d.appendChild(c));h.appendChild(d)});var p=Recite.Sizzle("#recite-margins")[0];
Recite.Util.each(a.margins,function(a,b){var d=document.createElement("div");d.setAttribute("class","recite-margin recite-preference-set");d.setAttribute("data-key","style.marginSize");d.setAttribute("data-value",b.value);var c=b.icon||null;if(null!==c){var e=document.createElement("div");e.setAttribute("class",c);e.style.margin="0 auto";d.appendChild(e)}else d.textContent=b.name,d.innerText=b.name;p.appendChild(d)});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"});b=Recite.Sizzle(".recite-button",b);Recite.UI.Dropdown.invoke(b);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(){c(n,"stop")});Recite.Event.subscribe("Audio:started",function(){c(n,"play")});
a.showLogo||Recite.Sizzle(".recite-logo")[0].setAttribute("class","custom-logo");!1!=a.customLogo&&(b=Recite.Sizzle(".recite-logo")[0],b.setAttribute("class","custom-logo"),b.innerHTML='<img src="'+a.customLogo+'" height="80" />',!1!=a.customLogoLink&&(b.href=a.customLogoLink),!1!=a.customLogoTitle&&(b.title=a.customLogoTitle));!1===Recite.AudioDownload.getOptions().enabled&&(b=Recite.Sizzle(".recite-sprite-button-mp3")[0],b.outerHTML="")}}}();Recite.namespace("Recite.Parser.Html");
Recite.Parser.Html=function(){function c(a){if(0<a.length){var d=0;Recite.Util.each(a,function(a,b){d+=Recite.Dom.getText(b).trim().length});if(d>=b.minCharacters){var c=a[0].ownerDocument.createElement(b.wrapTag);c.className="recite-ele";c.style.display="inline";if(b.debug.highlightElements){var j=Math.floor(256*Math.random()),i=Math.floor(256*Math.random()),h=Math.floor(256*Math.random());try{c.style.backgroundColor="rgba("+j+","+i+","+h+",0.4)"}catch(p){c.style.backgroundColor="rgb("+j+","+i+","+
h+")"}}a[0].parentNode.insertBefore(c,a[0]);for(j=0;j<a.length;j++)i=a[j].parentNode.removeChild(a[j]),c.appendChild(i);return c}}return null}function a(c,g,f){"undefined"===typeof f&&(f=[[]]);var j=!1,i=!1;if(1===c.nodeType&&/recite-ele/g.test(c.getAttribute("class")))return f;if(c){if(1===c.nodeType&&(0<=Recite.Util.inArray(c.tagName,b.skipElements)||"true"===c.getAttribute("data-recite-skip"))||1===c.nodeType&&0<d.length&&"BR"===c.tagName&&"BR"===d[d.length-1].tagName)return f;3===c.nodeType&&
Recite.Dom.getText(c).replace(/^\s*/,"").replace(/\s*$/,"");if(1===c.nodeType){var h;if(h=0<=Recite.Util.inArray(Recite.Dom.getStyle(c,"display"),b.concatenateTypes)){a:{if(1===c.nodeType){h=c.getElementsByTagName("*");for(var p=0;p<h.length;p++)if("block"===Recite.Dom.getStyle(h[p],"display")){h=!0;break a}}h=!1}h=!h}h&&(j=!0)}else 3===c.nodeType&&(j=!0);!0===j&&(d[d.length-1]!==c.previousSibling&&(f.push(d),d=[]),d.push(c),i=!0);j=0;h=c.childNodes[j];if(!i)for(;h;)a(h,g+1,f),j++,h=c.childNodes[j]}return f}
var b={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}},d=[];return{setOptions:function(a){Recite.Debug.log("Recite.Parser.Html","Setting options");b=Recite.Util.merge(b,a)},parse:function(e){Recite.Debug.log("Recite.Parser.Html","Parser invoked on element:",e);var g=new Date,f=a(e,
1);0<d.length&&f.push(d);0===f[f.length-1].length&&f.pop();var j=[];Recite.Util.each(f,function(a,b){if(0!==b.length){var d=c(b);null!==d&&j.push(d)}});if(b.parseImgAltAttribute){var i=Recite.Sizzle("img[data-recite-skip!=true]",e);Recite.Util.each(i,function(a,d){if(d)if(null===d.getAttribute("alt")||0===d.getAttribute("alt").length)i.splice(a,1);else if(b.debug.highlightElements){var c=Math.floor(256*Math.random()),e=Math.floor(256*Math.random()),f=Math.floor(256*Math.random());try{d.style.backgroundColor=
"rgba("+c+","+e+","+f+",0.4)"}catch(g){d.style.backgroundColor="rgb("+c+","+e+","+f+")"}}});Recite.PlayerControls.invoke(i)}Recite.Debug.log("Recite.Parser.Html","Parsed "+j.length+" elements in: "+((new Date).getTime()-g.getTime())+"ms");!1!==b.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){c(b)})}}}();Recite.namespace("Recite.Parser.Selector");
Recite.Parser.Selector=function(){var c={maxCharacters:1E3,minCharacters:1,selector:".recite"};return{setOptions:function(a){Recite.Debug.log("Recite.Parser.Selector","Setting options");c=Recite.Util.merge(c,a)},parse:function(a){Recite.Debug.log("Recite.Parser.Selector","Parser invoked on element:",a);var b=Recite.Sizzle(c.selector,a);Recite.Util.each(b,function(a,e){var g=Recite.Dom.getText(e);(g.length<c.minCharacters||g.length>c.maxCharacters)&&b.splice(a)});return b}}}();Recite.namespace("PlayerControls");
Recite.PlayerControls=function(){function c(){null===b.provider?b.provider=b.enableMobileControls&&Recite.Browser.isMobile()?Recite.PlayerControls.Fixed:Recite.PlayerControls.Tooltip:"none"===b.provider?b.provider=Recite.PlayerControls.NoGUI:"disable"===b.provider&&(b.provider=null);null!=b.provider&&b.provider.init&&b.provider.init()}function a(){Recite.Preferences.get("playerControls.enabled")?Recite.PlayerControls.enable():Recite.PlayerControls.disable()}var b={provider:null,enableMobileControls:!0};
Recite.Event.subscribe("Recite:load",c);Recite.Event.subscribe("Preferences:load",a);Recite.Event.subscribe("Preferences:set",a);Recite.Event.subscribe("Preferences:reset",a);return{init:c,setOptions:function(a){a.provider&&b.provider&&b.provider.destroy();b=Recite.Util.merge(b,a);Recite.PlayerControls.Tooltip.setOptions(a.Tooltip);Recite.PlayerControls.Fixed.setOptions(a.Fixed);Recite.PlayerControls.NoGUI.setOptions(a.NoGUI);a.provider&&a.provider.init&&b.provider.init()},invoke:function(a){null!=
b.provider&&b.provider.invoke(a)},enable:function(){null!=b.provider&&b.provider.enable()},disable:function(){null!=b.provider&&b.provider.disable()},invalidate:function(){null!=b.provider&&b.provider.invalidate()},getControls:function(){return null!=b.provider?b.provider.getControls():null},getProvider:function(){return b.provider},play:function(){return null!=b.provider?b.provider.play():null},stop:function(){return null!=b.provider?b.provider.stop():null},next:function(){Recite.Debug.log("Recite.PlayerControls",
"next");return null!=b.provider?b.provider.next():null},previous:function(){Recite.Debug.log("Recite.PlayerControls","prev");return null!=b.provider?b.provider.previous():null}}}();Recite.namespace("PlayerControls.Tooltip");
Recite.PlayerControls.Tooltip=function(){function c(a){Recite.Util.each(i,function(b,c){!Recite.Dom.isDescendant(a.target,c)&&(a.target!==c&&!Recite.Dom.isDescendant(a.target,h)&&a.target!==h&&!Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0]))&&d(c)})}function a(){if(f){clearTimeout(g.timeout);var a=this;h!==this&&(g.timeout=setTimeout(function(){b(a)},g.intent))}}function b(a){null!==a&&(null!==h&&(h.setAttribute("class",h.getAttribute("class").replace("recite-selected","")),
Recite.Event.publish("Recite.Tooltip:hide",{target:h})),h=a,e(a),h.setAttribute("class",h.getAttribute("class")+" recite-selected"),Recite.Event.publish("Recite.Tooltip:show",{target:h}),Recite.Preferences.get("player.autoplay")&&Recite.PlayerControls.Tooltip.play())}function d(a){a.style.display="none";null!==h&&(h.setAttribute("class",h.getAttribute("class").replace("recite-selected","")),Recite.Event.publish("Recite.Tooltip:hide",{target:h}));h=null}function e(a){var b,d=Recite.Sizzle("#recite-tooltip",
j)[0];if("undefined"===typeof d){Recite.Debug.log("Recite.Tooltip","Adding tooltip to document");d=j.createElement("div");d.setAttribute("class","recite-tooltip small");d.setAttribute("id","recite-tooltip");d.style.position="absolute";d.innerHTML='<div class="recite-tooltip-content">'+g.content+'</div>                         <div class="recite-sprite-tip-bottomleft" id="recite-tip"></div>';Recite.Sizzle("body",j)[0].appendChild(d);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"),d.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(d)}b=d;b.style.display="block";for(var c=0;c<i.length;c++)i[c]!==b&&(i[c].style.display="none");var e=j.body,f=Recite.Dom.getPosition(a),c=Recite.Dom.getScroll(a.ownerDocument.defaultView),h=f.top-b.offsetHeight-g.adjust.y,k=f.left+("right"==g.position?a.offsetWidth:0),d="recite-sprite-tip-bottom-left",p=h-c.y-g.adjust.y,m=k+b.offsetWidth-c.x;b.style.position=
"absolute";for(var n=Recite.Dom.getAncestors(a),c=0;c<n.length;c++)"fixed"===Recite.Dom.getStyle(n[c],"position")&&(b.style.position="fixed",p=h-g.adjust.y);p<g.protect.top-g.adjust.y?(h=f.top+a.offsetHeight+g.adjust.y,d="recite-sprite-tip-top-left",m>e.clientWidth-g.protect.right&&(k=f.left-b.offsetWidth+g.adjust.x,d="recite-sprite-tip-top-right")):m>e.clientWidth&&(k=f.left-b.offsetWidth+g.adjust.x,d="recite-sprite-tip-bottom-right");b.style.top=h+"px";b.style.left=k+"px";a=j.getElementById("recite-tip");
a.setAttribute("class",d);a.setAttribute("className",d)}var g={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=[],h=null,p=!1,m=null,n,k;n=k=function(){h&&e(h)};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",c);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",c)});p=!1},enable:function(){f=!0},disable:function(){f=!1;Recite.Util.each(i,function(a,b){d(b)})},setOptions:function(a){g=Recite.Util.merge(g,a)},getOptions:function(){return g},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(g.timeout)})},invalidate:function(){h&&e(h)},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),
b(a)):null===h?this.next():Recite.PlayerDispatcher.dispatch(h)},stop:function(){Recite.Player.stop()},seekingSupported:function(){return!0},next:function(){var a=Recite.Dom.getNextElement(h);a===h?Recite.Debug.log("Recite.PlayerControls.Tooltip","next element same as current, halting"):b(a)},previous:function(){var a=Recite.Dom.getPreviousElement(h);b(a)},current:h}}();Recite.namespace("PlayerControls.Fixed");
Recite.PlayerControls.Fixed=function(){function c(){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 b(){if(f){clearTimeout(g.timeout);
var a=this;h!==this&&(g.timeout=setTimeout(function(){d(a)},g.intent))}}function d(a){null!==h&&h.setAttribute("class",h.getAttribute("class").replace("recite-selected",""));h=a;e(a);Recite.Preferences.get("player.autoplay")&&Recite.PlayerDispatcher.dispatch(h);h.setAttribute("class",h.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">'+g.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(h)});
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=g.dimensions.height+"px"}var g={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=[],h=null,p=!1,m=null,n,k;n=k=function(){h&&e(h)};var t=function(a){Recite.Util.each(i,function(b,
d){!Recite.Dom.isDescendant(a.target,d)&&(a.target!==d&&!Recite.Dom.isDescendant(a.target,h)&&a.target!==h&&!Recite.Dom.isDescendant(a.target,Recite.Sizzle("#recite-header")[0]))&&(d.style.display="none",null!==h&&h.setAttribute("class",h.getAttribute("class").replace("recite-selected","")),Recite.Sizzle("body",document)[0].style.paddingBottom="0px",h=null)})};return{init:function(){p||(c(),p=!0)},destroy:function(){a();p=!1},enable:function(){f||c();f=!0},disable:function(){f&&a();f=!1},setOptions:function(a){g=
Recite.Util.merge(g,a)},getOptions:function(){return g},invoke:function(a){Recite.Debug.log("Recite.Tooltop.Desktop","Invoking fixed playerControls");j=a.ownerDocument?a.ownerDocument:document;Recite.DomEvent.add(a,"mouseover",b);Recite.DomEvent.add(a,"mouseout",function(){clearTimeout(g.timeout)})},invalidate:function(){h&&e(h)},seekingSupported:function(){return!0},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),d(a)):null===h?this.next():Recite.PlayerDispatcher.dispatch(h)},stop:function(){Recite.Player.stop()},
next:function(){var a=Recite.Dom.getNextElement(h);a===h||null===a?Recite.Debug.log("Recite.PlayerControls.Fixed","next element same as current, halting"):d(a)},previous:function(){var a=Recite.Dom.getPreviousElement(h);d(a)},current:h}}();Recite.namespace("PlayerControls.NoGUI");
Recite.PlayerControls.NoGUI=function(){function c(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(d){clearTimeout(b.timeout);var a=this;e!==this&&(b.timeout=setTimeout(function(){c(a)},b.intent))}}var b={timeout:null},d=!0,e=null,g=!1;return{init:function(){g||(Recite.Event.subscribe("Style:updated",
Recite.PlayerControls.Tooltip.invalidate),g=!0)},destroy:function(){g=!1},enable:function(){d=!0},disable:function(){d=!1},setOptions:function(a){b=Recite.Util.merge(b,a)},getOptions:function(){return b},invoke:function(d){this.init();Recite.Debug.log("Recite.PlayerControls.NoGUI","Invoking NoGUI controls.");Recite.DomEvent.add(d,"mouseover",a);Recite.DomEvent.add(d,"mouseout",function(){clearTimeout(b.timeout)})},invalidate:function(){},play:function(a){a?(Recite.PlayerDispatcher.dispatch(a),c(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"):c(a)},previous:function(){var a=Recite.Dom.getPreviousElement(e);c(a)},current:e}}();Recite.namespace("PlayerDispatcher");
Recite.PlayerDispatcher=function(){function c(a){var d=Recite.Dom.getText(a);Recite.Util.each(b.readElements,function(b,c){a.tagName===b&&""!==d&&(d=c+". "+d)});return d}function a(a,b){var f=null,j=null;"string"===typeof a?f=a:(f=c(a),j=a.getAttribute("data-recite-voice")||null);null!==b&&"undefined"!==typeof b&&(b=b.split("-")[0]);try{if(Recite.Player.play(f,b,j),Recite.getOptions().autoCache&&"string"!==typeof a){var i=Recite.Dom.getNextElement(a);i!==a&&setTimeout(function(){d===a&&Recite.Player.cache(c(i),
b,j)},500)}}catch(h){if(h instanceof Recite.Player.PlayerException)switch(h.code){case 400:Recite.Gui.Notification.show("This language is not supported by Recite",{play:!0})}}}var b={readElements:{A:"Link",IMG:"Image"}},d=null;return{setOptions:function(a){b=Recite.Util.merge(b,a)},dispatch:function(b){(null===Recite.Player.getPlayer()||Recite.Player.getPlayer().getOptions().prepareAudio)&&Recite.Player.prepare();var c=null,f=null;"string"===typeof b?c=b:(f=Recite.Dom.getLanguage(b),d=b,c=Recite.Dom.getText(b));
var j=Recite.Player.getOptions().languageDetection;2===j||null===f&&1<=j?f=Recite.Dom.detectLanguage(c,function(d){"und"===d&&(d=null);a(b,d)}):a(b,f)}}}();Recite.namespace("Player");
Recite.Player=function(){function c(){if(d)return d;Recite.Audio.HTML5.support()?(Recite.Debug.log("Recite.Player","HTML5 Audio support detected, using Recite.Audio.HTML5 as backend."),Recite.Audio.HTML5.init(),d=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(),d=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 d}function a(a,d,j,i,h){d=d||e.language;j=j||null;if(!Recite.Player.languageSupported(d))throw Recite.Debug.log("Recite.Player","Language not supported:"+d),new Recite.Player.PlayerException(400,"Unsupported Language");var p=c().format(),m={q:a,f:p};if(null!==d){m.l=d;var j=b(d)||j,n=Recite.Preferences.get("voices");"undefined"!==typeof n[d]&&(null!=n[d]&&null===b(d))&&(j=n[d]);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);h&&h(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;h&&h(a)})}}))}function b(a){return"undefined"!==
typeof e.voices[a]?e.voices[a]:null}var d=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(){c().play(Recite.baseUrl+"/audio/blank.mp3")},play:function(b,d,e){a(b,d,e,{},function(a){c().play(a);Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Player",
event:"play"})})},pause:function(){c().pause()},restart:function(){c().restart()},resume:function(){c().resume()},cache:function(b,d,c){a(b,d,c,{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);c().stop()},rewind:function(){c().rewind()},forward:function(){c().forward()},setPlayer:function(a){d=a},getPlayer:function(){return d},getSupportedLanguauges:function(){return e.languages},
languageSupported:function(a){return-1<Recite.Util.inArray(a,e.languages)||null===a}}}();Recite.Player.PlayerException=function(c,a){this.code=c;this.message=a};Recite.namespace("Audio.HTML5");
Recite.Audio.HTML5=function(){var c=null,a="",b={prepareAudio:!0};return{setOptions:function(a){b=Recite.Util.merge(b,a)},init:function(){Recite.Debug.log("Recite.Audio.HTML5","Init");c=document.createElement("audio");a=Recite.Audio.HTML5.format();c.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");c.setAttribute("src",a);c.load();var b=setInterval(function(){3<=c.readyState&&(c.play(),clearInterval(b))},5)},pause:function(){c.pause();Recite.Event.publish("Audio:paused")},resume:function(){c.play();Recite.Event.publish("Audio:started")},restart:function(){c.currentTime=0;c.load();c.play()},stop:function(){c.pause();Recite.Event.publish("Audio:ended")},rewind:function(){c.currentTime-=1},forward:function(){c.currentTime+=2},support:function(){var a=
document.createElement("audio"),b=!!a.canPlayType;b&&(b=new Boolean(b),b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),b.mp3=a.canPlayType("audio/mpeg;"),b.wav=a.canPlayType('audio/wav; codecs="1"'),b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return b},format:function(){var a=Recite.Audio.HTML5.support();return a.ogg?"ogg":a.mp3?"mp3":a.wav?"wav":a.m4a?"m4a":!1},getOptions:function(){return b}}}();Recite.namespace("Audio.SoundManager");
Recite.Audio.SoundManager=function(){function c(){Recite.Event.publish("Audio:ended");Recite.Preferences.get("player.continuePlay")&&Recite.PlayerControls.next()}var a=null,b={prepareAudio:!0},b={path:Recite.baseUrl+"/common/js/soundmanager/soundmanager2-jsmin.js",soundmanager:{debugMode:!1,debug:!1,url:Recite.baseUrl+"/common/swf/"}};return{setOptions:function(a){b=Recite.Util.merge(b,a)},init:function(){},play:function(d){window.soundManager?((a=soundManager.getSoundById(d))||(a=soundManager.createSound({id:d,
url:d})),soundManager.stopAll(),a.play({onfinish:function(){c()}})):Recite.AssetLoader.js(b.path,function(){window.soundManager=new SoundManager;Recite.Util.each(b.soundmanager,function(a,b){soundManager[a]=b});soundManager.beginDelayedInit();soundManager.stopAll();soundManager.onready(function(){a=soundManager.createSound({id:d,url:d}).play({onfinish:function(){c()}})})});Recite.Event.publish("Audio:started")},pause:function(){a.pause();Recite.Event.publish("Audio:paused")},resume:function(){a.resume();
Recite.Event.publish("Audio:started")},restart:function(){a&&(Recite.Debug.log("Recite.Audio.Soundmanager","Restarting track"),a.setPosition(0))},stop:function(){a&&a.stop();Recite.Event.publish("Audio:ended")},rewind:function(){a&&(Recite.Debug.log("Recite.Audio.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 b}}}();Recite.namespace("Audio.Download");
Recite.Audio.Download=function(){var c={prepareAudio:!1};return{setOptions:function(a){c=Recite.Util.merge(c,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 c}}}();Recite.namespace("Style");
Recite.Style=function(){function c(){var a="",d=Recite.Preferences.get("style"),c=Recite.Preferences.get("textMode.enabled");null!==d.marginSize&&c&&(a+="#recite-wrapper { padding: 0 "+d.marginSize+"; } body { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; } ");null!==d.font.color&&(a+="#recite-wrapper, #recite-wrapper * { color: "+d.font.color+" !important; text-shadow: none !important; }");null!==d.font.face&&(a+="#recite-wrapper, #recite-wrapper * { font-family: "+
d.font.face+" !important; }");null!==d.font.size&&(a+=".recite-ele { font-size: "+d.font.size+"% !important; } #recite-wrapper *, .recite-ele { line-height: normal !important; }");null!==d.link.color&&(a+="#recite-wrapper a { color: "+d.link.color+" !important; }");null!==d.backgroundColor&&(a=a+"#recite-wrapper * { background: transparent !important; box-shadow: none !important; }"+("body, html, #recite-wrapper { background: "+d.backgroundColor+" !important; }"));null!==d.ruler.color&&(a+="#recite-ruler { background-color: "+
d.ruler.color+" }");return a}function a(){var a;a=window.document;var d=Recite.Sizzle("style[id=recite-style]");0===d.length?(d=a.createElement("style"),d.type="text/css",d.id="recite-style",d.setAttribute("data-recite-skip","true"),Recite.Sizzle("head",a)[0].appendChild(d)):d=d[0];a=d;if(a.styleSheet)a.styleSheet.cssText=c();else{for(d=window.document.createTextNode(c());a.hasChildNodes();)a.removeChild(a.lastChild);a.appendChild(d)}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),d=Recite.Sizzle("body",document)[0];Recite.Debug.log("Recite.Style","Wrapping body elements in a recite-wrapper.");var c=document.createElement("div");c.id="recite-wrapper";Recite.Util.each(a,function(a,b){"true"!==b.getAttribute("data-recite-skipwrap")&&(b.parentNode.removeChild(b),
c.appendChild(b))});d.appendChild(c)});return{update:a}}();Recite.namespace("Ruler");
Recite.Ruler=function(){function c(){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 d=Recite.Sizzle("body",a)[0],b=a.createElement("div");b.id="recite-ruler";d.appendChild(b)}else b=b[0];return b}function b(b){var c=a(document);switch(d.mode){case "bottom":c.style.bottom=0;c.style.top=b.screenY+d.modes.bottom.yOffset+"px";break;case "top":c.style.top=0;c.style.bottom=b.screenY+d.modes.top.yOffset+
"px";break;case "bar":c.style.bottom="auto",c.style.height=d.modes.bar.height+"px",c.style.top=b.screenY+d.modes.bar.yOffset+"px"}}var d={enabled:!1,mode:"bar",modes:{top:{yOffset:-80},bottom:{yOffset:-80},bar:{yOffset:-80,height:160}}};Recite.Event.subscribe("Preferences:load",c);Recite.Event.subscribe("Preferences:set",c);Recite.Event.subscribe("Preferences:reset",c);return{setOptions:function(a){d=Recite.Util.merge(d,a)},enable:function(){if(!d.enabled){Recite.Debug.log("Recite.Ruler","Enabled ruler");
Recite.PlayerControls.disable();Recite.Player.stop();var c=Recite.Sizzle("body",document)[0];a(document);Recite.DomEvent.add(c,"mousemove",b);d.enabled=!0;Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Ruler",event:"enable"})}},disable:function(){if(d.enabled){Recite.Debug.log("Recite.Ruler","Disabled ruler");Recite.PlayerControls.enable();var c=Recite.Sizzle("body",document)[0];Recite.DomEvent.remove(c,"mousemove",b);c=a(document);c.parentNode.removeChild(c);d.enabled=!1;Recite.Event.publish("Recite:ModuleEvent",
{name:"Recite.Ruler",event:"disable"})}}}}();Recite.namespace("Browser");
Recite.Browser=function(){function c(){d=a(j)||"unknown browser";e=b(navigator.userAgent)||b(navigator.appVersion)||"unknown version";g=a(i)||"unknown OS"}function a(a){for(var b=0;b<a.length;b++){var d=a[b].string,c=a[b].prop;f=a[b].versionSearch||a[b].identity;if(d){if(-1!==d.indexOf(a[b].subString))return a[b].subString}else if(c)return a[b].subString}return!1}function b(a){var b=a.indexOf(f);return-1===b?!1:parseFloat(a.substring(b+f.length+1))}var d,e,g,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(){c();return d},getVersion:function(){c();return e},getOS:function(){c();return g},getData:function(){c();return{name:d,version:e,OS:g}},isMobile:function(){return"Android"===Recite.Browser.getOS()||"iPhone"===Recite.Browser.getOS()?!0:
!1}}}();Recite.namespace("Selection");
Recite.Selection=function(){function c(){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 b=c();0<b.length&&(Recite.Event.publish("Selection:textSelection",{method:"selection",text:b}),a.playOnSelection&&Recite.Player.play(b))});return{setOptions:function(b){a=
Recite.Util.merge(a,b)},getOptions:function(){return a},getTextSelection:c}}();Recite.namespace("AudioDownload");
Recite.AudioDownload=function(){var c={enabled:!0},a=null;Recite.Event.subscribe("Selection:textSelection",function(b,d){"selection"===d.method&&c.enabled&&(a=d.text)});return{setOptions:function(a){c=Recite.Util.merge(c,a)},getOptions:function(){return c},getEnabled:function(){return c.enabled},generateDownload:function(b){c.enabled?(b||(b=a),b?(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(b),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 c(a,b){Recite.Util.each(a.styleSheets,function(a,d){if(b){if("true"!==(d.ownerNode||d.owningElement).getAttribute("data-recite-skip"))d.prevState=d.disabled,d.disabled=!0}else"undefined"!==typeof d.prevState?(d.disabled=d.prevState,d.prevState=null):d.disabled=!1})}var a={disableInlineStyles:!0,disableStylesheets:!0,hideElements:["img","iframe","object","embed"]},b=[];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"),b=Recite.Sizzle("#recite-wrapper")[0];a?Recite.TextMode.transform(b):Recite.TextMode.restore(b)});Recite.Event.subscribe("Preferences:reset",function(){var a=Recite.Preferences.get("textMode.enabled"),b=Recite.Sizzle("#recite-wrapper")[0];!0===a?Recite.TextMode.transform(b):Recite.TextMode.restore(b)});return{setOptions:function(b){a=
Recite.Util.merge(a,b)},transform:function(d){if(!(0<=Recite.Util.inArray(d,b))){b.push(d);var e=d.ownerDocument;a.disableStylesheets&&c(e,!0);e=Recite.Sizzle("*",d);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,b){var c=Recite.Sizzle(b,d);Recite.Util.each(c,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(d){var e=Recite.Util.inArray(d,b);if(!(0>e)){var g=d.ownerDocument;a.disableStylesheets&&c(g,!1);g=Recite.Sizzle("*",d);a.disableInlineStyles&&Recite.Util.each(g,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,b){var c=Recite.Sizzle(b,d);Recite.Util.each(c,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))})});b.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 c(){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){d({text:a.target.innerHTML})})}function b(a,b){if("selection"===b.method){if(!f||""===b.text||!1===b.text||
b.text===j)return!1;d(b);j=b.text}return!0}function d(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 d="";Recite.Util.each(b,function(a,b){d+="<strong>"+unescape(b.word)+"</strong><br />"+unescape(b.definition)+"<br /><br />";b.synonyms&&(d+="<strong>Synonyms</strong><br />",Recite.Util.each(b.synonyms,function(a,b){d+=
"<span class='recite-dictionary-synonym'>"+unescape(b)+"</span>,<br />"}),d+="<hr />")});a(d)}})}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>'},g=null,f=!1,j=null;Recite.Event.subscribe("Recite.disable",function(){Recite.Dictionary.disable()});
Recite.Event.subscribe("Preferences:load",c);Recite.Event.subscribe("Preferences:set",c);Recite.Event.subscribe("Preferences:reset",c);return{enable:function(){if(!f){var d=document.createElement("div");d.id="recite-dictionary";d.setAttribute("data-recite-skip","true");d.innerHTML=e.content;document.body.appendChild(d);d.className="recite-dictionary-"+e.position;"header"!==e.position&&(d.style.width=e.dimensions.width,d.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();g=Recite.Event.subscribe("Selection:textSelection",b);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(g),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 c(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 b=[],d=["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){b=document.getElementsByTagName("a");for(var a=0;a<b.length;a++){var f=b[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])&&c(j);for(var j=f,i=j.getAttribute("href").split(".").pop(),h=0;h<d.length;h++)i===d[h]&&c(j);(f.className===e.selector||f.getAttribute("id")===e.selector)&&c(f)}}}}}}();Recite.namespace("Keyboard");
Recite.Keyboard=function(){function c(){Recite.Debug.log("Recite.Keyboard","Binding keyboard keys");a.enabled&&Recite.Util.each(a.key_bindings,function(a,d){Recite.Key(a,d)})}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",c);return{setOptions:function(b){a=Recite.Util.merge(a,b)},enabled:function(){return a.enabled},setEnabled:function(b){a.enabled=b},load:function(){c()}}}();Recite.namespace("Tracker");
Recite.Tracker=function(){var c={enabled:!0};return{setOptions:function(a){c=Recite.Util.merge(c,a)},track:function(a,b){c.enabled&&(b=b||{},b.type=a,b.uri=window.location.toString(),b.referrer=window.document.referrer||null,Recite.Api.call("tracker","POST",{data:b,success:function(){Recite.Debug.log("Recite.Tracker","Tracked event type: "+a)}}))}}}();Recite.namespace("Language.Translate");
Recite.Language.Translate=function(){function c(){var a=Recite.Preferences.get("language");null!==a?Recite.Language.Translate.translate(document,a):Recite.Language.Translate.restore()}var a=[],b=[];Text.prototype.originalContent=null;Text.prototype.originalLang=null;Text.prototype.originalParentLang=null;var d={sourceLanguage:"en",maxChunkSize:100,maxCharacterLimit:3E3,disallowedTags:["SCRIPT","STYLE"],translateableAttributes:[]};Recite.Event.subscribe("Preferences:load",c);Recite.Event.subscribe("Preferences:reset",
c);return{setOptions:function(a){d=Recite.Util.merge(d,a)},translate:function(c,g){if(g===d.sourceLanguage)Recite.Language.Translate.restore();else{var c=Recite.Util.isArray(c)?c:[c],f={};Recite.Util.each(c,function(a,b){for(var c=b.childNodes[0];null!==c;){if(3===c.nodeType&&0<c.nodeValue.trim().length){if("undefined"===typeof c.originalContent||null===c.originalContent)c.originalContent=c.nodeValue,c.originalLang=null!==Recite.Dom.getLanguage(c)?Recite.Dom.getLanguage(c):d.sourceLanguage,c.originalParentLang=
c.parentNode.lang;if(c.originalLang===g||c.originalLang.split("-")[0]===g)c.nodeValue=c.originalContent,c.parentNode.lang=c.originalParentLang||null;else{var e=c.originalLang.split("-")[0];"undefined"===typeof f[e]&&(f[e]=[]);f[e].push(c)}}if(c.hasChildNodes()&&0>Recite.Util.inArray(c.tagName,d.disallowedTags))c=c.firstChild;else{for(;null===c.nextSibling&&c!==b;)c=c.parentNode;c=c===b?null:c.nextSibling}}});var j={};0!==d.translateableAttributes.length&&Recite.Util.each(c,function(a,b){for(var c=
b.childNodes[0];null!==c;){c.affectedAttributes=[];var e=!1;if("undefined"!==typeof c.attributes&&null!==c.attributes){for(var f=0;f<d.translateableAttributes.length;f++)for(a=0;a<c.attributes.length;a++)if(c.attributes[a].nodeName===d.translateableAttributes[f]){c.affectedAttributes.push(c.attributes[a].nodeName);"undefined"===typeof c.originalContent&&(c.originalContent=[]);if("undefined"===typeof c.originalContent[d.translateableAttributes[f]]||null===c.originalContent[d.translateableAttributes[f]])c.originalContent[d.translateableAttributes[f]]=
c.getAttribute(d.translateableAttributes[f]),c.originalLang=null!==Recite.Dom.getLanguage(c)?Recite.Dom.getLanguage(c):d.sourceLanguage,c.originalParentLang=c.parentNode.lang;if(c.originalLang===g||c.originalLang.split("-")[0]===g)c.setAttribute(c.attributes[a].nodeName,c.originalContent[d.translateableAttributes[f]]),c.parentNode.lang=c.originalParentLang||null,e=!0}!e&&"undefined"!==typeof c.originalLang&&(e=c.originalLang.split("-")[0],"undefined"===typeof j[e]&&(j[e]=[]),j[e].push(c))}if(c.hasChildNodes()&&
0>Recite.Util.inArray(c.tagName,d.disallowedTags))c=c.firstChild;else{for(;null===c.nextSibling&&c!==b;)c=c.parentNode;c=c===b?null:c.nextSibling}}});for(var i in j){var h=[];Recite.Util.each(j[i],function(a,b){for(var c=0;c<b.affectedAttributes.length;c++)h.push(b.originalContent[b.affectedAttributes[c]])});var p={target:g,source:i,text:h};Recite.Api.call("translate","POST",{data:p,contentType:"application/json",success:function(a){for(var c in j)Recite.Util.each(j[c],function(c,d){for(var e=0;e<
d.affectedAttributes.length;e++)d.setAttribute(d.affectedAttributes[e],a[0]),a.shift();b.push(d)})}})}for(i in f){var m=[],n=0,k=[];Recite.Util.each(f[i],function(a,b){if(null!==d.maxChunkSize&&k.length>=d.maxChunkSize||null!==d.maxCharacterLimit&&n>=d.maxCharacters)m.push(k),k=[],n=0;k.push(b.originalContent);n+=b.originalContent.length});m.push(k);Recite.Util.each(m,function(b,c){var e=i;p={target:g,source:e,text:c};Recite.Api.call("translate","POST",{data:p,contentType:"application/json",success:function(c){Recite.Util.each(c,
function(c,h){var i=f[e][b*d.maxChunkSize+c];3===i.nodeType?(i.nodeValue=h,i.parentNode.lang=g):(i.innerHTML=h,i.lang=g);a.push(i)})}})})}Recite.Event.publish("Recite:ModuleEvent",{name:"Recite.Language",event:"translate:"+g})}},restore:function(){Recite.Debug.log("Language","Restoring source language");Recite.Util.each(a,function(a,b){b.nodeValue=b.originalContent;b.parentNode.lang=null!==b.originalParentLang?b.originalParentLang:d.sourceLanguage});Recite.Util.each(b,function(a,b){for(a=0;a<b.attributes.length;a++)for(var c=
0;c<d.translateableAttributes.length;c++)d.translateableAttributes[c]===b.attributes[a].nodeName&&(b.setAttribute(b.attributes[a].nodeName,b.originalContent[b.attributes[a].nodeName]),b.lang=null!==b.originalLang?b.originalLang:d.sourceLanguage)});a=[];b=[]}}}();Recite.namespace("Gui.Notification");
Recite.Gui.Notification=function(){function c(a){try{document.body.removeChild(a),b.splice(b.indexOf(a.id),1)}catch(c){}}var a={position:"top-right",timeout:4E3,read:!0,elementTopMgn:5,surpress:!1},b=[],d=0;return{show:function(e,g){if(!a.surpress&&!Recite.Browser.isMobile()){Recite.Gui.Notification.setOptions(g);var f=document.createElement("div");f.innerHTML=e;f.id=d;f.content=e;d++;var j=!1;Recite.Util.each(b,function(a,b){b.content==f.content&&(j=!0)});j||(b.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(){c(f)},a.timeout);if(a.read)try{Recite.Player.play(f.innerHTML)}catch(h){}Recite.DomEvent.add(f,"click",function(){c(f)})}},destroy:function(a){c(a)},setOptions:function(b){a=Recite.Util.merge(a,b)}}}();
