﻿function PlaySound(soundObjectId)
{
	var soundObject = window.document.getElementById(soundObjectId);
	if(soundObject)
	{
		try
		{
			soundObject.Play();
		}
		catch(e)
		{
			try
			{
				soundObject.DoPlay();
			}
			catch(e)
			{
				// Nothing can be done here
			}
		}
	}
}

function GenerateAndPlaySound(soundPlaceholderObjectId, mimeType, soundFileURL)
{
	var soundObject = window.document.getElementById(soundPlaceholderObjectId);
	if(soundObject)
	{
		try
		{
			soundObject.innerHTML = "<embed '" + mimeType + "' src='" + soundFileURL + "' hidden='false' autostart='true' loop='true' width='0' height='0'>";
		}
		catch(e)
		{
			// Nothing can be done here
		}
	}
}
