I have very little experience with javascript, and what little I did was quite a while ago, so there is certainly a more elegant way to do this, but here I go:
Code:
<HTML>
<BODY>
<SCRIPT>
num_of_songs = 3
randnum = Math.round(Math.random()*(num_of_songs-1)) + 1
if(randnum == 1){
filename = "song1.wav";
songname = "Name of first song";
}else if(randnum == 2){
filename = "song2.wav";
songname = "Name of second song";
}else if(randnum == 3){
filename = "song3.wav";
songname = "Name of thrd song";
}
document.write("<H2>");
document.write(songname);
document.write("<\H2>");
document.write("<object height=50% width=50% classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95> <param name=AutoStart value=0 /> <param name=FileName value='");
document.write(filename);
document.write("'/></object>");
</SCRIPT>
<P>
<A HREF="javascript:history.go()">Click here to change track</A>
</BODY>
</HTML>
The "change track" link actually refreshes the page, causing a different random number to be picked. This might not be a very satisfactory way of doing it, but its a start at least.
Unfortunately, this method does not lend itself to easily implementing your "Autoplay" check box.