function show_taches(id) {
				if (document.getElementById(id).style.display=='none') {
					document.getElementById(id).style.display='';
				} else {
					document.getElementById(id).style.display='none';
				}
			}
			function expand_taches_all() {";
				foreach ($tasks->types_taches as $type_tache) {
					print "if (document.getElementById('".$type_tache->name."').style.display=='none') {
						document.getElementById('".$type_tache->name."').style.display='';
					}";
				}	
			print "}
			function collapse_taches_all() {";
				foreach ($tasks->types_taches as $type_tache) {
					print "if (document.getElementById('".$type_tache->name."').style.display=='') {
						document.getElementById('".$type_tache->name."').style.display='none';
					} ";
				}	
			print "}
		
		
		
		
		
		
";
	}
switch ($act)  {
	case "modif":
		if ($type_task_id) {
			$tasks=new taches();
			print $tasks->show_type_task_form($type_task_id);
		}
		break;
	case "update":
		$tasks=new taches();
		foreach ($tasks->types_taches as $type_tache) {
			if ($type_tache->id_type == $type_task_id) {
				require_once($base_path."/admin/planificateur/".$type_tache->name."/".$type_tache->name.".class.php");
				eval("\$plan=new ".$type_tache->name."();");
				if ($plan) {
					$plan->id_type=$type_task_id;
					$plan->timeout=$timeout;
					$plan->histo_day=$histo_day;
					$plan->histo_number=$histo_number;
					$plan->restart_on_failure=($restart_on_failure ? "1" : "0");
					$plan->alert_mail_on_failure=($alert_mail_on_failure ? "1" : "0").($mail_on_failure ? ",".$mail_on_failure : "");
					$plan->save_global_properties();
				}
			}
		}
		task_list();
		break;
	case "task":
		$tasks=new taches();
		switch ($subaction) {
			case "change":
				print $tasks->show_form_task($planificateur_id);
				break;
			case "save":
				foreach ($tasks->types_taches as $type_tache) {
					if ($type_tache->id_type == $type_task_id) {
						if (is_file($base_path."/admin/planificateur/".$type_tache->name."/".$type_tache->name.".class.php")) {
							require_once($base_path."/admin/planificateur/".$type_tache->name."/".$type_tache->name.".class.php");
							eval("\$plan=new ".$type_tache->name."();");
							$plan->save_property_form($planificateur_id);
						}
					}
				}		
				task_list();
				break;
			default :
				print $tasks->show_form_task($planificateur_id);
		}
		break;
	case "task_del":
		$tasks=new taches();
		print $tasks->del_task($planificateur_id);
		break;
	case "task_duplicate":
		$tasks=new taches();
		print $tasks->show_form_task($planificateur_id);
		break;
	default:
		task_list();
		break;
}