function isNumber(val)
	if isNumeric(val.value) then
		isNumber = true
	else
		msgbox "This value must be numeric."
		val.focus()
		isNumber = false
	end if
end function

function isVerify(val)
	if Len(val.value)>0 then
		IsVerify = true
	else
		msgbox "Passwords do not match - please reenter"
		val.focus()
		isVerify = false
	end if
end function

function isLength(val)
	if len(val.value)>0 then
		isLength = true
	else
		msgbox "This value can't be empty."
		val.select
		isLength = false
	end if
end function

function isdat(val)
	if len(val.value)> 2  then
		isdat = true
	else
		msgbox "Please enter at least 3 characters."
		val.select
		isdat = false
	end if
	end function


function isUsername(val)
	if len(val.value)> 3 then
		isUsername = true
	else
		msgbox "Please enter at least 4 characters."
		val.select
		isUsername = false
	end if
	end function

function isEmail(val)
	if isLength(val) then
	e = val.value
	if instr(e,"@")>0 and instr(e,".")>0 and len(e)>1 then
	isEmail = true
	else
	msgbox "Please enter a proper email address."
	val.select
	'val.focus()
	isEmail = false
	end if
	end if
end function

function isphone(val)
	isphone = false
	tVal = trim(val.value)
	if len(tVal)=10 then
		if isNumeric(tVal) then
			isphone = true
		end if
	end if
	if not isphone then
		msgbox "Please enter a valid 10 digit phone number."
		val.select
	end if		
end function

function isZip(val)
	isZip = false
	tVal = trim(val.value)
	if len(tVal)=5 then
		if isNumeric(tVal) then
			isZip = true
		end if
	elseif len(tVal)=10 then
		l5 = left(tVal,5)
		r4 = right(tVal,4)
		m1 = mid(tVal,6,1)
		if isNumeric(l5) and isNumeric(r4) and m1="-" then
			isZip = true
		end if
	end if
	if not isZip then
		msgbox "Please enter a valid Zip code."
		val.select
	end if		
end function

function isstate(val)
	e = val.value
	if e <> ""  then
	isstate = true
	else
	msgbox "Please select a state."
	'val.select
	'val.focus()
	isstate = false
	end if
end function
function issubject(val)
	e = val.value
	if e <> ""  then
	issubject = true
	else
	msgbox "Please enter your subject."
	val.select
	'val.focus()
	issubject = false
	end if
end function

function isto_dept(val)
	e = val.value
	if e <> ""  then
	isto_dept = true
	else
	msgbox "Please select a department from the list."
	'val.select
	val.focus()
	isto_dept = false
	end if
end function

function isage(val)
	e = val.value
	if e <> "Select One"  then
	isage = true
	else
	msgbox "Please select a Ref. Agent or Select First Available Agent"
	'val.select
	val.focus()
	'else	
	'val.select
	'val.focus()
	isage = false
	end if
end function


function istop(val)
	e = val.value
	if e <> "Select"  then
	istop = true
	else
	msgbox "Please select a Topic or Select New Topic to create a new topic"
	'val.select
	val.focus()
	'else	
	'val.select
	'val.focus()
	istop = false
	end if
end function




function isv1(val)
	isv1 = false
	tVal = trim(val.value)
	if len(tVal)=3 then
		if isNumeric(tVal) then
			isv1 = true
		end if
	'elseif len(tVal)=10 then
		'l5 = left(tVal,5)
		'r4 = right(tVal,4)
		'm1 = mid(tVal,6,1)
		'if isNumeric(l5) and isNumeric(r4) and m1="-" then
			'isZip = true
		'end if
	end if
	if not isv1 then
		msgbox "Please enter a valid 3 digit area code."
		'val.focus()
		val.select
	end if		
end function

function isv2(val)
	isv2 = false
	tVal = trim(val.value)
	if len(tVal)=3 then
		if isNumeric(tVal) then
			isv2 = true
		end if
	'elseif len(tVal)=10 then
		'l5 = left(tVal,5)
		'r4 = right(tVal,4)
		'm1 = mid(tVal,6,1)
		'if isNumeric(l5) and isNumeric(r4) and m1="-" then
			'isZip = true
		'end if
	end if
	if not isv2 then
		msgbox "Please enter a 3 digit number."
		'val.focus()
		val.select
	end if		
end function

function isv3(val)
	isv3 = false
	tVal = trim(val.value)
	if len(tVal)=4 then
		if isNumeric(tVal) then
			isv3 = true
		end if
	'elseif len(tVal)=10 then
		'l5 = left(tVal,5)
		'r4 = right(tVal,4)
		'm1 = mid(tVal,6,1)
		'if isNumeric(l5) and isNumeric(r4) and m1="-" then
			'isZip = true
		'end if
	end if
	if not isv3 then
		msgbox "Please enter a 4 digit number."
		'val.focus()
		val.select
	end if		
end function

function isvcode(val)
	isvcode = false
	tVal = trim(val.value)
	if len(tVal)=3 then
		if isNumeric(tVal) then
			isvcode = true
		end if
	end if
	if not isvcode then
		msgbox "Please enter a 3 digit number."
		val.select
	end if		
end function

function isccno(val)
	isccno = false
	tVal = trim(val.value)
	if len(tVal)>6 then
		if isNumeric(tVal) then
			isccno = true
		end if
	end if
	if not isccno then
		msgbox "Please enter a valid cc number."
		val.select
	end if		
end function



function iscom(val)
	if len(val.value)>2 then
		iscom = true
	else		
		msgbox "Please enter at least 3 characters."
		val.focus()
		iscom = false
	end if
end function




