function loadCountryList(continent_id, arParams)
{
	property_id = arParams.CITY_INPUT_NAME;

	function __handlerCitiesList(data)
	{
		//alert(data);
		var obContainer = document.getElementById('LOCATION_' + property_id);
		if (obContainer)
		{
			obContainer.innerHTML = data;
			PCloseWaitMessage('wait_container_' + property_id, true);
		}
	}

    arParams.CONTINENT = continent_id;

	if (arParams.CONTINENT <= 0) return;
    //alert(arParams.REGION);

	PShowWaitMessage('wait_container_' + property_id, true);

	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID,__handlerCitiesList);
	CPHttpRequest.Post(TID, '/bitrix/components/realtytour/main.ajax.locations/templates/.default/ajax.php', arParams);
}

function loadCitiesList(continent_id, country_id, region_id, arParams)
{
	property_id = arParams.CITY_INPUT_NAME;

	function __handlerCitiesList(data)
	{
		//alert(data);
		var obContainer = document.getElementById('LOCATION_' + property_id);
		if (obContainer)
		{
			obContainer.innerHTML = data;
			PCloseWaitMessage('wait_container_' + property_id, true);
		}
	}

    arParams.CONTINENT = continent_id;
	arParams.COUNTRY = country_id;
    arParams.REGION = region_id;
	
	if (arParams.COUNTRY <= 0) return;
    //alert(arParams.REGION);

	PShowWaitMessage('wait_container_' + property_id, true);
	
	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID,__handlerCitiesList);
	CPHttpRequest.Post(TID, '/bitrix/components/realtytour/main.ajax.locations/templates/.default/ajax.php', arParams);
}

function loadRegionsList(continent_id, country_id, arParams)
{
	property_id = arParams.CITY_INPUT_NAME;

	function __handlerRegionsList(data)
	{
		//alert(data);
		var obContainer = document.getElementById('LOCATION_' + property_id);
		if (obContainer)
		{
			obContainer.innerHTML = data;
			PCloseWaitMessage('wait_container_' + property_id, true);
		}
	}

    arParams.CONTINENT = continent_id;
	arParams.COUNTRY = country_id;

	if (arParams.COUNTRY <= 0) return;

	PShowWaitMessage('wait_container_' + property_id, true);

	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID,__handlerRegionsList);
	CPHttpRequest.Post(TID, '/bitrix/components/realtytour/main.ajax.locations/templates/.default/ajax.php', arParams);
}

function loadAdv1List(continent_id, country_id, region_id, city_id, arParams)
{
	property_id = arParams.CITY_INPUT_NAME;

	function __handlerCitiesList(data)
	{
		//alert(data);
		var obContainer = document.getElementById('LOCATION_' + property_id);
		if (obContainer)
		{
			obContainer.innerHTML = data;
			PCloseWaitMessage('wait_container_' + property_id, true);
		}
	}

    arParams.CONTINENT = continent_id;
	arParams.COUNTRY = country_id;
    arParams.REGION = region_id;
    arParams.CITY = city_id;

	if (arParams.COUNTRY <= 0) return;

	PShowWaitMessage('wait_container_' + property_id, true);

	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID,__handlerCitiesList);
	CPHttpRequest.Post(TID, '/bitrix/components/realtytour/main.ajax.locations/templates/.default/ajax.php', arParams);
}

function loadAdv2List(continent_id, country_id, region_id, city_id, adv_id, arParams)
{
	property_id = arParams.CITY_INPUT_NAME;

	function __handlerCitiesList(data)
	{
		//alert(data);
		var obContainer = document.getElementById('LOCATION_' + property_id);
		if (obContainer)
		{
			obContainer.innerHTML = data;
			PCloseWaitMessage('wait_container_' + property_id, true);
		}
	}

    arParams.CONTINENT = continent_id;
	arParams.COUNTRY = country_id;
    arParams.REGION = region_id;
    arParams.CITY = city_id;
    arParams.ADV1 = adv_id;

	if (arParams.COUNTRY <= 0) return;

	PShowWaitMessage('wait_container_' + property_id, true);

	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID,__handlerCitiesList);
	CPHttpRequest.Post(TID, '/bitrix/components/realtytour/main.ajax.locations/templates/.default/ajax.php', arParams);
}