var $blockDowloadMost=$w8x("#listDownloadMost").find("#menuDownloadMost:first").html();var $keyLastSong=0;var $keyCount=0;$downloadMost=function(c){$w8x(".ac_loading").show();var b=newXMLHttpRequest();var a="./XML/downAll.xml?rnd="+Math.random();b.onreadystatechange=getReadyStateHandler(b,extDownloadMost,a);sendReq(b,a)};var $start1lastSong=true;extDownloadMost=function(f){var c=parser.rpS(f);var b=c.getElementsByTagName("response")[0];var k="";var a=b.getElementsByTagName("random")[0].firstChild.nodeValue;if(parseInt(a)!=$keyLastSong){$keyLastSong=parseInt(a);var m=b.getElementsByTagName("song");var j=$blockDowloadMost;for(var n=0;n<m.length;n++){var t=m[n].getElementsByTagName("name")[0].firstChild.nodeValue;var p="";var s=m[n].getElementsByTagName("img")[0].firstChild.nodeValue;var l=m[n].getElementsByTagName("videoid")[0].firstChild.nodeValue;var h=m[n].getElementsByTagName("radioid")[0].firstChild.nodeValue;var g=m[n].getElementsByTagName("time")[0].firstChild.nodeValue;var d=m[n].getElementsByTagName("ext")[0].firstChild.nodeValue;t=$replaceAll(t,'"',"");t=$replaceAll(t,"^","&");t=$replaceAll(t,"'","");p=$replaceAll(p,'"',"");p=$replaceAll(p,"^","&");p=$replaceAll(p,"'","");var o=j;o=$replaceAll(o,'<!-- id="list"  >',"");o=$replaceAll(o,"<-->","");o=$replaceAll(o,"[w8xRadio_id]",h);o=$replaceAll(o,"[w8xYoutube_id]",l);o=$replaceAll(o,"[w8xYoutube_ext]",d);o=$replaceAll(o,"[w8xYoutube_img]",s);o=$replaceAll(o,"[w8xYoutube_name]",t);o=$replaceAll(o,"[w8xYoutube_description]",p);o=$replaceAll(o,'style="display:none;"',"");var r=document.getElementById("selectRadio").value;o=$replaceAll(o,"[w8xStation_id]",r);k=k+o}try{document.getElementById("menuDownloadMost").innerHTML=j+k;$w8x("#mostDownload_content_wrapper").jScrollPane({showArrows:true,horizontalGutter:10})}catch(q){}}$w8x(".ac_loading").hide()};$downloadMost();var downloadInfoTimer=setInterval(function(){$downloadInfo()},1000);var $downloadWait=function(b){if(document.getElementById("downloadFileStatus")!=null){var c=document.getElementById("downloadFileStatus").value;if(c!="-"){var a=$w8x(c).find("video").length;if(a>2){}else{if(document.getElementById("download"+b)!=null){document.getElementById("download"+b).innerHTML='<h2 style="margin:0;padding:0;margin-top:15px;text-align: center;color:#F900B0;font-size: 16px;">Wait ...</h2>'}}}else{if(document.getElementById("download"+b)!=null){document.getElementById("download"+b).innerHTML='<h2 style="margin:0;padding:0;margin-top:15px;text-align: center;color:#F900B0;font-size: 16px;">Wait ...</h2>'}}}};var $downloadInfo=function(){if(document.getElementById("downloadFileStatus")!=null){var d=document.getElementById("downloadFileStatus").value;if(d!="-"){var b=0;$w8x(d).find("video").each(function(){var i=$w8x(this).find("status").text();if(i==1){var h=$w8x(this).find("val").text();if(document.getElementById("download"+h)!=null){document.getElementById("download"+h).innerHTML='<h2 style="margin:0;padding:0;margin-top:15px;text-align: center;color:#F900B0;font-size: 16px;">Please wait DOWNLOAD</h2>'}}if(i==4){var h=$w8x(this).find("val").text();if(document.getElementById("download"+h)!=null){var f=$w8x(this).html();var l=parser.rpS("<video>"+f+"</video>");var j=l.getElementsByTagName("img")[0].firstChild.nodeValue;var e=l.getElementsByTagName("progress")[0].firstChild.nodeValue;var g=l.getElementsByTagName("name")[0].firstChild.nodeValue;var m=l.getElementsByTagName("size")[0].firstChild.nodeValue;if(document.getElementById("download"+h+"4")==null){var k='<div id="download'+h+'4"><div id="progressbar'+h+'" style="height: 22px;margin-left:10px;margin-top:10px;" ></div><p style="margin:0;padding:0;text-align: center;color:white;">prepares '+m+"M</p></div>";document.getElementById("download"+h).innerHTML=k}$("#progressbar"+h).progressbar({value:parseFloat(e)})}}if(i==5){var h=$w8x(this).find("val").text();if(document.getElementById("download"+h)!=null){document.getElementById("download"+h).innerHTML="<img onclick=\"projects.getDrawObj().setDownloadEnd('"+h+'\')" src="http://w8x.ru/radiotv/img/download.png" style="margin-top:15px;height: 32px;cursor: pointer;">'}}});if(document.getElementById("downloadFileSuccess")!=null){var c=document.getElementById("downloadFileSuccess").value;var a=c.split(",");for(var b=0;b<a.length;b++){if(document.getElementById("download"+a[b])!=null){document.getElementById("download"+a[b]).innerHTML=""}}}}}else{}};
