function validateWordCount(string, fieldName, fieldDescription, minWordsRequired, maxWordsRequired, maxCharacters, submit)
{
	var returnValue								=	true;
			
	if (string.length == 0)
		var words								=	0;
	else
	{
		var a									=	string.replace(/^\s+|\s+$/g,"").split(/\s+/g);	// split the text into an array of words
		var words								=	a.length;
	}
			
	var moreWordsRequired						=	minWordsRequired - words;
	var tooManyWords							=	words - maxWordsRequired;
			
	if ((string.length = 0) && (!submit))
	{
		returnValue								=	true;
		return returnValue;
	}
					
	if ((moreWordsRequired > 0) || (tooManyWords > 0))
	{
					
		var text								=	'';
				
		if (!submit)
			text								=	'Note: ';
				
		text									=	text + words;
		if (words == 1)
			text								=	text + ' word has ';
		else
			text								=	text + ' words have ';
					
		text									=	text + 'been entered in the "' + fieldDescription + '" field.\n\nThis page cannot be accepted until ' + minWordsRequired + ' to ' + maxWordsRequired + ' words have been entered.\n\nWatch below the "' + fieldDescription + '" field for a real-time word count.';
				
		if (submit)
			text								=	text + '\n\nTry again...';
				
		alert(text);
			
		if (submit)
		{
			returnValue							=	false;
			eval('document.getElementById("' + fieldName + '").focus();');
		}
	}
			
	if (returnValue && (string.length > maxCharacters))
	{
		alert('The "' + fieldDescription + '" field allows a maximum of ' + maxCharacters + '. The entered text contains ' + (string.length) + ' characters.\n\nThis page cannot be accepted until at least ' + (string.length - maxCharacters) + ' are removed.');
		if (submit)
		{
			eval('document.getElementById("' + fieldName + '").focus();');
		}
	}

	window.status								=	'Done'
	return returnValue;
}

