function tabs()
{
	if(document.getElementById && (typeof(encodeURIComponent) == 'function'))
	{
		var f = function()
		{
			search_input = document.getElementById("search");
			a_showcase = document.getElementById("showcase");
			a_toprating = document.getElementById("toprating");
			a_firms = document.getElementById("firms");
			a_prices = document.getElementById("prices");

			text = search_input.value.replace(/^\s+|\s+$/g, "");
			if (a_showcase)
			{
				a_showcase.href = a_showcase.protocol + "//" + a_showcase.host + "/showcase/";
			}
			if (a_toprating)
			{
				a_toprating.href = a_toprating.protocol + "//" + a_toprating.host + "/toprating/";
			}
			a_firms.href = a_firms.protocol + "//" + a_firms.host + "/firms/";
			a_prices.href = a_prices.protocol + "//" + a_prices.host + "/price/";
			if (text)
			{
				if (a_showcase)
				{
					a_showcase.href += "?scr=1&search=" + encodeURIComponent(text)
				}
				if (a_toprating)
				{
					a_toprating.href += "?scr=1&search=" + encodeURIComponent(text)
				}
				a_firms.href += "?scr=1&search=" + encodeURIComponent(text);
				a_prices.href += "?scr=1&search=" + encodeURIComponent(text);
			}
		}

		setInterval(f, 200);	
	}
}
tabs();
