var jplayer = null;
var video = null;
function play_mp3(mp3,id,path_play,path_stop){
	var el = $('#play_' + id);
	if (el.attr('class')=='play') {
		jplayer.stop();
		el.removeClass('play');
		$('#play_' + id + ' img').attr('src',path_play);
	} else {
		$('.btn_play').attr('src',path_play);
		$('#play_' + id + ' img').attr('src',path_stop);
		$('#play_' + id).addClass('play');
		if (jplayer!=null) jplayer.stop();
		jplayer = jPlayer.setFile(mp3);
		jplayer.play();
	}
}
function play_mp3_2(mp3,id,path_play,path_stop){
	var el = $('#play2_' + id);
	if (el.attr('class')=='play') {
		jplayer.stop();
		el.removeClass('play');
		$('#play2_' + id + ' img').attr('src',path_play);
	} else {
		$('.btn_play').attr('src',path_play);
		$('#play2_' + id + ' img').attr('src',path_stop);
		$('#play2_' + id).addClass('play');
		if (jplayer!=null) jplayer.stop();
		jplayer = jPlayer.setFile(mp3);
		jplayer.play();
	}
}
$(document).ready(function() {
	//video=$('a.fancyvideo').fancybox();
	
	if ($('div.image_in_fck').size()>0) {
		$('div.image_in_fck img').each(function() {
			src = $(this).attr('src');									
			$(this).wrap('<a href="' + src.replace('thumb/','') + '" class="fancy"></a>');
		});
	}
	
	//$('a.fancy').fancybox();
	$("a.fancy").fancybox({
		'hideOnContentClick': true,
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'overlayOpacity':  0.8,
		'overlayColor': '#000'		
	});	
});