function musicPlayer(MP3URL, embedXtra, autoStart, loopSwitch) { 
   // Get Operating System 
   var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1;
   if (isWin) { // Use MIME type application/x-mplayer2
      visitorOS="Windows";
   } else { // Use MIME type audio/mpeg, audio/x-wav, etc.
      visitorOS="Other";
   }
var browserName=navigator.appName;

   var audioURL = MP3URL;
   var objTypeTag = "application/x-mplayer2"; // The MIME type to load the WMP plugin in non-IE browsers on Windows
   if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"}; // The MIME type for Macs and Linux
   if (browserName != "Microsoft Internet Explorer") {
   document.write("<object width='280' height='24'>"); // Width is the WMP minimum. Height = 45 (WMP controls) + 24 (WMP status bar) 
   document.write("<param name='type' value='" + objTypeTag + "'>");
   document.write("<param name='src' value='" + audioURL + "'>");
   document.write("<param name='autostart' value='" + autoStart + "'>");
   document.write("<param name='showcontrols' value='0'>");
   document.write("<param name='showstatusbar' value='0'>");
   }
   document.write("<embed src ='" + audioURL + "' type='" + objTypeTag + "' " + embedXtra + "autoplay='" + autoStart + "' autostart='" + autoStart + "' width='240' height='24' controller='0' showstatusbar='0' bgcolor='#ffffff' loop='" + loopSwitch + "'></embed>"); 
   if (browserName != "Microsoft Internet Expolorer") {
   document.write("</object>");
   }
   document.close(); // Finalizes the document
}

