	function checkPhone(phone)
	{
		var stripped = phone.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
		if (isNaN(parseInt(stripped))) {
		   alert('The phone number contains illegal characters.');
		}
		if (!(stripped.length == 10)) {
			alert('The phone number is the wrong length.  Make sure you included an area code.');
		}		
	}


	/* age validation */
	function checkAge(age)
	{
		if (!isNaN(age.value))
		{
			if (age.value>17 && age.value <100)
				return  true;
			else
			{
				alert('Age must be greater than 17 and less than 100.');
				age.focus();
				age.value='';
				return false;
			}
		}
		else
		{
				alert('Age must be numeric.');
				age.value='';
				age.focus();
				return false;
		}
	}
	
	

	/*
	'-----------------------------------------------------------------------
	'	Function:		checkEmail(email) 
	'	Author:			Dan Delino (dan@netgeekster.com)
	'	Date:			January 5, 2005
	'	Description:	This function validates an email value.
	'	Input:			email	-	email value to be validated
	'	Output:			None
	'	Return:			True or False
	'	Dependences:	None
	'	Notes:
	'	Rev History:
	'-----------------------------------------------------------------------	
	*/
	function checkEmail(email) 
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{
			return (true);
		}
		alert("Invalid E-mail Address! Please re-enter.");
		return (false);
	}

	/*
	'-----------------------------------------------------------------------
	'	Function:		validateArticleCommentForm(form)
	'	Author:			Dan Delino (dan@netgeekster.com)
	'	Date:			January 5, 2005
	'	Description:	This function validates the Registration form.
	'	Input:			form			-	form object
	'	Output:			none
	'	Return:			True or False
	'	Dependences:	checkEmail()	-	validates an email value
	'	Notes:
	'	Rev History:
	'-----------------------------------------------------------------------	
	*/
	function validateArticleCommentForm(form)
	{

		// 1. validate the name
		if(form.PostedBy.value=="")
		{
			alert("Name is required.");
			form.PostedBy.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);

		// 2. check for valid email
		if(form.Email.value=="")
		{
			alert("Please enter an E-mail Address.");
			form.Email.focus();
			//li_EmailAddress.style.color = 'red';
			//li_EmailAddress.style.fontWeight = 'bold';
			//li_EmailStar.style.visibility = 'visible';
			return (false);	
		}
		else
		{
			if (checkEmail(form.Email.value)==false)
			{
				form.Email.value="";
				form.Email.focus();
				return (false);
			}
			
		}
		// 3. valid the passwords
		
		if(form.Comment.value=="")
		{
			alert("A comment is required.");
			form.Comment.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
	//	else
	//		return (true);
			return jcap();
	}

	/*
	'-----------------------------------------------------------------------
	'	Function:		validateEmailForm(form)
	'	Author:			Dan Delino (dan@netgeekster.com)
	'	Date:			January 5, 2005
	'	Description:	This function validates the Registration form.
	'	Input:			form			-	form object
	'	Output:			none
	'	Return:			True or False
	'	Dependences:	checkEmail()	-	validates an email value
	'	Notes:
	'	Rev History:
	'-----------------------------------------------------------------------	
	*/
	function validateEmailForm(form)
	{

		// 1. validate the name
		if(form.PostedBy.value=="")
		{
			alert("Name is required.");
			form.PostedBy.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);

		// 2. check for valid email
		if(form.Email.value=="")
		{
			alert("Please enter an E-mail Address.");
			form.Email.focus();
			//li_EmailAddress.style.color = 'red';
			//li_EmailAddress.style.fontWeight = 'bold';
			//li_EmailStar.style.visibility = 'visible';
			return (false);	
		}
		else
		{
			if (checkEmail(form.Email.value)==false)
			{
				form.Email.value="";
				form.Email.focus();
				return (false);
			}
			
		}
		
		// 3. validate the subject
		if(form.Subject.value=="")
		{
			alert("Subject is required.");
			form.Subject.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);
		
		// 4. valid the passwords
		if(form.Comment.value=="")
		{
			alert("A comment is required.");
			form.Comment.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
//		else
//			return (true);
			return jcap();

	}

	/*
	'-----------------------------------------------------------------------
	'	Function:		validatePostingForm(form)
	'	Author:			Dan Delino (dan@netgeekster.com)
	'	Date:			January 5, 2005
	'	Description:	This function validates the Registration form.
	'	Input:			form			-	form object
	'	Output:			none
	'	Return:			True or False
	'	Dependences:	checkEmail()	-	validates an email value
	'	Notes:
	'	Rev History:
	'-----------------------------------------------------------------------	
	*/
	function validatePostingForm(form)
	{

		// 1. validate the name
		if(form.PostedBy.value=="")
		{
			alert("Your name is required.");
			form.PostedBy.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);

		// 2. check for valid email
		if(form.Email.value=="")
		{
			alert("Your e-mail address is required.");
			form.Email.focus();
			//li_EmailAddress.style.color = 'red';
			//li_EmailAddress.style.fontWeight = 'bold';
			//li_EmailStar.style.visibility = 'visible';
			return (false);	
		}
		else
		{
			if (checkEmail(form.Email.value)==false)
			{
				form.Email.value="";
				form.Email.focus();
				return (false);
			}
			
		}
		
		// 3. validate the subject
		if(form.Title.value=="")
		{
			alert("A title is required.");
			form.Title.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);
		
		// 4. valid the body
		if(form.Comment.value=="")
		{
			alert("Your posting is required.");
			form.Comment.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);
		// 4. valid the expiration date
		if(form.ExpirationDate.value=="")
		{
			alert("An expiration date is required.");
			form.ExpirationDate.focus();
			//li_Password.style.color = 'red';
			//li_Password.style.fontWeight = 'bold';
			//li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		//else
		//	return (true);
		
			return jcap();
		
		//ExpirationDate
		//alert('Hi ~name~, thank you for submitting your FREE posting.  You are allow 1 active posting per week.  Would to be able to sumbmit more, please visit our services page for more information.  Sincerely, www.SalsaSanDiego.net')	
		
	}
	/*
	'-----------------------------------------------------------------------
	'	Function:		validateLoginForm(form)
	'	Author:			Dan Delino (dan@netgeekster.com)
	'	Date:			January 5, 2005
	'	Description:	This function validates the Registration form.
	'	Input:			form			-	form object
	'	Output:			none
	'	Return:			True or False
	'	Dependences:	checkEmail()	-	validates an email value
	'	Notes:
	'	Rev History:
	'-----------------------------------------------------------------------	
	*/
	function validateLoginForm(form)
	{
		// 1. check for valid email
		if(form.EmailAddress.value=="")
		{
			alert("Please enter an E-mail Address.");
			form.EmailAddress.focus();
			li_EmailAddress.style.color = 'red';
			li_EmailAddress.style.fontWeight = 'bold';
			li_EmailStar.style.visibility = 'visible';
			return (false);	
		}
		else
		{
			if (checkEmail(form.EmailAddress.value)==false)
			{
				form.EmailAddress.value="";
				form.EmailAddress.focus();
				return (false);
			}
			
		}
		// 2. valid the passwords
		if(form.Pass1.value=="")
		{
			alert("Password is required.");
			form.Pass1.focus();
			li_Password.style.color = 'red';
			li_Password.style.fontWeight = 'bold';
			li_PasswordStar.style.visibility = 'visible';
			return (false);	
		}
		else
			return (true);
	}
	
	function validateRetrievePasswordForm(form)
	{
		//check for blank
		if (form.EmailAddress.value=="")
		{
			alert("Please enter an E-mail Address.");
			form.EmailAddress.focus();
			EmailStar.style.visibility = 'visible';
			lblEmailAddress.style.color = 'red';
			lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}
		else
		{
			if (checkEmail(form.EmailAddress.value)==false)
			{
				form.EmailAddress.value="";
				form.EmailAddress.focus();
				return (false);
			}
			else
				return (true);
		}
	}

	function validateRegistrationForm(form)
	{
		//check for blank
		if (form.FirstName.value=="")
		{
			alert("Please enter your first name.");
			form.FirstName.focus();
			//EmailStar.style.visibility = 'visible';
			//lblEmailAddress.style.color = 'red';
			//lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}
		if (form.LastName.value=="")
		{
			alert("Please enter your last name.");
			form.LastName.focus();
			//EmailStar.style.visibility = 'visible';
			//lblEmailAddress.style.color = 'red';
			//lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}
		if (form.EmailAddress.value=="")
		{
			alert("Please enter a valid e-mail address.");
			form.EmailAddress.focus();
			//EmailStar.style.visibility = 'visible';
			//lblEmailAddress.style.color = 'red';
			//lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}
		if (checkEmail(form.EmailAddress.value)==false)
		{
			//alert("Please enter a valid e-mail address.");
			form.EmailAddress.value="";
			form.EmailAddress.focus();
			return (false);
		}


		if (form.Pass1.value=="")
		{
			alert("Please enter a password.");
			form.Pass1.focus();
			//EmailStar.style.visibility = 'visible';
			//lblEmailAddress.style.color = 'red';
			//lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}


		if (form.Pass2.value=="")
		{
			alert("Please re-enter your password.");
			form.Pass2.focus();
			//EmailStar.style.visibility = 'visible';
			//lblEmailAddress.style.color = 'red';
			//lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}

		if (form.Pass1.value != form.Pass2.value)
		{
			alert("Passwords do not match.  Please re-enter");
			form.Pass1.value='';
			form.Pass2.value='';
			form.Pass1.focus();
			//EmailStar.style.visibility = 'visible';
			//lblEmailAddress.style.color = 'red';
			//lblEmailAddress.style.fontWeight = 'bold';
			return (false);
		}

	}
	
