$(document).ready(function () {
		//Redimensionnement selon l'espace hauteur du client
		var H=tb_getPageSize()[1];
		var Hsite=$("body").height();
		if(H>Hsite){
			var libre=(H-Hsite);
			libre=libre/2-15;
			var topc=20+libre-2+"px";
			//alert(libre);
			if(libre>0){
				libre='center '+libre+'px';
				$("#container").css("margin-top",topc);
				$("#corps").addClass('reposition');
				$(".reposition").css("background-position",libre);
			}
		}
		
		//Action au survol des liens pages 
	    $("#entete ul img").hover(
	    	//Mouse over
	    	function(){ 
	    		$(this).fadeTo(1000, 0.5);
	    		return(false); 
	    	},
	    	//Mouse out
	    	function(){ 
	    		//$(this).css('border','2px solid #e0dddc');
	    		$(this).fadeTo(1000, 1);
	    		return(false);
	    	}
	    ); 
	    
	    //Effet marquee rencontre
	    //$('.rencontre').attr("margin-left","0px");
	    $('.rencontre').attr("left","400px");
	    var deplacement=parseInt($('.rencontre').attr("left"))-100;
	    $('.rencontre').fadeTo(1000, 0.5);
	    $('.rencontre').animate({
	        'left' : deplacement + "px"
	      });
	    $('.rencontre').fadeTo(1000, 1);

	    
	    //Sroll de pages sauf contact
	    if($('#content').find("#texte").val()!=undefined){
	    	$('#texte').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
	    }
	    
	    function tb_getPageSize(){
	    	var de = document.documentElement;
	    	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	    	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	    	arrayPageSize = [w,h];
	    	return arrayPageSize;
	    }
	    
	    $('#w_rencontre').click(function (e) {
			var boite=$('#modal-rencontre');
			$("#entete").append('<p class="loader">&nbsp;</p>');
			e.preventDefault();
			$.ajax({
				url: "liste_rencontre.php",
				data: 'affiche_rencontre=true',
				type: 'post',
				cache: false, 
				dataType: 'html',
				success: function(data){
						boite.html(data);
						boite.modal();
						$(".loader").remove();
				},
				error:affiche
			});
		});
		
		function affiche(xhr){
			alert(xhr.statusText);
	  	}
});
