
// prevent blank search requests
function validate_search(frm) {
	searchstring = frm.q.value.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
	if (searchstring=="") {
		alert('Please enter a word or phrase to search for');
		frm.q.focus();
		return false;
	
	} else {
		return true;
	}	
}


// set the background of google search box
var f = document.getElementById('gs'); 
if (f && f.q) { 
	var q = f.q;
	var n = navigator;
	
	if (n.platform == 'Win32') { 
		q.style.cssText = 'border: 1px #EEE; padding: 2px;'; 
	} 
	var b = function() { 
		if (q.value == '') { 
			q.style.background = '#FFFFFF url(http://www.cass.city.ac.uk/Cass/globalnavxhtml/search_watermark.gif) left no-repeat'; 
		} 
	}; 
	var f = function() { 
		q.style.background = '#ffffff'; 
	}; 
	q.onfocus = f; 
	q.onblur = b; 
	b();
}	

