$(function() {
  $('.error').hide();
  $('input.text-input').css({backgroundColor:"#1A1A1A"});
  $('input.text-input').focus(function(){
    $(this).css({backgroundColor:"#FFFFFF"});
  });
  $('input.text-input').blur(function(){
    $(this).css({backgroundColor:"#1A1A1A"});
  });

  $(".button").click(function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		/*
	  var name = $("input#name").val();
		if (name == "") {
      $("label#name_error").show();
      $("input#name").focus();
      return false;
    }*/
		var email = $("input#email").val();
		if (email == "") {
      $("label#email_error").show();
      $("input#email").focus();
      return false;
    }
	/*
		var phone = $("input#phone").val();
		if (phone == "") {
      $("label#phone_error").show();
      $("input#phone").focus();
      return false;
    }*/
		
		var dataString = '&YMP0=' + email;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "http://ymlp.com/subscribe.php?YMLPID=guyqwsbgmgs",
      data: dataString,
      success: function() {
        $('#contact_form').html("<div id='message'></div>");
        $('#message').html("<img src='http://www.usloteverywhere.com/wp2/wp-content/themes/zmbntn/images/newsletterThanks.gif' />")
        .append("<p>You will receive confirmation shortly.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#message').append("");
        });
      }
     });
    return false;
	});
});
/*runOnLoad(function(){
  $("input#name").select().focus();
});*/

