var SyncleonAJAX = new Class( {

/**
* Initializes the class, and sets properties.
*/
initialize : function(url) {
this.url = url;
this.list = $('todo');
this.details = $('todo-details');
},

/**
* Attaches the event to the list.
*/
attachEvents : function() {
this.list.addEvent('change', this.getDetails.bind(this));
},

/**
* Retrieves the data from the Joomla model using a HTTP call.
*/
getDetails : function() {
var id = this.list.getProperty('value');
var details = this.details;

var request = new Json.Remote(this.url + "&id=" + id, {
onComplete : function(todo) {
details.setHTML(todo.body);
}
}).send();
}

});