var ready=false;var yp_url="http://theartcollider.org/yp/";var tac_url="http://theartcollider.org/";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}if(a>1225){a=1225}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()-840)/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=yp_url+"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?pln=1&url="+a}else{document.getElementById("infoframe").data="video.php?pln=1&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()",20000)}function del_stream(a){var b=document.getElementById("main");var c=document.getElementById("div_"+a);if(c){b.removeChild(c)}}function add_stream(d,b,j,e,l,f,a){var c=document.getElementById("main");var g=document.getElementById("mainend");var k=document.createElement("div");k.setAttribute("id","div_"+d);k.setAttribute("class","entry");k.onclick=function(){showPlayer(j)};k.onmouseover=function(){show("nfo_"+d)};k.onmouseout=function(){hide("nfo_"+d)};var i=f.substring(1+f.lastIndexOf("/"));var h=l.replace(/,/g,", ").replace(/_/g," ");k.innerHTML='<img src="'+yp_url+"thumb.php?sid="+d+'&small=1" alt="'+b+'" width="180" height="88" id="img_'+d+'" onload="img_loaded(\''+d+'\');"/><div class="nfo" id="nfo_'+d+'" style="display:none;"><div class="nfobox"><a href="'+j+'" class="nfotitle">'+b+"</a><br/>"+(f?'by <a href="'+f+'" class="nfoauthor">'+i+"</a>":"")+'<div class="nfotxt">'+e+"<br/><em>Tags:</em> "+h+"<br/>"+(f?'<div style="width:145px; height:21px; float:left; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href='+f+'&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; overflow:hidden;" allowTransparency="true"></iframe></div>':"")+'<div style="width:26px; float:right; overflow:hidden"><a href="http://twitter.com/share?url='+tac_url+"video.php?url="+encodeURI(j)+'" 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>';c.insertBefore(k,g);all_anim2(d,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=25";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(e){var d=new RegExp("(?:^|\\s)"+e+"(?:$|\\s)");var f=document.getElementsByTagName("*");var c=[];var b;for(var a=0;(b=f[a])!=null;a++){var g=b.className;if(g&&g.indexOf(e)!=-1&&d.test(g)){c.push(b)}}return c}}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)}};
