// Scripts diversos

// Função aumentar tamanho fonte
var fontsizebase=12;
function chcss(clr,tagname) {
var nodes = document.getElementsByTagName(tagname)
if (document.getElementById('ngprn').checked==true) var ng=1
if (document.getElementById('ngprn2').checked==true) var ng2=1
if (tagname=="b")document.getElementById('ngprn').value=clr;
if (tagname=="pre") document.getElementById('ngprn2').value=clr;
for(var i = 0;i < nodes.length;i++) {
var nodeObj = nodes.item(i);
if (clr==1) {fontsizebase++;nodeObj.style.fontSize=fontsizebase;document.getElementById('ftprn').value=fontsizebase;}
else if(clr==2){fontsizebase--;nodeObj.style.fontSize=fontsizebase;document.getElementById('ftprn').value=fontsizebase;}
else {
	nodeObj.style.color = clr;
	if ((ng==1 && tagname=="b")|| (tagname=="pre" && ng2==1)) nodeObj.style.fontWeight = 'bold';
	else nodeObj.style.fontWeight = 'normal';
	}
}
}

function prn() {
document.all.printtools.style.visibility="hidden";
var nodes = document.getElementsByTagName('td')
for(var i = 0;i < nodes.length;i++) {
var nodeObj = nodes.item(i);

if(nodeObj.innerHTML.indexOf('variar') > 0) nodeObj.innerHTML = '';
}

}

// Início do código de Aumentar/ Diminuir a letra
 
// Para usar coloque o comando: "javascript:mudaTamanho('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:mudaTamanho('tag_ou_id_alvo', +1);" para aumentar
 
var tagAlvo = new Array('pre'); //pega todas as tags p//
 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array( '9px','10px','11px','12px','13px','14px','15px' );
var tamanhoInicial = 2;
 
function mudaTamanho( idAlvo,acao ){
  if (!document.getElementById) return
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho += acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 6 ) tamanho = 6;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
  selecionados.style.fontSize = tamanhos[ tamanho ];
  
  for ( i = 0; i < tagAlvo.length; i++ ){
    tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );
    for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];
  }
}
// Fim do código de Aumentar/ Diminuir a letra

// Esconde Layer de impressão cifras
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
// Fim do código de Esconde Layer

// Exibição de notícias randônicas
setInterval("mudarNoticia('auto')", 5000);
 var link_noticias = new Array();
 link_noticias[0] = "aqui vc coloca os links";
 link_noticias[1] = "/artistas/cifras/1030/madonna.htm";
 link_noticias[2] = "/artistas/cifras/1445/felipe-e-falcao.htm";
 link_noticias[3] = "/artistas/cifras/521/ivan-lins.htm"; 
 var texto_noticias = new Array(); 
 texto_noticias[0] = "aqui vc coloca as noticias"; 
 texto_noticias[1] = "<b>Madonna</b><br>Aprenda a tocar seus sucessos."; 
 texto_noticias[2] = "<b>Felipe e Falcão</b><br>Confira nosso acervo de cifras."; 
 texto_noticias[3] = "<b>Ivan Lins</b><br>Inclua suas cifras no seu repertótio."; 
 var imagem_noticias = new Array(); 
 imagem_noticias[0] = "aqui vc coloca as imagens"; 
 imagem_noticias[1] = "/img/destaque/d1.jpg"; 
 imagem_noticias[2] = "/img/destaque/d2.jpg"; 
 imagem_noticias[3] = "/img/destaque/d3.jpg"; 
 function mudarNoticia( noticia ) 
 { if ( noticia == "auto" ) { for ( i=0; i<document.getElementsByName('op_noticia').length; i++ ) { if ( document.getElementsByName('op_noticia')[i].checked ) { noticia = parseInt(document.getElementsByName('op_noticia')[i].value) + 1; } } if ( noticia > texto_noticias.length-1 ) noticia = 1; document.getElementsByName('op_noticia')[noticia-1].checked = true; } document.getElementById("img_noticia").src = imagem_noticias[noticia]; document.getElementById("txt_noticia").innerHTML = texto_noticias[noticia];document.getElementById("url_noticia").href = link_noticias[noticia]; } 