$(document).ready(function() {
// le fond est en plein ecran
jQuery.fn.positionFond = function(loaded){
var obj_fond = $('#fond');
	if(!loaded){
	obj_fond.css('height', $(window).height());
}
}

jQuery.fn.positionElements = function(loaded){
var obj_contenu = $('#contenu');
var obj_slogan = $('#slogan-aquarium');
var obj_footer = $('#footer');
	if(!loaded){
	// on centre le contenu et on positionne le footer en bas
		if($(window).height()>(document.getElementById('contenu').offsetHeight)+200){
		obj_contenu.css('top',100+(($(window).height()-100)-parseInt(document.getElementById('contenu').offsetHeight))/2);
		obj_slogan.css('top',65+(($(window).height()-65)-parseInt(document.getElementById('contenu').offsetHeight))/2);
		obj_footer.css('top', $(window).height()-20);
		}
		else{
		obj_contenu.css('top', 175);
		obj_slogan.css('top', 160);
		obj_footer.css('top', parseInt(document.getElementById('contenu').offsetHeight)+parseInt(180));
		}
		
	}
	else{
	obj_contenu.stop();
	obj_footer.stop();
	}

}
$(window).load(function(){
	$('#contenu').positionElements();
	$('#fond').positionFond();
});


$(window).resize(
function(){ 
$('#contenu').positionElements();
$('#fond').positionFond();
}
);

});
