function cleanForm(event)
{
	Event.stop(event);
	
	$('nombre').value = '';
	$('apellidos').value = '';
	$('empresa').value = '';
	$('telefono').value = '';
	$('email').value = '';
	$('asunto').value = '';
}

function validateForm(event)
{	
	var nombre = $('nombre').value;
	var apellidos = $('apellidos').value;
	var empresa = $('empresa').value;
	var telefono = $('telefono').value;
	var email = $('email').value;
	var asunto = $('asunto').value;
	
	var error = false;
	var errorText = '';
	
	if ('' == nombre)
	{	
		error = true;
		errorText = errorText + '\nEl campo nombre es obligatorio.';
	}
	
	if ('' == apellidos)
	{	
		error = true;
		errorText = errorText + '\nEl campo apellidos es obligatorio.';
	}	
	
	/*
	if ('' == empresa)
	{	
		error = true;
		errorText = errorText + '\nEl campo empresa es obligatorio.';
	}		
	
	if ('' == telefono)
	{	
		error = true;
		errorText = errorText + '\nEl campo teléfono es obligatorio.';
	}
	*/
	if ('' == email)
	{	
		error = true;
		errorText = errorText + '\nEl campo email es obligatorio.';
	}

	if ('' == asunto)
	{	
		error = true;
		errorText = errorText + '\nEl campo asunto es obligatorio.';
	}		

	if (error)
	{
		alert('Debe rellenar todos los campos del formulario.' + errorText);
		Event.stop(event);
		return false;
	}
	else	
	{
		return true;
	}
}

Event.observe(window, 'load', function() {
	Event.observe('borrarButton', 'click', cleanForm);	
	Event.observe('contactoForm', 'submit', validateForm);
});