//====================================================================================================
//	Function Name	:	Validate_Form
//----------------------------------------------------------------------------------------------------
function Validate_Form(frm)
{
	with(frm)
    {
		if(!IsEmpty(appointment_name, 'Please enter Name.'))
		{
			return false;
		}
		
		if(!IsEmpty(appointment_address, 'Please enter Address.'))
		{
			return false;
		}
		
		if(!IsEmpty(appointment_phone, 'Please enter Phone.'))
		{
			return false;
		}
		else if(!IsPhone(appointment_phone, 'Oppsss!!! Invalid Phone specified.'))
		{
			return false;
		}
		
		if(!IsEmpty(appointment_email, 'Please enter your Email Address.'))
		{
			return false;
		}
		else if(!IsEmail(appointment_email, 'Oppsss!!! Invalid Email Address specified.'))
		{
			return false;
		}
		
		if(!IsEmpty(appointment_pom, 'Please enter Purpose of Meeting.'))
		{
			return false;
		}
		
		if(appointment_ref1_phone.value != '')
		{
			if(!IsPhone(appointment_ref1_phone, 'Oppsss!!! Invalid Phone specified.'))
			{
				return false;
			}
		}
		
		if(appointment_ref1_email.value != '')
		{
			if(!IsEmail(appointment_ref1_email, 'Oppsss!!! Invalid Email Address specified.'))
			{
				return false;
			}
		}
		
		if(appointment_ref2_phone.value != '')
		{
			if(!IsPhone(appointment_ref2_phone, 'Oppsss!!! Invalid Phone specified.'))
			{
				return false;
			}
		}
		
		if(appointment_ref2_email.value != '')
		{
			if(!IsEmail(appointment_ref2_email, 'Oppsss!!! Invalid Email Address specified.'))
			{
				return false;
			}
		}
	}
	
	return true;
}
