var searchboxHadFocus = false;

window.onload = function()
{
	if (document.getElementById)
	{
		document.getElementsByTagName('form')[0].onsubmit = checkForm;

		document.getElementById('suchtext').onfocus = function()
		{
			if (searchboxHadFocus)
			{
				this.onfocus = null;
				return;
			}

			this.value = '';
			searchboxHadFocus = true;
		}

		var goBtn = document.getElementById('go');

		goBtn.onmouseover = function()
		{
			this.className = 'over';
		}

		goBtn.onmouseout = function()
		{
			this.className = '';
		}
	}
};

function checkForm()
{
	if (!this.suchtext.value || !searchboxHadFocus)
	{
		alert(searchTerm);
		this.suchtext.focus();
		return false;
	}
	else if (this.suchtext.value.length < 3)
	{
		alert(minLength);
		this.suchtext.focus();
		return false;
	}

	return true;
}
