jQuery(document).ready( function () {
	// AJOUT DE LA CLASS LAST
		$('nav li:last-child').addClass("last");
		$('li:last-child').addClass("last");
		$('ul.listProjects:last-child').addClass("last");															
		
		// SCROLL SMOOTH
		$('a[href^="#"]').click(function(){  
    var the_id = $(this).attr("href");  
    $('html, body').animate({  
        scrollTop:$(the_id).offset().top  
    }, 'slow');  
    return false;
		});
		
		//VIGNETTEs
//		jQuery(function($){
//		$('.circle').mosaic({
//			opacity		:	0.8			//Opacity for overlay (0-1)
//		});
//		});
		
		$('.mask').css("opacity",0);
		$('.screen').hover(function(){
			//$(this).find('.circle').addClass("hide");
			$(this).find('.mask').stop().animate({opacity:0.6}, 200);
		},function(){
			//$(".circle").removeClass("hide");
			$(this).find('.mask').stop().animate({opacity:0}, 200);
		});
		
		
		//SHADOWBOX initialisation manuelle
		Shadowbox.init({
			skipSetup: true
		});
			window.onload = function() {
			// GALERIE
			Shadowbox.setup("a.show", {
					gallery: "work",
					autoplayMovies:     true
			
			});
			
		};
		
		//twitter
		$('#tweetBox').lastTweets({
					username:'Neovent',
					count: 1
		});

		
		
		// LABEL FORM FADEIN
		{
			$("label").inFieldLabels({ fadeOpacity:0.1});
		}


		// NAVIGATION SECONDAIRE FADEIN
		$(function () {
		$('#secondary').hide();
		$(window).scroll(function () {
			if ($(this).scrollTop() >= 320) {
				$('#secondary').fadeIn(800);
			} else {
				$('#secondary').fadeOut(800);
			}
		});
		
		
		//VALIDATION DE FORMULAIRE
		$("#formContact").validate({
		rules: {
			nom: {
				required: true,
				minlength:1
			},
			prenom: {
				required: true,
				minlength:2
			},
			email: {
				required: true,
				email:true
			},
			message: "required"	
		},
		messages: {
			nom: {
				required: "Ouuups ! Vous avez oublié d'entrer votre nom.",
				minlength: "Votre nom doit bien contenir au moins 2 caractères."
			},
			prenom: {
				required: "Ouuups ! Vous avez oublié d'entrer votre prénom.",
				minlength: "Votre prénom doit bien contenir au moins 2 caractères."
			},
			email: {
				required: "Ouuups ! Vous avez oublié d'entrer votre adresse e-mail.",
				email: "Ouuups ! Votre adresse e-mail n'est pas valide. Merci de la corriger."
			},
			message: "Un petit mot gentil est toujours apprécié !"
		}
	});
	
	});

});



