function getPlayerName(player, format) {
if (typeof(format) === 'undefined' || format === '') {
format = 'full';
}
var values = [];
if (format === 'reverse') {
values.push(player['lastName'] || player['lastname'] || player['playerLastName'] || player['playerlastname']);
values.push(player['firstName'] || player['firstname'] || player['playerFisrtName']|| player['playerfirstname']);
return values.filter(function(e) { return typeof(e) !== 'undefined' && e !== ''; }).join (', ');
} else { // default == full
values.push(player['firstName'] || player['firstname'] || player['playerFisrtName']|| player['playerfirstname']);
values.push(player['lastName'] || player['lastname'] || player['playerLastName'] || player['playerlastname']);
return values.filter(function(e) { return typeof(e) !== 'undefined' && e !== ''; }).join (' ');
}
}