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

function initSounds(id, shortName){
	soundManager.createSound({
		id: 'Sound'+id,
		url: 'phenologMedia/'+shortName+'.mp3',
		autoLoad: true,
		onfinish: function(){ $('soundControl').update('Listen'); }
	});
	
	$('soundControl').onclick = function(){
		if (soundManager.sounds['Sound' + id].playState == 1) {
			soundManager.stopAll();
			$('soundControl').update('Listen');
		} else {
			soundManager.sounds['Sound' + id].play('Sound' + id);
			$('soundControl').update('Stop');			
		}
		return false;
	}
}