	// SearchFormRedirect() forwards to the URL for the relevant search type with
	// the SearchString contents appended as a querystring variable

function SearchFormRedirect() {
	var selectedSearchType = document.SearchForm.SearchType.selectedIndex;
	var SearchString = document.SearchForm.SearchString.value;
	var searchTypeURL = document.SearchForm.SearchType.options[selectedSearchType].value + '&SearchString=' + SearchString;
	location.href=searchTypeURL;
}



	// SubmitOnEnter() sends the form data when enter/return is hit
	// and the cursor is focussed on the calling form field

function SubmitOnEnter(e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   SearchFormRedirect();
   return false;
   }
else
   return true;
}



	//This launches a new window and then focuses. 
	//The 3rd parameter can be used to set height, width etc

var newWindow;
function launchWindow(url,windowName,windowFeatures)
{	
	newWindow = window.open(url,windowName,windowFeatures);
 	setTimeout('newWindow.focus();',250);
}


// Checks for popup blocking software which prevents windows opening
// It can be checked in javascript using if(popupblocker)

 /*var popupTestWindow = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
 if(popupTestWindow) {
    var popupBlocker = false
                     }
 else
    var popupBlocker = true
 popupTestWindow.close();*/


// Prevents javascript errors being displayed
function handleError() {
    return true
}
window.onerror = handleError;

