function showIcons() {
	var icons = document.getElementsByTagName('SPAN');
	for(i=0; i<icons.length; i++) {
		if(icons[i].className=='noscript'){
			icons[i].className = 'scriptAvailable';
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", showIcons);
if (window.addEventListener) window.addEventListener( "load", showIcons, false );



function checkform(form)
{
	var query = trim(form.searchText.value);
	if (!(query.length > 0))
	{
		alert("Invalid search string");
		form.searchText.focus();
		return false;
	}
	if ((query.indexOf("and") == 0) || (query.indexOf("and") == query.length - 3))
	{
			alert('The word "and" cannot be at the begining nor at the end of the query');
			form.searchText.focus();
			return false;
	}
	
	return true;
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

