$(document).ready(function(){		

	/* Comportement Rollover avec class="rollover" */
	attachRollOverEvent("img.rollover");
	
	
	// Comportement pour le diaporama jquery
	$('#diaporama').cycle(
	{
	    fx:     'fade',
	    after:  onAfter,
	    speed:  'slow',
	    timeout: 0,
	    pager:  '#vignettes',
	    next:   '#next',
	    prev:   '#prev',
	    pagerAnchorBuilder: function(idx, slide)
	    { 
	        // return selector string for existing anchor 
	        return '#vignettes li:eq(' + idx + ') a'; 
	    }, 
    	startingSlide: 0 // zero-based 
	});
	
	
});/* Fin ready */ 

function onAfter()
{ 
	$('#titre').html('<h2>' + this.alt + '</h2>'); 
}

/* Comportement Rollover avec class="rollover" */
attachRollOverEvent = function(imageId){
	$(imageId).mouseover( function(){ $(this).attr("src", $(this).attr("src").replace('.','_roll.')) } );
	$(imageId).mouseout( function(){ $(this).attr("src", $(this).attr("src").replace('_roll','')) } );
}

