function pop_states()
{
	url='/geo.php';
	cid=$F('country');
	var pars='t=ct&c='+cid;
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: pars,
				onComplete: fill_states
			});
}

function fill_states(r)
{
    res=eval(r.responseText);
	st_elm=$('state');
	st_elm.options.length=0;
	$('city').options.length=0;
	for(i=0;i<res.length;i++)
	{
		st_elm.options[st_elm.options.length]=new Option(res[i][1],res[i][0]);
	}
	pop_cities();
}


function fill_cities(r)
{
    res=eval(r.responseText);
	st_elm=$('city');
	st_elm.options.length=0;
	for(i=0;i<res.length;i++)
	{
		st_elm.options[st_elm.options.length]=new Option(res[i][1],res[i][0]);
	}
}

function pop_cities()
{
	url='/geo.php';
	sid=$F('state');
	params='t=st&s='+sid;
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: params,				
				onComplete: fill_cities
			});
}