$(document).ready(function() { $.fn.dataTable.ext.order['sortMln'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return 1*$(td).text().replace(' mln.', ''); } ); }; $.fn.dataTable.ext.order['sortCountryFlag'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return $('i', td).attr('title'); } ); }; $.fn.dataTable.ext.order['sortMostPopular'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return 1*$(td).text().substr(0,$(td).text().indexOf("x")-1); } ); }; }); var countries = {"214":{"id":"214","country":"England","countryCode":"EN","countryTr":"England"},"217":{"id":"217","country":"Northern Ireland","countryCode":"NIE","countryTr":"Northern Ireland"},"3":{"id":"3","country":"United States","countryCode":"US","countryTr":"United States"},"14":{"id":"14","country":"Germany","countryCode":"DE","countryTr":"Germany"},"51":{"id":"51","country":"Australia","countryCode":"AU","countryTr":"Australia"},"26":{"id":"26","country":"South Africa","countryCode":"ZA","countryTr":"South Africa"},"25":{"id":"25","country":"South Korea","countryCode":"KR","countryTr":"South Korea"},"88":{"id":"88","country":"Sweden","countryCode":"SE","countryTr":"Sweden"},"109":{"id":"109","country":"Denmark","countryCode":"DK","countryTr":"Denmark"},"23":{"id":"23","country":"Italy","countryCode":"IT","countryTr":"Italy"},"215":{"id":"215","country":"Scotland","countryCode":"SF","countryTr":"Scotland"},"28":{"id":"28","country":"Spain","countryCode":"ES","countryTr":"Spain"},"10":{"id":"10","country":"Japan","countryCode":"JP","countryTr":"Japan"},"158":{"id":"158","country":"Fiji","countryCode":"FJ","countryTr":"Fiji"},"110":{"id":"110","country":"Slovakia","countryCode":"SK","countryTr":"Slovakia"},"76":{"id":"76","country":"Belgium","countryCode":"BE","countryTr":"Belgium"},"29":{"id":"29","country":"Colombia","countryCode":"CO","countryTr":"Colombia"},"118":{"id":"118","country":"Ireland","countryCode":"IE","countryTr":"Ireland"},"216":{"id":"216","country":"Wales","countryCode":"WL","countryTr":"Wales"},"19":{"id":"19","country":"France","countryCode":"FR","countryTr":"France"},"61":{"id":"61","country":"Netherlands","countryCode":"NL","countryTr":"Netherlands"},"42":{"id":"42","country":"Venezuela","countryCode":"VE","countryTr":"Venezuela"},"31":{"id":"31","country":"Argentina","countryCode":"AR","countryTr":"Argentina"},"69":{"id":"69","country":"Zimbabwe","countryCode":"ZW","countryTr":"Zimbabwe"},"20":{"id":"20","country":"Thailand","countryCode":"TH","countryTr":"Thailand"},"7":{"id":"7","country":"Bangladesh","countryCode":"BD","countryTr":"Bangladesh"},"124":{"id":"124","country":"New Zealand","countryCode":"NZ","countryTr":"New Zealand"},"2":{"id":"2","country":"India","countryCode":"IN","countryTr":"India"},"93":{"id":"93","country":"Austria","countryCode":"AT","countryTr":"Austria"},"60":{"id":"60","country":"Chile","countryCode":"CL","countryTr":"Chile"},"1":{"id":"1","country":"China","countryCode":"CN","countryTr":"China"},"36":{"id":"36","country":"Canada","countryCode":"CA","countryTr":"Canada"},"116":{"id":"116","country":"Singapore","countryCode":"SG","countryTr":"Singapore"},"77":{"id":"77","country":"Portugal","countryCode":"PT","countryTr":"Portugal"},"104":{"id":"104","country":"Paraguay","countryCode":"PY","countryTr":"Paraguay"},"49":{"id":"49","country":"Taiwan","countryCode":"TW","countryTr":"Taiwan"},"112":{"id":"112","country":"Finland","countryCode":"FI","countryTr":"Finland"},"5":{"id":"5","country":"Brasil","countryCode":"BR","countryTr":"Brazil"},"12":{"id":"12","country":"Philippines","countryCode":"PH","countryTr":"Philippines"},"11":{"id":"11","country":"Mexico","countryCode":"MX","countryTr":"Mexico"},"117":{"id":"117","country":"Norway","countryCode":"NO","countryTr":"Norway"},"43":{"id":"43","country":"Malaysia","countryCode":"MY","countryTr":"Malaysia"},"119":{"id":"119","country":"Costa Rica","countryCode":"CR","countryTr":"Costa Rica"},"126":{"id":"126","country":"Puerto Rico","countryCode":"PR","countryTr":"Puerto Rico"},"122":{"id":"122","country":"United Arab Emirates","countryCode":"AE","countryTr":"United Arab Emirates"},"175":{"id":"175","country":"Iceland","countryCode":"IS","countryTr":"Iceland"},"17":{"id":"17","country":"Turkey","countryCode":"TR","countryTr":"Turkey"},"94":{"id":"94","country":"Swiss","countryCode":"CH","countryTr":"Switzerland"},"33":{"id":"33","country":"Poland","countryCode":"PL","countryTr":"Poland"},"37":{"id":"37","country":"Morocco","countryCode":"MA","countryTr":"Morocco"},"105":{"id":"105","country":"Jordan","countryCode":"JO","countryTr":"Jordan"},"46":{"id":"46","country":"Saudi Arabia","countryCode":"SA","countryTr":"Saudi Arabia"},"40":{"id":"40","country":"Peru","countryCode":"PE","countryTr":"Peru"},"78":{"id":"78","country":"Czech Republic","countryCode":"CZ","countryTr":"Czech Republic"},"203":{"id":"203","country":"Bermuda","countryCode":"BM","countryTr":"Bermuda"},"220":{"id":"220","country":"Cayman Islands","countryCode":"KY","countryTr":"Cayman Islands"},"68":{"id":"68","country":"Guatemala","countryCode":"GT","countryTr":"Guatemala"},"98":{"id":"98","country":"Hong Kong","countryCode":"HK","countryTr":"Hong Kong"},"66":{"id":"66","country":"Ecuador","countryCode":"EC","countryTr":"Ecuador"}}; var teams = [{"id":0,"name":""}]; var sportsmen = [{"id":"4427","tem":"0","ctr":"214","nam":"Rose, Justin ","namorig":"Rose, Justin ","cat":"","pri":"20 mln.","rat":0,"mw":"M","link":"Rose, Justin <\/a>","confirmed_b":1},{"id":"15875","tem":"0","ctr":"28","nam":"Rahm, Jon ","namorig":"Rahm, Jon ","cat":"","pri":"18.4 mln.","rat":0,"mw":"M","link":"Rahm, Jon <\/a>","confirmed_b":1},{"id":"4457","tem":"0","ctr":"28","nam":"Garcia, Sergio ","namorig":"Garcia, Sergio ","cat":"","pri":"16.3 mln.","rat":0,"mw":"M","link":"Garcia, Sergio <\/a>","confirmed_b":1},{"id":"7537","tem":"0","ctr":"214","nam":"Hatton, Tyrrell ","namorig":"Hatton, Tyrrell ","cat":"","pri":"14.6 mln.","rat":0,"mw":"M","link":"Hatton, Tyrrell <\/a>","confirmed_b":1},{"id":"4561","tem":"0","ctr":"214","nam":"Fleetwood, Tommy ","namorig":"Fleetwood, Tommy ","cat":"","pri":"14.5 mln.","rat":0,"mw":"M","link":"Fleetwood, Tommy <\/a>","confirmed_b":1},{"id":"4482","tem":"0","ctr":"88","nam":"Noren, Alex ","namorig":"Noren, Alex ","cat":"","pri":"12.9 mln.","rat":0,"mw":"M","link":"Noren, Alex <\/a>","confirmed_b":1},{"id":"4442","tem":"0","ctr":"23","nam":"Molinari, Francesco ","namorig":"Molinari, Francesco ","cat":"","pri":"11.8 mln.","rat":0,"mw":"M","link":"Molinari, Francesco <\/a>","confirmed_b":1},{"id":"4579","tem":"0","ctr":"28","nam":"Cabrera Bello, Rafa ","namorig":"Cabrera Bello, Rafa ","cat":"","pri":"11.2 mln.","rat":0,"mw":"M","link":"Cabrera Bello, Rafa <\/a>","confirmed_b":1},{"id":"7509","tem":"0","ctr":"3","nam":"Reed, Patrick ","namorig":"Reed, Patrick ","cat":"","pri":"10.9 mln.","rat":0,"mw":"M","link":"Reed, Patrick <\/a>","confirmed_b":1},{"id":"4489","tem":"0","ctr":"214","nam":"Fisher, Ross ","namorig":"Fisher, Ross ","cat":"","pri":"10 mln.","rat":0,"mw":"M","link":"Fisher, Ross <\/a>","confirmed_b":1},{"id":"4628","tem":"0","ctr":"93","nam":"Wiesberger, Bernd ","namorig":"Wiesberger, Bernd ","cat":"","pri":"9.4 mln.","rat":0,"mw":"M","link":"Wiesberger, Bernd <\/a>","confirmed_b":1},{"id":"10425","tem":"0","ctr":"76","nam":"Pieters, Thomas ","namorig":"Pieters, Thomas ","cat":"","pri":"9.3 mln.","rat":0,"mw":"M","link":"Pieters, Thomas <\/a>","confirmed_b":1},{"id":"7534","tem":"0","ctr":"214","nam":"Fitzpatrick, Matt ","namorig":"Fitzpatrick, Matt ","cat":"","pri":"8.5 mln.","rat":0,"mw":"M","link":"Fitzpatrick, Matt <\/a>","confirmed_b":1},{"id":"4422","tem":"0","ctr":"26","nam":"Schwartzel, Charl ","namorig":"Schwartzel, Charl ","cat":"","pri":"8.1 mln.","rat":0,"mw":"M","link":"Schwartzel, Charl <\/a>","confirmed_b":1},{"id":"4670","tem":"0","ctr":"26","nam":"Grace, Branden ","namorig":"Grace, Branden ","cat":"","pri":"7.4 mln.","rat":0,"mw":"M","link":"Grace, Branden <\/a>","confirmed_b":1},{"id":"7418","tem":"0","ctr":"3","nam":"Uihlein, Peter ","namorig":"Uihlein, Peter ","cat":"","pri":"6.7 mln.","rat":0,"mw":"M","link":"Uihlein, Peter <\/a>","confirmed_b":1},{"id":"7501","tem":"0","ctr":"19","nam":"Levy, Alexander ","namorig":"Levy, Alexander ","cat":"","pri":"6.3 mln.","rat":0,"mw":"M","link":"Levy, Alexander <\/a>","confirmed_b":1},{"id":"4546","tem":"0","ctr":"109","nam":"Olesen, Thorbj\u00f8rn ","namorig":"Olesen, Thorbj\u00f8rn ","cat":"","pri":"6.2 mln.","rat":0,"mw":"M","link":"Olesen, Thorbj\u00f8rn <\/a>","confirmed_b":1},{"id":"4433","tem":"0","ctr":"214","nam":"Poulter, Ian ","namorig":"Poulter, Ian ","cat":"","pri":"6.1 mln.","rat":0,"mw":"M","link":"Poulter, Ian <\/a>","confirmed_b":1},{"id":"4575","tem":"0","ctr":"20","nam":"Aphibarnrat, Kiradech ","namorig":"Aphibarnrat, Kiradech ","cat":"","pri":"6 mln.","rat":0,"mw":"M","link":"Aphibarnrat, Kiradech <\/a>","confirmed_b":1},{"id":"4506","tem":"0","ctr":"61","nam":"Luiten, Joost ","namorig":"Luiten, Joost ","cat":"","pri":"5.9 mln.","rat":0,"mw":"M","link":"Luiten, Joost <\/a>","confirmed_b":1},{"id":"4484","tem":"0","ctr":"76","nam":"Colsaerts, Nicolas ","namorig":"Colsaerts, Nicolas ","cat":"","pri":"5.8 mln.","rat":0,"mw":"M","link":"Colsaerts, Nicolas <\/a>","confirmed_b":1},{"id":"8451","tem":"0","ctr":"1","nam":"Li, Haotong ","namorig":"Li, Haotong ","cat":"","pri":"5.7 mln.","rat":0,"mw":"M","link":"Li, Haotong <\/a>","confirmed_b":1},{"id":"11915","tem":"0","ctr":"26","nam":"Frittelli, Dylan ","namorig":"Frittelli, Dylan ","cat":"","pri":"5.6 mln.","rat":0,"mw":"M","link":"Frittelli, Dylan <\/a>","confirmed_b":1},{"id":"17644","tem":"0","ctr":"214","nam":"Smith, Jordan ","namorig":"Smith, Jordan ","cat":"","pri":"5.5 mln.","rat":0,"mw":"M","link":"Smith, Jordan <\/a>","confirmed_b":1},{"id":"10697","tem":"0","ctr":"118","nam":"Dunne, Paul ","namorig":"Dunne, Paul ","cat":"","pri":"5.3 mln.","rat":0,"mw":"M","link":"Dunne, Paul <\/a>","confirmed_b":1},{"id":"4647","tem":"0","ctr":"19","nam":"Dubuisson, Victor ","namorig":"Dubuisson, Victor ","cat":"","pri":"5.2 mln.","rat":0,"mw":"M","link":"Dubuisson, Victor <\/a>","confirmed_b":1},{"id":"8587","tem":"0","ctr":"10","nam":"Tanihara, Hideto ","namorig":"Tanihara, Hideto ","cat":"","pri":"5.1 mln.","rat":0,"mw":"M","link":"Tanihara, Hideto <\/a>","confirmed_b":1},{"id":"4412","tem":"0","ctr":"214","nam":"Westwood, Lee ","namorig":"Westwood, Lee ","cat":"","pri":"5 mln.","rat":0,"mw":"M","link":"Westwood, Lee <\/a>","confirmed_b":1},{"id":"4578","tem":"0","ctr":"214","nam":"Wood, Chris ","namorig":"Wood, Chris ","cat":"","pri":"4.9 mln.","rat":0,"mw":"M","link":"Wood, Chris <\/a>","confirmed_b":1},{"id":"4416","tem":"0","ctr":"14","nam":"Kaymer, Martin ","namorig":"Kaymer, Martin ","cat":"","pri":"4.8 mln.","rat":0,"mw":"M","link":"Kaymer, Martin <\/a>","confirmed_b":1},{"id":"4618","tem":"0","ctr":"118","nam":"Lowry, Shane ","namorig":"Lowry, Shane ","cat":"","pri":"4.7 mln.","rat":0,"mw":"M","link":"Lowry, Shane <\/a>","confirmed_b":1},{"id":"6484","tem":"0","ctr":"51","nam":"Hend, Scott ","namorig":"Hend, Scott ","cat":"","pri":"4.6 mln.","rat":0,"mw":"M","link":"Hend, Scott <\/a>","confirmed_b":1},{"id":"4674","tem":"0","ctr":"104","nam":"Zanotti, Fabrizio ","namorig":"Zanotti, Fabrizio ","cat":"","pri":"4.5 mln.","rat":0,"mw":"M","link":"Zanotti, Fabrizio <\/a>","confirmed_b":1},{"id":"11064","tem":"0","ctr":"124","nam":"Fox, Ryan ","namorig":"Fox, Ryan ","cat":"","pri":"4.4 mln.","rat":0,"mw":"M","link":"Fox, Ryan <\/a>","confirmed_b":1},{"id":"4580","tem":"0","ctr":"215","nam":"Jamieson, Scott ","namorig":"Jamieson, Scott ","cat":"","pri":"4.4 mln.","rat":0,"mw":"M","link":"Jamieson, Scott <\/a>","confirmed_b":1},{"id":"10705","tem":"0","ctr":"214","nam":"Southgate, Matthew ","namorig":"Southgate, Matthew ","cat":"","pri":"4.3 mln.","rat":0,"mw":"M","link":"Southgate, Matthew <\/a>","confirmed_b":1},{"id":"4577","tem":"0","ctr":"109","nam":"Kjeldsen, S\u00f8ren ","namorig":"Kjeldsen, S\u00f8ren ","cat":"","pri":"4.2 mln.","rat":0,"mw":"M","link":"Kjeldsen, S\u00f8ren <\/a>","confirmed_b":1},{"id":"7254","tem":"0","ctr":"214","nam":"Sullivan, Andy ","namorig":"Sullivan, Andy ","cat":"","pri":"4.2 mln.","rat":0,"mw":"M","link":"Sullivan, Andy <\/a>","confirmed_b":1},{"id":"4567","tem":"0","ctr":"215","nam":"Ramsay, Richie ","namorig":"Ramsay, Richie ","cat":"","pri":"4.1 mln.","rat":0,"mw":"M","link":"Ramsay, Richie <\/a>","confirmed_b":1},{"id":"4504","tem":"0","ctr":"28","nam":"Larraz\u00e1bal, Pablo ","namorig":"Larraz\u00e1bal, Pablo ","cat":"","pri":"4 mln.","rat":0,"mw":"M","link":"Larraz\u00e1bal, Pablo <\/a>","confirmed_b":1},{"id":"11993","tem":"0","ctr":"25","nam":"Wang, Jeunghun ","namorig":"Wang, Jeunghun ","cat":"","pri":"4 mln.","rat":0,"mw":"M","link":"Wang, Jeunghun <\/a>","confirmed_b":1},{"id":"4513","tem":"0","ctr":"214","nam":"Horsey, David ","namorig":"Horsey, David ","cat":"","pri":"3.9 mln.","rat":0,"mw":"M","link":"Horsey, David <\/a>","confirmed_b":1},{"id":"4708","tem":"0","ctr":"214","nam":"Storm, Graeme ","namorig":"Storm, Graeme ","cat":"","pri":"3.8 mln.","rat":0,"mw":"M","link":"Storm, Graeme <\/a>","confirmed_b":1},{"id":"17665","tem":"0","ctr":"88","nam":"Bj\u00f6rk, Alexander ","namorig":"Bj\u00f6rk, Alexander ","cat":"","pri":"3.7 mln.","rat":0,"mw":"M","link":"Bj\u00f6rk, Alexander <\/a>","confirmed_b":1},{"id":"7416","tem":"0","ctr":"214","nam":"Pepperell, Eddie ","namorig":"Pepperell, Eddie ","cat":"","pri":"3.6 mln.","rat":0,"mw":"M","link":"Pepperell, Eddie <\/a>","confirmed_b":1},{"id":"4511","tem":"0","ctr":"26","nam":"Coetzee, George ","namorig":"Coetzee, George ","cat":"","pri":"3.5 mln.","rat":0,"mw":"M","link":"Coetzee, George <\/a>","confirmed_b":1},{"id":"18205","tem":"0","ctr":"3","nam":"Suri, Julian ","namorig":"Suri, Julian ","cat":"","pri":"3.5 mln.","rat":0,"mw":"M","link":"Suri, Julian <\/a>","confirmed_b":1},{"id":"12387","tem":"0","ctr":"19","nam":"Lorenzo-Vera, Mike ","namorig":"Lorenzo-Vera, Mike ","cat":"","pri":"3.4 mln.","rat":0,"mw":"M","link":"Lorenzo-Vera, Mike <\/a>","confirmed_b":1},{"id":"12056","tem":"0","ctr":"51","nam":"Dodt, Andrew ","namorig":"Dodt, Andrew ","cat":"","pri":"3.3 mln.","rat":0,"mw":"M","link":"Dodt, Andrew <\/a>","confirmed_b":1},{"id":"6481","tem":"0","ctr":"3","nam":"Lipsky, David ","namorig":"Lipsky, David ","cat":"","pri":"3.2 mln.","rat":0,"mw":"M","link":"Lipsky, David <\/a>","confirmed_b":1},{"id":"12417","tem":"0","ctr":"214","nam":"Shinkwin, Callum ","namorig":"Shinkwin, Callum ","cat":"","pri":"3.2 mln.","rat":0,"mw":"M","link":"Shinkwin, Callum <\/a>","confirmed_b":1},{"id":"10430","tem":"0","ctr":"28","nam":"Otaegui, Adrian ","namorig":"Otaegui, Adrian ","cat":"","pri":"3.1 mln.","rat":0,"mw":"M","link":"Otaegui, Adrian <\/a>","confirmed_b":1},{"id":"5741","tem":"0","ctr":"26","nam":"Sterne, Richard ","namorig":"Sterne, Richard ","cat":"","pri":"3.1 mln.","rat":0,"mw":"M","link":"Sterne, Richard <\/a>","confirmed_b":1},{"id":"15354","tem":"0","ctr":"26","nam":"Burmester, Dean ","namorig":"Burmester, Dean ","cat":"","pri":"3 mln.","rat":0,"mw":"M","link":"Burmester, Dean <\/a>","confirmed_b":1},{"id":"17664","tem":"0","ctr":"19","nam":"Pavon, Matthieu ","namorig":"Pavon, Matthieu ","cat":"","pri":"2.9 mln.","rat":0,"mw":"M","link":"Pavon, Matthieu <\/a>","confirmed_b":1},{"id":"10481","tem":"0","ctr":"109","nam":"Bjerregaard, Lucas ","namorig":"Bjerregaard, Lucas ","cat":"","pri":"2.8 mln.","rat":0,"mw":"M","link":"Bjerregaard, Lucas <\/a>","confirmed_b":1},{"id":"15360","tem":"0","ctr":"26","nam":"Porteous, Haydn ","namorig":"Porteous, Haydn ","cat":"","pri":"2.7 mln.","rat":0,"mw":"M","link":"Porteous, Haydn <\/a>","confirmed_b":1},{"id":"6526","tem":"0","ctr":"215","nam":"Drysdale, David ","namorig":"Drysdale, David ","cat":"","pri":"2.5 mln.","rat":0,"mw":"M","link":"Drysdale, David <\/a>","confirmed_b":1},{"id":"7504","tem":"0","ctr":"214","nam":"Waring, Paul ","namorig":"Waring, Paul ","cat":"","pri":"2 mln.","rat":0,"mw":"M","link":"Waring, Paul <\/a>","confirmed_b":1}]; var sportsmenTeams = []; var showTeams = 0; //*********************** //SPORTSMEN TABLE HEADERS //*********************** var headersTableSportsmen = [ { 'sTitle': 'Nr.' }, { 'sTitle': 'Group' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'Country', 'sSortDataType': 'sortCountryFlag', sType : "text" }, { 'sTitle': 'Golf player'}, { 'sTitle': 'Value', 'sSortDataType': 'sortMln', 'sType': 'numeric' }, { 'sTitle': 'Team' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'M/F' , 'bSearchable': false, 'bVisible': false } ]; //*********************** //TEAMS TABLE HEADERS //*********************** var headersTableTeams = [ {'sTitle': 'Nr.'}, {'sTitle': '' , 'bSearchable': false, 'bVisible': false }, {'sTitle': 'Country' , 'sSortDataType': 'sortCountryFlag', sType : 'text' }, { 'sTitle': ''}, { 'sTitle': 'Value', 'sSortDataType': 'sortMln', 'sType': 'numeric' } ]; //*********************** //SPORTSMEN TABLE CONTENT //*********************** var contentTableSportsmen = []; $.each(sportsmen, function(k, v) { contentTableSportsmen.push([ k + 1, v['cat'], getFlag(v['ctr']), v['link'], v['pri'], isset(teams[v['tem']])? teams[v['tem']]['name']:'', v['mw'] ]); }); //*********************** //TEAMS TABLE CONTENT //*********************** var contentTableTeams = []; $.each(sportsmenTeams, function(k, v) { contentTableTeams.push([ k + 1, "", getFlag(v['ctr']), v['nam'], v['pri'] ]); }); function isset (va) { return typeof va != 'undefined'; } $(document).ready(function() { $.fn.dataTable.ext.order['sortMln'] = function (settings, col) { return this.api().column(col, {order: 'index'}).nodes().map(function (td) { return parseFloat($(td).text().replace(' mln.', '').replace(',', '.')); } ); }; if (sportsmen.length) { var sportsmenTable = $('#tblSportsmen').dataTable( { "bPaginate": false, "bFilter": true, "bInfo": false, "bAutoWidth": true, "aoColumns" : headersTableSportsmen, "aaData": contentTableSportsmen, "bAutoWidth": false } ); } if (sportsmenTeams.length) { var sportsmenTeamsTable = $('#tblTeams').dataTable( { "bPaginate": false, "bFilter": true, "bInfo": false, "bAutoWidth": true, "aoColumns" : headersTableTeams, "aaData": contentTableTeams, "bAutoWidth": false } ); $('#teamsOverview').show(); } } ); function getFlag(id, margin) { if (!id || typeof countries[id] === "undefined" ) return ""; if (typeof margin == 'undefined') margin = true; return ""; }