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

  jQuery(".buttons").click(function() {
		// validate and process form
		// first hide any error messages
    jQuery('.error').hide();
		
	var gift = jQuery("input#txtgift").val();
	if (gift == "") {
      jQuery("label#gift_error").show();
      jQuery("input#txtgift").focus();
      return false;
	}
		
		var dataString = 'gift=' + gift+'&sub=1';
		//alert (dataString);//return false;
		
	jQuery.ajax({
      type: "POST",
      url: "gift.php",
      data: dataString,
      success: function() {
		  alert("Thank You! Your suggestion will be considered");
		  jQuery("#txtgift").attr("value","");
		  jQuery("input#txtgift").focus();
        /*jQuery('#suggestgift').html("<div id='message'></div>");
        jQuery('#message').html("<h2>Thank you!</h2>")
        .append("<p>Your suggestion will be<br /> considered</p>")
        .hide()
        .fadeIn(1500, function() {
          jQuery('#message').append("<img id='checkmark' src='images/check.png' />");
        });*/
      }
     });
    return false;
	});
});
runOnLoad(function(){
  jQuery("input#txtgift").select().focus();
});
