// FONCTION POUR IMAGE PLEIN ECRAN
function scaleImage(monImage){
	// LARGEUR ET HAUTEUR DE LA FENETRE SELON LE NAVIGATEUR
    var LargeurWin = 0, HauteurWin = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    LargeurWin = window.innerWidth;
    HauteurWin = window.innerHeight;
  		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    LargeurWin = document.documentElement.clientWidth;
    HauteurWin = document.documentElement.clientHeight;
  		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    LargeurWin = document.body.clientWidth;
    HauteurWin = document.body.clientHeight;
  	}

	if (LargeurWin > HauteurWin + 200) {
	var MyWidth = LargeurWin;
	var MyHeight = Math.round((LargeurWin*900)/1345);
	}
	else {	
	var MyHeight = HauteurWin;
	var MyWidth = Math.round((HauteurWin*1345)/900);
	}
	
	document.getElementById(monImage).style.width=MyWidth+'px';
	document.getElementById(monImage).style.height=MyHeight+'px';
	$('loader').style.display="none";
	$('choixImage').fade(1);

}

// FONCTION POUR IMAGE PLEIN ECRAN
function reziseImage(monImage){
	// LARGEUR ET HAUTEUR DE LA FENETRE SELON LE NAVIGATEUR
    var LargeurWin = 0, HauteurWin = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    LargeurWin = window.innerWidth;
    HauteurWin = window.innerHeight;
  		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    LargeurWin = document.documentElement.clientWidth;
    HauteurWin = document.documentElement.clientHeight;
  		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    LargeurWin = document.body.clientWidth;
    HauteurWin = document.body.clientHeight;
  	}

	if (LargeurWin > HauteurWin + 200) {
	var MyWidth = LargeurWin;
	var MyHeight = Math.round((LargeurWin*900)/1345);
	}
	else {	
	var MyHeight = HauteurWin;
	var MyWidth = Math.round((HauteurWin*1345)/900);
	}
	
	document.getElementById(monImage).style.width=MyWidth+'px';
	document.getElementById(monImage).style.height=MyHeight+'px';

}


// FONCTION POUR IMAGE PROJETS PLEIN HAUTEUR

function scaleProjet(obj){
		$('imageProjet').set('overflow','hidden');
		$('loading').style.display='none';
		thisWidth = obj.width;
   		thisHeight = obj.height;
		obj.height = window.getHeight();
		obj.width = Math.round((window.getHeight()*thisWidth)/thisHeight);
		$('pictureSlide').fade('hide');
		$('pictureSlide').fade(1);
		
}


// FONCTION POUR IMAGE PROJETS PLEIN HAUTEUR

function scaleProjet2(obj){
		$('imageProjet2').set('overflow','hidden');
		$('loading2').style.display='none';
		thisWidth = obj.width;
   		thisHeight = obj.height;
		obj.height = window.getHeight();
		obj.width = Math.round((window.getHeight()*thisWidth)/thisHeight);
		$('pictureSlide2').fade('hide');
		$('pictureSlide2').fade(1);
		
}
	
window.addEvent('resize',function(e){
							reziseImage('picture');
		}
);
