function checkvalid()
{
	var Email = Trim(document.frmadd.vEmail.value);
	if(Email.length < 1)
	{
		alert(MSG_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.vName.value);
	if(Fname.length < 1)
	{
		alert(MSG_NAME);
		document.frmadd.vName.focus();
		return false;
	}
	var comd = Trim(document.frmadd.vAddress.value);
	if(comd.length < 1)
	{
		alert(MSG_ADDRESS);
		document.frmadd.vAddress.focus();
		return false;
	}
	var comy = Trim(document.frmadd.vZip.value);
	if(comy.length < 1)
	{
		alert(MSG_ZIPCODE);
		document.frmadd.vZip.focus();
		return false;
	}
	var area = Trim(document.frmadd.vArea.value);
	if(area.length < 1)
	{
		document.frmadd.vArea.value = "";
		alert(MSG_AREA);
		document.frmadd.vArea.focus();
		return false;
	}
	var phone =	Trim(document.frmadd.vPhone.value);
	if(phone.length < 1)
	{
		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;
	}
	if(document.frmadd.mode.value == "Add")
	{
		if(document.frmadd.capt.value.length < 1)
		{
			alert(MSG_CODE);
			document.frmadd.capt.focus();
			return false;
		}					
	}
	
}
