$(function() {
  $('.error').hide();
 
 

  $(".button").click(function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		
	  var name = $("input#name").val();
	
		var email = $("input#email").val();
		if (email == "") {
      $("label#email_error").show();
      $("input#email").focus();
      return false;
    }
		var msj = $("textarea#msj").val();
		
		
		var dataString = 'name='+ name + '&email=' + email + '&contact="true"' ;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "wp-content/themes/soundexile/mail.php",
      data: dataString,
      success: function() {
      
      }
     });  $('#newsletter-form').html("<div id='message'></div>");
        $('#message').html("<h2 class='contactt'>Thank you for subscribing.</h2>")
        .append("<p class='main-text'>You are now on board :)</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#message').append("");
        });
    return false;
	});
});

