String.prototype.trim = function() {
	return this.replace(/^\s*/, '').replace(/\s*$/, '');
};

function initDropdown(url, id) {
	document.getElementById(id).onchange = function(e) {
		var value = e.target['options'][e.target.selectedIndex].value;
		var action = e.target['options'][e.target.selectedIndex].innerHTML;
	
		new Ajax.Request(url, {
			method: 'get',
			parameters: {
			action: action.trim(),
			id: value
			},
			onSuccess: function (transport) {
			}
		});
	};
}
