function settings_save(type)
{
	loading(1);
	$.getJSON(home+'control/id/'+id+'/server/'+server+'/section/settings/subsection/start/save/'+type+'/value/'+$('#'+type).val()+'/go/',
	function(data)
	{
		$.each(data, function(i, val)
		{
			if(i == 'e')
				bootbox.dialog('<h3 class="red">Ошибка</h3>'+val,
					[{
						"label" : "OK",
						"class" : "btn-small btn-primary",
					}]
				);
			if(i == 's')
				bootbox.dialog('<h3 class="green">Внимание</h3> Внесенные изменения сохранены.',
					[{
						"label" : "OK",
						"class" : "btn-small btn-primary",
					}]
				);

			loading(0)
		});
	});
}

function settings_save_address()
{
	loading(1);

	$.ajax({
		type: 'POST',
		url: home+'control/id/'+id+'/server/'+server+'/section/settings/subsection/start/save/address/value/1/go/',
		data: 'address='+$('#address').val(),
		dataType: 'json',
		success: function(data)
		{
			$.each(data, function(i, val)
			{
				if(i == 'e')
					bootbox.dialog('<h3 class="red">Ошибка</h3>'+val,
						[{
							"label" : "OK",
							"class" : "btn-small btn-primary",
						}]
					);

				if(i == 's')
					bootbox.dialog('<h3 class="green">Внимание</h3> Внесенные изменения сохранены.',
						[{
							"label" : "OK",
							"class" : "btn-small btn-primary",
						}]
					);

				loading(0)
			});
		}
	});
}

function maplist()
{
	$.getJSON(home+'control/id/'+id+'/server/'+server+'/section/settings/subsection/start/maps', function(data)
	{
		$.each(data, function(i, val)
		{
			if(i == 'maps')
				$('#map').html(val);
		});
	});
}

function core_fix_list()
{
	$.getJSON(home+'control/id/'+id+'/server/'+server+'/section/settings/subsection/start/core', function(data)
	{
		$.each(data, function(i, val)
		{
			if(i == 'core_fix')
				$('#core_fix').html(val);
		});
	});
}