/*********************************************************************** speaker.js ************************************************************************ Do not change this file unless it should change for all users. This file defines functions that deal with the automatic speaker. ************************************************************************/ Content.prototype.attachSpeaker = function(){ if(localTest) { return; } var c = this; var url = window.location.toString().split("?"); var encodedURL = encodeURIComponent(url[0]); var html = "
"; $(".scrollable").append(html); $("#readspeaker_button1").hide(); if(document.getElementById('readspeaker_button1')){ var a = $("#readspeaker_button1").find("a"); $(a).click(function(e){ window.readpage(this); //e = e.originalEvent; e.stopPropagation(); if (e.preventDefault) { e.preventDefault(); } e.returnValue = false; return false; }); $("#soundBtn").click(function(e){ //toggla speaker-autoplay och sätt pace till lägsta c.ToggleSpeaker(); c.SetPace(0); $(a).trigger("click",e); }); } } Content.prototype.ToggleSpeaker = function(){ var speakerState = getCookie("speakerState"); if(speakerState == "on"){ setCookie("speakerState","off",360); }else if (speakerState == "off"){ setCookie("speakerState","on",360); } else { setCookie("speakerState","off",360); } }; Content.prototype.Speaker = function(speakerState){ var c = this; if(speakerState == "on"){ c.DisablePace(); //Collect text and put in rs_hiddenLayer $("#at_content").append(""); //Kolla först om sidan har delays var hasDelay = $("."+elements.delay).length > 0; var pgtitle, pgcontent; if(!hasDelay){ pgtitle = $(".heading1"); pgcontent = $("div.p, .item, .lcQuestion, .lcAnswerOption"); $("#rs_hiddenLayer").html("