function Locatie()
{
}

Locatie.setup = function ()
{
	Locatie.setupAjaxsearch();
}

Locatie.showResults = function ()
{
	var target = TabControl.instances.location_tabcontrol;
	if (target != null)
		target.showTab("results");

}


Locatie.setupAjaxsearch = function (attempts)
{
	if (AjaxSearch.current != null)
	{
		AjaxSearch.current.addListener("onupdate", Locatie, "showResults");
	}
	else if (!attempts || attempts < 10)
	{
		attempts = attempts || 0;
		window.setTimeout(function ()
		{
			Locatie.setupAjaxsearch(++attempts)
		}, 100);
	}
}

$(document).ready(Locatie.setup);
