void 0===window.centovacast&&(window.centovacast={});void 0===window.centovacast.options&&(window.centovacast.options={});
void 0===window.centovacast.loader&&(window.centovacast.loader={attempts:0,external_jquery:!1,loaded:!1,ready:!1,widget_definitions:{},url:"",load_script:function(a){var b=document.createElement("script");void 0!==b&&(b.setAttribute("type","text/javascript"),b.setAttribute("src",a),void 0!==b&&document.getElementsByTagName("head")[0].appendChild(b))},load_widget:function(a){a=this.widget_definitions[a];null===a.ref&&(a.ref=a.define(jQuery))},jq_loaded:function(){this.external_jquery||jQuery.noConflict();
jQuery.getJSONP=this.jq_get_jsonp;for(var a in this.widget_definitions)"string"===typeof a&&this.load_widget(a);this.loaded=!0;var b=this;jQuery(document).ready(function(){b.ready=!0;for(var a in b.widget_definitions)"function"===typeof b.widget_definitions[a].init&&b.widget_definitions[a].init(jQuery)})},check:function(){if("undefined"===typeof jQuery){var a=this;setTimeout(function(){a.check()},100);this.attempts++}else this.jq_loaded()},process_widget_element:function(a,b,c,f){a=jQuery(a);var d=
!1,e={},g;for(g in b)if(b.hasOwnProperty(g)){var k=b[g];var h=a.data(k);"undefined"!==typeof h?(e[k]=h,d=!0):e[k]=""}h=a.prop("id");if(d)e.type=a.data("type");else{if("string"!==typeof h||h.substr(0,c.length+1)!==c+"_")return null;e.fromid=!0;e.originalid=h;c=h.substr(c.length+1);if(f){f=/^([a-z0-9]+)_/;d=f.exec(c);if(!d)return null;e.type=d[1];c=c.replace(f,"")}var l=null;for(g in b)b.hasOwnProperty(g)&&(k=b[g],null===l&&(l=k),f=new RegExp("_"+g+"-([^_]+)"),d=f.exec(c))&&(e[k]=d[1],c=c.replace(f,
""));e[l]=c;"string"===typeof e.mount&&(e.mount=e.mount.replace(/-/,"/"))}e.id=h;e.$el=a;return e},process_widget_elements:function(a,b,c,f){var d={},e=this;a.each(function(){var g=e.process_widget_element(this,b,c,f),a=""+g.username+g.mount;d[a]||(d[a]=jQuery.extend({},g),f&&(d[a].type=void 0),d[a].hastype=f,d[a].$el=f?{}:null);f?d[a].$el[g.type]=d[a].$el[g.type]?d[a].$el[g.type].add(g.$el[0]):g.$el:d[a].$el=d[a].$el?d[a].$el.add(g.$el[0]):g.$el});return{widget_data:d,get:function(a){if(this.widget_data[a])return this.widget_data[a]},
get_property:function(a,b){if(this.widget_data[a]&&this.widget_data[a][b])return this.widget_data[a][b]},get_element:function(a,b){if(this.widget_data[a])return this.widget_data[a].hastype?this.widget_data[a].$el[b]?this.widget_data[a].$el[b]:jQuery():this.widget_data[a].$el?this.widget_data[a].$el:jQuery()},set_element:function(a,b,c){this.widget_data[a].hastype?b&&b.length&&(this.widget_data[a].$el[b]=c):this.widget_data[a].$el=c},set_property:function(a,b,c){if(!this.widget_data[a])return!1;this.widget_data[a][b]=
c;return!0},each:function(a){for(var b in this.widget_data)"string"===typeof b&&a(b,this.widget_data[b])},each_element:function(a,b){if(this.widget_data[a].hastype)for(var c in this.widget_data[a].$el)"string"!==typeof c&&void 0!==c||b(this.widget_data[a].$el[c],c);else b(this.widget_data[a].$el)}}},init:function(){var a=document.getElementsByTagName("script");a=a[a.length-1];a=void 0!==a.getAttribute.length?a.getAttribute("src"):a.getAttribute("src",2);a.match(/^https?:\/\//i)||(a=a.replace(/\/system\/.*$/,
"/"));this.url=a.replace(/(\.(?:[a-z]{2,}|[0-9]+)(:[0-9]+)?\/).*$/i,"$1");(this.external_jquery="undefined"!==typeof jQuery)||this.load_script(this.url+"system/jquery.min.js");this.check()},add:function(a,b,c){this.widget_definitions[a]||(this.widget_definitions[a]={define:c,init:b,ref:null});this.loaded&&this.load_widget(a);this.ready&&b(jQuery)},jq_get_jsonp:function(a,b,c){return jQuery.ajax({type:"GET",url:a,data:b,success:c,dataType:"jsonp"})}},window.centovacast.loader.init());
window.centovacast.loader.add("streaminfo",function(a){a.extend(window.centovacast.streaminfo.settings,window.centovacast.options.streaminfo);window.centovacast.streaminfo.settings.manual||window.centovacast.streaminfo.run()},function(a){window.centovacast.options.streaminfo=a.extend({},window.centovacast.options.streaminfo,window.centovacast.streaminfo?window.centovacast.streaminfo.config:null);return window.centovacast.streaminfo={pollcount:0,settings:{poll_limit:60,poll_frequency:6E4},widgets:{},
element_class:".cc_streaminfo",handle_json:function(b,c){c||(c=b.rid);var f=this.widgets.get(c);if(f)if("error"===b.type){if(b=b?b.error:"No JSON object",this.widgets.get_element(c,"song").html('Unavailable'),"function"===typeof this.settings.on_error_callback)this.settings.on_error_callback(b,c)}else{var d=b.data[0];b.data[0].songchanged=d.song!==f.current_song;"function"===typeof this.settings.before_change_callback&&this.settings.before_change_callback(b,c);this.widgets.each_element(c,
function(a,b){if("song"!==b&&"track"!==b){if(b.match(/^track[a-z]+/))if("object"===typeof d.track)switch(b){case "trackbuyurl":a.attr("href",d.track.buyurl?d.track.buyurl:"javascript:void(0)");break;case "trackimageurl":a.attr("src",d.track.imageurl);return;case "trackplaylist":case "playlist":a.html("object"===typeof d.track.playlist?d.track.playlist.title:"");return;default:var c=d.track[b.replace(/^track/,"")]}else c=null;else c=d[b];b=typeof c;"string"!==b&&"number"!==b||a.html(c)}});"function"===
typeof this.settings.after_change_callback&&this.settings.after_change_callback(b,c);var e=d.song;e&&e!==f.current_song&&(this.widgets.get_element(c,"song").fadeOut("fast",function(){a(this).html(e).fadeIn("fast")}),this.widgets.set_property(c,"current_song",e))}},poll:function(b){var c=this.widgets.get(b),f=this;a.getJSONP((this.settings.local?"/":window.centovacast.loader.url)+"external/rpc.php",{m:"streaminfo.get",username:c.username,charset:c.charset,mountpoint:c.mount,rid:b},function(a){a&&f.handle_json(a,
b)})},poll_username:function(a){var b=this;this.widgets.each(function(c,d){d.username===a&&b.poll(c)})},poll_all:function(){var a=this;this.widgets.each(function(b){a.poll(b)});(0===this.settings.poll_limit||this.pollcount++