FlipAjaxClass = Class.create();

FlipAjaxClass.prototype = {

	initialize: function () {
	},

	request: function (url, param, method, returnFunction) {
	    
		new Ajax.Request(
			url, 
			{
				// Use POST
				method: method,
				// Send this lovely data
				postBody: param,
				// Handle successful response
				onSuccess: function(t) { returnFunction(t.responseText, "sucess"); },
				// Handle 404
				on404: function(t) { returnFunction(t.responseText, "404"); },
				// Handle other errors
				onFailure: function(t) { returnFunction(t.responseText, "failed"); }
			}
		);
	}
};
flipAjax = new FlipAjaxClass();