text: /*
   *  jquery-open-soccer - v0.2.0beta
   *  Sportsopendata.net API interface jQuery plugin
   *  https://github.com/Gix075/gOpenSoccer
   *
   *  Made by Gix075 <gildo.giuliani@gmail.com> (https://github.com/Gix075)
   *  Under MIT License
   */
  !function(a,b,c,d){"use strict";function e(b,c){this.element=b,this.settings=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="JOS_getStandings",g={apiBaseURL:"http://soccer.sportsopendata.net/v1/leagues/",season:"15-16",league:"serie-a",view:"simple",template:"table",debug:!1};a.extend(e.prototype,{init:function(){var a=this;this.getStandings(a,!1)},getStandings:function(b,c){a.ajax({url:b.settings.apiBaseURL+b.settings.league+"/seasons/"+b.settings.season+"/standings",dataType:"json",success:function(d){a(b.element).html(b.getStandingsTemplate(b,d,c))},error:function(){!0===b.settings.debug&&console.log("getStandings => AJAXERROR!")}})},getStandingsTemplate:function(b,c,d){var e=c.data.standings,f="",g=this.utils_switchDomEl(b.settings.template);return a.each(e,function(a,c){!1!==d&&c.team!==d||(f+="<"+g.row_open+">",f+="     <"+g.col_open+">"+c.position+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.team+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.points+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.matches_played+"<"+g.col_close+">","advanced"!==b.settings.view&&"extended"!==b.settings.view&&"full"!==b.settings.view||(f+="     <"+g.col_open+">"+c.overall.wins+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.draws+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.losts+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.scores+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.conceded+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.overall.goal_difference+"<"+g.col_close+">"),"extended"!==b.settings.view&&"full"!==b.settings.view||(f+="     <"+g.col_open+">"+c.home.wins+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.home.draws+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.home.losts+"<"+g.col_close+">"),"full"===b.settings.view&&(f+="     <"+g.col_open+">"+c.home.scores+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.home.conceded+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.home.goal_difference+"<"+g.col_close+">"),"extended"!==b.settings.view&&"full"!==b.settings.view||(f+="     <"+g.col_open+">"+c.away.wins+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.away.draws+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.away.losts+"<"+g.col_close+">"),"full"===b.settings.view&&(f+="     <"+g.col_open+">"+c.away.scores+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.away.conceded+"<"+g.col_close+">",f+="     <"+g.col_open+">"+c.away.goal_difference+"<"+g.col_close+">"),f+="<"+g.row_close+">")}),f},utils_switchDomEl:function(a){var b={row_open:"",row_close:"",col_open:"",col_close:""};switch(a){case"table":b.row_open="tr",b.row_close="/tr",b.col_open="td",b.col_close="/td";break;case"tableless":b.row_open='div class="soccerstats_standings-row"',b.row_close="/div",b.col_open='div class="soccerstats_standings-col"',b.col_close="/div"}return b}}),a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document),function(a,b,c,d){"use strict";function e(b,c){this.element=b,this.settings=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="JOS_getStats",g={apiBaseURL:"http://soccer.sportsopendata.net/v1/leagues/",season:"15-16",league:"serie-a",team:!1,template:"default",style:"default",wrapperClass:"",debug:!1};a.extend(e.prototype,{init:function(){var a=this;this.getStats(a)},getStats:function(b){a.ajax({url:b.settings.apiBaseURL+b.settings.league+"/seasons/"+b.settings.season+"/standings",dataType:"json",success:function(c){var d=""!==b.settings.wrapperClass?" "+b.settings.wrapperClass:"";a(b.element).addClass("JOS-teamStats"+d),a(b.element).html(b.getStatsTemplate(b,c))},error:function(){!0===b.settings.debug&&console.log("getStandings => AJAXERROR!")}})},getStatsTemplate:function(b,c){var d=c.data.standings,e="";return a.each(d,function(a,c){!1!==b.settings.team&&b.settings.team!==c.team&&"all"!==b.settings.team||(e+='<div class="JOS-teamStats__team">',e+='     <div class="JOS-teamStats__team-inner">',e+='         <div class="JOS-teamStats__team-row">',e+='             <div class="JOS-teamStats__team-col JOS-teamStats__team-col-1">',e+='                 <div class="JOS-teamStats__team-col-inner">',e+='                     <h3 class="JOS-teamStats__team-teamname">'+c.team+"</h3>",e+='                     <div class="JOS-teamStats__team-col-data overall-data overall-data-standings">',e+='                         <div class="JOS-teamStats__team-data-title">',e+="                             <h5>Standing</h5>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Points</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.points+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Position</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.position+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Played</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.matches_played+"</span>",e+="                             </div>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Wins</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.wins+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Draws</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.draws+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Losts</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.losts+"</span>",e+="                             </div>",e+="                         </div>",e+="                     </div>",e+='                     <div class="JOS-teamStats__team-col-data overall-data overall-data-goals">',e+='                         <div class="JOS-teamStats__team-data-title">',e+="                             <h5>Goals</h5>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Scores</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.scores+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Conceded</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.conceded+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Difference</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.overall.goal_difference+"</span>",e+="                             </div>",e+="                         </div>",e+="                     </div>",e+="                 </div>",e+="             </div>",e+='             <div class="JOS-teamStats__team-col JOS-teamStats__team-col-2">',e+='                 <div class="JOS-teamStats__team-col-inner">',e+='                     <h4 class="JOS-teamStats__team-teamname">Advanced Data</h4>',e+='                     <div class="JOS-teamStats__team-col-data home-data home-data-standings">',e+='                         <div class="JOS-teamStats__team-data-title">',e+="                             <h5>Home Standings</h5>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Wins</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.home.wins+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Draws</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.home.draws+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Losts</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.home.losts+"</span>",e+="                             </div>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Home Power</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+b.getTeamPower(c.home.wins,c.home.draws,c.home.losts,"home")+"</span>",e+="                             </div>",e+="                         </div>",e+="                     </div>",e+='                     <div class="JOS-teamStats__team-col-data home-data home-data-goals">',e+='                         <div class="JOS-teamStats__team-data-title">',e+="                             <h5>Home Goals</h5>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Scores</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.home.scores+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Conceded</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.home.conceded+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Difference</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.home.goal_difference+"</span>",e+="                             </div>",e+="                         </div>",e+="                     </div>",e+='                     <div class="JOS-teamStats__team-col-data away-data away-data-standings">',e+='                         <div class="JOS-teamStats__team-data-title">',e+="                             <h5>Away Standings</h5>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Wins</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.away.wins+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Draws</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.away.draws+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Losts</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.away.losts+"</span>",e+="                             </div>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Away Power</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+b.getTeamPower(c.away.wins,c.away.draws,c.away.losts,"home")+"</span>",e+="                             </div>",e+="                         </div>",e+="                     </div>",e+='                     <div class="JOS-teamStats__team-col-data away-data away-data-goals">',e+='                         <div class="JOS-teamStats__team-data-title">',e+="                             <h5>Away Goals</h5>",e+="                         </div>",e+='                         <div class="JOS-teamStats__team-datas">',e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Scores</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.away.scores+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Conceded</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.away.conceded+"</span>",e+="                             </div>",e+='                             <div class="JOS-teamStats__team-data">',e+='                                 <span class="JOS-teamStats__team-data-label">Difference</span>',e+='                                 <span class="JOS-teamStats__team-data-value">'+c.away.goal_difference+"</span>",e+="                             </div>",e+="                         </div>",e+="                     </div>",e+="                 </div>",e+="             </div>",e+="         </div>",e+="     </div>",e+="</div>")}),e},getTeamPower:function(a,b,c,d){var e;return Number(a)>Number(b)+Number(c)&&(e="+1"),Number(a)==Number(b)+Number(c)&&(e="0"),Number(a)<Number(b)+Number(c)&&(e="-1"),e}}),a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document);