var myrules ={
	'a.remote_delete' : function(element){
	element.onclick = function(){
		if (!confirm('Weet u zeker dat u dit item wil verwijderen?')) return false; 
		// It's always a good idea to give people a second chance to undo a destroying action
		
		new Ajax.Updater(
			'ajaxmessage', element.href + '',
			{
					asynchronous:true,
					onComplete: function(element){ 
						Effect.Appear('ajaxmessage') 
						Effect.Fade('ajaxmessage', {duration:4.0, queue: 'end'});
					}
			}
			); 
		// Send off the request!
		
		Effect.Fade(element.parentNode.parentNode); 
		// This drops out the parent of the parent of the link (the <li> surrounding it)
		
		return false;
		// This prevents the browser from executing the request
	}
	},
	
	'.message' : function(element){
			if (element.id != 'ajaxmessage') Effect.Fade(element, {duration:3.0});
	}
}
	


var myrules2 ={
	
	'a.remote_approve' : function(element){
	element.onclick = function(){
		if (!confirm('Weet u zeker dat u dit item wilt goedkeuren?')) return false; 
		// It's always a good idea to give people a second chance to undo a destroying action
		
		new Ajax.Updater(
			'ajaxmessage', element.href + '',
			{
					asynchronous:true,
					onComplete: function(element){ 
						Effect.Appear('ajaxmessage') 
						Effect.Fade('ajaxmessage', {duration:4.0, queue: 'end'});
					}
			}
			); 
		// Send off the request!
		
		Effect.Pulsate(element.parentNode.parentNode);
		
		return false;
		// This prevents the browser from executing the request
	}
	},
	
	'.message' : function(element){
			if (element.id != 'ajaxmessage') Effect.Fade(element, {duration:3.0});
	}	
}

Behaviour.register(myrules);
Behaviour.register(myrules2);