function validateContact(f)
{
	if (f.ContactPersonFirstName.value == '')
	{
		window.alert('Please type in your first name into the box provided to continue');
		f.ContactPersonFirstName.focus();
		return false;
	}
	
	if (f.ContactPersonLastName.value == '')
	{
		window.alert('Please type in your last name into the box provided to continue');
		f.ContactPersonLastName.focus();
		return false;
	}
	
	if (f.ContactPhone.value == '')
	{
		window.alert('Please type in your contact phone number into the box provided to continue');
		f.ContactPhone.focus();
		return false;
	}
	
	if (f.EmailAddress.value == '')
	{
		window.alert('Please type in your email address into the box provided to continue');
		f.EmailAddress.focus();
		return false;
	}
	else
	{
		if (!isValidEmailAddress(f.EmailAddress.value))
		{
			window.alert('Please ensure your email address is correct to continue');
			f.EmailAddress.focus();
			return false;
		}
	}
	
	for (i = 1; i != 8; i++)
	{
		var elem = eval('Apartment_' + i);
		if (elem.style.display == 'inline')
		{
			c1 = eval('f.Bedrooms_Apartment_' + i);
			
			if (c1.selectedIndex == 0)
			{
				window.alert('Please choose the amount of bedrooms you wish to book to continue');
				c1.focus();
				return false;
			}
			
			c2 = eval('f.Bedrooms_Apartment_' + i);
			
			if (c2.selectedIndex == 0)
			{
				window.alert('Please choose the amount of bathrooms you wish to book to continue');
				c2.focus();
				return false;
			}
		}		
	}
	
	return true;
}

function isValidEmailAddress(inEmailAddress)
{
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    
    return re.test(inEmailAddress);
}