$(function() {
	$("form.add-to-wishlist, form.remove-from-wishlist").ajaxForm({
		loading: function() {
			this.addClass("processing");
		},
		success: function(response) {
			this
				.removeClass("processing")
				.closest(".actions")[(response.inWishList ? "add" : "remove") + "Class"]("in-wishlist");
		},
		error: function() {}
	})
	.children("a").click(function(e) {
		e.preventDefault();
		$(this).closest("form").submit();
	});
});