
// Add model to the application.
window.application.addModel((function( $, application ){
    // I am the profile service class.
	function Interface(){
		this.interfaceURL = null;
	}
	
	// I initialize the model. I get called once the application starts
	// running. At that point, the DOM is available and all the other model
	// and view classes will have been added to the system.
	Interface.prototype.init = function(){
		// initialize properties
		this.interfaceURL = 'interface.php';
	};
	
	// call the interface function
	Interface.prototype.execute = function( vars, onSuccess, onError ){
		var self = this;
		// call the interface
		$.ajax({
			url: self.interfaceURL,
			type: 'POST',
			data: vars,
			dataType: 'json',
			success: function(result){onSuccess(result);},
			error: function(result){onError(result);}
		});
	};
	
	// Return a new model class.
	return( new Interface() );
	
})( jQuery, window.application ));

