<!--

$(function() {

	$('.facebook').animate({left: 0}, {duration: 450, complete: function() {
			$('.twitter').animate({left: 0}, {duration: 450, complete: function() {
					$('.youtube').animate({left: 0}, {duration: 450});
				}
			});
		}
	});
	
	if($.browser.msie && ($.browser.version < 9.0)) {
				
		$('#lueur').css('opacity', 1);
		$('#content_display').css('display', 'block');
		lance_parallax();
		
	}else{
		$('#content').css({scale: 0});
		$('#bg_formes').css({scale: 0});
		$('#bg_fruitsFlou').css({scale: 0});
		$('#bg_fruits').css({scale: 0});
				
	}
   	
});


// CHARGEMENT IMAGES
var t_img = ['/images/background_formes.png',
			'/images/background_fruits_flous.png',
			'/images/background_fruits.png',
			'/images/logo.png',
			'/images/fruit_pamplemousse.png',
			'/images/logo_universBoissons.png',
			'/images/input_bg.png',
			'/images/submit_bt.png'];
			
var compteur_loading = 0;

var t_temp_img =  [];
$(function () {	
	for(var i = 0 ; i < t_img.length ; i++){
		  t_temp_img[i] = new Image();
		  // wrap our new image in jQuery, then:
		  $(t_temp_img[i])
			// once the image has loaded, execute this code
			.load(function () {
			 compteur_loading++;
			 
			 if(compteur_loading == t_img.length){
				 temp_animations();
			 }
			})
			
			// if there was an error loading the image, react accordingly
			.error(function () {
			  	console.log("erreur");
			})
			
			// *finally*, set the src attribute of the new image to our image
			.attr('src', t_img[i]);
	}
});
//------------

function temp_animations() {
	setTimeout('lance_animations()',1100);
}


function lance_animations() {
		
	$('#lueur').animate({opacity: 1},{duration: 2000});
	$('#content').transition({scale: 1}, 1000);
	$('#content_display').delay(800).fadeIn(400);
	
	setTimeout('anime_fruits()',700);	
	
	$('#borderTop, #borderBottom').animate({height: '6px'},{duration: 600});
	$('#borderLeft, #borderRight').animate({width: '6px'},{duration: 600});
}

function anime_fruits() {
	$('#bg_formes').transition({scale: 1}, 1000);
	$('#bg_fruitsFlou').transition({scale: 1}, 1000);
	$('#bg_fruits').transition({scale: 1}, 1000);
	setTimeout('lance_parallax()',1100);	
		
}
function lance_parallax() {
	$('#bg_formes').plaxify({"xRange":40,"yRange":40});
	$('#bg_fruitsFlou').plaxify({"xRange":60,"yRange":60,"invert":true});
	$('#bg_fruits').plaxify({"xRange":75,"yRange":75});
	$.plax.enable();	
}

/*===========HOVER SHARE=============*/
$(function() {    
    $('.share').hover(function(){
        $(this).stop().animate({width: '55px'},{queue:false, duration:250});
    },
        function(){
            $(this).stop().animate({width: '40px'},{queue:false, duration:250});
    });     
});
-->
