 $(document).ready(function() 
	  {
    
		
		// $('#scrollable_animation').cycle({   });
	   //-----------  	

		 $(document).pngFix();  
		//-------------
		 function animer()
         {
         $('#error').animate({ fontSize:"1.3em",opacity: 0.4},1500);
       $('#error').animate({ fontSize:"1.0em",opacity: 1},1500);
         }
		  
		  $("#email").focus(function()
	          {
	          $(this).val("");
			 
			  $(this).css("color", "black");
	           });
			   
	      $("#sinscrir").click(function()
		  {
		    var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/i; 
            var mail=$("#email").val();
            var resultat = reg.test(mail);
            var maill=$("#email").val().length;
                if ( maill!=0 )
	                {
	                     if(!resultat)
		                    {
		                       $("#email").focus();
						       $('#error').html('Mail incorrect');
						       $('#error').fadeIn("slow", 0, function(){$(this).show();});
								animer();
								$('#error').hide("slow"); 
		                      }
		                       else
							   {
							       //------lancer le loading animation
								   $('#error').html('<img src="images/loadingAnimation.gif" />');
								   $('#error').fadeIn("slow", 0, function(){$(this).show();});
								   $.post('trait_newslettre.php', { email: mail},    
                                       function(data){ 
			                            if( data )
		                                     {
					                          $('#error').html('merci pour votre inscription');
						                      $('#error').fadeIn("slow", 0, function(){$(this).show();});
								              animer();
								              $('#error').hide("slow"); 
											  
					                           }
                                         });
							   }
						 
						 
	                }					  
		  })//---------sinscrir click
		 
		     
	   });//-----------onload
	
