function getOffices() {

	var region = $F('region');
	var url = '/ajax';
	var pars = 'act=get_offices&region=' + region;

	var myAjax = new Ajax.Request(
		url, 
		{
			method: 'get', 
			parameters: pars, 
			onComplete: getOffices_callback
		});
}



function getOffices_callback(originalRequest) {
	//put returned XML in the textarea
	var res = originalRequest.responseText;
	if (res != 'EMPTY') {

		var offices = res.split('|||');

		$('pick_up').options.length = 0;
		$('drop_off').options.length = 0;

		$('pick_up').options.length = offices.length;
		$('drop_off').options.length = offices.length;

		var office_prop;

		for (i = 0; i < offices.length ; i++) {

			office_prop = offices[i].split('||');

			$('pick_up').options[i].value = office_prop[0];
			$('pick_up').options[i].text = office_prop[1];

			$('drop_off').options[i].value = office_prop[0];
			$('drop_off').options[i].text = office_prop[1];


		}

	} else {
		emptyOffices();
	}
}


function emptyOffices() {
	$('pick_up').options.length = 0;
	$('drop_off').options.length = 0;
}
