<!--
notas_musicais = new Array ();
notas_musicais[1] = new Array('C', '')
notas_musicais[2] = new Array('C#', 'Db')
notas_musicais[3] = new Array('D', '')
notas_musicais[4] = new Array('Eb', 'D#')
notas_musicais[5] = new Array('E', '')
notas_musicais[6] = new Array('F', '')
notas_musicais[7] = new Array('F#', 'Gb')
notas_musicais[8] = new Array('G', '')
notas_musicais[9] = new Array('G#', 'Ab')
notas_musicais[10] = new Array('A', '')
notas_musicais[11] = new Array('Bb', 'A#')
notas_musicais[12] = new Array('B', '')
function retornaCifra(cifra, poeTags) {
	poeTags = (poeTags == null)
	tamanho1 = cifra.length;
	nova_cifra = ''
	for (n = 0; n<tamanho1; n++) {
		char1 = cifra.substr(n,1);
		if (char1 == '[') {
			nota = ''; n ++;
			while (cifra.substr(n,1) != ']' && n < tamanho1) {
				nota += cifra.substr(n,1); n++; } // while 
			n ++; nova_cifra += retornaNovaNota2(nota, tom, poeTags);
		} // if (char1 == '['...
		nova_cifra += cifra.substr(n,1);} // for (n=0...
	return nova_cifra
}
document.getElementById("spCifra").innerHTML  = "<pre>" + retornaCifra(cifra) + "</pre>"
function procuraNota(strNota3) {
	for (n1=1; n1<=12; n1++) {if (notas_musicais[n1][0] == strNota3 || notas_musicais[n1][1] == strNota3) break	}
	return n1;
}
function retornaNota(strNota1, intTom) {
id = procuraNota(strNota1);
if (id == 13) return strNota1
if (intTom < 0) {intTom += 12;}
if (intTom > 12) intTom = intTom % 12;
var novo_id = id + intTom;
if (novo_id > 12) novo_id = novo_id % 12;
strNota1 = notas_musicais[novo_id][0];
return strNota1;
}
function retornaNovaNota2(strNota2, intTom, poeTags) {
strNota2 += ' ';nova_nota = ''; nota_2 = ''; tamanho = strNota2.length; acorde = '';aberto = false
for (pos = 0; pos < tamanho; pos ++)
{
	nova_nota += strNota2.substr(pos, 1);
	notaFutura = nova_nota + strNota2.substr( pos + 1, 1) // + '*'
	if ((strNota2.substr(pos, 1) == ' ' || strNota2.substr(pos, 1) == '\t') && aberto)  
	{
		aberto = false
		if (poeTags)
			nota_2 += '<a class=db onClick=montaEscala(\'' + acorde + '\') onMouseOver="MD(\'' + acorde + '\')" onMouseOut="AD(\'\')">' + acorde + '</a>' 
		else
			nota_2 += acorde
		acorde = ''
		txtAcorde = ''
	}
	if (strNota2.substr(pos, 1) != ' ' && strNota2.substr(pos, 1) != '\t' && !aberto) 
	{ aberto= true;acorde = '';txtAcorde = '' }
	if (procuraNota(notaFutura) == 13) 
	{
		if (intTom == 0) acorde += nova_nota
		else 
		acorde += retornaNota (nova_nota, intTom);nova_nota = '';
	} 
	if (!aberto && pos < tamanho - 1) nota_2 += strNota2.substr(pos, 1)
}
return nota_2;
}
if(!window.event && window.captureEvents) {
  // set up event capturing for mouse events (add or subtract as desired)
  window.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.CLICK|Event.DBLCLICK);
  // set window event handlers (add or subtract as desired)
  window.onmouseover = WM_getCursorHandler;
  window.onmouseout = WM_getCursorHandler;
  window.onclick = WM_getCursorHandler;
  window.ondblclick = WM_getCursorHandler;
  // create an object to store the event properties 
  window.event = new Object;
}


function WM_getCursorHandler(e) {
  // set event properties to global vars (add or subtract as desired)
  window.event.clientX = e.pageX;
  window.event.clientY = e.pageY;
  window.event.x = e.layerX;
  window.event.y = e.layerY;
  window.event.screenX = e.screenX;
  window.event.screenY = e.screenY;
  // route the event back to the intended function
  if ( routeEvent(e) == false ) {
    return false;
  } else {
    return true;
  }
}

function MD(pDetalhes)
{
	for (n=0; n< arrDesenhos.length; n++){if (pDetalhes == arrDesenhos[n] || pDetalhes == arrDesenhos[n]) break;}
	totalAcordes = arrAcordes[n].length
	strAcorde = arrAcordes[n][arrPosAcorde[n]] 
//	document.all.acorde1000.style.filter = 'progid:DXImageTransform.Microsoft.Shadow(direction=130,color=gray,strength=8);'
	document.getElementById('acorde1000').style.filter = 'progid:DXImageTransform.Microsoft.Shadow(direction=130,color=gray,strength=8);'

//	document.all.acorde1000.style.display = "block"
	document.getElementById('acorde1000').style.display = "block"

	//document.all.notas1000.style.display = "block"
	document.getElementById('notas1000').style.display = "block"

	if (keyb == "true") 
		desenhaTeclado(1000, pDetalhes, strAcorde)
	else
		desenhaAcorde(1000, pDetalhes, strAcorde)
//alert(document.body.scrollTop )
//	document.all.notas1000.style.top = window.event.y+document.body.scrollTop - 80
	IEHorizontal = (document.all ? document.body.scrollTop : 0);
	document.getElementById('notas1000').style.top = -80 + window.event.y + IEHorizontal

//	document.all.acorde1000.style.top = window.event.y+document.body.scrollTop - 80
	document.getElementById('acorde1000').style.top = -80 + window.event.y + IEHorizontal

//	document.all.notas1000.style.left = window.event.x + (keyb == "true" ? 0 : 20)
	document.getElementById('notas1000').style.left = window.event.x + (keyb == "true" ? 0 : 20) + 30

//	document.all.acorde1000.style.left = window.event.x
	document.getElementById('acorde1000').style.left = window.event.x + 30
}
function AD(pDetalhes) {
//document.all.acorde1000.style.display = "none"
document.getElementById('acorde1000').style.display = "none";

//document.all.notas1000.style.display = "none" 
document.getElementById('notas1000').style.display = "none";
}
//-->