var manchete = "Stevie Wonder diz que ainda não escreveu sua melhor canção"; var link = "http://www.cifraclub.com.br/noticias/9371-stevie-wonder-diz-que-ainda-nao-escreveu-sua-melhor-cancao.html";var noticias = new Array("Stevie Wonder diz que ainda não escreveu sua melhor canção","http://www.cifraclub.com.br/noticias/9371-stevie-wonder-diz-que-ainda-nao-escreveu-sua-melhor-cancao.html","Stevie Wonder diz que ainda não escreveu sua melhor canção","http://www.cifraclub.com.br/noticias/9371-stevie-wonder-diz-que-ainda-nao-escreveu-sua-melhor-cancao.html","Rihanna participa como convidada especial em vídeo de Kanye West","http://www.cifraclub.com.br/noticias/9369-rihanna-participa-como-convidada-especial-em-video-de-kanye-west.html","Varg Vikernes, do Burzum, está livre após passar 16 anos na prisão","http://www.cifraclub.com.br/noticias/9368-varg-vikernes-do-burzum-esta-livre-apos-passar-16-anos-na-prisao.html","Herbert Vianna planeja gravação de seu quarto álbum solo","http://www.cifraclub.com.br/noticias/9367-herbert-vianna-planeja-gravacao-de-seu-quarto-album-solo.html","Músico e compositor Zé Rodrix morre aos 61 anos em São Paulo","http://www.cifraclub.com.br/noticias/9365-musico-compositor-ze-rodrix-morre-aos-61-anos-em-sao-paulo.html","Novo trabalho de Ivete Sangalo será lançado também em Portugal","http://www.cifraclub.com.br/noticias/9364-novo-trabalho-de-ivete-sangalo-sera-lancado-tambem-em-portugal.html","Novo álbum do Green Day não será vendido pela rede Wal-Mart","http://www.cifraclub.com.br/noticias/9363-novo-album-do-green-day-nao-sera-vendido-pela-rede-wal-mart.html","Leonardo DiCaprio deve interpretar Frank Sinatra em filme de Scorsese","http://www.cifraclub.com.br/noticias/9362-leonardo-dicaprio-deve-interpretar-frank-sinatra-em-filme-de-scorsese.html");
function mArt(letra,link)
{
    tira_classe();
	link.className = 'on';
    var bar3 = document.getElementById('bar3');
    var top3 = document.getElementById('top');
    num = 6;
    top3.innerHTML = document.getElementById('letra'+letra).innerHTML;
    bar3.innerHTML = '<div id="top" style="display:block;">' + top3.innerHTML + '</div>';
}
var num = 7;
function fecha_artistas()
{
	tira_classe();
	var div = document.getElementById('bar3');
    div.innerHTML = '<label>Leia <b>&raquo;</b></label> <a href="'+link+'" target="_blank">'+manchete+'</a><div class="right"><a href="http://cifraclub.terra.com.br/noticias/"class="btn" onclick="mostra_noticias(0);return false">&#9668;</a> <a href="http://cifraclub.terra.com.br/noticias/" class="btn" onclick="mostra_noticias(1);return false">&#9658;</a><div id="top" style="display:none;"></div></div>';
    div.style.display = 'block';
    document.getElementById('top').style.display = 'none';
}

function tira_classe()
{
	var links = document.getElementsByTagName('a');
	for(var i=0;i<links.length;i++)
	{
        if((links[i].className == 'on') &&(links[i].innerHTML.length < 4))
            links[i].className = '';
	}
}

var noticia
function busca_pos_manchete()
{
	for(i=1;i<noticias.length;i+=2)
	{
	    if(noticias[i]==link)
	    {
	    	noticia = i-1;
	    	break;
	    }
	}   
}

function altera_noticia(opcao)
{
	if(opcao == 1)
	    if(noticia+2 > noticias.length-2)
	        noticia = 0;
	    else    
            noticia+=2;
    else if(opcao == 0)
        if(noticia-2 < 0)
            noticia = noticias.length-2;
        else
            noticia-=2;                         
}
function mostra_noticias(opcao)
{
	altera_noticia(opcao);
	if(noticias[noticia] == manchete)
			fecha_artistas();
    else
    	document.getElementById('bar3').innerHTML = '<label>Leia <b>&raquo;</b></label> <a href="' + noticias[noticia+1] + '" target="_blank">' + noticias[noticia] + '</a><div class="right"><a href="http://cifraclub.terra.com.br/noticias/"class="btn" onclick="mostra_noticias(0);return false" id="anterior">&#9668;</a> <a href="http://cifraclub.terra.com.br/noticias/" class="btn" onclick="mostra_noticias(1);return false" id="proximo">&#9658;</a><div id="top" style="display:none;"></div></div>';
}

function contador_regressivo()
{
	/*if(num == 0)
	    fecha_artistas(); 
	else*/ if (num == 7)
	{
		tira_classe();
		mostra_noticias(2);
	}
	else if((num > 0) &&(num != 6))
		num--;
	setTimeout("contador_regressivo()",500);
}

function verifica_resolucao()
{
	if((document.body.clientWidth <= 800) && (document.body.clientHeight <= 600))
	{
		try
		{    
			document.getElementById('all').id = 'all2';
		}
	    catch(e)
	    {
	    	document.getElementById('all2').id = 'all2';
	    }    
	}    
	else
	{
		try
		{
			document.getElementById('all').id = 'all';
		} 
	    catch(e)    
	    {
	    	document.getElementById('all2').id = 'all';
	    } 
	}    
}

function utube(id_video,width,height)
{
	//document.write('<center><div id="video"class="pol"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="425" height="350" id="swfobj" align="middle" type="application/x-shockwave-flash"><param name="movie" value="http://www.youtube.com/v/'+id_video+'&autoplay=1" /><param name="quality" value="high" /><param name="wmode" value="Transparent" /><embed src="http://www.youtube.com/v/'+id_video+'&autoplay=1" flashvars="" quality="high" width="425" height="350" name="flashobj" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" wmode="Transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object><small><img src="/rate'+nota+'.gif"alt="excelente"title="excelente"/> | duração '+tempo+' | enviado em '+data+'</small><small>enviado por <a href="http://www.youtube.com/user/'+usuario+'">'+usuario+'</a> |<a href="http://www.youtube.com/t/dmca_policy">Copyright&copy;</a></small></div></center>');
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"id="swfobj"type="application/x-shockwave-flash" align="middle"width="'+width+'"height="'+height+'"><param name="movie" value="http://www.youtube.com/v/'+id_video+'"><param name="quality"value="high"><param name="wmode"value="Transparent"><embed src="http://www.youtube.com/v/'+id_video+'"flashvars=""quality="high"name="flashobj"allowscriptaccess="sameDomain"type="application/x-shockwave-flash"wmode="Transparent"pluginspage="http://www.macromedia.com/go/getflashplayer"align="middle"width="'+width+'"height="'+height+'"/></object>');
}

function muda_foto(num_foto,artista)
{
	var principal = document.getElementById('principal');
	var imagem = document.getElementById('foto'+num_foto);
	var caminho = imagem.src.substr(0,imagem.src.length-7);
	var imagens = document.getElementsByTagName('img');
	
	var j = 1;
	for(var i=0;i<imagens.length;i++)
	{
		if(imagens[i].title="foto"+j)
		    imagens[i].className = '';
		j++;    
	}
	
	imagem.className = 'on';
	principal.innerHTML = '<img src="'+caminho+'.jpg" alt="'+artista+'"title="'+artista+'"/>';
	
}