var speakstate;var isie=(navigator.appName=="Microsoft Internet Explorer");function Speakarticle(a,b){$.ajax({type:"GET",async:false,url:a,dataType:"text",data:{id:""+b+""},success:function(d){var c="article_"+b+".wav";if(d==c){$("#speak .load").html("等待处理…");$("#speak .load").show();speakstate=window.setInterval("getstate("+b+")",500)}else{$("#speak .load").html("等待处理…");$("#speak .load").show();if(d=="no right!"){$("#speak .load").html("系统已禁用语音朗读功能！")}else{$("#speak .load").html("服务器配置或权限错误!")}}},error:function(c){$("#speak .load").html("声音输出错误!");$("#speak .load").show()}})}function cfm_ifm(b){var a=document.getElementById("player");a.innerHTML="";var d=document.createElement("iframe");d.setAttribute("name","ifr_wav");d.setAttribute("id","ifr_wav");d.setAttribute("src","");d.setAttribute("marginwidth","0");d.setAttribute("marginheight","0");d.setAttribute("width","300");d.setAttribute("height","50");d.setAttribute("scrolling","no");d.setAttribute("border","0");d.setAttribute("frameborder","0");a.appendChild(d);var c=window.frames.ifr_wav;createcfm(c,b)}function createcfm(b,a){b.document.open();b.document.write(a);b.document.close()}function player(b){var a=paperweburl+"jquery/tts_html5/"+b;$.ajax({type:"GET",async:false,url:a,dataType:"html",data:{id:""+b+"",temp:""+(new Date()).getTime()+""},success:function(d){if(d!=""){cfm_ifm(d);$("#speak .load").html("");$("#speak .load").hide();var c=window.frames.ifr_wav.document.getElementById("speakaudio");c.play()}},error:function(c){$("#speak .load").html("状态错误!")}})}function getstate(b){var a=paperweburl+"jquery/getstate";$.ajax({type:"GET",async:false,url:a,dataType:"text",data:{id:""+b+"",temp:""+(new Date()).getTime()+""},success:function(c){if(c==""){clearInterval(speakstate);$("#speak .load").html("正在缓冲…");player(b)}},error:function(c){$("#speak .load").html("状态错误!")}})}function Speakstop(){clearInterval(speakstate)};