// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
sound_manager_currently_playing = null;

function toggle_sound(id, url) {
	soundManager.stopAll();
	
	if (sound_manager_currently_playing == id)
	{
		if (sound_manager_currently_playing != null)
		{
			Element.update(sound_manager_currently_playing, '<img alt="Play" border="0" src="/images/SoundManager2/play-control.gif"/>');
		}
		sound_manager_currently_playing = null;
	}
	else
	{
		soundManager.play(id, url);
		sound_manager_currently_playing = id;
		Element.update(sound_manager_currently_playing, '<img alt="Pause" border="0" src="/images/SoundManager2/pause-control.gif"/>');
	}
}
