// $Header: /HBI Websites/_client_common/js/hispanicbusiness/validate_main_search.js 3     4/25/05 11:34a Matthew.van.eerde $
function validate_main_search(form)
{	var aok = true;

	if (!trim(form.keyword1.value) || trim(form.keyword1.value) == 'Search')
	{
		var k = prompt('Please enter keywords to search', '');

		if (k)
		{	form.keyword1.value = k;
		} else
		{	aok = false;
		}
	}

	return aok;
}

// trim: remove white space from left and right side of string
function trim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

// ltrim: remove white space from left side of string
function ltrim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+/,"");
}

// rtrim: remove white space from right side of string
function rtrim(stringToTrim) 
{
	return stringToTrim.replace(/\s+$/,"");
}
