$(document).ready(function() {
var h = $("#contain").height();

$('#projet').css("height", h);

		var $winwidth = $(window).width();
		var sizePict = $("img#bgimg").width()
		$("img#bgimg").attr({width: $winwidth});
		$(window).bind("resize", function(){
			var $winwidth = $(window).width();					
			var ratio =( $winwidth/sizePict);
			if(ratio>0.55) $("img#bgimg").attr({width: $winwidth});
		 });
	});

function f_show_projet(id)
{
 	jQuery.ajax({
			type: "POST",
			url: "php/functions.php",
			data: 'value=sendprojet&id='+id,
			error: function() {alert('erreur');},
			success: function(r) {				
				$('#contenuprojet').empty();
				$('#contenuprojet').append(r);			
				$("#slider").easySlider();				
				$('#slider').animate({opacity: 1},{duration: 900});
				var t = $('#projet'+id).html();
			
				document.title = 'Atelier Peplum - Projet: ' + t;
			},
			beforeSend: function(){
			  $("#loading").show();
			},
			complete: function(){
			$("#loading").hide();
			}
		});
}

