onload = function(){
	resizeBackground();
}

function initPage(){
	if ($('background_pict')) $('background_pict').hide();
}


/*******************************************************************************
 *                                               GESTION DE L'IMAGE DE FOND
 ******************************************************************************/

onresize = resizeBackground;

function resizeBackground(){ 
	if ($('background_pict')){
		if( typeof( window.innerWidth ) == 'number' ) {	//Non-IE
			window_h = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode'
			window_h = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {	//IE 4 compatible
			window_h = document.body.clientHeight;
		}
		window_w = document.getElementById("background").offsetWidth;

		if ($('background_pict')){
			bg_img_w = $('background_pict').getWidth();
			bg_img_h = $('background_pict').getHeight();
			delta = bg_img_w/bg_img_h;
		

			if ( document.getElementById("background_pict").style.height!= null ){
				if ((window_w/window_h)>delta) Element.setStyle("background_pict", { width: px(window_w), height: px(window_w/delta) } );
				else                           Element.setStyle("background_pict", { width: px(window_h*delta), height: px(window_h) } );
			}
		
			//new Effect.Appear('background_pict', {delay:0, duration: 1 } );
			Element.show('background_pict');  
		}    
	    if ($('content_links') && $('content_main')){
	    	if ($('content_main').getHeight()<(window_h)) $('content_main').setStyle({height: px(window_h-80) });
	    }
	}
}

function px(x){
	return ''.concat(Math.round(x), 'px');
}
