initElements = function(){


	Element.hide('background');
}

onload = function(){

	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
	var is_minor = parseFloat(navigator.appVersion);

	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_ie3    = (is_ie && (is_major < 4));
	var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
	var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
	var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
	var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
	var is_ie7    = (is_ie && (is_major == 4) && (agt.indexOf("msie 7")!=-1) );
	var is_ie7up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5 && !is_ie6);
	var is_ie7down= (is_ie && !is_ie7up);
	if (is_ie7down) alert("Vous utilisez une version de navigateur trop ancienne (plus de 3 ans) pour visualiser correctement ce site.\n Merci de bien vouloir mettre à jour votre ordinateur.");

	resizeBackground();
    correctPNG();
}







////////////////////////////////////////////////////////////////////////////////
//                            FONCTIONS   image de fond                       //
////////////////////////////////////////////////////////////////////////////////

onresize = resizeBackground;

function resizeBackground(){ 
    bg_img_w = $('background').getWidth();
    bg_img_h = $('background').getHeight();
    delta = bg_img_w/bg_img_h;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        //window_w = window.innerWidth;
        window_h = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        //window_w = document.documentElement.clientWidth;
        window_h = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        //window_w = document.body.clientWidth;
        window_h = document.body.clientHeight;
    }
    //window_h = document.getElementById("background_zone").offsetHeight;
    window_w = document.getElementById("background_zone").offsetWidth;
    
    if ( document.getElementById("background").style.height!= null ){
        if ((window_w/window_h)>delta) Element.setStyle("background", { width: px(window_w), height: px(window_w/delta) } );
    	else                           Element.setStyle("background", { width: px(window_h*delta), height: px(window_h) } );
    }
    new Effect.Appear('background', {duration: 1 } );
    //Element.show('background');  
}





                     
function px(x){
        return ''.concat(Math.round(x), 'px');
}

