(function()
{
	var S = go.selects;
	S.makeCountries = (
		function(select)
		{
			var obj = new S.cSelect(select);			
			obj.change = (
				function()
				{
					if (this.select.value == -2) {
						if (full) {
							this.load(full, 0);							
						} else {
							this.disable();
							this.load({0: "- Загружаю... -"});
							if (fulla) {
								ajlist.push(this);
							} else {
								fulla = new go.ajax.getAction("placies");
								fulla.get = {"type": "countries", "full": 1};
								fulla.handler = fullLoaded;
								fulla.send();
								ajlist = [this];
							}
						}
					}
					return true;
				}
			);
			this._msgValue0 = "- Выберите страну -";
			this._dOther = false;
			return obj;
		}
	);
	var full;
	var fulla;
	var ajlist = [];
	function fullLoaded()
	{
		var list = this.JSON();
		var len = ajlist.length;
		for (var i = 0; i < len; i++) {
			ajlist[i].load({0: "- Выберите страну -"});
			ajlist[i].load(list, 0, true);
			ajlist[i].enable();
		}
		return true;
	}
})();
(function()
{
	var S = go.selects;
	S.makeCities = (
		function(select, country, dOther)
		{
			var obj = new S.cLink(select, country, "cities");
			obj._msgValue0 = "- Выберите город -";
			obj._msgParent = "- Сначала выберите страну -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeAreas = (
		function(select, city, dOther)
		{
			var obj = new S.cLink(select, city, "areas");
			obj._msgValue0 = "- Выберите район -";
			obj._msgParent = "- Сначала выберите город -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeMetro = (
		function(select, city, dOther)
		{
			var obj = new S.cLink(select, city, "metro");
			obj._msgValue0 = "- Выберите метро -";
			obj._msgParent = "- Сначала выберите город -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeStreets = (
		function(select, city, dOther)
		{
			var obj = new S.cLink(select, city, "streets");
			obj._msgValue0 = "- Выберите улицу -";
			obj._msgParent = "- Сначала выберите город -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeSchools = (
		function(select, city, dOther)
		{
			var obj = new S.cLink(select, city, "schools");
			obj._msgValue0 = "- Выберите школу -";
			obj._msgParent = "- Сначала выберите город -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeUnivers = (
		function(select, city, dOther)
		{
			var obj = new S.cLink(select, city, "institutes");
			obj._msgValue0 = "- Выберите ВУЗ -";
			obj._msgParent = "- Сначала выберите город -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeFaculties = (
		function(select, univ, dOther)
		{			
			var obj = new S.cLink(select, univ, "faculties");
			obj._msgValue0 = "- Выберите факультет -";
			obj._msgParent = "- Сначала выберите ВУЗ -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();
(function()
{
	var S = go.selects;
	S.makeDepts = (
		function(select, fac, dOther)
		{
			var obj = new S.cLink(select, fac, "depts");
			obj._msgValue0 = "- Выберите кафедру -";
			obj._msgParent = "- Сначала выберите факультет -";
			obj._dOther = dOther;
			obj.parentChange();			
			return obj;
		}
	);
})();