$(function() {
	
	//$("#updateVisibility").remove();
	//$("#updateGameLength").remove();

	//$("#passwordDiv").hide();

/*
	$("input[name='visibility']").change(
		function()
		{
			if ($("input[name='visibility']:checked").val() == 'Public')
			{
				$("#passwordDiv").hide();
			}
			else if ($("input[name='visibility']:checked").val() == 'Private')
			{
				$("#passwordDiv").show();
			}
			else if ($("input[name='visibility']:checked").val() == 'Hidden')
			{
				$("#passwordDiv").show();
			}
			else
			{
				$("#passwordDiv").hide();
			}
		}
	);
*/
/*
	$("input[name='gameLength']").change(
		function()
		{
			if ($("input[name='gameLength']:checked").val() == 'Continuous')
			{
				$("#continuousLength").show();
				$("#fixedLength").hide();
			}
			else if ($("input[name='gameLength']:checked").val() == 'Fixed')
			{
				$("#continuousLength").hide();
				$("#fixedLength").show();
			}
		}
	);
*/	
	var dates = $('#startDateBox, #endDateBox').datepicker({
		minDate: 0, dateFormat: 'dd M yy', firstDay: 1,
		onSelect: function(selectedDate) {
			var option = this.id == "startDateBox" ? "minDate" : "maxDate";
			var instance = $(this).data("datepicker");
			var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
			dates.not(this).datepicker("option", option, date);
		}
	});

});
