function checkvalid()
{
	var Email = Trim(document.frmadd.vEmail.value);
	if(Email.length < 1)
	{
		alert(MSG_ENETR_EMAIL);
		document.frmadd.vEmail.focus();
		return false;
	}
	if(!isValidEmail(document.frmadd.vEmail.value))
	{
		document.frmadd.vEmail.focus();
		return false;
	}
	if(document.frmadd.mode.value == "Add")
	{
		var psw = Trim(document.frmadd.vPassword.value);
		if(psw.length < 5)
		{
			alert(MSG_PASSWORDLENGTH);
			document.frmadd.vPassword.focus();
			return false;
		}
		var psw1 = Trim(document.frmadd.vRePassword.value);
		if(psw1.length < 5)
		{
			alert(MSG_CONFORMPASSWORD);
			document.frmadd.vRePassword.focus();
			return false;
		}
		if(psw!=psw1)
		{
			alert(MSG_COMPAREPASSWORD);
			document.frmadd.vRePassword.focus();
			return false;
		}
	}
	var Fname = Trim(document.frmadd.vFirstName.value);
	if(Fname.length < 1)
	{
		alert(MSG_FNAME);
		document.frmadd.vFirstName.focus();
		return false;
	}
	var Lname = Trim(document.frmadd.vLastName.value);
	if(Lname.length < 1)
	{
		alert(MSG_LNAME);
		document.frmadd.vLastName.focus();
		return false;
	}
	var exe = Trim(document.frmadd.vExequatur.value)
	if(exe.length < 1)
	{
			alert(MSG_EXEQUATUR);
			document.frmadd.vExequatur.focus();
			return false;
	}
	var ced = Trim(document.frmadd.vCedula.value)
	if(ced.length < 1)
	{
			alert(MSG_CEDULA);
			document.frmadd.vCedula.focus();
			return false;
	}
	var city = Trim(document.frmadd.vCity.value);
	if(city.length < 1)
	{
		alert(MSG_PROVINCE);
		document.frmadd.vCity.focus();
		return false;
	}
	if(Trim(document.frmadd.vPhone.value) == "")
	{
		alert(MSG_PHONE);
		document.frmadd.vPhone.focus();
		return false;
	}					
	else if(!phoneformate(document.frmadd.vPhone.value,document.frmadd.vPhone.value.length))
	{
		alert(MSG_VALIDPHONE);
		document.frmadd.vPhone.focus();
		return false;
	}
	var tit = Trim(document.frmadd.iSpecializationId.value)
	if(tit.length < 1)
	{
			alert(MSG_SPECIALIZATION);
			document.frmadd.iSpecializationId.focus();
			return false;
	}
	var tit1 = Trim(document.frmadd.iWorkPlaceId.value)
	if(tit1.length < 1)
	{
			alert(MSG_WORKPLACE);
			document.frmadd.iWorkPlaceId.focus();
			return false;
	}
	var work = Trim(document.frmadd.vWorkPlaceName.value)
	if(work.length < 1)
	{
			alert(MSG_WORKPLACENAME);
			document.frmadd.vWorkPlaceName.focus();
			return false;
	}
	var addr = Trim(document.frmadd.vAddress.value)
	if(addr.length < 1)
	{
			alert(MSG_ADDRESS);
			document.frmadd.vAddress.focus();
			return false;
	}	
	if(document.frmadd.mode.value == "Add")
	{
		if(document.frmadd.capt.value.length < 1)
		{
			alert(MSG_CODE);
			document.frmadd.capt.focus();
			return false;
		}					
		if(!document.frmadd.terms_cond.checked)
		{
			alert(MSG_AGREE);
			document.frmadd.terms_cond.focus();
			return false;
		}
	}
}

