I'm running into problems with the following script I have. I would appreciate any help you can give. I need the following features, but am lost as to how to implement them and how to create the functions.

1) When the Power is turned off, the time displays (I already have a function created for the time called time())When the power is turned on, the current station is displayed. However, it does not need to play any music. I will work on that later.

2) Pressing the AM/FM button will change it to either AM or FM. (I have the AM stations all set which are incremented by 10, but how can I get it to display FM stations ranging from 88 to 108 incremented by 0.1?)

3) The volume buttons change the volume display from 1 to 10 in increments of 1, shown by dashes.

4) I also need help with this radio remembering its settings. For instance, if the radio is set at FM 88 at a volume of 3, when the radio is turned off then back on again, these same settings display. Is this done with cookies? If so, how?



Here is the script I have so far:

SONG = new Array()
var x=540
for (x=540; x<=1600; x=x+10)

function prev(){
if (x>540)
{ x=x-10
document.midi.typein.value=x
}
}

function next(){
if (x<1600)
{ x=x+10
document.midi.typein.value=x
}
}

function go(){
if (x != 0){
location.href='http://home.dmv.com/~lcrocket/SONG'+x+'.MID'
}
}

function display(){
document.midi.typein.value="~ display time ~"
}


<BODY Bgcolor="#ffffff" onload="display()">
<FONT face="arial,helvetica">
<FORM Name="midi">
<INPUT
TYPE=Button Value="POWER" Align=left onclick="go()">

<br>
<br>
<INPUT TYPE=Button Value="AM/FM" Align=left>
<INPUT NAME="typein" TYPE="text" SIZE="15" ALIGN=top>
<INPUT TYPE=Button Value="<<" Align=left onclick="prev()">
Tune
<INPUT TYPE=Button Value=">>" Align=left onclick="next()">
<br>
<input type=button value=" - " onClick="MIDI_decVolume(5); blur();">
Vol
<input type=button value=" + " onClick="MIDI_incVolume(5); blur();">
<input name="txtVolume" type=text size="10" maxlength="10" value=""
onFocus="blur();">
</FORM>


Again, I would be very greatful for any help you can give. Thanks!