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 comd = Trim(document.frmadd.comd.value);
	if(comd.length < 1)
	{
		alert(MSG_SEL_DAY);
		document.frmadd.comd.focus();
		return false;
	}
	var comm = Trim(document.frmadd.comm.value);
	if(comm.length < 1)
	{
		alert(MSG_SEL_MONTH);
		document.frmadd.comm.focus();
		return false;
	}
	var comy = Trim(document.frmadd.comy.value);
	if(comy.length < 1)
	{
		alert(LBL_SEL_YEAR);
		document.frmadd.comy.focus();
		return false;
	}
	var addr = Trim(document.frmadd.vAddress.value)
	if(addr.length < 1)
	{
			alert(MSG_ADDRESS);
			document.frmadd.vAddress.focus();
			return false;
	}	
	
	var city = Trim(document.frmadd.vCity.value);
	if(city.length < 1)
	{
		alert(MSG_PROVINCE);
		document.frmadd.vCity.focus();
		return false;
	}
	if(document.frmadd.vPhone.value.length < 1)
	{
		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;
	}
	if(document.frmadd.mode.value == "Add")
	{
		if(document.frmadd.capt.value.length < 1)
		{
			alert(MSG_CODE);
			document.frmadd.capt.focus();
			return false;
		}					
	}
}

