+// ttsShowPopup
+//______________________________________________________________________________
+BookReader.prototype.ttsShowPopup = function() {
+ this.popup = document.createElement("div");
+ $(this.popup).css({
+ position: 'absolute',
+ top: '20%',
+ left: ($('#BRcontainer').attr('clientWidth')-600)/2 + 'px',
+ width: '600px',
+ padding: "20px",
+ border: "3px double #999999",
+ zIndex: 3,
+ backgroundColor: "#f00",
+ color: "#fff",
+ fontSize: '1.875em'
+ }).appendTo('#BookReader');
+
+ htmlStr = '<p style="text-align:center;"><b>Ever wanted to wait while audio loads?</b><br/>';
+ htmlStr += "It's OK. We all do.</p>";
+
+ this.popup.innerHTML = htmlStr;
+}
+
+// ttsNextPageCB
+//______________________________________________________________________________
+BookReader.prototype.ttsNextPageCB = function (data) {
+ this.ttsNextChunks = data;
+ console.log('preloaded next chunks.. data is');
+}
+
+// ttsLoadChunk
+//______________________________________________________________________________
+BookReader.prototype.ttsLoadChunk = function (page, pos, string) {
+ var snd = soundManager.createSound({
+ id: 'chunk'+page+'-'+pos,
+ url: 'http://home.us.archive.org/~rkumar/getOgg.php?string=' + escape(string) + '&f=.ogg' //the .ogg is to trick SoundManager2 to use the HTML5 audio player
+ });
+ snd.br = this;
+ snd.load()
+}
+
+