﻿function PlayAudio(fileName, header, imageSrc, pageLoad) {
    var strHTML = "";
    strHTML += "<b>" + header + "</b><br />" +
						"<img width='180' border='0' src='" + imageSrc + "' /><br />" +
						"<object id='MediaPlayer1' width='180' height='70'" +
						"classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'" +
						"codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'" +
						"standby='Loading Microsoft Windows Media Player components...'" +
						"type='application/x-oleobject' align='middle'>";
    if (pageLoad == "yes")
        strHTML += "<PARAM NAME='AutoStart' VALUE='false'>";
    else
        strHTML += "<PARAM NAME='AutoStart' VALUE='true'>";

    strHTML += "<PARAM NAME='Balance' VALUE='False'>" +
						"<PARAM NAME='DisplaySize' VALUE='True'>" +
						"<PARAM NAME='Filename' VALUE=''>" +
						"<PARAM NAME='Mute' VALUE='False'>" +
						"<PARAM NAME='SelectionStart' VALUE='False'>" +
						"<PARAM NAME='SelectionEnd' VALUE='False'>" +
						"<PARAM NAME='ShowControls' VALUE='True'>" +
						"<PARAM NAME='ShowAudioControls' VALUE='True'>" +
						"<PARAM NAME='ShowDisplay' VALUE='false'>" +
						"<PARAM NAME='ShowPositionControls' VALUE='false'>" +
						"<param name='ShowGotoBar' value='false'>" +
						"<PARAM NAME='Volume' VALUE='1'>" +
						"<PARAM NAME='AudioStream' VALUE='true'>" +
						"<PARAM NAME='AutoSize' VALUE='false'>" +
						"<PARAM NAME='AnimationAtStart' VALUE='False'>" +
						"<PARAM NAME='AllowScan' VALUE='true'>" +
						"<PARAM NAME='AllowChangeDisplaySize' VALUE='False'>" +
						"<PARAM NAME='AutoRewind' VALUE='true'>" +
						"<PARAM NAME='BaseURL' VALUE=''>" +
						"<PARAM NAME='BufferingTime' VALUE='5'>" +
						"<PARAM NAME='CaptioningID' VALUE=''>" +
						"<PARAM NAME='ClickToPlay' VALUE='True'>" +
						"<PARAM NAME='CursorType' VALUE='0'>" +
						"<PARAM NAME='CurrentPosition' VALUE='True'>" +
						"<PARAM NAME='CurrentMarker' VALUE='false'>" +
						"<PARAM NAME='DefaultFrame' VALUE='mainframe'>" +
						"<PARAM NAME='DisplayMode' VALUE='false'>" +
						"<PARAM NAME='Enabled' VALUE='true'>" +
						"<PARAM NAME='EnableContextMenu' VALUE='true'>" +
						"<PARAM NAME='EnablePositionControls' VALUE='true'>" +
						"<PARAM NAME='EnableFullScreenControls' VALUE='False'>" +
						"<PARAM NAME='EnableTracker' VALUE='true'>" +
						"<PARAM NAME='InvokeURLs' VALUE='False'>" +
						"<PARAM NAME='Language' VALUE='False'>" +
						"<PARAM NAME='PlayCount' VALUE='1'>" +
						"<PARAM NAME='PreviewMode' VALUE='false'>" +
						"<PARAM NAME='ShowStatusBar' VALUE='True'>" +
						"<PARAM NAME='TransparentAtStart' VALUE='False'>" +
						"<PARAM NAME='Src' Value='" + fileName + "'>" +
						"<embed type='application/x-mplayer2'" +
						"pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/'" +
						"autoStart='1'" +
						"src='" + fileName + "'" +
						"align='middle'" +
						"width='180'" +
					"height='60'" +
						"defaultframe='rightFrame'" +
						"showstatusbar='true'" +
						" volume='10'" +
						" showcontrols='1'" +
						" showstatusbar='0'" +
						" showaudiocontrols='1'" +
						" showpositioncontrols='0'" +
						" EnablePositionControls='1'" +
						" AudioStream='1'>" +
						"</embed>" +
						"</object><br />";
    document.getElementById("PlayerDiv").innerHTML = strHTML;
    document.getElementById("extraDiv").style.display = "block";
}
