$(document).ready(function() {
	//Test du navigateur pour IE l'icompatible de service
	if(navigator.appName=="Microsoft Internet Explorer"){
		var isIE=true;
		if(window.document.compatMode == "CSS1Compat" ){
			var ch=document.documentElement.clientHeight;
			var cw=document.documentElement.clientWidth;
		}else{
			var ch=document.body.clientHeight;
			var cw=document.body.clientWidth;
		}	
	}else{
		var isIE=false;
		var ch=window.innerHeight;
		var cw=window.innerWidth;
	}
	
	
	$("body").append('<div id="masque"></div>');
	$('#masque').css({ position: "absolute",
            marginLeft: 0, marginTop: 0, height:window.innerHeight+'px'});
	$('#masque').css('background-color','#000000');
	
	$('#masque').animate({
		height: ch+'px',
		width: cw+'px',
	}, 400);
	/*$('#masque').animate({ backgroundColor: "#f6f6f6" }, 'slow');*/
	
	//Positionner le logo
	$('#logo').animate({
			marginTop: (ch-300)/2+'px',
			marginLeft: (cw-200)/2+'px',
	}, 300);
	//Positionner les rubriques
	$('#info').animate({
			marginTop: (ch-340)/2+'px',
			marginLeft: (cw-600)/2+'px',
	}, 300);
	$('#web').animate({
			marginTop: (ch-60)/2+'px',
			marginLeft: (cw-600)/2+'px',
	}, 300);
	$('#footer').animate({
			marginTop: (ch)/2+100+'px',
			marginLeft: (cw)/2-120+'px',
	}, 300);

  	
	//Positionner le fond du logo et l'afficher
	$('#bg_logo').animate({
		marginTop: (ch-340)/2+'px',
		marginLeft: (cw-240)/2+'px',
	}, 300);

	$('#bg_logo').fadeIn('slow',function(){
		$('#logo').fadeIn('slow',function(){
			$('#bg_logo').delay(200).animate({
				marginLeft: (cw-600)/2+'px',
			}, 300);
			$('#logo').delay(200).animate({
				marginLeft: (cw-600)/2+20+'px',
			}, 300);
			//On fait apparaitre les rubriques
			$('#info').delay(400).fadeIn('slow',function(){
				$('#info').animate({
					width: '300px',
					marginLeft: (cw-100)/2+'px',
				}, 400);
			});
			$('#web').delay(1000).fadeIn('slow',function(){
				$('#web').animate({
					width: '300px',
					marginLeft: (cw-100)/2+'px',
				}, 400);
			});
			$('#footer').delay(3000).fadeIn('slow');
			
			
		
		});
		$('#masque').animate({
			opacity: 0.80,
		}, 300);
		
		
	
	});
  	/*
  	var tabmots= new Array('informatique','web','multimedia','maintenance','serveur','applications','sérénité');
  	
  	for(var i=0;i<tabmots.length;i++){
  		$('body').append('<div id="mot_'+i+'" style="display:none;position:absolute;">'+tabmots[i]+'</div>');
  		//On positionne tous les elements au centre
  		$('#mot_'+i).animate({
			marginTop: (window.innerHeight-300)/2+'px',
			marginLeft: (window.innerWidth-200)/2+'px',
			
		}, 10);
  		$('#mot_'+i).fadeIn(1000, function(){
  			$(this).delay(i*800).animate({
				marginTop: Math.round(Math.random()*(window.innerHeight-400))+'px',
				marginLeft: Math.round(Math.random()*(window.innerWidth-400))+'px',
				fontSize: Math.round(Math.random()*60)+30+'px'
			}, 500);
  		});
  	
  	}
  	*/

  	
  	
});
