// Copyright 1998, 1999, 2000, 2001, 2002, 2003 © Erik van der Neut
function db(b86,chordName,b62){var q7=0;var b65=chordName;var b61=b62.split("|");var a56=b61[3];var b54=b61[4];if(a56!="1")b65=chordName+" ("+a56+"fr.)";b65+=b54;if(b86=="Power")b65+=("@"+b86);Chords[b65]=b62+chordName;if(b86=="A"){q7=q7A;q7A++;q7All++;}if(b86=="A#"){q7=q7Ais;q7Ais++;q7All++;}if(b86=="B"){q7=q7B;q7B++;q7All++;}if(b86=="C"){q7=q7C;q7C++;q7All++;}if(b86=="C#"){q7=q7Cis;q7Cis++;q7All++;}if(b86=="D"){q7=q7D;q7D++;q7All++;}if(b86=="D#"){q7=q7Dis;q7Dis++;q7All++;}if(b86=="E"){q7=q7E;q7E++;q7All++;}if(b86=="F"){q7=q7F;q7F++;q7All++;}if(b86=="F#"){q7=q7Fis;q7Fis++;q7All++;}if(b86=="G"){q7=q7G;q7G++;q7All++;}if(b86=="G#"){q7=q7Gis;q7Gis++;q7All++;}if(b86=="Power"){q7=q7Power;q7Power++;q7All++;}if(b86=="Slash"){q7=q7Slash;q7Slash++;q7All++;}if(navigator.appName=="Netscape"){if(!q7All%10)status="Loading data: "+q7All;}else status="Loading data: "+q7All;if(b86.charAt(1)=="#")b=b86.charAt(0)+"is";else b=b86;b63[b][q7]=b65;}function a64(b29,a56){var music_notes="";var openStringMidiNoteNum=new Array(40,45,50,55,59,64);for(var i=0;i<6;i++){if(b29.charAt(i)!="x"){if(b29.charAt(i)=="0"||b29.charAt(i)=="o"){music_notes+=b01(openStringMidiNoteNum[i]);}else {music_notes+=b01(openStringMidiNoteNum[i]+parseInt(a56)-1+parseInt(b29.charAt(i)));}if(i<5)music_notes+=",";}}top.main_window.document.midi.music_notes.value=music_notes;return ;}function b01(b07){var b00=new Array("C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","B");var music_note=b00[b07%12];music_note+="_";music_note+=Math.floor((b07/12)-1);return music_note;}function clearstring(a38){if(a29.indexOf(a38)!=-1)b20(a38,s_.src);}function a83(a38,finger){var h_src="h";if(a29.indexOf(a38)!=-1){b20(a38,eval("s"+finger+".src"));i=b31+parseInt(a38.charAt(1))-2;if(a38.charAt(0)=="E"||a38.charAt(0)=="e")h_src=hNotes_e[i];else if(a38.charAt(0)=="a")h_src=hNotes_a[i];else if(a38.charAt(0)=="d")h_src=hNotes_d[i];else if(a38.charAt(0)=="g")h_src=hNotes_g[i];else if(a38.charAt(0)=="b")h_src=hNotes_b[i];h=a38.charAt(0)+"h"
;b20(h,eval(h_src+".src"));}}function a87(a38){if(a29.indexOf(a38)!=-1)b20(a38,so.src);}function b60(flag){var sep=",";var a85=-1;var a84=0;var i=0;if(flag=="top_of_list"||flag=="end_of_list"){a84=a29.indexOf(sep);while(a84!=-1){b20(a29.substring(a85+1,a84),eval(sNotes[i]+".src"));a85=a84;a84=a29.indexOf(sep,a85+1);i++;}b20(a29.substring(a85+1,a29.length),eval(sNotes[i]+".src"));if(flag=="top_of_list"){b18();a66("1-5");}else if(flag=="end_of_list"){b18();a66("");}a05("");}else {a84=a29.indexOf(sep);while(a84!=-1){clearstring(a29.substring(a85+1,a84));a85=a84;a84=a29.indexOf(sep,a85+1);}clearstring(a29.substring(a85+1,a29.length));b18();}}function a05(a49){setCNT(a49);}function b18(){b20("Eh",hE.src);b20("ah",hA.src);b20("dh",hD.src);b20("gh",hG.src);b20("bh",hB.src);b20("eh",hE.src);}function a67(b29,b41){var a35=new Array("Eh","ah","dh","gh","bh","eh");for(var i=0;i<6;i++){if(b29.charAt(i)=="x"){b20(a35[i],hx.src)}else if(b29.charAt(i)>0){a83("Eadgbe".charAt(i)+b29.charAt(i),b41.charAt(i))}}}function a62(a86){for(var i=0;i<6;i++){if(a86.charAt(i)!="."){a87("Eadgbe".charAt(i)+a86.charAt(i))}}}function a66(a42){if(a42=="1-5"){b20("nut",nutOn.src);b20("fret1",b33[1].src);b20("fret2",b33[2].src);b20("fret3",b33[3].src);b20("fret4",b33[4].src);b20("fret5",b33[5].src);}else {if(a42==""||a42=="0"||a42=="1"){b20("fret1",b33[0].src);b20("nut",nutOn.src);}else if(a41.indexOf(a42)!=-1&&a42.indexOf(",")==-1){b20("fret1",b33[a42].src);b20("nut",nutOff.src);}b20("fret2",b33[0].src);b20("fret3",b33[0].src);b20("fret4",b33[0].src);b20("fret5",b33[0].src);}b31=parseInt(a42);}function aa(b62){if(b62=="top_of_list"){b60(b62);return ;}if(b62=="end_of_list"){b60(b62);return ;}b60("");document.ch_gr_db.chorddata.value=b62;if(document.images){var b61=b62.split("|");var b29=b61[0];var b41=b61[1];var a86=b61[2];var a56=b61[3];var b66=b61[4];a66(a56);a67(b29,b41);a62(a86);a05(b66);a64(b29,a56);}}function ResetSelects(a34){if(a34!="ChordListA"
&&document.ch_gr_db.ChordListA.selectedIndex!=0)document.ch_gr_db.ChordListA.selectedIndex=0;if(a34!="ChordListAis"&&document.ch_gr_db.ChordListAis.selectedIndex!=0)document.ch_gr_db.ChordListAis.selectedIndex=0;if(a34!="ChordListB"&&document.ch_gr_db.ChordListB.selectedIndex!=0)document.ch_gr_db.ChordListB.selectedIndex=0;if(a34!="ChordListC"&&document.ch_gr_db.ChordListC.selectedIndex!=0)document.ch_gr_db.ChordListC.selectedIndex=0;if(a34!="ChordListCis"&&document.ch_gr_db.ChordListCis.selectedIndex!=0)document.ch_gr_db.ChordListCis.selectedIndex=0;if(a34!="ChordListD"&&document.ch_gr_db.ChordListD.selectedIndex!=0)document.ch_gr_db.ChordListD.selectedIndex=0;if(a34!="ChordListDis"&&document.ch_gr_db.ChordListDis.selectedIndex!=0)document.ch_gr_db.ChordListDis.selectedIndex=0;if(a34!="ChordListE"&&document.ch_gr_db.ChordListE.selectedIndex!=0)document.ch_gr_db.ChordListE.selectedIndex=0;if(a34!="ChordListF"&&document.ch_gr_db.ChordListF.selectedIndex!=0)document.ch_gr_db.ChordListF.selectedIndex=0;if(a34!="ChordListFis"&&document.ch_gr_db.ChordListFis.selectedIndex!=0)document.ch_gr_db.ChordListFis.selectedIndex=0;if(a34!="ChordListG"&&document.ch_gr_db.ChordListG.selectedIndex!=0)document.ch_gr_db.ChordListG.selectedIndex=0;if(a34!="ChordListGis"&&document.ch_gr_db.ChordListGis.selectedIndex!=0)document.ch_gr_db.ChordListGis.selectedIndex=0;if(a34!="ChordListPower"&&document.ch_gr_db.ChordListPower.selectedIndex!=0)document.ch_gr_db.ChordListPower.selectedIndex=0;if(a34!="ChordListSlash"&&document.ch_gr_db.ChordListSlash.selectedIndex!=0)document.ch_gr_db.ChordListSlash.selectedIndex=0;}function b89(b86){if(b86.charAt(1)=="#"){b__=b86.charAt(0)+"is";}else {b__=b86;}for(i=0;i<eval("q7"+b__);i++){if(navigator.appName=="Netscape")if(i%10==9)status="Loading chords: "+b86+" Chords ("+(i+1)+")";else status="Loading chords: "+b86+" Chords ("+(i+1)+")";var option_text="";var j=b63[b__][i].indexOf("@");if(j!=-1)option_text=b63[b__][i].substring(0,j);else option_text=b63[b__][i];var b88=new Option(option_text,b63[b__][i],false,false);var b67="";if(b__=="C"
)b67=document.ch_gr_db.ChordListC;if(b__=="Cis")b67=document.ch_gr_db.ChordListCis;if(b__=="D")b67=document.ch_gr_db.ChordListD;if(b__=="Dis")b67=document.ch_gr_db.ChordListDis;if(b__=="E")b67=document.ch_gr_db.ChordListE;if(b__=="F")b67=document.ch_gr_db.ChordListF;if(b__=="Fis")b67=document.ch_gr_db.ChordListFis;if(b__=="G")b67=document.ch_gr_db.ChordListG;if(b__=="Gis")b67=document.ch_gr_db.ChordListGis;if(b__=="A")b67=document.ch_gr_db.ChordListA;if(b__=="Ais")b67=document.ch_gr_db.ChordListAis;if(b__=="B")b67=document.ch_gr_db.ChordListB;if(b__=="Power")b67=document.ch_gr_db.ChordListPower;if(b__=="Slash")b67=document.ch_gr_db.ChordListSlash;b67.options[b67.options.length]=b88;}}function b96(chord1,chord2,chord3,chord4){document.write("<tr>"+"<td align=\"right\" valign=\"bottom\"><img src=\"ChordName.gif\" border=\"0\" alt=\""+chord1+" chords\" name=\"name"+chord1+"\"></td>"+"<td align=\"left\" valign=\"bottom\"><img src=\"ChordUR.gif\" border=\"0\"></td>"+"<td align=\"right\" valign=\"bottom\"><img src=\"ChordName.gif\" border=\"0\" alt=\""+chord2+" chords\" name=\"name"+chord2+"\"></td>"+"<td align=\"left\" valign=\"bottom\"><img src=\"ChordUR.gif\" border=\"0\"></td>"+"<td align=\"right\" valign=\"bottom\"><img src=\"ChordName.gif\" border=\"0\" alt=\""+chord3+" chords\" name=\"name"+chord3+"\"></td>"+"<td align=\"left\" valign=\"bottom\"><img src=\"ChordUR.gif\" border=\"0\"></td>"+"<td align=\"right\" valign=\"bottom\"><img src=\"ChordName.gif\" border=\"0\" alt=\""+chord4+" chords\" name=\"name"+chord4+"\"></td>"+"<td align=\"left\" valign=\"bottom\"><img src=\"ChordUR.gif\" border=\"0\"></td>"+"</tr>");}function BuildForm(){status="Loading chords...";b89("C");b89("C#/Db");b89("D");b89("D#/Eb");b89("E");b89("F");b89("F#/Gb");b89("G");b89("G#/Ab");b89("Power");b89("Slash");b89("A");b89("A#/Bb");b89("B");status="Loading chords: ...done";status="";}var b38=1;var xon=new Image();xon.src="xon.gif";var xoff=new Image();xoff.src="xoff.gif";var upon=new Image();upon.src="upon.gif";
var upoff=new Image();upoff.src="upoff.gif";var downon=new Image();downon.src="downon.gif";var downoff=new Image();downoff.src="downoff.gif";var addchordon=new Image();addchordon.src="addchordon.gif";var addchordoff=new Image();addchordoff.src="addchordoff.gif";var printon=new Image();printon.src="printon.gif";var printoff=new Image();printoff.src="printoff.gif";function imgOn(b21){document[b21].src=eval(b21+"on.src");}function imgOff(b21){document[b21].src=eval(b21+"off.src");}function b20(name,a58){document[name].src=a58;}function setCNT(a49){var strChordNameWithoutFret=a49;var fret_index=a49.indexOf(" (");if(fret_index!=-1){strChordNameWithoutFret=a49.substring(0,fret_index);}document.ch_gr_db.CNT.value=strChordNameWithoutFret;document.ch_gr_db.CFullName.value=a49;}function addChord(){if(document.ch_gr_db.CFullName.value=="")alert("Sorry, but there's nothing to add.\nSelect a chord first.");else {var i=document.ch_gr_db.PrintList.length;if(b38){i=0;b38=0;}document.ch_gr_db.PrintList.options[i]=new Option(document.ch_gr_db.CFullName.value,document.ch_gr_db.chorddata.value,0,1);document.ch_gr_db.PrintList.options[i].selected=true;}}function moveChordUp(){var i=document.ch_gr_db.PrintList.selectedIndex;if(i>0){var tmpTxt=document.ch_gr_db.PrintList.options[i].text;var a09=document.ch_gr_db.PrintList.options[i].value;document.ch_gr_db.PrintList.options[i].text=document.ch_gr_db.PrintList.options[i-1].text;document.ch_gr_db.PrintList.options[i].value=document.ch_gr_db.PrintList.options[i-1].value;document.ch_gr_db.PrintList.options[i-1].text=tmpTxt;document.ch_gr_db.PrintList.options[i-1].value=a09;document.ch_gr_db.PrintList.options[i-1].selected=true;}}function moveChordDown(){var i=document.ch_gr_db.PrintList.selectedIndex;if(i>=0&&i<document.ch_gr_db.PrintList.length-1){var tmpTxt=document.ch_gr_db.PrintList.options[i].text;var a09=document.ch_gr_db.PrintList.options[i].value;document.ch_gr_db.PrintList.options[i].text=document.ch_gr_db.PrintList.options[i+1].text;
document.ch_gr_db.PrintList.options[i].value=document.ch_gr_db.PrintList.options[i+1].value;document.ch_gr_db.PrintList.options[i+1].text=tmpTxt;document.ch_gr_db.PrintList.options[i+1].value=a09;document.ch_gr_db.PrintList.options[i+1].selected=true;}}function deleteChord(){var i=document.ch_gr_db.PrintList.selectedIndex;if(i<0||i>=document.ch_gr_db.PrintList.length)return ;document.ch_gr_db.PrintList.options[i]=null;if(document.ch_gr_db.PrintList.length==0){document.ch_gr_db.PrintList.options[0]=new Option("_________________","",0,1);b38=1;}else if(i<document.ch_gr_db.PrintList.length)document.ch_gr_db.PrintList.options[i].selected=true;else document.ch_gr_db.PrintList.options[i-1].selected=true;}function displayPrintAndEmailSettings(){if(document.ch_gr_db.PrintList.options[0].text=="_________________"||b38||document.ch_gr_db.PrintList.length==0){document.ch_gr_db.PrintList.options.length=0;document.ch_gr_db.PrintList.options[0]=new Option("_________________","",0,1);alert("Sorry, but there's nothing to print or email.\nAdd some chords to the list first.");return ;}var a12="printsettings.html?prlist=";for(var i=0;i<document.ch_gr_db.PrintList.options.length;i++){a12+=escape(document.ch_gr_db.PrintList.options[i].text)+"->"+escape(document.ch_gr_db.PrintList.options[i].value)+"][";}var w=window.open(a12,"PrintSettings",'location=1,menubar=1,toolbar=0,scrollbars=1,width=650,height=450,resizable=0,status=1');w.focus();}