var qmid=new Array();
var qname=new Array();
var qtime=new Array();
qtime[0]=.1 // Do NOT change this line

numsongs=6   			// Número de músicas
qmid[1]="Ansiedade.mid" //Nome File midi
qname[1]="Ansiedade" 		// Nome Canção
qtime[1]=246          // Tempo em segundos
qmid[2]="Coimbra.mid"  
qname[2]="Coimbra"
qtime[2]=358
qmid[3]="LaIslaBonita.mid" 
qname[3]="La Isla Bonita"
qtime[3]=405
qmid[4]="Paredesconfesso.mid" 
qname[4]="Paredes Confes." 		
qtime[4]=260          
qmid[5]="Nikita.mid"  
qname[5]="Nikita"
qtime[5]=248
qmid[6]="Sultanswing.mid" 
qname[6]="Sultan of Swing"
qtime[6]=435
qmid[7]="Teste1.mid" 
qname[7]="Piano" 		
qtime[7]=10          
qmid[7]="Teste2.mid"  
qname[7]="Killing me Softly"
qtime[7]=8
qmid[7]="Teste3.mid" 
qname[7]="Flauta"
qtime[7]=12
qmid[8]="Teste1.mid" 
qname[8]="Piano" 		
qtime[8]=10          
qmid[8]="Teste2.mid"  
qname[8]="Killing me Softly"
qtime[8]=8
qmid[9]="Teste3.mid" 
qname[9]="Flauta"
qtime[9]=12
qmid[10]="Teste1.mid" 
qname[10]="Piano" 		
qtime[10]=10          
qmid[11]="Teste2.mid"  
qname[11]="Killing me Softly"
qtime[11]=8
qmid[12]="Teste3.mid" 
qname[12]="Flauta"
qtime[12]=12
qmid[13]="Teste1.mid" 
qname[13]="Piano" 		
qtime[13]=10          
qmid[14]="Teste2.mid"  
qname[14]="Killing me Softly"
qtime[14]=8
qmid[15]="Teste3.mid" 
qname[15]="Flauta"
qtime[15]=12
qmid[16]="Teste1.mid" 
qname[16]="Piano" 		
qtime[16]=10          
qmid[17]="Teste2.mid"  
qname[17]="Killing me Softly"
qtime[17]=8
qmid[18]="Teste3.mid" 
qname[18]="Flauta"
qtime[18]=12
qmid[19]="Teste1.mid" 
qname[19]="Piano" 		
qtime[19]=10          
qmid[20]="Teste2.mid"  
qname[20]="Killing me Softly"
qtime[20]=8
qmid[21]="Teste3.mid" 
qname[21]="Flauta"
qtime[21]=12
qmid[22]="Teste1.mid" 
qname[22]="Piano" 		
qtime[22]=10          
qmid[23]="Teste2.mid"  
qname[23]="Killing me Softly"
qtime[23]=8
qmid[24]="Teste3.mid" 
qname[24]="Flauta"
qtime[24]=12

function playsong(today){
	window.location.href="select.htm?"+today+"x0";}

function continuous(){
	var today=new Date();
	today=today.getTime()/10;
	today=(today%numsongs)+1;
	document.location="select.htm?0x"+today;}

function nextsong(){
	if(!done){
		window.setTimeout("nextsong()",100);}
	else{
		var today=new Date();
		today=today.getTime()/10;
		today=(today%numsongs)+1;
		document.location="select.htm?"+song2+"x"+today;}}

function fastforward(){
	if(done){
		nextsong();}}

function setdone(){
	done=true;}

done=false;
song1=0;song2=0;
param=location.search;
if(param.length>3){
n=param.substring(1,param.length);
p=n.indexOf("x");
song1=parseInt(n.substring(0,p));
song2=parseInt(n.substring(p+1,n.length))}
player='<CENTER><EMBED SRC="'+qmid[song1]+'" volume="0" hidden="true" AUTOSTART="TRUE"><BR>';
songname='<FONT SIZE=1>'+qname[song1]+'</FONT></CENTER>';
if(song2==0){
	cacher=''}
if(song1==0){
	player='';
	songname='';}

function musicstart(){
	document.write('<FORM NAME="songs" CLASS="tx1">Escolha Canção:<div STYLE="padding-top:4px"></div><center><SELECT NAME="song" CLASS="tx1a" style="Background:#184A4A">');
	for(i=1;i<=numsongs;document.writeln("<OPTION>"+qname[i++]));
	document.write('</center></SELECT><div STYLE="padding-top:4px"></div>');
	document.write('<TABLE BORDER="0" WIDTH="116" CELLPADDING="0" CELLSPACING="0" class="tx1">');
	document.write('<tr><td>');
	document.write('<A HREF="select.htm" style="background:none; width:36px">');
	document.write('<IMG SRC="Parar.gif" WIDTH="36" HEIGHT="25" BORDER="0" ALT="Parar Música"></A></td>');
	document.write('<td><A HREF="javascript:playsong(document.songs.song.selectedIndex+1)" style="background:none; width:36px" onClick="playsong(document.songs.song.selectedIndex+1)">');
	document.write('<IMG SRC="Tocar.gif" WIDTH="36" HEIGHT="25" BORDER="0" ALT="Tocar Selecção Musical"></A></td>');
	document.write('<td><A HREF="javascript:continuous();" style="background:none; width:36" onClick="continuous()">');
	document.write('<IMG SRC="Fundo.gif" WIDTH="36" HEIGHT="25" BORDER="0" ALT="Música de Fundo"></A></td></tr></table>');
	document.write('<div STYLE="padding-top:2px"></div>');
	document.write('<div CLASS="tx1a" ALIGN="CENTER">'+player+songname+'</div></form>');
	if(song2!=0){
		window.setTimeout("nextsong()",qtime[song1]*1000)}}