// JavaScript Document

Event.observe(window, 'load', function() {
									  
	count();

});

function count() {
	
	var E = $('pourcentage');
	var value = parseInt(E.innerHTML);
	E.update(parseInt(value+1)+'%');
	
	if(value < 99) { setTimeout('count()', 50) } else { setTimeout('preload()', 100); }

}

function preload() {
	
	var i = 0;
	new Effect.Appear('loading', { duration: 1, from: 1, to: 0 });								// On cache le chargement
	new Effect.Morph('titre', { duration: 2, style: 'font-size:12px;', delay: 0.5 });	// On retraici le texte
	new Effect.Appear('menu', { duration: 2, from: 0, to: 1, delay: 1.5 });				// On affiche le menu
	new Effect.Appear('contact', { duration: 2, from: 0, to: 1, delay: 1.5 });			// On affiche les contacts
	new Effect.Appear('telecharger-book', { duration: 2, from: 0, to: 1, delay: 2.5 });	// On affiche le book
	new Effect.Appear('afficher-cv', { duration: 2, from: 0, to: 1, delay: 3.5 });		// On affiche le CV
	new Effect.SlideRightIn('cadre', { duration: 3, delay: 4.5, afterFinish: function() { hCarousel = new UI.Carousel("horizontal_carousel"); } });						// On affiche le cadre
	$$('.projet').each(function(element) {
		new Effect.Appear(element, { duration: 2.5, from: 0, to: 1, delay: parseInt(i+5) });
		i += 0.3;
	});		
	
}

