
$(document).ready(function(){

	var basepath = "";
	if(location.hostname == "localhost") basepath = "/lsdlr";

	// Ouvre le bon plan en color box
	$(".bonplan").colorbox({width:'800', height:'300', iframe:true, opacity:'0.7' });
	
	$("#navigation img").hover( 

		function() {
			$(this).attr("src", basepath+"/images/menu/" + $(this).attr('rel') + "on.jpg");	
		},
		function () {
			$(this).attr("src", basepath+"/images/menu/" + $(this).attr('rel') + "off.jpg");	
		}
	);

	// Genere le menu deroulant des emissions	
	var i = 0;
	var cmenu = -1;

	$("#accordion h3").each( function() {

		$("ul li a", $(this).next()).each( function() {
	
			if(	window.location.href.indexOf( $(this).attr('href') ) >= 0) {
				$(this).addClass('selected');
				cmenu = i;
				return;
			}
	
		});
		
		i++;		

	});
	
	$("#accordion").accordion( { active: cmenu, autoHeight: false } );
	
	
	// Genere le player au dessus de chaque download
	$(".download").each( function() {
		
		var href = $(this).attr('href');
	
		var player = '<p>Ecoutez : <br/>                <object type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" width="200" height="20">                    <param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />                    <param name="bgcolor" value="#ffffff" />                    <param name="FlashVars" value="mp3='+ href + '&amp;showstop=1&amp;bgcolor1=bfbf8e&amp;bgcolor2=bfbf8e&amp;slidercolor1=00000&amp;slidercolor2=00000&amp;sliderovercolor=ffffff&amp;buttoncolor=000000&amp;buttonovercolor=000000" />                </object>                </p>';
		
		$(this).before(player);	

	});
	
	// Affiche les interviews
	$(".interview").hide();
	
	$(".interview:first").show();
	
	$(".interviewlink").click( function() {
		
		$(".interview").hide();
		var i = $(this).attr('rel');
		$("#interview"+i).show();
		
		return false;

	});
	
	// Affiche l'info bulle sur les interviews
	$("#contentinterviews .contentdroite a").tooltip( { showURL:false });
	
	
	
});		
