/*************************************************************
* Page: search.js v 1.0.2  
* Description: To validate the search engine to make sure they fill
* in a keyword.
* 
* Hospitality Recruitment - Online Strategies
* Copyright (C) 2005 Online Strategies, All rights reserved
* Email  info@hospitalityonline.co.uk
* 
*************************************************************/
function validate_search(e){	

		// Trim the data to make sure there is no white space
		String.prototype.trim = function()
		{
			return this.replace(/^\s*|\s*$/g, '');
		}
		
		var focus_el = null, msg = '';
		
		// title must be filled in
		e.keywords.value = e.keywords.value.trim();
		if (is_empty(e.keywords) || e.keywords.value == "Type in your preferred job title" || e.keywords.value == "keywords")
		{
			msg += error[301];
			focus_el = focus_el || e.keywords;
		}
		// If there is an error then send through an alert (var msg) and return false
		if (msg != '')
		{
			var prefix = "The search form has been completed incorrectly:\n\n";
			alert(prefix + msg);
			if (focus_el.focus)
			{
				focus_el.focus();
			}
			return false;
		}
		return true;
}