var refreshtimer;function wefunkscriptcleanup(){var el=document.getElementById('wefunkupdatescript');var el2=document.getElementById('currentplaylist');if(el!==null&&el2!==null){el.parentNode.removeChild(el);}}function wefunkrequestupdate(){var el=document.getElementById('metarefresh');if(el!==null){el.parentNode.removeChild(el);}wefunkscriptcleanup();el=document.createElement('script');el.type='text/javascript';el.id='wefunkupdatescript';var d=new Date();el.src='http://www.wefunkradio.com/radio/json?callback=WEFUNK_showdataupdate&'+d.getTime();document.body.appendChild(el);}function setautorefresh(){clearInterval(refreshtimer);refreshtimer=setInterval(wefunkrequestupdate,60500);wefunkrequestupdate();}function WEFUNK_showdataupdate(data){wefunkscriptcleanup();if(data.error||!data.currentshownum){}else{var attr;for(attr in data){if(typeof(attr)!='string'){continue;}try{document.getElementById('W_'+attr).innerHTML=data[attr];}catch(e){}}try{document.getElementById('currentplaylist').innerHTML='<h2>PLAYLIST &nbsp;&middot; '+data.currenttimeelapsed+' in, '+data.currenttimeremaining+' remaining</h2>'+data.currentplaylisthtml;document.getElementById('currentshowlink').href=data.currentshowurl;document.getElementById('currentshowlinktext').innerHTML=data.currentshowname;document.getElementById('currentcommentlink').href='/addcomment.plx?item='+data.currentshowdate+'&return=%2Fradio%2F';document.getElementById('timetonextshow').innerHTML='in '+data.currenttimeremaining;document.getElementById('nextshowlink').href=data.nextshowurl;document.getElementById('nextshowlink').innerHTML='About '+data.nextshowname;document.getElementById('nextplaylistlink').href='/playlist/wefunk-show-'+data.nextshownum+'_'+data.nextshowdate;}catch(e){}}if(typeof(showupdate_events)=='object'&&typeof(showupdate_events.push)=='function'){var i;for(i in showupdate_events){showupdate_events[i](data);}}}refreshtimer=setInterval(wefunkrequestupdate,60500);