







// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){

	$('#screen').serialScroll({
		target:'#sections',
		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.next',// Selector to the 'next' button (absolute too)
		axis:'y',// The default is 'y' scroll on both ways
		duration:700,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)	
		onBefore:function( e, elem, $pane, $items, pos ){

			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
		}
	});
	
});

function scrolling()
{
    	$('#screen').serialScroll({
		target:'#sections',
		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.next',// Selector to the 'next' button (absolute too)
		axis:'y',// The default is 'y' scroll on both ways
		duration:700,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)	
		onBefore:function( e, elem, $pane, $items, pos ){

			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
		}
	});
}

function mp3emission(idnews,media)
{
    var so = new SWFObject("multimedia/medias/playMP3mini.swf", 'playMP3Emission'+idnews, 196, 23, 9, "#000000");
    so.addParam("wmode", "transparent");
    so.addVariable("mp3", "http://www.journaldugolf.fr/"+media);
    so.write('playerMP3Emission'+idnews);
}
	            
function initLecteurAudio()
{
    var lA = $('.lecteurAudio');
    for(var i = 0 ; i < lA.length ; i++)
    {
        var lInfos = lA[i].getElementsByTagName('input');
        if(lInfos.length == 2 )
        {
            var lID = lInfos[0].value;
            var lCHEMIN = lInfos[1].value;
            mp3emission(lID,lCHEMIN);
        }   
    }
}

/* CALENDRIER */
$(document).ready( function () {
    $(".conteneur-calendrier").hide();  
	
	$(".conteneur-date > .btn-calendrier-from").click( function () {
		 $(".calendrier-from").fadeIn();  
	});
	
	$(".conteneur-date > .btn-calendrier-to").click( function () {
		 $(".calendrier-to").fadeIn();  
	});
	
} ) ;




/* SUBMENU */

  $(document).ready(function(){
  	$("div ul li strong").hover(function() {
  		
  		$(this).parent().find("div.sub-menu").slideDown('fast').show();
  
  		$(this).parent().hover(function() {
  		}, function(){	
  			$(this).parent().find("div.sub-menu").slideUp('slow');
  		});
  		
  	});
  
  });

