function whole_name(subname)
{
if (subname=="destination") return("Special Destination");
if (subname=="activity") return("Activity");
return(subname);
}
function ac_change_menu(scope,title)
{
var testval=(Form.Element.getValue(title));
var url = '/phpAjax/Ajax.php?action='+title+'&item='+testval+'&mode=json';
// notice the use of a proxy to circumvent the Same Origin Policy.
//

	$(title).remove(0);

new Ajax.Request(url, {
  method: 'get',
  onSuccess: function(transport) {
	var json = transport.responseText.evalJSON();
	var reset=json['reset'];
	var values=json['values'];
	for(var i=1;i<reset.length;i++) {
		Form.Element.disable(reset[i]);
		Form.Element.clear(reset[i]);
		$(reset[i]).options[0] = new Option(whole_name(reset[i]),whole_name(reset[i]));
		}


	var activate=json['activate'];
	$(activate).options[0] = new Option('Select','Select');
	for(var i=0;i<values.length;i++) {
	$(activate).options[i+1] = new Option(values[i]);
	}
	Form.Element.enable(activate);
	if (values.length==1) {
			$(activate).options[1].selected=true;
			$(activate).onchange(this,activate);
			}
	}


});

}
