function adjust() {
	var Hg= document.body.clientHeight;

	//if(Hg > 700){//peut etre affiner ce seuil
	//document.getElementById('corps').style.height = Hg+'px';
	
	if($("body").attr('class') == 'index'){
		h = Hg - 580;
		limite = Hg - 180;
	}
	else if ($("body").attr('class') == 'photos'){
		h = Hg - 205;
		limite = Hg - 200;
	}
	
	
	
	else {
		h = Hg - 250;
		limite = Hg - 200;
		}
	
	h_txt = document.getElementById("txt_body").scrollHeight;
	if((h_txt < limite) && (h_txt < h) ){
		$('#txt_body').css({height: h});
	}
	
	
	//alert(document.getElementById("txt_body").scrollHeight);

}
function lettr(){
	//$("p").html('<span class="lettr">'+$(this).text().substr(0, 1)+'</span>'+$(this).html().substr(1));
	//alert('kj');
	$("p.L").each(function(){
		$(this).html('<span class="lettr"><img src="img/lettres/'+$(this).text().substr(0, 1)+'.gif"></span>'+$(this).html().substr(1));
	});
}

function mask(nom,dom,dlt){
	adr = nom+'@'+dom+'.'+dlt;
	sortie = '<a href="mailto:'+adr+'">'+adr+'</a>'
	return sortie;
}




$(document).ready(function(){

	adjust();
	
	//mel = mask('rene.boutang','wanadoo','fr');
	//$(".ml").html(mel);
	$(".ml").each(function(){
		$(this).html(mask($(this).attr('title'),'chateaudecavagnac','com'));
	});
	
		$(".vml").each(function(){
		$(this).html(mask($(this).attr('title'),'vincent-marcel','com'));
	});
	
	$(window).resize( function() {adjust(); } );
	
	lettr();
	
		
});
