<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

<xi:include href="master.html" />
<head>
<title>Task</title>
<script type="text/javascript">
	var hiding_fields = ['interval', 'weekdays', 'monthdays', 'timeofday']
	function show_field(field) {
		$(field + '.container').set('styles', {'display': ''});
	}
	function change_fields(value) {
		hiding_fields.each(function(field) {
			$(field + '.container').set('styles', {'display': 'none'});
		});
		if (value=='weekdays') {
			show_field('weekdays');
			show_field('timeofday');
		}
		else if (value=='monthdays') {
			show_field('monthdays');
			show_field('timeofday');
		}
		else if (value=='interval') {
			show_field('interval');
		}
	}
	window.addEvent('domready', function() {
		var type_selector = $('type');
		change_fields(type_selector.get('value'));
		type_selector.addEvent('change', function() {
			change_fields(type_selector.get('value'));
		});
	});
</script>
</head>
<body>
	<div id="content" style="margin-left: 20px;">
	<h2 style="margin-top:1px;">Task</h2>
	 ${tmpl_context.widget(value=value, action='./')}
	 </div>
</body>
</html>