// escreve o .css correspondente ao browser
writeCSS('http://radio.musica.uol.com.br/');

// configurações da barra
var NumBar = 21;
var ColorBar1 = '#969698'; // cor clara
var ColorBar2 = '#666666'; // cor escura

// ícone para bookmark
document.write('<link rel="SHORTCUT ICON" HREF="http://home.img.uol.com.br/favicon.ico">');


// GetMethodParserJS ::: fermads @ uol
var L=location.href;
var d=L.substring(L.indexOf("?")+1);
var c=v=new Array(); c=d.split("&");
for(i=0;i<c.length&&c.length>0;i++) {
v=c[i].split("="); if(v.length>1)
eval(v[0]+"=unescape('"+v[1].replace(/\+/g," ")+"')");}

// função que deixa as colunas (esquerda, centro, direita) com a mesma altura
function resizeCols()
{
if(dC.getElementById) dC.getElementById('td1').style.height = dC.getElementById('td3').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
}

// mostra banners //
if(typeof(DErand)=="undefined") {
	var DEt=new Date(); DEt=DEt.getTime(); DErand=Math.floor(DEt*1000*Math.random());
}
var scw=0,sch=0; if(screen.height){scw=screen.width;sch=screen.height;}
function DEshow(ad,pos){
	var DEconn=document.body; DEconn.style.behavior='url(#default#clientCaps)'; DEconn=(DEconn.connectionType=='lan')?1:0;
	document.write('<'+'scr'+'ipt type="text/javascript" src="http://bn.uol.com.br/js.ng/site='+DEsite+'&amp;chan='+DEchan+'&amp;subchan='+DEsubc+'&amp;affiliate='+DEsite+DEchan+'&amp;size='+ad+'&amp;page='+pos+'&amp;conntype='+DEconn+'&amp;expble='+Expble+'&amp;reso='+scw+'x'+sch+'&amp;tile='+DErand+'?"><\/scr'+'ipt>');
}

function abrecanal(canal) {

	ts = new Date()
	Loc = canal;
	velho = Loc.indexOf("&");
	
	if (velho < 1) {
		radio = Loc.substring (Loc.indexOf ("canal=")+6);
		url = "http://app.radio.musica.uol.com.br/radiouol/player/frameset.php?opcao=playlist&nomeplaylist="+radio 
	}else{
		radio = Loc.substring (Loc.indexOf ("canal=")+6, Loc.indexOf ("&disco="));
		pop   = Loc.substring (Loc.indexOf ("&disco=")+7);
		if (pop=="s"){ url = "http://app.radio.musica.uol.com.br/radiouol/player/frameset.php?opcao=umcd&nomeplaylist="+radio }
		else{ url = "http://app.radio.musica.uol.com.br/radiouol/player/frameset.php?opcao=umamusica&nomeplaylist="+radio }
	}

	window.open(url,'popplaylist'+ts.getTime(),'width=480,height=350,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
}

function abreprograma(programa) {
	player = ((programa.indexOf("_128")!=-1) ? programa.slice(0,-4) : programa.slice(0,-3));
	url = 'http://radio.musica.uol.com.br/players/detector.htm?au='+programa+'&htm='+player+'_player';
	feat = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,title=yes,resizable='+((navigator.appName.indexOf("Explorer")!=-1) ? 'no' : 'yes')+',width=215,height=380';
	window.open(url,'audio_'+programa,feat);
}
