function validateForm(theForm, buttonName, messageEmail, messagePassword, messageWrongEmail)
{
	if(buttonName == 'btnProfileUpdate')
	{
		if(isEmpty(theForm.SignEmail.value))
		{
			alert(messageEmail);
			theForm.SignEmail.focus();
			return false;
		}
		if(!isEmail(theForm.SignEmail.value))
		{
			alert(messageWrongEmail);
			theForm.SignEmail.focus();
			return false;
		}
		if(isEmpty(theForm.SignPwd.value))
		{
			alert(messagePassword);
			theForm.SignPwd.focus();
			return false;
		}
		return true;
	}

	if(buttonName == 'btnForgetSubmit')
	{
		if(isEmpty(theForm.ForgetEmail.value))
		{
			alert(messageEmail);
			theForm.ForgetEmail.focus();
			return false;
		}
		if(!isEmail(theForm.ForgetEmail.value))
		{
			alert(messageWrongEmail);
			theForm.ForgetEmail.focus();
			return false;
		}
		return true;
	}
	
	if(buttonName == 'btnDeleteSubmit')
	{
		if(isEmpty(theForm.DeleteEmail.value))
		{
			alert(messageEmail);
			theForm.DeleteEmail.focus();
			return false;
		}
		if(!isEmail(theForm.DeleteEmail.value))
		{
			alert(messageWrongEmail);
			theForm.DeleteEmail.focus();
			return false;
		}
		if(isEmpty(theForm.DeletePwd.value))
		{
			alert(messagePassword);
			theForm.DeletePwd.focus();
			return false;
		}
		return true;
	}
	
	if(buttonName == 'btnChangePasswordSubmit')
	{
		if(isEmpty(theForm.ChangeEmail.value))
		{
			alert(messageEmail);
			theForm.ChangeEmail.focus();
			return false;
		}
		if(!isEmail(theForm.ChangeEmail.value))
		{
			alert(messageWrongEmail);
			theForm.ChangeEmail.focus();
			return false;
		}
		return true;
	}
	
}


