// Preload button images
img_Nav0=new Image();
img_Nav0 .src="images/Navoff.gif";
img_Nav1=new Image();
img_Nav1 .src="images/Navon.gif";


// Functions to handle button changes
function mouseOver(img_id) {
document.getElementById(img_id).src=eval(img_id + "1.src");
}
function mouseOff(img_id) {
document.getElementById(img_id).src=eval(img_id + "0.src");
}
function mouseClick(img_id) {
document.getElementById(img_id).src=eval(img_id + "2.src");
}

// Sound variables and functions

var mute=false;
var playit=true;

//document.write("<h1>mute value: "+mute+" -- playit value: "+playit+" </h1>");

// Sound playback functions

function switchSound()
{
    if(mute) {
      document.getElementById("spkr_img").src="images/spkr_on.gif";
      mute=false;
    }
    else {
      document.getElementById("spkr_img").src="images/spkr_off.gif";
      mute=true;
    }
}

function playSound(embd_snd,time) 
{
  var thissound=document.getElementById(embd_snd);
  var t=time*1000;

  if (playit && !mute)
//  if (playit)  
  {
	 try {
	     playit=false;
	     thissound.Play();
//	     t=setTimeout("playit=true",t);

	 }
	 catch (e) {
	     playit=false;
	     thissound.DoPlay();
//	     var t=setTimeout("playit=true",t);
	 }
  }
}

function stopSound(embd_snd) 
{
  var thissound=document.getElementById(embd_snd);
  try {
     thissound.Stop();
     thissound.Rewind();
     playit=true;
  }
  catch (e) {
     thissound.DoStop();
     thissound.DoRewind();
      playit=true;
  }
}

// End Script