function abrePlayerRadioOnline(){
	//window.open('/player', 'PlayerRadioOnline', 'status=0, width=390, height=106, resizable = 0');
	window.open('/player', 'PlayerRadioOnline', 'status=0,width=800,height=470,resizable=0,status=1,toolbar=0,resizable=0,scrollbars=no');
}
function abrePlayerOnline(){
	//window.open('/player', 'PlayerRadioOnline', 'status=0, width=390, height=106, resizable = 0');
	window.open('/eco96fm', 'Eco96FM', 'status=0,width=580,height=280,resizable=0,status=1,toolbar=0,resizable=0,scrollbars=no');
}

$(function() {
	setInterval('atualiza_musica()', 30000);
	atualiza_musica();
	//$("ul#ticker01").liScroll();
});
function atualiza_musica () {
	$.ajax({  
		type: "GET",  
		url: "/pulsar.asp",  
		dataType: "xml",  
		success: function(xml) {
			$(xml).find("musica").each(function(){
				var programa =  $(this).find("programa").text();
				var programaLogo =  $(this).find("logo").text();
				var interprete =  $(this).find("interprete").text();
				var musica =  $(this).find("titulo").text();
				var img =  $(this).find("img_80x80").text();
				
				if($("#live_interprete").html()!=interprete){
				
					$("#live_programa").hide().html("Programa: "+programa).fadeIn('slow');
					
					if ((interprete && musica)) {
						$("#live_interprete").hide().html(interprete).fadeIn('slow');
						$("#live_musica").hide().html(musica).fadeIn('slow');
						if (img) {
							$("#live_img").attr({ 
							  src: img,
							}).hide().fadeIn('slow');
						}
						else {
							if(programaLogo=='vazio'){
								$("#live_img").attr({ 
								  src: '/images/sem_foto.jpg'
								});
							}else{
								$("#live_img").attr({ 
								  src: programaLogo
								});
							}
						}
					}
					else {
						$("#live_musica").hide().html('96FM FM<br />AO VIVO').fadeIn('slow');
						$("#live_img").attr({ 
						  src: '/images/sem_foto.jpg'
						}).hide().fadeIn('slow');
					}
				}
			});
		}  
	});
}

