  $(function() { // onload...do
	$('#mailing-list-form').submit(function() {
	  // now we're going to capture *all* the fields in the
	  // form and submit it via ajax.
	  
	  // Collect form input fields
	  var inputs = new Object;
	  $(':input', this).each(function() {
		if (this.name != "") {  // Ignore inputs without a name
		   if ( !((this.type == "radio" || this.type == "checkbox") && !this.checked) ) {
			  inputs[this.name] = this.value;
		   }
		}
	  });

	  // Send the request
	  jQuery.ajax({
		data: inputs,
		url:  this.getAttribute('action'),
		type: this.getAttribute('method'),
		timeout: 2000,
		error: function(xhr, desc, e) {
		   alert("Failed to submit: " + desc);
		},
		success: function(xml) {
			var _email = "";
			var _postalcode = "";

			_email        = $("emailaddress", xml).text();
			_postalcode   = $("postalcode", xml).text();

			if (_email == "Invalid" || _email == "Required") {
			  $("#emailaddress").css({"font-weight" : "bold", "color" : "red"});
			} else {
			  $("#emailaddress").css({"font-weight" : "bold", "color" : "green"});
			}

			if (_postalcode == "Invalid" || _postalcode == "Required") {
			  $("#postalcode").css({"font-weight" : "bold", "color" : "red"});
			} else {
			  $("#postalcode").css({"font-weight" : "bold", "color" : "green"});
			}

			$("#emailaddress").val(_email);
			$("#postalcode").val(_postalcode);

		}
	  })
	  
	  // re-test...
	  // by default - we'll always return false so it doesn't redirect the user.
	  return false;
	})
  })