//-------------------------------------------------------------------------- //
// Este script está registrado no Registro de Títulos e Documentos           //
// de Petrópolis / RJ Protocolado no livro nº 35101 livro B13 selo RDT50443  //
// A cópia não autorizada deste script acarretará em ação judicial (art 127) // 
// Desenvolvido por Peter M Jordan - tocando@tocando.com.br                  //
//-------------------------------------------------------------------------- //




































function desenhaTeclado(spanId, Titulo, strAcorde){
//strAcorde = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33' //(strAcorde)
strAcorde = le(strAcorde)
spanAcorde = document.getElementById('acorde' + spanId)
spanNotas = document.getElementById('notas' + spanId)
arrAcorde = strAcorde.split(' ')
acorde = '<table border=0><tr><td> <br><table width=205 height=55 border=0 cellpadding="0" cellspacing="0"><tr height=68><td width=3><img src="imagens/c/teclado.png"></td></tr></table></td></tr></table>'
notas = '<table border=0><tr><td> <a href=""><b>' + Titulo + '</b></a><br><table width=205 height=68 border=0 cellpadding="0" cellspacing="0"><tr height=68><td width=3></td>'
posArray = 0
tecla = 0
for (n=1; n<=33; n++){
if (n != 6 && n != 14 && n!= 20 && n!= 28) tecla ++
if (tecla == 13) tecla = 1
if (tecla==parseInt(arrAcorde[posArray])){
if (tecla == 2 || tecla == 4 || tecla == 7 || tecla == 9 || tecla == 11)
{notas += '<td align=right width=6><br><img src=imagens/c/o_branco2.gif><br><br><br></td>'}
else
{notas += '<td align=right width=6><br><br><br><img src=imagens/c/o_preto.gif></td>'}
posArray ++}
else
{notas += '<td align=right width=6></td>'}}
notas += "<td width=6></td></tr></table></td></tr><tr><td colspan=33 align=center>"
if (spanId != 1000 && arrAcordes[spanId - 1].length > 1) 
{notas += '<a style=cursor:hand onClick=\'variaTeclado(' + spanId + ',\"' + Titulo + '\")\' class=font1>variação</a>'}
else
notas += " "
notas += "</td></tr></table>"
if (spanId != 1000) {
	if (ns6){spanNotas.style.top ='-5px';spanNotas.style.left ='1px';}
	else
	{spanNotas.style.left = '3px' ;}

	spanAcorde.style.left = '1px';
	
}
spanAcorde.innerHTML = acorde;
spanNotas.innerHTML = notas;
leftX += 220
if (leftX == 660) leftX = 0}
function variaTeclado(spanId, Titulo)
{
	totalAcordes = arrAcordes[spanId - 1].length
	arrPosAcorde[spanId - 1] = (((arrPosAcorde[spanId - 1] + 1) >= totalAcordes) ? 0 : arrPosAcorde[spanId - 1] + 1);
	strAcorde = arrAcordes[spanId - 1][arrPosAcorde[spanId - 1]] 
	leftX = ((spanId % 3) == 0 ? 3 * 220 : (spanId % 3) * 220) - 220
	desenhaTeclado(spanId, Titulo, strAcorde)
}

function derivacoes(chord)
{
chord = replaceChars(chord, '+', '%2b')
chord = replaceChars(chord, '#', '%23')
window.open('frm_dicionario.asp?acorde=' + chord, 'deriva', 'width=500, height=600')
}

function le(txt)
{
	rtxt = replaceChars(txt,  "A" , "2")
	rtxt = replaceChars(rtxt, "S" , "3")
	rtxt = replaceChars(rtxt, "D" , "0")
	rtxt = replaceChars(rtxt, "F" , "1")
	rtxt = replaceChars(rtxt, "G" , "5")
	rtxt = replaceChars(rtxt, "H" , "4")
	rtxt = replaceChars(rtxt, "J" , "6")
	rtxt = replaceChars(rtxt, "K" , "7")
	rtxt = replaceChars(rtxt, "L" , "8")
	rtxt = replaceChars(rtxt, "O" , "9")
	return rtxt
}
function MD(e,pDetalhes)
{
	var offSetX1 = (ns6)?0:0;
	var offSetY1 = (ns6)?0:0;
	var offSetX2 = (ns6)?22:22;
	var offSetY2 = (ns6)?-11:0;
	curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
	curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;

	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.getElementById('acorde1000').style.filter = 'progid:DXImageTransform.Microsoft.Shadow(direction=130,color=gray,strength=8);'

	document.getElementById('acorde1000').style.display = "block"

	document.getElementById('notas1000').style.display = "block"

	desenhaTeclado(1000, pDetalhes, strAcorde)

	document.getElementById('notas1000').style.top = (curY + offSetY2 - 50) + 'px'; //-80 + window.event.y + IEHorizontal
	document.getElementById('acorde1000').style.top = (curY + offSetY1 - 50) + 'px'; //-80 + window.event.y + IEHorizontal
	document.getElementById('notas1000').style.left = (curX + offSetX2 + 20) + 'px'; //window.event.x + (keyb == "true" ? 0 : 20) + 30
	document.getElementById('acorde1000').style.left = (curX + offSetX1 + 20) + 'px'; //window.event.x + 30
}

function AD(pDetalhes) {
document.getElementById('acorde1000').style.display = "none";
document.getElementById('notas1000').style.display = "none";
}
-->
