function setDays()
	{
	var mEl = document.getElementById('month');
	var i = mEl.selectedIndex-1;
	//if (i < 0)
	//	return;
	var daysEl = document.forms[0].elements['day'];
	daysEl.options.length = 0;
	daysEl.options[0] = new Option('Choose day', '');
	if (i >= 0)
		{
		a = dates[i];
		for (j = 0; j < a.length; j++)
			daysEl.options[j+1] = new Option(a[j], a[j]);
		}

	var timeEl = document.forms[0].elements['time'];
	timeEl.options.length = 0;
	if (i >= 0)
		{
		a = times[i];
		if (a.length == 1)
			timeEl.options[0] = new Option(a[0], a[0]);
		else
			{
			timeEl.options[0] = new Option('Choose start time', '');
			for (j = 0; j < a.length; j++)
				timeEl.options[j+1] = new Option(a[j], a[j]);
			}
		}
	else
		timeEl.options[0] = new Option('Choose start time', '');
	}
function setAdults()
	{
	var cEl = document.getElementById('adults');
	var count = cEl.value;
	count = parseInt(count);
	if (isNaN(count))
		count = '';
	cEl.value = count;
	if (count == '')
		count = 0;

	var el = document.getElementById('adultinfo');
	var p = document.getElementById('adultp');
	el.removeChild(p);
	p = document.createElement('p');
	p.id = 'adultp';
	if (count == 0)
		{
		el.appendChild(p);
		return;
		}
	var label = document.createElement('label');
	label.setAttribute('for', 'adultname0');
	label.appendChild(document.createTextNode('Please list adults'));
	p.appendChild(label);
	var br = document.createElement('br');
	p.appendChild(br);
	var table = document.createElement('table');
	table.setAttribute('border', '0');
	table.setAttribute('cellPadding', '0');
	table.setAttribute('cellSpacing', '0');
	p.appendChild(table);
	var tbody = document.createElement('tbody');
	table.appendChild(tbody);
	var tr = document.createElement('tr');
	tbody.appendChild(tr);
	var th = document.createElement('th');
	th.appendChild(document.createTextNode('Name*'));
	tr.appendChild(th);
	var th = document.createElement('th');
	th.appendChild(document.createTextNode('Email'));
	tr.appendChild(th);
	var td;
	var input;
	for (var i = 0; i < count; i++)
		{
		tr = document.createElement('tr');
		tbody.appendChild(tr);
		td = document.createElement('td');
		tr.appendChild(td);
		input = document.createElement('input');
		input.setAttribute('name', 'adultname'+i);
		input.setAttribute('id', 'adultname'+i);
		input.setAttribute('size', '25');
		if (adultName.length > i)
			input.setAttribute('value', adultName[i]);
		td.appendChild(input);
		td = document.createElement('td');
		tr.appendChild(td);
		input = document.createElement('input');
		input.setAttribute('name', 'adultemail'+i);
		input.setAttribute('id', 'adultemail'+i);
		input.setAttribute('size', '25');
		if (adultEmail.length > i)
			input.setAttribute('value', adultEmail[i]);
		td.appendChild(input);
		}
	el.appendChild(p);
	}
function setChildren()
	{
	var cEl = document.getElementById('children')
	var count = cEl.value;
	count = parseInt(count);
	if (isNaN(count))
		count = '';
	cEl.value = count;
	if (count == '')
		count = 0;

	var el = document.getElementById('childinfo');
	var p = document.getElementById('childp');
	el.removeChild(p);
	p = document.createElement('p');
	p.id = 'childp';
	if (count == 0)
		{
		el.appendChild(p);
		return;
		}
	var label = document.createElement('label');
	label.setAttribute('for', 'childname0');
	label.appendChild(document.createTextNode('Please list children under 16'));
	p.appendChild(label);
	var br = document.createElement('br');
	p.appendChild(br);
	var table = document.createElement('table');
	table.setAttribute('border', '0');
	table.setAttribute('cellPadding', '0');
	table.setAttribute('cellSpacing', '0');
	p.appendChild(table);
	var tbody = document.createElement('tbody');
	table.appendChild(tbody);
	var tr = document.createElement('tr');
	tbody.appendChild(tr);
	var th = document.createElement('th');
	th.appendChild(document.createTextNode('Name*'));
	tr.appendChild(th);
	var th = document.createElement('th');
	th.appendChild(document.createTextNode('Age*'));
	tr.appendChild(th);
	var th = document.createElement('th');
	th.appendChild(document.createTextNode("Parent's name*"));
	tr.appendChild(th);
	var th = document.createElement('th');
	th.appendChild(document.createTextNode('Email'));
	tr.appendChild(th);
	var td;
	var input;
	for (var i = 0; i < count; i++)
		{
		tr = document.createElement('tr');
		tbody.appendChild(tr);
		td = document.createElement('td');
		tr.appendChild(td);
		input = document.createElement('input');
		input.setAttribute('name', 'childname'+i);
		input.setAttribute('id', 'childname'+i);
		input.setAttribute('size', '25');
		if (childName.length > i)
			input.setAttribute('value', childName[i]);
		td.appendChild(input);
		td = document.createElement('td');
		tr.appendChild(td);
		input = document.createElement('input');
		input.setAttribute('name', 'childage'+i);
		input.setAttribute('id', 'childage'+i);
		input.setAttribute('size', '3');
		if (childAge.length > i)
			input.setAttribute('value', childAge[i]);
		td.appendChild(input);
		td = document.createElement('td');
		tr.appendChild(td);
		input = document.createElement('input');
		input.setAttribute('name', 'parentname'+i);
		input.setAttribute('id', 'parentname'+i);
		input.setAttribute('size', '25');
		if (parentName.length > i)
			input.setAttribute('value', parentName[i]);
		td.appendChild(input);
		td = document.createElement('td');
		tr.appendChild(td);
		input = document.createElement('input');
		input.setAttribute('name', 'childemail'+i);
		input.setAttribute('id', 'childemail'+i);
		input.setAttribute('size', '25');
		if (childEmail.length > i)
			input.setAttribute('value', childEmail[i]);
		td.appendChild(input);
		}
	el.appendChild(p);
	}
function getAdultValues()
	{
	adultName = getValuesOf('adultname');
	adultEmail = getValuesOf('adultemail');
	}
function getChildValues()
	{
	childName = getValuesOf('childname');
	childAge = getValuesOf('childage');
	parentName = getValuesOf('parentname');
	childEmail = getValuesOf('childemail');
	}
function getValuesOf(varname)
	{
	var a = new Array();
	var el;
	for (var i = 0; (el=document.getElementById(varname+i)) != null; i++)
		a[i] = el.value;
	return a;
	}

