function fill()
{
	httpObject = getHTTPObject();
	if (httpObject != null) 
	{
		httpObject.open("GET", "modules/main.auto.fill.php?city="+document.getElementById('city').value, true);
		httpObject.onreadystatechange = setOutput;
		httpObject.send(null);
	}
}

function setOutput()
{
	if(httpObject.readyState == 4)
	{
		var combo_1 = document.getElementById('place_1');
		var combo_2 = document.getElementById('place_2');
		var combo_3 = document.getElementById('place_3');
		var combo_4 = document.getElementById('place_4');
		combo_1.options.length = 0;
		combo_2.options.length = 0;
		combo_3.options.length = 0;
		combo_4.options.length = 0;
		var response = httpObject.responseText;
		var items = response.split(";");
		var count = items.length;
		for (var i=0;i<count;i++)
		{
			var options = items[i].split("|");
			if(options[1] != null)
			{
				combo_1.options[i] = new Option(options[0],options[1]);
				combo_2.options[i] = new Option(options[0],options[1]);
				combo_3.options[i] = new Option(options[0],options[1]);
				combo_4.options[i] = new Option(options[0],options[1]);
			}
		}
	}
}

function show(id)
{
	document.getElementById(id).style.display=''; 
}

function show_content(show, hide)
{
	document.getElementById(show).className=''; 
	document.getElementById(hide).className='hidden'; 
}

