function do_search()
{
	var item = document.getElementById('q');
	if (item.value.length < 3)
	{
		alert('Podana fraza musi mieć więcej niż 3 znaki.');
		item.focus();
	}
	else
	{
		document.getElementById('search_form').submit();
	}
}

var hightlight_status = 1;

function unhightlight()
{
	var items = document.getElementsByTagName('span');
	var i;
	if (hightlight_status == 1)
	{
		document.getElementById('hightlight_img').src = "images/hightlight.gif";
		for (i=0; i<items.length; i++)
		{
			if (items[i].id.substr(0,18) == 'phrase_hightlight_')
			{
				items[i].style.backgroundColor = '';
				if (items[i].style.color != '')
				{
					items[i].style.color = '#FFFFFF';
				}
			}
		}
		document.getElementById('hightlight_lab').innerHTML = 'zaznacz';
		hightlight_status = 0;
	}
	else
	{
		document.getElementById('hightlight_img').src = "images/hightlight_off.gif";
		for (i=0; i<items.length; i++)
		{
			if (items[i].id.substr(0,18) == 'phrase_hightlight_')
			{
				items[i].style.backgroundColor = 'yellow';
				if (items[i].style.color != '')
				{
					items[i].style.color = '#17316B';
				}
			}
		}
		document.getElementById('hightlight_lab').innerHTML = 'odznacz';
		hightlight_status = 1;
	}
}


function get_details(id,s)
{
	document.location.href=id;
}

function do_login()
{
	if (document.getElementById('login').value.length == 0)
	{
		alert('Proszę podać login.');
		document.getElementById('login').focus();
	}
	else if (document.getElementById('pass').value.length == 0)
	{
		alert('Proszę podać hasło.');
		document.getElementById('pass').focus();
	}
	else
	{
		document.getElementById('login_form').submit();
	}
}
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function check_enter(e)
{
	var keyCode = (isNN) ? e.which : e.keyCode;
	if (keyCode == 13)
	{
		do_login();
	}
}