	function EmbedExtMP3(URL, Width, Height) {
	/* writes the object-embed block into current document */
		var isWin = navigator.userAgent.toLowerCase().indexOf("windows") !=-1;
		
		if (isWin) { // Use MIME type = "application/x-mplayer2"
			visitorOS="Windows";
		} else { // Use MIME type = "audio/mpeg"; // or audio/x-wav or audio/x-ms-wma, etc.
			visitorOS="Other";
		}

	  // Get the MIME type of the audio file from its extension (for non-Windows browsers)
	   var mimeType = "audio/mpeg"; // assume MP3/M3U
	   var objTypeTag = "application/x-mplayer2"; // The Windows MIME type to load the WMP plug-in in Firefox, etc.
/*
	   var theExtension = URL.substr(URL.lastIndexOf('.')+1, 3); // truncates .aiff to aif
		if (theExtension.toLowerCase() == "wav") { mimeType = "audio/x-wav"};
		if (theExtension.toLowerCase() == "aif") { mimeType = "audio/x-aiff"};    
		if (theExtension.toLowerCase() == "wma") { mimeType = "audio/x-ms-wma"};
		if (theExtension.toLowerCase() == "mid") { mimeType = "audio/mid"};
*/	
		if (visitorOS != "Windows")
			objTypeTag = mimeType; // audio/mpeg, audio/x-wav, audio/x-ms-wma, etc.};

	    var oeTags = '<object'
	    + ' width="' + Width + '" height="' + Height + '">'
	    + ' <param name="src" value="' + URL + '" >'
		+ ' <param name="type" value="' + objTypeTag + '" >'
		+ ' <param name="autostart" value="0" >'
		+ ' <param name="autoplay" value="0" >'
		+ ' <param name="showstatusbar" value="1" >'
		+ ' <param name="showcontrols" value="1" >'
		+ ' <param name="bgcolor" value="#F6F1D3" >'
	    + ' <embed src="' + URL + '" bgcolor="#F6F1D3" '
	    + ' width="' + Width + '" height="' + Height + '" name="MP3Audio" align="middle"'
		+ ' type="' + objTypeTag + '" '
	    + ' autoplay="0"'
	    + ' autostart="0"'
		+ ' controller="1"'
		+ ' showstatusbar="1"'
	    + ' <\/embed>'
	    + ' <\/object>';

	    document.write(oeTags);   // embed the mp3 file
		document.close();
	}

	function OpenMP3Player(URL, Caption, Width, Height, Browser) {
		/* opens a window for mp3_external.cfm with appropriate URL parameters */

		WinHeight = Height;	// may be reset below for various browsers
		var WidthDelta = 0;
		var HeightDelta = 0;
		if (Browser == "IE") {
			if (BrowserName == "IE") {
				if (BrowserVersion <= 6) {
					var WidthDelta = 12;
					if (navigator.userAgent.indexOf("Windows NT 5.0") > -1) // Windows 2000
						var HeightDelta = 60;
					else
						var HeightDelta = 50;
				} else {
					var WidthDelta = 12;
					var HeightDelta = 60;
				}
			}
		}

		//"location" (below) was introduced in IE 7; it's the navigation bar; it seems to be displayed even when set to "no"
		var Props = "location=no,status=yes,toolbar=no,scrollbars=no,resizable=yes,menubar=no,width=" + Width + ",height=" + WinHeight;
		var URLArg = "mp3_external.cfm?URL=" + URL + "&Width=" + Width + "&Height=" + Height;
		MP3Window=window.open(URLArg,"MP3SubWindow",Props);

		if ((Browser == "FF") || (Browser == "NN")) {
			MP3Window.innerWidth = Width;
			MP3Window.innerHeight = WinHeight;
		} else
			MP3Window.resizeTo(Width + WidthDelta, Height + HeightDelta);

		MP3Window.focus();

	}

  
