var ready=false;function show(a){document.getElementById(a).style.display="block"}function hide(a){document.getElementById(a).style.display="none"}function window_width(){var a=630;if(window){a=window.innerWidth}if(document.body){a=document.body.offsetWidth}return a}function set_width(){var b=Math.floor((window_width()-80)/190)*190;if(b<570){b=570}document.getElementById("main").style.width=""+b+"px";var a=Math.floor((window_width()-680)/2);if(document.getElementById("infobox")){document.getElementById("infobox").style.left=a+"px"}return true}function update_img(b){if(document.getElementById("dimmer").style.display!="none"){img_loaded(b);return}var c=document.getElementById("img_"+b);if(!c){return}var d=new Date;var a=d.getTime();c.src="http://theartcollider.org/yp/thumb.php?sid="+b+"&small=1&timeout=5&"+a;c.lastupdate=a}function img_loaded(a){setTimeout("update_img('"+a+"');",5000+Math.floor(Math.random()*5000))}function inlinePlayer(){document.getElementById("infobox").style.display="inline";document.getElementById("dimmer").style.display="inline";document.getElementById("infobox").scrollTop=0}function showPlayer(a){if(document.getElementById("ieframe")){document.getElementById("ieframe").src="video.php?url="+a}else{document.getElementById("infoframe").data="video.php?url="+a}inlinePlayer()}function hidePlayer(){if(document.getElementById("ieframe")){document.getElementById("ieframe").src="video.php"}else{document.getElementById("infobox").style.display="none";document.getElementById("infoframe").data="video.php";inlinePlayer()}document.getElementById("infobox").style.display="none";document.getElementById("dimmer").style.display="none"}function all_anim1(b,a,c,e){if(c>0){c=c-2;a=a-4;if(c<0){c=0}if(a<0){a=0}document.getElementById("img_"+b).style.width=a+"px";document.getElementById("img_"+b).style.height=c+"px";document.getElementById("img_"+b).style.marginTop=Math.floor((88-c)/2)+"px";document.getElementById("img_"+b).style.marginLeft=Math.floor((180-a)/2)+"px";document.getElementById("img_"+b).style.marginRight=Math.floor((180-a)/2)+"px";setTimeout("all_anim1('"+b+"',"+a+","+c+","+e+");",20)}else{if(e){del_stream(b)}else{document.getElementById("img_"+b).style.width="0px";document.getElementById("img_"+b).style.marginLeft="0px";if(document.getElementById("dimmer").style.display=="none"){showWindow()}}}}function all_anim2(b,a,c){if(c<88||a<180){c=c+2;a=a+4;if(c>88){c=88}if(a>180){a=180}document.getElementById("img_"+b).style.width=a+"px";document.getElementById("img_"+b).style.height=c+"px";document.getElementById("img_"+b).style.marginTop=Math.floor((88-c)/2)+"px";document.getElementById("img_"+b).style.marginLeft=Math.floor((180-a)/2)+"px";document.getElementById("img_"+b).style.marginRight=Math.floor((180-a)/2)+"px";setTimeout("all_anim2('"+b+"',"+a+","+c+");",20)}}function start(){set_width();js_update();setInterval("js_update()",30000)}function del_stream(a){var b=document.getElementById("main");var c=document.getElementById("div_"+a);if(c){b.removeChild(c)}}function add_stream(b,g,k,c,l,d,f){var a=document.getElementById("main");var e=document.getElementById("mainend");var h=document.createElement("div");h.setAttribute("id","div_"+b);h.setAttribute("class","entry");h.onclick=function(){showPlayer(k)};h.onmouseover=function(){show("nfo_"+b)};h.onmouseout=function(){hide("nfo_"+b)};var i=d.substring(1+d.lastIndexOf("/"));var j=l.replace(/,/g,", ").replace(/_/g," ");h.innerHTML='<img src="http://theartcollider.org/yp/thumb.php?sid='+b+'&small=1" alt="'+g+'" width="180" height="88" id="img_'+b+'" onload="img_loaded(\''+b+'\');"/><div class="nfo" id="nfo_'+b+'" style="display:none;"><div class="nfobox"><a href="'+k+'" class="nfotitle">'+g+"</a><br/>"+(d?'by <a href="'+d+'" class="nfoauthor">'+i+"</a>":"")+'<div class="nfotxt">'+c+"<br/><em>Tags:</em> "+j+"<br/>"+(d?'<div style="width:145px; float:left; overflow=hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href='+d+'&amp;layout=button_count&amp;show_faces=false&amp;width=180&amp;action=like&amp;colorscheme=dark&amp;height=21" scrolling="no" frameborder="0" style="border:none; width:145px; height:21px;" allowTransparency="true"></iframe></div>':"")+'<div style="width:26px; float:right; overflow:hidden"><a href="http://twitter.com/share?url='+k+'" class="nfoauthor"><img src="static/img/twitter_20.png" alt="Tweet this"/></a></div><div class="clearer"></div></div></div><div class="nfobtm"> </div></div>';a.insertBefore(h,e);all_anim2(b,0,0)}function check_stream(b){if(document.getElementById("dimmer").style.display!="none"){return}var d=new Date;var a=d.getTime();var c=document.getElementById("img_"+b);if(c.lastupdate+30000<a){update_img(b)}}var feedurl="/yp/feed.php?type=json&limit=30";var request=false;function js_update(){if(document.getElementById("dimmer").style.display!="none"){return}if(request){if(request.readyState>0&&request.readyState<4){return}}try{request=new XMLHttpRequest()}catch(b){try{request=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{request=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){request=false}}}if(!request){alert("Error initializing XMLHttpRequest!");return}request.open("GET",feedurl,true);request.onreadystatechange=updatePage;request.send(null)}function updatePage(){if(request.readyState!=4){return}var r=eval(request.responseText);for(var i=0;i<r.length;i++){updateSid(r[i])}var x=document.getElementsByClassName("entry");for(var i=0;i<x.length;i++){if(x[i].id){var sid=x[i].id.substr(4);if(!findSid(r,sid)){all_anim1(sid,180,88,1)}}}var now=new Date;document.getElementById("updated").innerHTML="updated: "+now.toUTCString();ready=true}function findSid(c,a){for(var b=0;b<c.length;b++){if(c[b].sid==a){return true}}return false}function updateSid(a){var b=document.getElementById("div_"+a.sid);if(b){check_stream(a.sid);return}add_stream(a.sid,a.server_name,a.listen_url,a.description,a.genre,a.url,a.last_touch)}function initialize(){if(document.getElementsByClassName==undefined){document.getElementsByClassName=function(a){var c=new RegExp("(?:^|\\s)"+a+"(?:$|\\s)");var f=document.getElementsByTagName("*");var e=[];var b;for(var d=0;(b=f[d])!=null;d++){var g=b.className;if(g&&g.indexOf(a)!=-1&&c.test(g)){e.push(b)}}return e}}browserTest()}function nfowinclose(){hidePlayer();var a=document.getElementsByClassName("entry");for(var c=0;c<a.length;c++){if(a[c].id){var b=a[c].id.substr(4);all_anim2(b,0,0)}}ready=true}var openwin="";var openmode=false;function nfowin(d,e){if(ready==false){return}ready=false;openwin=d;openmode=e;var a=document.getElementsByClassName("entry");for(var c=0;c<a.length;c++){if(a[c].id){var b=a[c].id.substr(4);all_anim1(b,180,88,0)}}}function showWindow(){var a=openwin;if(openmode==1){document.location=a;return}else{if(openmode==0){a="nfo.php?id="+openwin}}if(document.getElementById("ieframe")){document.getElementById("ieframe").src=a}else{document.getElementById("infoframe").data=a}inlinePlayer()}function browserTest(){var c=navigator.userAgent;var a=-1;var b=true;if(c.indexOf("MSIE")>=0){a=parseFloat(c.substr(5+c.indexOf("MSIE")));if(a<8){b=false}}else{if(c.indexOf("Firefox")>=0){a=parseFloat(c.substr(8+c.indexOf("Firefox")));if(a<3.5){b=false}}else{if(c.indexOf("Chrome/")>=0){a=parseFloat(c.substr(7+c.indexOf("Version")));if(a<7){b=false}}else{if(c.indexOf("Safari")>=0){a=parseFloat(c.substr(8+c.indexOf("Version")));if(a<5){b=false}}else{if(c.indexOf("Opera")>=0){a=parseFloat(c.substr(8+c.indexOf("Version")));if(a<10.6){b=false}}}}}}if(!b){alert("This site requires a modern XHTML5 compatible browser. Please upgrade to Firefox >=3.5, Google Chrome >=9.0, Safari >=5.0, Opera >= 10.60, Internet Explorer >= 8.0 or similar for the best experience of this site.\n\ndetected:"+c+" v"+a)}};
