
var player_shown;
	
function show_player() {
 player_shown = true;
  $("#head-top").css("margin-top","0px");
    
}

	
$('.play').click(function() {
	currentItem = -1; previousItem = -1; 
	var o = $(this); 
	show_player();
	player_shown = true;
	setTimeout(function(){  player.sendEvent('LOAD',o.attr('data-url')) }, 1000);
});

function play_player() {
 player_shown = true;
 currentItem = -1; previousItem = -1;
 alert($(".play").attr('data-url'))
  
}	

$(".btn-closeplayer").click(function(){
	$("#head-top").css("margin-top","-32px");
	 player.sendEvent('STOP');
	$(this).toggleClass("active"); return true;
});


// panier
function yofancybox(article) {
	$.fancybox({
		'width'				: '30%',
		'height'			: '100%',
		'autoScale'     	: true,
		'type'				: 'iframe',
        'href'              : link2
    });
	
	var link2 = 'http://www.yozik.com/yo/panier.php?art='+article;
	document.getElementById("fancybox-frame").src=link2;
}

function article(article) {
	var link2 = 'http://www.yozik.com/yo/panier.php?art='+article;
	document.getElementById("fancybox-frame").src=link2;
}

// newsletter
function nlfancybox(article) {
	
	$.fancybox({
		'width'				: 500,
		'height'			: '100%',
		'autoScale'     	: true,
		'type'				: 'iframe',
        'href'              : 'http://www.discograph.com/lists/?p=subscribe&id=1'
    });
	
}

// video
	// Fix attention seekers
	
	// Fix attention seekers
	
	// Fix le z-index
	
		

	
$("a.video-gallery").click(function() {	var url = this.href;
	var re = new RegExp("http:\/\/.*dailymotion\.com\/embed\/([^(\&|$.%)]*)");
	var result = re.exec(url);
	var link = null;
    if (result) {
    	// Dailymotion
		var parts = url.split(re);
		var videoID = parts[1];
		link = 'http://www.dailymotion.com/swf/' + videoID + "&autoStart=1";
    } else {
    	// Youtube
    	link = url.replace(new RegExp("watch\\?v=", "i"), 'v/');
    }

	if (link != null) {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'		: 680,
				'height'		: 495,
				'href'			: link,
				'type'			: 'swf',
				'swf'			: {
				   	 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
		});
	}
	return false;
});
		



