$(function()
{

	var okCount = 0;

$(".dragg").draggable({
		revert:true
		});
$(".target").each(function(){

	$(this).droppable({
	tolerance: "pointer",
        drop: function(event, ui) {
		if (ui.draggable.data("value") === $(this).data('value'))
		{
		$('.sosna'+ui.draggable.data("value")).fadeIn();
		$(this).fadeOut()
		ui.draggable.fadeOut();
		okCount++;
		if (okCount === 2) {
		$('#jplayer_well').jPlayer('play');
		}
		} else $('#jplayer_wrong').jPlayer('play');
	}
	});
});


});