$(document).ready(function(){
	$("#home .photos img").fadeTo( 200, 0.8);
	
	$("#home .photos img").hover(function(){
		$(this).fadeTo( 200, 1);
	},function(){
		 $(this).fadeTo( 200, 0.5);
		 $(this).css("border","none");
	});
	$("#photo #content #contenu .photos img").hide();
	$("#photo #content #contenu .photos img").fadeTo( 500, 1);
	
	
	$("[title]").mbTooltip({ // also $([domElement]).mbTooltip  >>  in this case only children element are involved
      opacity : .97,       //opacity
      wait:500,           //before show
      cssClass:"default",  // default = default
      timePerWord:70,      //time to show in milliseconds per word
      hasArrow:true,			// if you whant a little arrow on the corner
      hasShadow:true,
      imgPath:"librairie/javascript/jquery/jquery.mb.tooltip.1.6/images/",
      ancor:"mouse", //"parent"  you can ancor the tooltip to the mouse position or at the bottom of the element
      shadowColor:"black", //the color of the shadow
      mb_fade:200 //the time to fade-in
    });
	
	
	
	
	$("body#photo #content #photos").height( $("#content").height() );
	$("body#home #content #photos").height( $("#content").height() );
	
	
});




var verifForm  = {

	//formContact
	formContact:function()
	{

		var nom = $("#nom").val();
		var prenom = $("#prenom").val();
		var mail = $("#email").val();
		var messsage = $("#messsage").val();
		
		
		if(nom==''){
			//$.jGrowl("Merci de remplir le champ 'Nom' du formulaire!", { header: 'Important' });
			alert("Merci de remplir le champ 'Nom' du formulaire!", { header: 'Important' });
			return false;
		}
		if(prenom==''){
			alert("Merci de remplir le champ 'Prénom' du formulaire!", { header: 'Important' });
			return false;
		}
		if(mail==''){
			alert("Merci de remplir le champ 'E-mail' du formulaire!", { header: 'Important' });
			return false;
		}
		if (!this.IsValidEmail(mail)){
			alert("Le champ 'E-mail' du formulaire contient une erreur!", { header: 'Important' });
			return false;
		}
		if(message==''){
			alert("Merci de remplir le champ 'Message du formulaire!", { header: 'Important' });
			return false;
		}
	
		
		return true;
	
	},
	
	
	
	
	IsValidEmail:function(email)
	{
	
	var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	
	return filter.test(email);
	}
		

	
}
