jquery.aucomplete format + options

Not sure about minificator you use, so before merge, can you minify by
your self?

Usage example: http://puu.sh/7oVAJ.jpg on real project.

var $idPalyersTextArea = $("#id_players");
$idPalyersTextArea.tagsInput({
autocomplete_opt: {
minLength: 2,
select: function (event, ui) {
$idPalyersTextArea.addTag(ui.item.key + ' ' + ui.item.id);
return false;
}
},
autocomplete_url: function (request, response) {
$.when(getResults('player', 'tag', request.term,
'Players')).then(function (resplayers) {
response(resplayers.result);
});
},
defaultText: 'add a player',
delimiter: '\n',
formatAutocomplete: aligulacAutocompleteTemplates
});

var aligulacAutocompleteTemplates = function (ajaxobject) {
if ((!ajaxobject.tag) && (!ajaxobject.name) && (!ajaxobject.fullname)) {
return '<span class="autocomplete-header">' + ajaxobject.label +
'</span>';
}
switch (ajaxobject.objectsType) {
case 'player':
ajaxobject.key = ajaxobject.tag;
return '<a>{aligulac-flag}<img src="{aligulac-race}"
/>{aligulac-name}</a>'.replace('{aligulac-flag}',
ajaxobject.country ? '<img src="' + aligulacApiConfig.flagsDirectory +
ajaxobject.country.toLowerCase() + '.png" />' : ' ')
.replace('{aligulac-race}', aligulacApiConfig.racesDirectory +
ajaxobject.race.toUpperCase() + '.png')
.replace('{aligulac-name}', ajaxobject.tag);
case 'team':
ajaxobject.key = ajaxobject.name;
return '<a>{aligulac-name}</a>'
.replace('{aligulac-name}', ajaxobject.name);
case 'event':
ajaxobject.key = ajaxobject.fullname;
return '<a>{aligulac-name}</a>'
.replace('{aligulac-name}', ajaxobject.fullname);
}
return '<a>' + ajaxobject.value + '</a>';
};