var nextOn='nonLink';
function notran(){showCells('s','s','h');}
function lat_tran(){showCells('h','s','s');}
function non_tran(){showCells('s','h','s');}
function showCells(v1,v2,v3){
 var m=document.getElementById('lyrics-table');
 var a=new Array('scr'+v1,'lat'+v2,'tran'+v3);
 var i=-1;
 while(m.getElementsByTagName('td').item(++i)&&i<400){
  m.getElementsByTagName('td').item(i).className=a[i%3];
 }
 return false;
}
function switchScriptLinks(off){
 if(document.getElementById){//firefox goes here
  document.getElementById(off).style.display='none';
  document.getElementById(nextOn).style.display='inline';
 }
 else if(document.all){//ie and apparently even opera go here
  document.all[off].style.display='none';
  document.all[nextOn].style.display='';
 }
 nextOn=off;
}
function firstOff(){
 if(document.getElementById&&document.getElementById(nextOn)) document.getElementById(nextOn).style.display='none';
 else if(document.all&&document.all[nextOn]) document.all[nextOn].style.display='none';
}

// onload stuff
if(typeof onloadInits=='undefined') onloadInits = new Array();
//onloadInits[onloadInits.length] = firstOff;
function initScriptLinks(){
 if(document.getElementById('latLink')){
  document.getElementById('latLink').getElementsByTagName('a')[0].onclick=function(){switchScriptLinks("latLink");return showCells("h","s","s");}
  document.getElementById('nonLink').getElementsByTagName('a')[0].onclick=function(){switchScriptLinks("nonLink");return showCells("s","h","s");}
  document.getElementById('tranLink').getElementsByTagName('a')[0].onclick=function(){switchScriptLinks("tranLink");return showCells("s","s","h");}
 }
}
onloadInits[onloadInits.length] = initScriptLinks;
window.onload = function(){
 //initScriptLinks();
 for(i=0; i<onloadInits.length; i++) onloadInits[i]();
}