/* ***************************************************************************** SWAP VALUE */
function swapValue() {swapValues=[];$(".swapValue").each(function(i){swapValues[i]=$(this).val();$(this).focus(function(){if($(this).val()==swapValues[i]){$(this).val("")}}).blur(function(){if($.trim($(this).val())==""){$(this).val(swapValues[i])}})});}

/* ***************************************************************************** SOUS MENU HOVER*/
function sousMenuHover(){
	$("#menu_top .link").hover(
		function() {$(this).parent().find('.sub').addClass("show");},
		function() {$(this).parent().find('.sub').removeClass("show");}
	);
	$("#menu_top .sub").hover(
		function() {$(this).addClass("show");},
		function() {$(this).removeClass("show");}
	);
}

/* ****************************************************************************** LIST FIRST-CHILD NO BORDER TOP */
function listFirstChild(){
	if($("li:first-child").length < 1 ) return false;
	$("li:first-child").addClass("first-child");
}

/* ****************************************************************************** CORNER BOTTOM */
function cornerBottom(){
	if($(".corner").length < 1 ) return false;
	$(".corner").corner("bottom");
}

/* ****************************************************************************** CORNER */
function corner(){
	if($(".btBig li").length < 1 ) return false;
	$(".btBig li").corner("5px");
}

/* ****************************************************************************** DIAPORAMA A LA UNE */
function diaporamaALaUne(){
	if($("#aLaUneImages").length < 1 ) return false;
	$('#aLaUneImages img').css('display','block');
	$('#aLaUneImages').cycle({
		fx:     'fade',
		timeout: 6000,
		pager:  '#pager',
		pagerEvent: 'mouseover',
		pagerAnchorBuilder: function(idx, slide) { 
       		return '#pager li:eq(' + idx + ') a'; 
    	},
		before:	onBefore
	});

	function onBefore() {
		var legende = $(this).find('img').attr('alt');
		$('#legende').html("").append(legende); 
	}
}

/* ****************************************************************************** APPEL DES FONCTIONS */
$(document).ready(function() {
	
	initDiaporamaALaUne = diaporamaALaUne();					// diaporama a la une home page
	
});

/**
 * Permet l'affichage du logo de retour à m6.fr en fonction
 */ 


