$(document).ready( function() {

	var nbr_img = $('#home_content IMG').length ;
	var k = 0 ;
	
	$('#home_content IMG').load( function() {
		k ++ ;
		if( k == nbr_img )
		{
			resizeDiv() ;
		}
	} );
	
	resizeDiv() ;
	reposeDiv() ;
	$(window).resize( function() {
		reposeDiv() ;
	} ) ;

} ) ;

function reposeDiv()
{
	x_home = $('#home_content').get(0).offsetLeft ;
	y_home = $('#home_content').get(0).offsetTop ;
	$('#home0_').css( 'left' , ( x_home + 15 ) + 'px' ).css( 'top' , ( y_home ) + 'px' ) ;
}

function resizeDiv()
{
	var b1 = $('#inside_home_bloc_1').height() ;
	var b2 = $('#inside_home_bloc_2').height() ;
	var b3 = $('#inside_home_bloc_3').height() ;
	
	var hauteurs = new Array( b1 , b2 , b3 ) ;
	hauteurs.sort( compareNombre ) ;
	
	$('#inside_home_bloc_1').css( 'height' , hauteurs[2] + 'px' ) ;
	$('#inside_home_bloc_2').css( 'height' , hauteurs[2] + 'px' ) ;
	$('#inside_home_bloc_3').css( 'height' , hauteurs[2] + 'px' ) ;
	
	$('#home_content').css( 'height' , ( hauteurs[2] + 40 ) + 'px' ) ;
	
	if( $.browser.msie && jQuery.browser.version == '6.0' )
	{
		$('#inside_home_bloc_2 .bouton_bottom').css( 'position' , 'absolute' ).css( 'top' , ( $('#inside_home_bloc_2').get(0).offsetTop + $('#inside_home_bloc_2').height() - 33 ) + 'px' ) ;
		$('#inside_home_bloc_3 .bouton_bottom').css( 'position' , 'absolute' ).css( 'top' , ( $('#inside_home_bloc_3').get(0).offsetTop + $('#inside_home_bloc_3').height() - 47 ) + 'px' ) ;
	}
	else
	{
		$('#inside_home_bloc_2 .bouton_bottom').css( 'position' , 'absolute' ).css( 'top' , ( $('#home_content').get(0).offsetTop + 20 + $('#inside_home_bloc_2').height() - 33 ) + 'px' ) ;
		$('#inside_home_bloc_3 .bouton_bottom').css( 'position' , 'absolute' ).css( 'top' , ( $('#home_content').get(0).offsetTop + 20 + $('#inside_home_bloc_3').height() - 47 ) + 'px' ) ;
	}
}

function compareNombre( a , b )
{
	return a - b ;
}

