TableRow = new Class({
	initialize: function (id)
	{
		this.element = $('row_' + id);
		this.selected_class = 'selected';
		this.deleting_class = 'deleting';
	},
	
	highlight: function()
	{
		this.element.addClass(this.selected_class);
	},
	
	unhighlight: function()
	{
		this.element.removeClass(this.selected_class);
	},
	
	transition: function()
	{
		this.unhighlight();
		this.element.addClass(this.deleting_class);
	},
	
	hide: function()
	{
		this.element.setStyle('display', 'none');	
	}
});

function deleteRow(id, message, a_tag)
{
	row = new TableRow(id);	
	row.highlight();
	
	if(confirm(message))
	{
		row.transition();
		
		req = new Request({'url': $(a_tag).get('href')});
		
		req.onSuccess = function(responseText, responseXML)
		{
			row.hide();
		}
		
		req.send();
	}
	else
	{
		row.unhighlight();
	}
	
	return false;
}