
var gIgnoredWords = ["limited", "ltd", "son", "sons"]; //Removed the 'and' word

function isIgnoredWord( sWord ) {
	var ix;
	sWord = sWord.toLowerCase();

	for ( ix = 0; ix < gIgnoredWords.length; ix++ ) {
		if ( gIgnoredWords[ ix ] == sWord )
			return true;
	}

	return false;
}

// check the contents of a single form element
function checkTextElement( elementObj ) {
	var searchString = elementObj.value;
	var s = "";
	var oneWord, c;
	var aWords, aKeepWords = new Array();
	var flLastWasSpace = false;
	var i, j;
	
	//loop through the words in the text of the element, remove those which are listed
	for ( i = 0; i <= searchString.length; i++ ) {
		c = searchString.charAt( i );
		if ( ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) || ( c >= '0' && c <= '9' ) || ( c == '\'' ) ) {
			s += c;
			flLastWasSpace = false;
		}
		else {
			// only add one space between words
			if ( ! flLastWasSpace )
				s += ' ';
			
			flLastWasSpace = true;
		}
	}
	
	aWords = s.split( ' ' );
	
	for ( i = 0; i < aWords.length; i++ ) {
		oneWord = aWords[ i ].toLowerCase();
		
		if ( ( oneWord.length > 0 ) &&  isIgnoredWord( oneWord ) ) {
			alert ( "Please do not include the word '" + oneWord + "' in your search" ) ;
			return false;
			}
	}

	return true;
	}


function checkTextElement2( elementObj ) {
	var searchString = elementObj.value;
	var s = "";
	var oneWord, c;
	var aWords, aKeepWords = new Array();
	var flLastWasSpace = false;
	var i, j;
	var badWord = null;
	
	//loop through the words in the text of the element, remove those which are listed
	for ( i = 0; i <= searchString.length; i++ ) {
		c = searchString.charAt( i );
		if ( ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) || ( c >= '0' && c <= '9' ) || ( c == '\'' ) ) {
			s += c;
			flLastWasSpace = false;
		}
		else {
			// only add one space between words
			if ( ! flLastWasSpace )
				s += ' ';
			
			flLastWasSpace = true;
		}
	}
	
	aWords = s.split( ' ' );
	
	for ( i = 0; i < aWords.length; i++ ) {
		oneWord = aWords[ i ].toLowerCase();
		
		if ( ( oneWord.length > 0 ) &&  isIgnoredWord( oneWord ) ) {
			//alert ( "Please do not include the word '" + oneWord + "' in your search" ) ;
			badWord = oneWord;
			return badWord;
			}
	}

	return null;
	}

