function validateForm()
{
	trimFields();
	if(obj.owner_name.value == '')
	{
		alert("Please enter Owner Name.");
		obj.owner_name.focus();
		return;
	}
	if(obj.address.value == '')
	{
		alert("Please enter Address.");
		obj.address.focus();
		return;
	}
	if(obj.city_state.value == '')
	{
		alert("Please enter City/State.");
		obj.city_state.focus();
		return;
	}
	if(obj.home_telephone.value == '')
	{
		alert("Please enter Home Telephone.");
		obj.home_telephone.focus();
		return;
	}
	if(obj.employer_name_and_address.value == '')
	{
		alert("Please enter Employer's Name & Address.");
		obj.employer_name_and_address.focus();
		return;
	}
	if(obj.driving_license_state.value == '')
	{
		alert("Please enter State.");
		obj.driving_license_state.focus();
		return;
	}
	if(obj.driving_license_number.value == '')
	{
		alert("Please enter Number.");
		obj.driving_license_number.focus();
		return;
	}
	if(obj.date_of_signature.value == '')
	{
		alert("Please enter Date of Signature.");
		obj.date_of_signature.focus();
		return;
	}
	if(obj.signature.value == '')
	{
		alert("Please enter Signature.");
		obj.signature.focus();
		return;
	}
	if(obj.pet_name1.value == '')
	{
		alert("Please enter Pet's Name.");
		obj.pet_name1.focus();
		return;
	}
	if((document.getElementById('other1').checked == true) && obj.other_pet1.value == '')
	{
		alert("Please specify a Category.");
		obj.other_pet1.focus();
		return;
	}
	if(obj.age1.value == '')
	{
		alert("Please enter Age.");
		obj.age1.focus();
		return;
	}
	if(obj.sex1.value == '')
	{
		alert("Please enter Sex.");
		obj.sex1.focus();
		return;
	}
	if((document.getElementById('other2').checked == true) && obj.other_pet2.value == '')
	{
		alert("Please specify a Category.");
		obj.other_pet2.focus();
		return;
	}
	if(obj.captcha.value == '')
	{
		alert('Please enter the security code.');
		obj.captcha.focus();
		return;
	}
	//All fine
	obj.action = 'online_form.php';
	obj.submit();
}

// Function to cancel the online form.
function cancelForm()
{
	var confMsg = 'Are you sure you want to Cancel?';
	if(confirm(confMsg))
	{
		self.location = 'index.php';
	}
}

function doDownload(fname)
{
	parent.frames['downloader'].location.href = 'download.php?file=' + fname;
}
