﻿<!-- 
var strSearchErrorStart = "The following details are incorrect:                                        \n\n";
var strSearchErrorEnd = "\nPlease correct and then try again.";
var blnSearchAlreadySubmitted = false;

function searchtrimstring(str) 
{
  	str = this != window? this : str;
  	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function searchlinkclick(aForm)
{
	var strButton

	if(blnSearchAlreadySubmitted==false)
	{
		if(searchvalidateform(aForm))
		{
			blnSearchAlreadySubmitted = true;
			aForm.submit();
		}
	}
	else
	{
		alert("Please wait, search being run...");
	}
}

function searchvalidateform(aForm)
{
	var strSearchErrorStart = "The following details are incorrect:                         \n\n";
	var strErrorMain = ""
	var strSearchErrorEnd = "\nPlease correct and then try again.";
	if (searchtrimstring(aForm.txtSearch.value)=="") strErrorMain = strErrorMain + "Search phrase: must be completed\n"
	if (strErrorMain != "")
	{
		alert(strSearchErrorStart + strErrorMain + strSearchErrorEnd);
		return false;
	}
	else
	{
		return true;
	}
}
-->
