
	fields = new Array ();
	fields['name']    = new Array ('Name', document.getElementById ('name'));
	fields['email']   = new Array ('E-Mail Address', document.getElementById ('email'));
	fields['subject'] = new Array ('Subject', document.getElementById ('subject'));
	fields['body']    = new Array ('Message Body', document.getElementById ('body'));

	// The "more contact info" button...
	document.getElementById ('show_aci').onclick = function ()
	{
		// Hide the button
		this.style.display = 'none';

		// Show the info
		document.getElementById ('additional_contact_info').style.display = 'block';
	}

	document.getElementById ('hide_aci').onclick = function ()
	{
		// Show the button
		document.getElementById ('show_aci').style.display = 'block';

		// Hide the info
		document.getElementById ('additional_contact_info').style.display = 'none';
	}


	// Setup the onfocus/onblur to wipe default values (or put them back if they're empty)
	for (var i in fields)
	{
		fields[i][1].onfocus = function ()
		{
			if (this.value.replace (/^\s*|\s*$/g, '') == fields[this.id][0])
			{
				this.value = '';

				// Heighten the body field when focused
				if (this.id == 'body')
				{
					this.rows = 6;
				}
			}
		}
		fields[i][1].onblur = function ()
		{
			if (this.value.replace (/^\s*|\s*$/g, '') == '')
			{
				this.value = fields[this.id][0];

				// Shorten the body field when blurred
				if (this.id == 'body')
				{
					this.rows = 2;
				}
			}
		}
	}

	form_obj = document.getElementById ('contact_form');
	form_obj.onsubmit = function ()
	{
		var errors = new Array ();
		var str = 'The following errors were returned:\n\n';
		var i;

		for (i in fields)
		{
			var current_field_value = fields[i][1].value.replace (/^\s*|\s*$/g, '');
			if (current_field_value == '' || current_field_value == fields[i][0])
			{
				errors.push ('The "' + fields[i][0] + '" field is empty.');
			}
		}

		if (errors.length > 0)
		{
			for (i = 0; i < errors.length; i++)
			{
				str = str + ' > ' + errors[i] + '\n';
			}

			alert (str);

			return false;
		}

		return true;
	}