function audioPlayer(MP3URL, 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 audioURL = "upload/music/" + 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 
   document.write("<object width='0' height='0'>"); // 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='true'>");
   document.write("<param name='showcontrols' value='0'>");
   document.write("<param name='showstatusbar' value='0'>");
   document.write("<embed src ='" + audioURL + "' type='" + objTypeTag + "' hidden='true' autoplay='true' autostart='true' width='0' height='0' controller='0' showstatusbar='0' bgcolor='#ffffff' loop='" + loopSwitch + "'></embed>"); 
   // Firefox and Opera Win require both autostart and autoplay
   document.write("</object>");
   document.close(); // Finalizes the document
}