/* *********************************************************
Article Site Master version 1.0 
Copyright 2006 - David C. Dalton 
site: http://www.davidcdalton.com 
This software is provided in a package along with a website. 
It may NOT be resold as a software package or any in part without the express written consent of David C. Dalton
The entire package including the accompaning website may be resold
If resold the new owner shall be bound by this copyright.
This copyright must stay intact! Removal of this copyright notice is a violation of the terms of use
************************************************************/

function checkContactForm()	{
	var emailpattern = /[\w\-]+\@[\w\-]+\.\w{2,3}/; 

	if (document.getElementById('conName').value.length == 0)	{
		alert("Please enter your name");
		document.getElementById('conName').focus();
		return false;
		}
	if (!emailpattern.test(document.getElementById('conEmail').value))	{
		alert("THe email address you have entered appears to be formatted incorrectly\n\nPlease check it and resubmit the form");
		document.getElementById('conEmail').focus();
		return false;
		}
	if (document.getElementById('message').value.length == 0 || document.getElementById('message').value == "please type your message here")	{
		alert("Please enter your message in the text area provided");
		document.getElementById('message').focus();
		return false;
		}
	}

function checkSearch()	{
	if (document.getElementById('q').value.length == 0)	 {
		alert("Please enter a word or phrase to search for");
		document.getElementById('q').focus();
		return false;
		}
	}

function checkArticleForm()	 {
	if (document.getElementById('title').value.length < 5 || document.getElementById('title').value == 'Article Title')	{
		alert("Please enter a descriptive title for your article!\n\nRemember adding a Keyword or two to your article's title helps your chances for search listings");
		document.getElementById('title').focus();
		return false;
		}
	if (document.getElementById('article').value.length < 200)	 {
		alert("Please copy and paste your article into the text area!\n\nWe do not accept articles that are less than 200 characters long!");
		document.getElementById('article').focus();
		return false;
		}
	var article = document.getElementById('article').value;
	if (article.indexOf("<table") != -1 || article.indexOf("<tr>") != -1 || article.indexOf("<td>") != -1)	{
		alert("we do not accept articles that have html table tags in them!");
		document.getElementById('article').focus();
		return false;
		}
	}