function PlayMIDI(SongURL) {

  var WriteLegend = "no";        //  Change to "no" if you don't want legend.
  var PlayIfNoCrescendo = "yes";   // Change to "yes" to try to play if Crescendo is not present.

  var NotCrescendo = "";
  var CrescendoIsPresent = "no"

  var CrescendoIndex = 0;
  var SongIndex = 1;
  var CrescendoVersion = "";
  var Legend = "";
  var DocString = "";
  var args = PlayMIDI.arguments;
  document.open();

  if (navigator.appName == "Netscape") {                  // Find out if the browser is Navigator.
    var NSMajorVersion = navigator.appVersion.charAt(0)   // Find major version number.
    
    DocString = '<EMBED SRC="' + SongURL + '" ';    
    DocString = DocString + 'PLUGINSPAGE="http://www.liveupdate.com/dl.html" ';
    DocString = DocString + 'HEIGHT=15 WIDTH=200 ';  // Use HEIGHT=2 WIDTH=0 for invisible.
    DocString = DocString + 'DETACH="true" ' ;    // Uncomment this for auto-detach.
    DocString = DocString + '>'
    }	
  else {   // Find out if the browser is Microsoft Internet Explorer 3.0 or greater.
   	if (navigator.appName == "Microsoft Internet Explorer") {
       // Load the ActiveX version of Crescendo or Crescendo PLUS if it's installed.
    
	      DocString = '<OBJECT ID=Crescendo '
          DocString = DocString + 'CLASSID="clsid:0FC6BF2B-E16A-11CF-AB2E-0080AD08A326" '
    	  var NSMajorVersion = navigator.appVersion.charAt(0)   // Find major version number.
          if (NSMajorVersion > "3") {                           // Is major version greater than 3?
              //DocString = DocString + 'CODEBASE="http://activex.liveupdate.com/controls/cres.cab#Version=3,0,0,70" ' }           

          } else {

             // DocString = DocString + 'CODEBASE="http://activex.liveupdate.com/controls/cres.cab#Version=2,3,0,35" ' 
			 }
          DocString = DocString + 'HEIGHT=15 '
          DocString = DocString + 'WIDTH=200>'
          DocString = DocString + '<PARAM NAME="RANDOM" VALUE="false">'
          DocString = DocString + '<PARAM NAME="Song" VALUE="' + SongURL + '">'
          if (args.length > 1)

              for (var i = 0; i < args.length; i++) {
                 DocString = DocString + '<PARAM NAME="SONG' + (i+1) + '" VALUE="' + args[i] + '"> ' 
				 }
 		      DocString = DocString + '<PARAM NAME="DETACH" VALUE="true">'
				// If the ActiveX Crescendo is not installed, this EMBED tag will cause MSIE
          // to load any Netscape plug-in that is associated with *.MID files.
          // The browser will only "see" this EMDED tag if the ActiveX Crescendo is not 
          // registered.  This is for versions of MSIE that don't see <OBJECT> but do see <EMBED>.
          DocString = DocString + '<EMBED SRC="' + SongURL + '" '
          DocString = DocString + 'PLUGINSPAGE="http://www.liveupdate.com/dl.html" '
          DocString = DocString + 'HEIGHT=15 WIDTH=200>'
          DocString = DocString + '</OBJECT>'  // Close the OBJECT tag.

        Legend = "This is Crescendo - running on Microsoft with auto-detach."

    } else {



      // The browser may be Netscape 1.x, or MSIE 2.0, or some other browser.  For MSIE 2.0,
// works in new ieas well
      DocString = DocString + '<BGSOUND SRC="' + SongURL + '">' + '<BR>'

      }

  }

  DocString = DocString + "\n"

  document.write(DocString)

  // Write legend.

  if (WriteLegend == "yes")  document.write("<BR><FONT SIZE=-1>" + Legend + "</FONT>")

  document.close()

}

