// Below, you can insert your MIDI songs and their titles into the jukebox.

midiList = new Array("","http://www.johntroutman.com/08_Fur_Elise__(Beethoven).mp3","http://www.yukopiano.com/media/audio/original/08/If_Only_I_Could.mid","http://www.yukopiano.com/media/audio/original/14/Fantasy.mid","http://www.johntroutman.com/Jesu%20Joy%20of%20Man's%20Desiring%20(J%20S%20Bach).mp3");
titleList = new Array("","Fur Elise (Beethoven) by John Troutman","If Only I Could by Yuko Ohigashi","Fantasy by Yuko Ohigashi","Jesu Joy of Man's Desiring by John Troutman");

// Now, you choose the format for the way the title of the song is displayed

playerType=1; 	 // Would you like to see a media player with controls? (1 = visible 0 = hidden)
		 // NOTE: Player does not appear in Internet Explorer!

// Now, you choose the format for the way the title of the song is displayed

checkBold=0; 	 // Would you like the title Bolded? (1 = yes 0 = no)
checkItalic=1;  	 // Would you like the title in Italics? (1 = yes 0 = no)
checkUnder=0;  	 // Would you like the title Underlined? (1 = yes 0 = no)
fontColor='#FFCACA'; 	 // Choose the color of your MIDI title (example: red, blue, black)
fontFace='Verdana';  // Choose the font for your MIDI title (example: Verdana, Arial, Times New Roman)

// Do not touch anything below this tag.
// Variables are set

howMany = midiList.length-1;

date = new Date();
seed = date.getTime();
randomNumber = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*howMany
+ 1,10);

URL = location.href;
QUERY_POS = URL.indexOf("?") + 1;
QUERY_STRING = URL.substring(QUERY_POS); 
QUERY_POS-=1;
QUERY_POS2=QUERY_POS;
QUERY_POS2+=1;
if(QUERY_POS!=0) newLocation=URL.substring(0,QUERY_POS);
if(QUERY_POS2==0) newLocation=QUERY_STRING;
if(QUERY_STRING > 0) randomNumber=QUERY_STRING;

midi=midiList[randomNumber];
title=titleList[randomNumber];

if(!title){ 
midi=midiList[1];
title=titleList[1];
randomNumber=1;
}

window.defaultStatus="Now Playing... "+randomNumber+": "+title;

ns = ((navigator.appName == "Netscape"));
ie = ((navigator.appName == "Microsoft Internet Explorer"));

if(playerType == 1 && ns){ playMIDI = '<EMBED SRC= "' + midi + '" WIDTH=200 HEIGHT=55 AUTOSTART=TRUE hidden=true></EMBED><BR>';}
else { playMIDI = '<BGSOUND SRC= "' + midi + '" loop=infinite AUTOSTART=TRUE></BGSOUND>';}

bold=(checkBold==1)?"<B>":"";
bold2=(checkBold==1)?"</B>":"";
italic=(checkItalic==1)?"<I>":"";
italic2=(checkItalic==1)?"</I>":"";
under=(checkUnder==1)?"<U>":"";
under2=(checkUnder==1)?"</U>":"";

function listMIDI(){
document.write(playMIDI);

for(x=0;x<=howMany;x++){
if(x==0)document.write("<B>Efelisite's Jukebox Selections</B>:<BR>");
if(x!=0 && x!=randomNumber)document.write("<font face="+fontFace+"> "+x+" - "+titleList[x]+" (<A HREF="+newLocation+"?"+x+">play</A>)</font><BR>");
if(x==randomNumber)document.write("<font color=\""+fontColor+"\" face="+fontFace+">"+bold+""+italic+""+under+""+x+" - "+titleList[x]+""+under2+""+italic2+""+bold2+" - Now Playing...</font><BR>");
}
}



