var savePartialForm = function()
{
  var dom_form = document.getElementById('eform');
  var fields = dom_form.getElementsByTagName('input');
	var stage = 0;

  var data = '';

	// First of all, get all the input fields (text fields, checkboxes and radio buttons).
  for(var x = 0; x < fields.length; x++)
  {
		if(fields[x].type == 'text')
		{
    	data += fields[x].name + '=' + fields[x].value + '&';
		}
		else if(fields[x].type == 'checkbox')
		{
			if(fields[x].checked)
			{
				data += fields[x].name + '=' + fields[x].value + '&';
			}
			else
			{
				data += fields[x].name + '=0&';
			}
		}
		else if(fields[x].type == 'radio' && fields[x].checked)
		{
			data += fields[x].name + '=' + fields[x].value + '&';
		}
  }

	var fields = dom_form.getElementsByTagName('select');

	for(var x = 0; x < fields.length; x++)
	{
		data += fields[x].name + '=' + fields[x].options[fields[x].selectedIndex].value + '&';
	}

	// Get any textarea fields
	fields = dom_form.getElementsByTagName('textarea');
	for(var x = 0; x < fields.length; x++)
	{
		data += fields[x].name + '=' + fields[x].value + '&';
	}

	// Get rid of the trailing & from the data
	data = data.substring(0, data.length - 1);

	// Send the partial data off to the server. We will not get anything back, so there is no point in setting up a return callback that does something.
	// Need to get the stage the form is currently at, or the server will not be able to process the data correctly.
	// It should be set to 1 higher than the actual stage.
	var params = location.search.split('&');
	for(var x = 0; x < params.length; x++)
	{
		var pair = params[x].split('=');
		
		// If the stage parameter is the first one, then it will still have the ? attached to the front.
		if(pair[0] == 'stage' || pair[0] == '?stage')
		{
			stage = pair[1];
		}
	}

	var ticket = requestProcess.add(new Request('POST', '/index.php?id=216&stage=' + (parseInt(stage) + 1), data, function(){}, function(){}));

}


