function  verify(theForm)
{

	//Verify First Name has a value
	var x = 0;
	if  (document.theForm.FirstName.value.length==0)
	{
		x += 1;
  		alert("First Name is required.");
		theForm.FirstName.focus();
		return (false);
	}

	//Verify Last Name has a value
	if  (document.theForm.LastName.value.length==0)
	{
		x+=1;
   		alert("Last Name is required.");
		theForm.LastName.focus();
		return (false);
	}


	//Verify Phone has a value
	if  (document.theForm.Phone1.value.length==0&&document.theForm.Phone2.value.length==0&&document.theForm.Phone3.value.length==0)
	{
		x+=1;
		alert("Phone is required.");
		theForm.Phone1.focus();
		return (false);
	}
	else
	{
	//Verify Phone Format
		if  (document.theForm.Phone1.value.length!=3||document.theForm.Phone2.value.length!=3||document.theForm.Phone3.value.length!=4)
		{
			x+=1;
			alert("Phone Number is invalid.");
			theForm.Phone1.focus();
			return (false);
		}
	}

	//Verify Email has a value
	 if  (document.theForm.Email.value.length==0)
	{
		x+=1;
   		alert("Email is required.");
		theForm.Email.focus();
		return (false);
	}
	 else
	{
	//Verify valid email address
		if (!isEmailAddr(document.theForm.Email.value))
		{
			x+=1;
			alert("Please enter a valid email address.");
			document.theForm.Email.focus();
			return (false);
		}
	} 

	return(true);
}

function isInteger (s)

{   var i;

// Search through string's characters one by one
// until we find a non-numeric character.
// When we do, return false false; if we don't, return true.

for (i = 0; i < s.length; i++)
{   
// Check that current character is number.
var c = s.charAt(i);

if (!isDigit(c)) return (false);
}

// All characters are numbers.
return true;
}
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isEmailAddr(email)
{
  	var result = false;
	var theStr = new String(email);
  	var index = theStr.indexOf("@");
	if (index > 0) {
  		var pindex = theStr.indexOf(".",index);
  		if ((pindex > index+1) && (theStr.length > pindex+1)) {
			result = true;
  		}
	}
	return result;
}




function  verify2(theForm)
{

	//Verify Name has a value
	var x = 0;
	if  (document.theForm.FirstName.value.length==0)
	{
		x += 1;
  		alert("Name is required.");
		return (false);
	}


	//Verify Phone has a value
	if  (document.theForm.Phone1.value.length==0&&document.theForm.Phone2.value.length==0&&document.theForm.Phone3.value.length==0)
	{
		x+=1;
		alert("Phone is required.");
		return (false);
	}
	else
	{
	//Verify Phone Format
		if  (document.theForm.Phone1.value.length!=3||document.theForm.Phone2.value.length!=3||document.theForm.Phone3.value.length!=4)
		{
			x+=1;
			alert("Phone Number is invalid.");
			return (false);
		}
	}


	return(true);
}

