<!--JAVASCIRPT TO REMOVE TEXT FROM SEARCH BOX WHEN CLICKED ON - AND ALSO NOT ALLOW BLANK SEARCHES -->
<!--DAVID WHITEHOUSE - 2007 -->


function colorChg(FormItem, ItemColor)
		{
			if(FormItem.style) FormItem.style.backgroundColor = ItemColor;
		}
		
	function raiseerror(s_srch,strerror)
		{
		FormHead = "";
		alert(FormHead + strerror)
		s_srch.focus();
		var frmType = s_srch.type;
		if(frmType.substring(0, 3) != "sel")
		{
			s_srch.select();
		}
		colorChg(s_srch, bgerr);
		}

function chk_keyword(textObj)
		{
			var newValue = textObj.value;
			var newLength = textObj.length;
			var extraChars = "0123456789 -.£";
			var search;
			
			for(var i = 0; i != newLength; i++)
			{
				aChar = textObj.substring(i,i+1);
				aChar = aChar.toUpperCase();
				search = extraChars.indexOf(aChar);
				if(search == -1 && (aChar < "A" || aChar > "Z"))
				{
					return false;
				}
			}
			return true;
		}

function val_search(frm)
	{
		objfrm = frm.mast;		
		bgok = "#e4bdbe";		
		bgerr = "#e4bdbe";	
		var objRegExp = / /g;
		colorChg (objfrm, bgok);
		var jsFirstname = new String(objfrm.value);		
		jsFirstname = jsFirstname.replace(objRegExp, '')
		if((jsFirstname.length < 2 && jsFirstname != '3') || !chk_keyword(jsFirstname) || jsFirstname == 'Search...')
			{
				raiseerror(objfrm,"Sorry your search is not valid.\n\nPlease make sure your search word length is greater 2 characters\nand that you only use letters, numbers and spaces.")
				return false;
			}
		return true;
	}
function clr_s_srch(ele)
	{
		ele.value = '';
	}
	

function gotoLink(form) 
	{
 	 var OptionIndex=form.ListBoxURL.selectedIndex;
  	parent.location = form.ListBoxURL.options[OptionIndex].value;
  	}
