<!--

curCountryID = '';
lastCountryID = '';
lastCountryObj = '';
lastCityID = '';
lastCityObj = '';

function loadCities(country_id, url, obj) {

	if (country_id != lastCountryID) {

		if (lastCityObj) {

			lastCityObj.style.color = '';

		}

		checkLastObj('cities', lastCountryID);
		checkLastObj('shops', lastCityID);

		if (!document.all['where_to_buy_cities_list_' + country_id]) {

			document.all.where_to_buy_cities_list.innerHTML += '<div id="where_to_buy_cities_list_temp_' + country_id + '" style="visibility: hidden"></div><div id="where_to_buy_cities_list_' + country_id + '" style="position: absolute; top: 0; padding: 0 0 0 35; display: none"></div>';

			xmlHttp = GetXmlHttpObject();

			xmlHttp.onreadystatechange = pasteCities;
			xmlHttp.open('GET', url + '?country_id=' + country_id, true);
			xmlHttp.send(null);

		}

		else {

			document.all['where_to_buy_cities_list_' + country_id].style.display = '';
			document.all['where_to_buy_cities_list_temp_' + country_id].style.display = '';
			fadeIn(document.all['where_to_buy_cities_list_' + country_id], -100);

		}


		if (obj) {

			obj.style.color = '#CF0000';

		}

		if (lastCountryObj) {

			lastCountryObj.style.color = '';

		}

		lastCountryID = country_id;
		lastCityID = '';

		if (obj) {

			lastCountryObj = obj;

		}

	}

}



function loadShops(city_id, url, obj) {

	if (city_id != lastCityID) {

		checkLastObj('shops', lastCityID);

		if (!document.all['where_to_buy_shops_list_' + city_id]) {

			document.all.where_to_buy_shops_list.innerHTML += '<div id="where_to_buy_shops_list_' + city_id + '" style="padding: 5 0 0 35; display: none"></div>';

			xmlHttp = GetXmlHttpObject();

			xmlHttp.onreadystatechange = pasteShops;
			xmlHttp.open('GET', url + '?city_id=' + city_id, true);
			xmlHttp.send(null);

		}

		else {

			document.all['where_to_buy_shops_list_' + city_id].style.display = '';
			fadeIn(document.all['where_to_buy_shops_list_' + city_id], -100);

		}

		lastCityID = city_id;

		obj.style.color = '#CF0000';

		if (lastCityObj) {

			lastCityObj.style.color = '';

		}

		lastCityObj = obj;

	}

}



function pasteCities() {

	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {

		document.all.where_to_buy_temp.innerHTML = xmlHttp.responseText;
		var country_id = document.all.where_to_buy_temp.getElementsByTagName('ul')[0].getAttribute('country_id');

		document.all['where_to_buy_cities_list_' + country_id].innerHTML = xmlHttp.responseText;
		document.all['where_to_buy_cities_list_temp_' + country_id].innerHTML = xmlHttp.responseText;
		document.all['where_to_buy_cities_list_' + country_id].style.display = '';
		fadeIn(document.all['where_to_buy_cities_list_' + country_id], fadeInStartPosition);

	}

}



function pasteShops() {

	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {

		document.all.where_to_buy_temp.innerHTML = xmlHttp.responseText;
		var city_id = document.all.where_to_buy_temp.getElementsByTagName('div')[0].getAttribute('city_id');
		document.cookie = 'where_to_buy_city_id='.city_id;

		document.all['where_to_buy_shops_list_' + city_id].innerHTML = xmlHttp.responseText;
		document.all['where_to_buy_shops_list_' + city_id].style.display = '';

	}

}



function fadeIn(obj, position) {

	curFadeInObj = obj;

	curFadeInObj.style.left = position;

	if (position < 0) {

		setTimeout('fadeIn(curFadeInObj, ' + (position + 10) + ')', '5');

	}

}



function checkLastObj(name, id) {

	if (document.all['where_to_buy_' + name + '_list_' + id]) {

		document.all['where_to_buy_' + name + '_list_' + id].style.display = 'none';

		if (document.all['where_to_buy_' + name + '_list_temp_' + id]) {

			document.all['where_to_buy_' + name + '_list_temp_' + id].style.display = 'none';

		}

	}

}

//-->