// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// Ajax call to remove a task
function DeleteTaskHandler(task_id, is_recurring)
{
 if (confirm('Are you sure to remove this task?')) 
	 {
	 del_recurring = 'false';
	 if (is_recurring && confirm('This is a recurring task.\n\nDo you want to also delete all other instances of this one?\n\nClick "OK" to delete all instances. \nClick "Cancel" to delete this task only.'))
		 {
			del_recurring = 'true';
		 }
	  new Ajax.Request('/task/remove/'+task_id, {parameters:'&del_recurring='+del_recurring, asynchronous:true, evalScripts:true}); 
	 }; 

  return false;
}