$(function() {
    $('#homeSlideshow').cycle({
        fx:     'fade',
        speed:  2000,
        timeout: 5000
    });
	
	$("#pThumbs").append('<ul id="galleryListUl">');
	
	var slideshow = $('#pSlideshow').cycle({
		fx:      'fade',
		timeout:  2000,
		prev:    '#pSlideshowPrev',
		next:    '#pSlideshowNext',
		pager:   '#galleryListUl',
		pagerAnchorBuilder: function(idx, slide){
			var classname = ""; 			
			if(idx%5==4){ classname = ' class="last"'; }
			return '<li' + classname + '><a href="#"><img src="' + slide.src + '" width="84" height="63" alt="Agence de la Poste" /></a></li>'; 
		}        	
	});
	
	slideshow.cycle('pause', true);
	
	$('#pSlideshowPlay').click(function() {
		var paused = slideshow.is(':paused');
		if(paused){
			$('#pSlideshowPlay span.on').hide();
			$('#pSlideshowPlay span.off').show();		
		} else {
			$('#pSlideshowPlay span.off').hide();
			$('#pSlideshowPlay span.on').show();		
		}	
		slideshow.cycle(paused ? 'resume' : 'pause', true);
		return false;
	});
	
	
	$("h1.reflection").FontEffect({ mirror:true, mirrorColor:"#0f1138", mirrorOffset:-8, mirrorHeight:100, mirrorDetail:1, mirrorTLength:20, mirrorTStart:0.15  });
	
});



function afficheDPE(div)
	{		
		$("."+div+"").fadeIn(1000);
	}
	
	function cacheDPE(div)
	{
		$("."+div+"").fadeOut(1000);
	}


