
$(function()
	{
	/**
	 * jPlayer
	 */
	$('#jplayer_sound').jPlayer(
		{
		ready: function()
			{
			$(this).jPlayer('setMedia', {mp3: './media/sound_1.mp3'});
			},

		swfPath: '../../styles/flash',
		supplied: 'mp3',
		cssSelectorAncestor: '#jp_container_sound'
		});

	$('#jplayer_sound').on($.jPlayer.event.ready,function()
		{
		$('#jplayer_sound').jPlayer('setMedia', {mp3: './media/sound_'+$('main').data('screen')+'.mp3'});
		});

	$('#jplayer_well').on($.jPlayer.event.ready,function()
		{
		$('#jplayer_well').jPlayer('setMedia', {mp3: './media/well.mp3'})
		});

	/**
	 * Click
	 */
	$('.elements > *').click(function()
		{
		$(this).addClass('active').siblings().removeClass('active');

		if($(this).hasClass('good'))
			{
			$('#jplayer_well').jPlayer('play');
			}
		else
			{
			$('#jplayer_wrong').jPlayer('play');
			}
		});
	});
