﻿
function PlayAudioClip(fileName, playerID)
{
	StopAllAudioClips();
	
	// the FlashObject script component is used to write flash movies to the page
	var fo = new FlashObject(__HostSubDirectory + "/DesktopModules/JWAudioSermons/Flash/audio_player.swf?AudioUrl=" + fileName, 
		"AudioPlayer", "295", "92", "7", "#FFFFFF");
	fo.addParam("wmode", "transparent");
	fo.write(playerID);
}
function StopAllAudioClips()
{
	// clear all player containers; this prevents players from being able to overlap each other
	// if the user has clicked successive 'play now' links (without waiting for a clip to finish playing)
	$j("div.audioplayer").empty();
	$j("div.audioplayer").append("<img src=\"" + __HostSubDirectory + 
		"/DesktopModules/JWAudioSermons/Images/audio_player.gif\" width=\"295\" height=\"92\" alt=\"Audio Player\"/>");
}
