// ==UserScript== // @name TrophyManager - Super Squad // @version 2.0.0 // @description Show a super detayled TrophyManager player page. // @namespace https://trophymanager.com // @include http://static.trophymanager.com/players/* // @include http://www.trophymanager.com/players/* // @include http://trophymanager.com/players/* // @include https://static.trophymanager.com/players/* // @include https://www.trophymanager.com/players/* // @include https://trophymanager.com/players/* // @author Joao Manuel Ferreira Fernandes // @github https://github.com/etnepres/trophymanager.git // @grant none // @downloadURL https://update.greasyfork.icu/scripts/29629/TrophyManager%20-%20Super%20Squad.user.js // @updateURL https://update.greasyfork.icu/scripts/29629/TrophyManager%20-%20Super%20Squad.meta.js // ==/UserScript== function embed() { function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; } function isNaNVer(xnum) { if(isNaN(xnum)){ return 0; } else { return xnum;} } function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i0) { totSkill += skills[i]*document.calculateSkillWeight(positions[positionIndex], weights[positionIndex], i); } } totSkill = totSkill / 200; totSkill = Math.round(totSkill*1000)/1000; return totSkill; }; document.calculateSkillWeight = function(positionWeightLevels, weights, index) { var weight = 0; weight = weights[positionWeightLevels[index]-1] / document.numberAtWeight(positionWeightLevels, positionWeightLevels[index]) * 10; return weight; }; document.numberAtWeight = function(positionWeightLevels, value) { var count = 0; for (var i=0; i< positionWeightLevels.length; i++) { if (positionWeightLevels[i] == value) { count++; } } return count; }; document.findPositionIndex = function(position) { var index = -1; for (var k=0; k< positionNames.length; k++) { if (position.indexOf(positionNames[k]) == 0) { index = k; k = positionNames.length; } } return index; }; document.getSkills = function(indicePlayer) { var skillArray = []; if (players_ar[indicePlayer]["fp"] == "GK"){ skillArray.push(players_ar[indicePlayer]["str"]); skillArray.push(players_ar[indicePlayer]["sta"]); skillArray.push(players_ar[indicePlayer]["pac"]); skillArray.push(players_ar[indicePlayer]["han"]); skillArray.push(players_ar[indicePlayer]["one"]); skillArray.push(players_ar[indicePlayer]["ref"]); skillArray.push(players_ar[indicePlayer]["ari"]); skillArray.push(players_ar[indicePlayer]["jum"]); skillArray.push(players_ar[indicePlayer]["com"]); skillArray.push(players_ar[indicePlayer]["kic"]); skillArray.push(players_ar[indicePlayer]["thr"]); } else { skillArray.push(players_ar[indicePlayer]["str"]); skillArray.push(players_ar[indicePlayer]["sta"]); skillArray.push(players_ar[indicePlayer]["pac"]); skillArray.push(players_ar[indicePlayer]["mar"]); skillArray.push(players_ar[indicePlayer]["tac"]); skillArray.push(players_ar[indicePlayer]["wor"]); skillArray.push(players_ar[indicePlayer]["pos"]); skillArray.push(players_ar[indicePlayer]["pas"]); skillArray.push(players_ar[indicePlayer]["cro"]); skillArray.push(players_ar[indicePlayer]["tec"]); skillArray.push(players_ar[indicePlayer]["hea"]); skillArray.push(players_ar[indicePlayer]["fin"]); skillArray.push(players_ar[indicePlayer]["lon"]); skillArray.push(players_ar[indicePlayer]["set"]); } players_ar[indicePlayer].totalSkill = 0; for (var i = 0; i < skillArray.length; i++){ players_ar[indicePlayer].totalSkill = players_ar[indicePlayer].totalSkill + skillArray[i]; } return skillArray; }; function checkIdPos(positionX) { var idPos; for (var k=0; k< positionNames.length; k++) { if (positionNames[k] == positionX) { idPos = k; } } return idPos; } function checkIfDefender(positionX, positionY) { var isPositionDefender = false; for (var k=0; k< defendingPositionNames.length; k++) { if (defendingPositionNames[k] == positionX || defendingPositionNames[k] == positionY) { isPositionDefender = true; } } return isPositionDefender; } function computeSKdefenida(SK,skills){ var SKs = 0; var positionIndex = document.findPositionIndex(SK); if (positionIndex > -1) { SKs = document.calculateSkill(positionIndex, skills); } return [[SK],[SKs]]; } function computeSK(idJogador,skills){ var SKs = [0, 0]; var positionArray = []; var posicoesAntes = players_ar[idJogador]["fp"].split(", "); var outraPos = []; if (posicoesAntes.length == 1){ var posicoes = players_ar[idJogador]["fp"].split("\/"); if (posicoes.length == 1){ outraPos = players_ar[idJogador]["fp"].split(" "); if(outraPos.length == 2){ if(outraPos[1].length >= 2){ positionArray[0] = outraPos[0] + " " + outraPos[1].substring(0,1); positionArray[1] = outraPos[0] + " " + outraPos[1].substring(1,2); } else { positionArray[0] = players_ar[idJogador]["fp"]; } } } else if (posicoes.length == 2){ var outraPos = posicoes[1].split(" "); positionArray[0] = posicoes[0] + " " + outraPos[1]; positionArray[1] = outraPos[0] + " " + outraPos[1]; } } else if(posicoesAntes.length == 2){ positionArray[0] = posicoesAntes[0]; positionArray[1] = posicoesAntes[1]; } if(players_ar[idJogador]["fp"] =="F"){ positionArray[0] = "F"; } if(players_ar[idJogador]["fp"] =="GK"){ positionArray[0] = "GK"; } for (var i = 0; i < positionArray.length; i++){ var positionIndex = document.findPositionIndex(positionArray[i]); if (positionIndex > -1) { SKs[i] = document.calculateSkill(positionIndex, skills); } } return [positionArray,SKs]; } document.potential = 0; document.charisma = 0; document.professionalism = 0; document.aggression = 0; function get_potential(){ return document.potential; } function get_charisma(){ return document.charisma; } function get_professionalism(){ return document.professionalism; } function get_aggression(){ return document.aggression; } function get_ti_level(){ return document.ti_level; } function get_skillsEvoluidas(){ return document.skillsEvoluidas; } var national = 1; var reserves = 1; document.isPlaying = []; document.isOnField = []; document.fieldSpot = []; document.isOnSub = []; document.subSpot = []; function tactics_init_national(idPlayer){ return [document.isPlaying[idPlayer],document.isOnField[idPlayer]]; } function tactics_init_national_aux() { $.ajaxSetup({async: false}); $.post("/ajax/tactics_get.ajax.php",{"reserves":0,"national":1},function(data){ if(data != null) { document.players = data["players"]; document.on_field = data["formation"]; document.formation_by_pos = data["formation_by_pos"]; document.on_subs = data["formation_subs"]; document.on_field_assoc = data["formation_assoc"]; document.positions = data["positions"]; for(var i_Player in document.players){ if(document.on_field[document.players[i_Player]["player_id"]] != undefined){ document.isOnField[document.players[i_Player]["player_id"]] = true; document.fieldSpot[document.players[i_Player]["player_id"]] = document.on_field[document.players[i_Player]["player_id"]][document.players[i_Player]["player_id"]]; } else { document.isOnField[document.players[i_Player]["player_id"]] = false; document.fieldSpot[document.players[i_Player]["player_id"]] = ""; } if(document.on_subs[document.players[i_Player]["player_id"]] != undefined){ document.isOnSub[document.players[i_Player]["player_id"]] = true; document.subSpot[document.players[i_Player]["player_id"]] = document.on_subs[document.players[i_Player]["player_id"]]; } else { document.isOnSub[document.players[i_Player]["player_id"]] = false; document.subSpot[document.players[i_Player]["player_id"]] = ""; } document.isPlaying[document.players[i_Player]["player_id"]] = document.isOnField[document.players[i_Player]["player_id"]] || document.isOnSub[document.players[i_Player]["player_id"]]; } } },"json"); $.ajaxSetup({async: true}); return [document.isPlaying,document.isOnField,document.fieldSpot,document.isOnSub,document.subSpot];//[info, document.isOnField]; } var arrayRespostaEquipa = tactics_init_national_aux(); document.isPlaying = arrayRespostaEquipa[0]; document.isOnField = arrayRespostaEquipa[1]; document.fieldSpot = arrayRespostaEquipa[2]; document.isOnSub = arrayRespostaEquipa[3]; document.subSpot = arrayRespostaEquipa[4]; function tactics_init_reserves(idPlayer){ return [document.isPlaying[idPlayer],document.isOnField[idPlayer]]; } function tactics_init_reserves_aux(idPlayer) { $.ajaxSetup({async: false}); $.post("/ajax/tactics_get.ajax.php",{"reserves":1,"national":0},function(data){ if(data != null) { document.players = data["players"]; document.on_field = data["formation"]; document.formation_by_pos = data["formation_by_pos"]; document.on_subs = data["formation_subs"]; document.on_field_assoc = data["formation_assoc"]; document.positions = data["positions"]; for(var i_Player in document.players){ if(document.on_field[document.players[i_Player]["player_id"]] != undefined){ document.isOnField[document.players[i_Player]["player_id"]] = true; document.fieldSpot[document.players[i_Player]["player_id"]] = document.on_field[document.players[i_Player]["player_id"]][document.players[i_Player]["player_id"]]; } else { document.isOnField[document.players[i_Player]["player_id"]] = false; document.fieldSpot[document.players[i_Player]["player_id"]] = ""; } if(document.on_subs[document.players[i_Player]["player_id"]] != undefined){ document.isOnSub[document.players[i_Player]["player_id"]] = true; document.subSpot[document.players[i_Player]["player_id"]] = document.on_subs[document.players[i_Player]["player_id"]]; } else { document.isOnSub[document.players[i_Player]["player_id"]] = false; document.subSpot[document.players[i_Player]["player_id"]] = ""; } document.isPlaying[document.players[i_Player]["player_id"]] = document.isOnField[document.players[i_Player]["player_id"]] || document.isOnSub[document.players[i_Player]["player_id"]]; } } },"json"); $.ajaxSetup({async: true}); return [document.isPlaying,document.isOnField,document.fieldSpot,document.isOnSub,document.subSpot];//[info, document.isOnField]; } var arrayRespostaEquipaR = tactics_init_reserves_aux(); document.isPlaying = arrayRespostaEquipaR[0]; document.isOnField = arrayRespostaEquipaR[1]; document.fieldSpot = arrayRespostaEquipaR[2]; document.isOnSub = arrayRespostaEquipaR[3]; document.subSpot = arrayRespostaEquipaR[4]; function get_player_info_history(player_id,show_non_pro_graphs){ $.ajaxSetup({async: false}); $.post("https://trophymanager.com/ajax/players_get_info.ajax.php",{"player_id":player_id, "type":"history","show_non_pro_graphs":show_non_pro_graphs},function(data){ if(data != null){ document.thisSeasonData = data["table"]["nat"][0]; document.allTimeData = data["table"]["nat"][data["table"]["nat"].length-1]; } },"json").error(function(){ });//json $.ajaxSetup({async: true}); thisSeasonData = document.thisSeasonData; allTimeData = document.allTimeData; document.thisSeasonData = []; document.allTimeData = []; return [thisSeasonData,allTimeData]; } document.isitreallydata = ""; document.isitreallydataAux = ""; document.hiddenAdapt = 0; document.hiddenProf = 0; document.hiddenInj = 0; document.hiddenAgr = 0; document.foundHidden = false; function get_player_info_hidden_skills(player_id){ $.ajaxSetup({async: false}); $.get( "https://trophymanager.com/players/"+player_id+"/", {paramOne : 1, paramX : 'abc'}, function(data) { if(data != null){ document.isitreallydata = data.split("class=\"skill_table zebra\" id=\"hidden_skill_table\">")[1].split("")[0]; document.isitreallydataAux = document.isitreallydata; if(document.isitreallydata.split("/20")[1]!=undefined){ document.foundHidden = true; document.isitreallydata= document.isitreallydataAux.split("/20")[1].split("")[1]; document.hiddenInj = document.isitreallydata * 1; document.isitreallydata= document.isitreallydataAux.split("/20")[3].split("")[1]; document.hiddenAgr=document.isitreallydata * 1; document.isitreallydata= document.isitreallydataAux.split("/20")[5].split("")[1]; document.hiddenProf=document.isitreallydata * 1; document.isitreallydata= document.isitreallydataAux.split("/20")[7].split("")[1]; document.hiddenAdapt=document.isitreallydata * 1; } else { document.foundHidden = false; } } } ); $.ajaxSetup({async: true}); isitreallydata = document.isitreallydata; foundHidden = document.foundHidden; hiddenInj=document.hiddenInj; hiddenAgr=document.hiddenAgr; hiddenProf=document.hiddenProf; hiddenAdapt=document.hiddenAdapt; document.isitreallydata = ""; document.isitreallydataAux = ""; document.foundHidden = false; document.hiddenAdapt = 0; document.hiddenProf = 0; document.hiddenInj = 0; document.hiddenAgr = 0; return [foundHidden,hiddenInj,hiddenAgr,hiddenProf,hiddenAdapt]; } function get_player_info_scout(player_id, player_fp,show_non_pro_graphs){ $.ajaxSetup({async: false}); $.post("https://trophymanager.com/ajax/players_get_info.ajax.php",{"player_id":player_id, "type":"scout","show_non_pro_graphs":show_non_pro_graphs},function(data){ if(data != null) { if (data["error"]) { var report_error = data["error"]; } if (data["reports"].length>-1) { for(var eachReport in data["reports"]) { report = data["reports"][eachReport]; if(report && !report_error) { //////////////////////////// BLOOM INFO //////////////////////////////// bloom_status = ""; dev_status = ""; report_age = parseInt(report["report_age"]); bloom_age = parseInt(report["bloom_age"]); rem_pot = parseFloat(report["remaining_pot"]); //var skill_names = ["",global_content["strength"],global_content["stamina"],global_content["pace"],global_content["marking"],global_content["tackling"],global_content["workrate"],global_content["positioning"],global_content["passing"],global_content["crossing"],global_content["technique"],global_content["heading"],global_content["finishing"],global_content["longshots"],global_content["set_pieces"]]; //var skill_names_gk = ["",global_content["strength"],global_content["stamina"],global_content["pace"],global_content["handling"],global_content["one_on_ones"],global_content["reflexes"],global_content["aerial_ability"],global_content["jumping"],global_content["communication"],global_content["kicking"],global_content["throwing"],data['scout_content'][80]]; if (report["bloom_status_txt"]!="") { bloom_status = report["bloom_status_txt"]; dev_status = report["dev_status"]; } if(report["potential"] > 0){ if(get_potential() >0){ document.potential = (get_potential()*1 + (report["potential"]*1/2))/2; } else { document.potential = (report["potential"]*1/2); } } if (report["specialist"]>0)//data['scout_content'][67] { if(player_fp=="GK") { if (report["specialist"]>12) report["specialist"] = 12; specialist = report["specialist"];//skill_names_gk[report["specialist"]]; } else { specialist = report["specialist"];//skill_names[report["specialist"]]; } } else { specialist = "N/D"; } if (report['peak_phy_txt']!="" || report['peak_tac_txt']!="" || report['peak_tec_txt']!="" || report['charisma']>0 || report['professionalism']>0 || report['aggression']>0) { //if (report['peak_phy_txt']!="") $div.append(report['peak_phy_txt'],"
"); //if (report['peak_tac_txt']!="") $div.append(report['peak_tac_txt'],"
"); //if (report['peak_tec_txt']!="") $div.append(report['peak_tec_txt'],"
"); if (report['charisma']>0) { if(get_charisma() >0){ document.charisma = (get_charisma()*1 + report["charisma"]*1)/2; } else { document.charisma = report["charisma"]*1; } } if (report['professionalism']>0) { if(get_professionalism() >0){ document.professionalism = (get_professionalism()*1 + report["professionalism"]*1)/2; } else { document.professionalism = report["professionalism"]*1; } } if (report['aggression']>0) { if(get_aggression() >0){ document.aggression = (get_aggression()*1 + report["aggression"]*1)/2; } else { document.aggression = report["aggression"]*1; } } } } } } } },"json").error(function(){ });//json $.ajaxSetup({async: true}); potential = document.potential; charisma = document.charisma; professionalism = document.professionalism; aggression = document.aggression; document.potential = 0; document.charisma = 0; document.professionalism = 0; document.aggression = 0; return [potential,charisma,professionalism,aggression];//[aggression] ; } document.ti_level = []; document.skillsEvoluidas = []; document.skillsDEvoluidas = []; function get_player_info_graphs(player_id,show_non_pro_graphs){ $.ajaxSetup({async: false}); $.post("https://trophymanager.com/ajax/players_get_info.ajax.php",{"player_id":player_id, "type":"graphs","show_non_pro_graphs":show_non_pro_graphs},function(data){ if(data != null) { //var ti = parseInt(data.graphs.ti[data.graphs.ti.length-1]); document.ti_level = data.graphs.ti; if(data.skillpoints.up.length) { for(var i in data.skillpoints.up) { document.skillsEvoluidas[i] = data.skillpoints.up[i];//global_content[data.skillpoints.up[i]] } } if(data.skillpoints.down.length) { for(var i in data.skillpoints.down) { document.skillsDEvoluidas[i] = data.skillpoints.down[i];//global_content[data.skillpoints.up[i]] } } } },"json").error(function(){ });//json $.ajaxSetup({async: true}); ti_level = document.ti_level; skillsEvoluidas = document.skillsEvoluidas; skillsDEvoluidas = document.skillsDEvoluidas; document.ti_level = []; document.skillsEvoluidas = []; document.skillsDEvoluidas = []; return [ti_level,skillsEvoluidas,skillsDEvoluidas];//[aggression] ; } document.calculateSkillDefPlay = function(positionX, skills) { var totSkill = [0,0,[0, 0, 0],[0,0,0,0,0],[0,0,0,0,0]]; var finReg; var finCab; var finRem; var positionIndex; for (var k=0; k< positionNames.length; k++) { if (positionNames[k] == positionX) { positionIndex = k; } } /* if(positionIndex==undefined){ positionIndex= 13; } */ for (var i=0; i< positions[positionIndex].length; i++) { if (skills[i]>0) { totSkill[0] += skills[i]*document.calculateSkillWeight(positions[positionIndex], weights[positionIndex], i); //totSkill[1] += skills[i]; } } for (var i=0; i< skills.length; i++) { totSkill[1] = totSkill[1]*1 + skills[i]*1; } totSkill[0] = totSkill[0] / 200; if(positionIndex == 13){ totSkill[1] = totSkill[1]*100/220; } else { totSkill[1] = totSkill[1]*100/280; } totSkill[1] = (totSkill[0] - totSkill[1]); totSkill[0] = Math.round(totSkill[0]*1000)/1000; totSkill[1] = Math.round(totSkill[1]*1000)/1000; //set pieces totSkill[2][0] = ((skills[8]*2+skills[13]*2)+skills[9]*1)/5;// corner totSkill[2][1] = ((skills[12]*2+skills[13]*2)+skills[9]*1)/5;// Frk totSkill[2][2] = ((skills[11]*2+skills[13]*2)+skills[9]*1)/5;// pen if(positionIndex != 13){ // is not goalkeeper is defender totSkill[3][0] =(skills[3]*3+skills[6]*3+skills[5]*3+skills[4]*2+skills[2]*2+skills[1]*1)/280; totSkill[3][1] =(skills[2]*3+skills[4]*3+skills[3]*3+skills[6]*2+skills[5]*2+skills[1]*1+skills[0]*1)/300; totSkill[3][2] =(skills[3]*3+skills[6]*3+skills[5]*3+skills[4]*2+skills[2]*2+skills[1]*1)/280; totSkill[3][3] =(skills[3]*3+skills[2]*3+skills[6]*3+skills[5]*3+skills[0]*2+skills[10]*2+skills[4]*2+skills[1]*1)/380; totSkill[3][4] =(skills[2]*3+skills[3]*2+skills[4]*2+skills[6]*1+skills[5]*1+skills[1]*1)/200; totSkill[3][0] = Math.round(totSkill[3][0]*10000)/100; totSkill[3][1] = Math.round(totSkill[3][1]*10000)/100; totSkill[3][2] = Math.round(totSkill[3][2]*10000)/100; totSkill[3][3] = Math.round(totSkill[3][3]*10000)/100; totSkill[3][4] = Math.round(totSkill[3][4]*10000)/100; //calculo de potencial para estilo de jogo totSkill[4][0] = (skills[2]*3+skills[1]*3+skills[7]*3+skills[6]*2+skills[5]*2)/260; totSkill[4][1] = (skills[2]*3+skills[9]*3+skills[8]*3+skills[5]*2+skills[1]*2+skills[0]*1)/280; totSkill[4][2] = (skills[7]*3+skills[9]*3+skills[5]*2+skills[2]*2+skills[6]*2+skills[1]*2)/280; totSkill[4][3] = (skills[7]*3+skills[8]*2+skills[9]*2+skills[6]*1+skills[5]*1+skills[1]*1)/200; totSkill[4][4] = (skills[7]*3+skills[9]*3+skills[8]*3+skills[6]*2+skills[5]*2+skills[7]*2+skills[1]*2)/340; totSkill[4][0] = Math.round(totSkill[4][0]*100); totSkill[4][1] = Math.round(totSkill[4][1]*100); totSkill[4][2] = Math.round(totSkill[4][2]*100); totSkill[4][3] = Math.round(totSkill[4][3]*100); totSkill[4][4] = Math.round(totSkill[4][4]*100); finReg = Math.round((skills[11]*3+skills[9]*3+skills[6]*2+skills[5]*2+skills[0]*1+skills[1]*1+skills[2]*1)/260*100); finCab = Math.round((skills[10]*3+skills[0]*2+skills[6]*2+skills[5]*1+skills[2]*1)/180*100); finRem = Math.round((skills[13]*3+skills[9]*3+skills[11]*2+skills[6]*1+skills[1]*1)/200*100); //calculo de potencial para estilo de finalização if(positionIndex == 12){//F totSkill[4][0] = totSkill[4][0]*0.2 + ((finReg*3+finCab*2+finRem*1)/6)*0.8; totSkill[4][1] = totSkill[4][1]*0.2 + ((finReg*2+finCab*3+finRem*1)/6)*0.8; totSkill[4][2] = totSkill[4][2]*0.2 + ((finReg*3+finCab*1+finRem*2)/6)*0.8; totSkill[4][3] = totSkill[4][3]*0.2 + ((finReg*1+finCab*4+finRem*1)/6)*0.8; totSkill[4][4] = totSkill[4][4]*0.2 + ((finReg*4+finCab*1+finRem*1)/6)*0.8; } if(positionIndex >= 9 && positionIndex <= 11){//MO totSkill[4][0] = totSkill[4][0]*0.45 + ((finReg*3+finCab*2+finRem*1)/6)*0.55; totSkill[4][1] = totSkill[4][1]*0.45 + ((finReg*2+finCab*3+finRem*1)/6)*0.55; totSkill[4][2] = totSkill[4][2]*0.45 + ((finReg*3+finCab*1+finRem*2)/6)*0.55; totSkill[4][3] = totSkill[4][3]*0.45 + ((finReg*1+finCab*4+finRem*1)/6)*0.55; totSkill[4][4] = totSkill[4][4]*0.45 + ((finReg*4+finCab*1+finRem*1)/6)*0.55; } if(positionIndex >= 6 && positionIndex <= 8){//M totSkill[4][0] = totSkill[4][0]*0.55 + ((finReg*3+finCab*2+finRem*1)/6)*0.45; totSkill[4][1] = totSkill[4][1]*0.55 + ((finReg*2+finCab*3+finRem*1)/6)*0.45; totSkill[4][2] = totSkill[4][2]*0.55 + ((finReg*3+finCab*1+finRem*2)/6)*0.45; totSkill[4][3] = totSkill[4][3]*0.55 + ((finReg*1+finCab*4+finRem*1)/6)*0.45; totSkill[4][4] = totSkill[4][4]*0.55 + ((finReg*4+finCab*1+finRem*1)/6)*0.45; } if(positionIndex >= 3 && positionIndex <= 5){//DM totSkill[4][0] = totSkill[4][0]*0.65 + ((finReg*3+finCab*2+finRem*1)/6)*0.35; totSkill[4][1] = totSkill[4][1]*0.65 + ((finReg*2+finCab*3+finRem*1)/6)*0.35; totSkill[4][2] = totSkill[4][2]*0.65 + ((finReg*3+finCab*1+finRem*2)/6)*0.35; totSkill[4][3] = totSkill[4][3]*0.65 + ((finReg*1+finCab*4+finRem*1)/6)*0.35; totSkill[4][4] = totSkill[4][4]*0.65 + ((finReg*4+finCab*1+finRem*1)/6)*0.35; } if(positionIndex <= 2){//D totSkill[4][0] = totSkill[4][0]*0.90 + ((finReg*3+finCab*2+finRem*1)/6)*0.10; totSkill[4][1] = totSkill[4][1]*0.90 + ((finReg*2+finCab*3+finRem*1)/6)*0.10; totSkill[4][2] = totSkill[4][2]*0.90 + ((finReg*3+finCab*1+finRem*2)/6)*0.10; totSkill[4][3] = totSkill[4][3]*0.90 + ((finReg*1+finCab*4+finRem*1)/6)*0.10; totSkill[4][4] = totSkill[4][4]*0.90 + ((finReg*4+finCab*1+finRem*1)/6)*0.10; //para diferentes posições diferentes pesos } totSkill[4][0] = Math.round(totSkill[4][0]*100)/100; totSkill[4][1] = Math.round(totSkill[4][1]*100)/100; totSkill[4][2] = Math.round(totSkill[4][2]*100)/100; totSkill[4][3] = Math.round(totSkill[4][3]*100)/100; totSkill[4][4] = Math.round(totSkill[4][4]*100)/100; } return totSkill; }; var skillArray = []; var SKs = []; var sk1 = ""; var sk2 = ""; var idJogador; var skillArrayAnterior = []; var isDefender ; var strSkill1; var strSkill2; var finReg; var finCab; var finRem; var potencialFuturo; var potencialFuturoAnterior; var skillMaior; var skillMaiorAnterior; var TotalSkillAnterior; var resultadoScouts; var totalSkillP = []; var stringTeste = ""; var global_content_FS = []; var var_DDi_a = 0; var var_DWi_a = 0; var var_DSh_a = 0; var var_DLB_a = 0; var var_DTB_a = 0; var var_PDi_a = 0; var var_PWi_a = 0; var var_PSh_a = 0; var var_PLB_a = 0; var var_PTB_a = 0; var var_DDi_b = 0; var var_DWi_b = 0; var var_DSh_b = 0; var var_DLB_b = 0; var var_DTB_b = 0; var var_PDi_b = 0; var var_PWi_b = 0; var var_PSh_b = 0; var var_PLB_b = 0; var var_PTB_b = 0; /* if(!is_pro){ var arrows = [{}]; } */ for (z=0; z skse2){ players_ar[i][positionNames[k]] = skse1; } else { players_ar[i][positionNames[k]] = skse2; } } players_ar[i][positionNames[k]] = Math.round(players_ar[i][positionNames[k]]*10)/10; if(players_ar[i][positionNames[k]] > bestSKill){ bestSKill = players_ar[i][positionNames[k]]; players_ar[i]["bestSkill"] = bestSKill; } } //#################################################################### var dadosDeJogador = get_player_info_history(players_ar[i]["id"],show_non_pro_graphs); var dadosActuaisJogador = dadosDeJogador[0]; var dadosTotaisJogador = dadosDeJogador[1]; players_ar[i]["last_games"] = isNaNVer(dadosActuaisJogador["games"]); players_ar[i]["last_goals"] = isNaNVer(dadosActuaisJogador["goals"]); players_ar[i]["last_goals_per_games"] = isNaNVer(Math.round(players_ar[i]["last_goals"] / players_ar[i]["last_games"]*100)/100); players_ar[i]["last_conceded"] = isNaNVer(dadosActuaisJogador["conceded"]); players_ar[i]["last_conceded_per_games"] = isNaNVer(Math.round(players_ar[i]["last_conceded"] / players_ar[i]["last_games"]*100)/100); players_ar[i]["last_assists"] = isNaNVer(dadosActuaisJogador["assists"]); players_ar[i]["last_assists_per_games"] = isNaNVer(Math.round(players_ar[i]["last_assists"] / players_ar[i]["last_games"]*100)/100); players_ar[i]["last_cards"] = isNaNVer(dadosActuaisJogador["cards"]); players_ar[i]["last_cards_per_games"] = isNaNVer(Math.round(players_ar[i]["last_cards"] / players_ar[i]["last_games"]*100)/100); players_ar[i]["last_rating"] = isNaNVer(dadosActuaisJogador["rating"]); players_ar[i]["last_productivity"] = isNaNVer(dadosActuaisJogador["productivity"]); players_ar[i]["last_productivity_per_games"] = isNaNVer(Math.round(players_ar[i]["last_productivity"] / players_ar[i]["last_games"]*100)/100); players_ar[i]["last_rating_avg"] = isNaNVer(dadosActuaisJogador["rating_avg"]); //DADOS TOTAIS players_ar[i]["total_games"] = isNaNVer(dadosTotaisJogador["games"]); players_ar[i]["total_goals"] = isNaNVer(dadosTotaisJogador["goals"]); players_ar[i]["total_goals_per_games"] = isNaNVer(Math.round(players_ar[i]["total_goals"] / players_ar[i]["total_games"]*100)/100); players_ar[i]["total_assists"] = isNaNVer(dadosTotaisJogador["assists"]); players_ar[i]["total_assists_per_games"] = isNaNVer(Math.round(players_ar[i]["total_assists"] / players_ar[i]["total_games"]*100)/100); players_ar[i]["total_productivity"] = isNaNVer(dadosTotaisJogador["productivity"]); players_ar[i]["total_productivity_per_games"] = isNaNVer(Math.round(players_ar[i]["total_productivity"] / players_ar[i]["total_games"]*100)/100); players_ar[i]["total_conceded"] = isNaNVer(dadosTotaisJogador["conceded"]); players_ar[i]["total_conceded_per_games"] = isNaNVer(Math.round(players_ar[i]["total_conceded"] / players_ar[i]["total_games"]*100)/100); players_ar[i]["total_cards"] = isNaNVer(dadosTotaisJogador["cards"]); players_ar[i]["total_cards_per_games"] = isNaNVer(Math.round(players_ar[i]["total_cards"] / players_ar[i]["total_games"]*100)/100); players_ar[i]["total_rating"] = isNaNVer(dadosTotaisJogador["rating"]); players_ar[i]["total_rating_avg"] = isNaNVer(dadosTotaisJogador["rating_avg"]); players_ar[i]["name"] =players_ar[i]["name"] + dadosTotaisJogador["transfer"]; //#################################################################### if(players_ar[i].SK1 >= players_ar[i].SK2){ skillMaior = players_ar[i].SK1; } else { skillMaior = players_ar[i].SK2; } if(players_ar[i]["fp"] !="GK"){ potencialFuturo = skillMaior - ((players_ar[i].totalSkill*100)/280); } else { potencialFuturo = skillMaior - ((players_ar[i].totalSkill*100)/220); } if(potencialFuturo != 0){ players_ar[i].growOK = Math.round(potencialFuturo*10)/10; } else { players_ar[i].growOK = 0; } if(players_ar[i].potential != ""){ players_ar[i].potGok = Math.round((((players_ar[i].potential)+(players_ar[i].growOK/4))/2)*10)/10; } else { players_ar[i].potGok = ""; } idJogador = players_ar[i]["id"]; var tactics_init_reserves_var = tactics_init_reserves(idJogador); var tactics_init_national_var = tactics_init_national(idJogador); if(SESSION["b_team"] == players_ar[i]["club"]){ //equipa reservas players_ar[i]["on_field"] = tactics_init_reserves_var[0]; players_ar[i]["on_field_playing_b"] = tactics_init_reserves_var[1]; } else {// equipa principal players_ar[i]["on_field"] = tactics_init_national_var[0]; players_ar[i]["on_field_playing_a"] = tactics_init_national_var[1]; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(!is_pro){ players_ar[i]["plot"] = get_player_info_graphs(idJogador,show_non_pro_graphs)[0]; players_ar[i]["ti"] = isNaNVer(players_ar[i]["plot"][players_ar[i]["plot"].length-1]); players_ar[i]["ti_dif"] = isNaNVer(players_ar[i]["ti"]-players_ar[i]["plot"][players_ar[i]["plot"].length-2]); /* if(!players_by_id[players_ar[i]["id"]]) players_by_id[players_ar[i]["id"]] = {}; players_by_id[players_ar[i]["id"]]["plot"] = players_ar[i]["plot"]; */ if(players_ar[i]["fp"] !="GK"){ arrows[idJogador]= {"raise":[0,0,0,0,0,0,0,0,0,0,0,0,0,0]}; }else { arrows[idJogador] = {"raise":[0,0,0,0,0,0,0,0,0,0,0]}; } arrows[idJogador].ti=players_ar[i]["ti"] ; arrows[idJogador].ti_shift=players_ar[i]["ti_dif"] ; var get_player_info_graphs_var = get_player_info_graphs(idJogador,show_non_pro_graphs)[1]; var get_player_info_graphs_varD = get_player_info_graphs(idJogador,show_non_pro_graphs)[2]; for (var lu=0; lu< get_player_info_graphs_var.length || lu = players_ar[i].SK2){ totalSkillP = document.calculateSkillDefPlay(strSkill1, skillArray); } else if (players_ar[i].SK1 < players_ar[i].SK2){ totalSkillP = document.calculateSkillDefPlay(strSkill2, skillArray); } players_ar[i].cantos = totalSkillP[2][0];//(players_ar[i]["set"] * 2 + players_ar[i]["cro"] * 2 + players_ar[i]["tec"]) / 5; players_ar[i].livres = totalSkillP[2][1];//(players_ar[i]["set"] * 2 + players_ar[i]["lon"] * 2 + players_ar[i]["tec"]) / 5; players_ar[i].penaltis = totalSkillP[2][2];//(players_ar[i]["set"] * 2 + players_ar[i]["fin"] * 2 + players_ar[i]["tec"]) / 5; players_ar[i].DDi = totalSkillP[3][0]; players_ar[i].DWi = totalSkillP[3][1]; players_ar[i].DSh = totalSkillP[3][2]; players_ar[i].DLB = totalSkillP[3][3]; players_ar[i].DTB = totalSkillP[3][4]; players_ar[i].PDi = totalSkillP[4][0]; players_ar[i].PWi = totalSkillP[4][1]; players_ar[i].PSh = totalSkillP[4][2]; players_ar[i].PLB = totalSkillP[4][3]; players_ar[i].PTB = totalSkillP[4][4]; //###############$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ if(players_ar[i]["on_field_playing_a"] == true && players_ar[i]["fp"] !="GK"){ var_DDi_a = var_DDi_a + players_ar[i].DDi; var_DWi_a = var_DWi_a + players_ar[i].DWi; var_DSh_a = var_DSh_a + players_ar[i].DSh; var_DLB_a = var_DLB_a + players_ar[i].DLB; var_DTB_a = var_DTB_a + players_ar[i].DTB; var_PDi_a = var_PDi_a + players_ar[i].PDi; var_PWi_a = var_PWi_a + players_ar[i].PWi; var_PSh_a = var_PSh_a + players_ar[i].PSh; var_PLB_a = var_PLB_a + players_ar[i].PLB; var_PTB_a = var_PTB_a + players_ar[i].PTB; } if(players_ar[i]["on_field_playing_b"] == true && players_ar[i]["fp"] !="GK"){ var_DDi_b = var_DDi_b + players_ar[i].DDi; var_DWi_b = var_DWi_b + players_ar[i].DWi; var_DSh_b = var_DSh_b + players_ar[i].DSh; var_DLB_b = var_DLB_b + players_ar[i].DLB; var_DTB_b = var_DTB_b + players_ar[i].DTB; var_PDi_b = var_PDi_b + players_ar[i].PDi; var_PWi_b = var_PWi_b + players_ar[i].PWi; var_PSh_b = var_PSh_b + players_ar[i].PSh; var_PLB_b = var_PLB_b + players_ar[i].PLB; var_PTB_b = var_PTB_b + players_ar[i].PTB; } if(is_pro || true){ //is_pro if(undefined == arrows[idJogador]){ players_ar[i].SK1ant = 0; players_ar[i].SK2ant = 0; players_ar[i].growOfGok = 0; } else { skillArrayAnterior = arrows[idJogador]["raise"].slice(); skillArrayAnteriorPerda = arrows[idJogador]["raise"].slice(); TotalSkillAnterior = 0; for (entry=0; entry= players_ar[i].SK2 - players_ar[i].SK2ant){ skillMaiorAnterior = players_ar[i].SK1 - players_ar[i].SK1ant; } else { skillMaiorAnterior = players_ar[i].SK2 - players_ar[i].SK2ant; } if(players_ar[i]["fp"] !="GK"){ potencialFuturoAnterior = skillMaiorAnterior - (((players_ar[i].totalSkill-TotalSkillAnterior)*100)/280); } else { potencialFuturoAnterior = skillMaiorAnterior - (((players_ar[i].totalSkill-TotalSkillAnterior)*100)/220); } if(potencialFuturoAnterior != 0){ players_ar[i].growOKAnterior = potencialFuturoAnterior; players_ar[i].growOfGok = Math.round((players_ar[i].growOK - players_ar[i].growOKAnterior)*10)/10; // } else { players_ar[i].growOfGok = players_ar[i].growOK - 0; } } /* if(arrows[idJogador].ti < 0){ players_ar[i].SK1ant = players_ar[i].SK1ant * -1; players_ar[i].SK2ant = players_ar[i].SK2ant * -1; players_ar[i].growOfGok = players_ar[i].growOfGok * -1; } */ } } //show_scoutskills var_DDi_a = Math.round(var_DDi_a / 11*100)/100; var_DWi_a = Math.round(var_DWi_a / 11*100)/100; var_DSh_a = Math.round(var_DSh_a / 11*100)/100; var_DLB_a = Math.round(var_DLB_a / 11*100)/100; var_DTB_a = Math.round(var_DTB_a / 11*100)/100; var_PDi_a = Math.round(var_PDi_a / 11*100)/100; var_PWi_a = Math.round(var_PWi_a / 11*100)/100; var_PSh_a = Math.round(var_PSh_a / 11*100)/100; var_PLB_a = Math.round(var_PLB_a / 11*100)/100; var_PTB_a = Math.round(var_PTB_a / 11*100)/100; var_DDi_b = Math.round(var_DDi_b / 11*100)/100; var_DWi_b = Math.round(var_DWi_b / 11*100)/100; var_DSh_b = Math.round(var_DSh_b / 11*100)/100; var_DLB_b = Math.round(var_DLB_b / 11*100)/100; var_DTB_b = Math.round(var_DTB_b / 11*100)/100; var_PDi_b = Math.round(var_PDi_b / 11*100)/100; var_PWi_b = Math.round(var_PWi_b / 11*100)/100; var_PSh_b = Math.round(var_PSh_b / 11*100)/100; var_PLB_b = Math.round(var_PLB_b / 11*100)/100; var_PTB_b = Math.round(var_PTB_b / 11*100)/100; function construct_tr(ply_ar, count, mode) { var myRow = myTable.insertRow(-1); var training_count=0; function construct_cell(assoc) { var myCell = myRow.insertCell(-1); if (assoc != undefined) { var assocs_to_star = ["str","sta","pac","mar","tac","wor","pos","pas","cro","tec","hea","fin","lon","set","han","one","ref","ari","jum","com","kic","thr"]; if (headers_ar[assoc]["style"]) { myCell.className = headers_ar[assoc]["style"]; } if (assoc == "name") { /* var ban = ""; if (ply_ar["ban"].indexOf("r") == 0) { ban += ""+ply_ar["ban"].substr(1); } else if (ply_ar["ban"] == "g") { ban += ""; } if(ply_ar["inj"]) { ban += ""+ply_ar["inj"]; } */ var tmp = "
"; tmp += " "+get_player_link({"player":{"id":ply_ar["id"],"name":ply_ar["name"]},"auto_tooltip":true,"class":"normal"}); // tmp += " "+ban; if(ply_ar["status"]) tmp += " "+ply_ar["status"]; if (ply_ar["retire"] == true) { tmp += ""; } if (ply_ar["banned_club"]) { tmp += " "; } if(ply_ar["country"] != SESSION["country"] && this_page != "shortlist" && this_page != "nt_shortlist") { tmp += " "+get_flag(ply_ar["country"]); } if(ply_ar["reserve_team"]){ tmp += ' B'; } tmp +="
"; myCell.innerHTML = tmp; $(myCell).addClass("text_fade"); if (ply_ar['txt'] != "") { var tmp = $(" ").tooltip(global_content[450]+"
"+ply_ar['txt']); } else { var tmp = " "; } $(myCell).find(".name").prepend(tmp); } else if (assoc == "country") { $(myCell).html(get_flag(ply_ar["nat"])); } else if (assoc == "fp") { myCell.innerHTML = "
"+retColorPos(ply_ar["fp"])+"
"; } else if (assoc == "scout") { var url = get_player_link({"player":{"id":ply_ar["id"],"name":ply_ar["name"]},"only_url":true}); $(myCell).html(make_button("", "href:"+url+"#scout","small_button")); } else if (assoc == "rec") { $(myCell).addClass("align_center").html("
"+rec_format(ply_ar["rec"])+"
"); } else if (assocs_to_star.indexOf(assoc) >= 0) { if (ply_ar[assoc] == 20) { myCell.innerHTML = ""; } else if (ply_ar[assoc] == 19) { myCell.innerHTML = ""; } else if (ply_ar[assoc] == 0 && !show_training) { myCell.style.color = "#AAAAAA"; myCell.innerHTML = "-"; } else if (ply_ar[assoc] < 6 && !show_training) { myCell.style.color = "#AAAAAA"; myCell.innerHTML = ply_ar[assoc]; } else { myCell.innerHTML = ply_ar[assoc]; } $(myCell).html("
"+$(myCell).html()+"
").addClass("skill"); if(show_training) { var $skill = $(myCell).find(".skill").addClass("training subtle"); if(arrows[ply_ar.id]) { var t = arrows[ply_ar.id].raise[training_count]; if(t == 2) $skill.addClass("one_up").removeClass("subtle"); else if(t == 1) $skill.addClass("part_up").removeClass("subtle"); else if(t == -1) $skill.addClass("part_down").removeClass("subtle"); else if(t == -2) $skill.addClass("one_down").removeClass("subtle"); training_count++; // if(ply_ar["fp"] == "GK" && training_count==3) training_count=14; } } } else if (assoc == "asi" || assoc == "wage") { myCell.innerHTML = "
"+addCommas(ply_ar[assoc])+"
"; } else if (assoc == "rat") { myCell.innerHTML = ply_ar[assoc].toFixed(2); } else if (assoc == "no") { $(myCell).addClass("minishirt small").html(""+ply_ar[assoc]+""); } else if (assoc == "timeleft"){ ply_ar["timeleft_string"] = ply_ar["timeleft_string"] || ""; $(myCell).html("
"+ply_ar["timeleft_string"].replace("d",global_content["days_abbr"]).replace("h",global_content["hours_abbr"]).replace("m",global_content["minutes_abbr"])+"
").attr("sort",ply_ar["timeleft"]); } else if (assoc == "delete"){ $(myCell).html(make_button("","remove_short_list_player("+ply_ar["id"]+",remove_player_from_list)","small_button")); } else if (assoc == "bid"){ if(ply_ar["bid"] == 0) { $(myCell).html(make_button("","pop_transfer_bid('"+number_format(ply_ar["next_bid"])+"',"+isPro+",'"+ply_ar["id"]+"','"+ply_ar["name_js"]+"')","small_button")); } else if(ply_ar["bid"] == 1) { // green $(myCell).html(''); } else if(ply_ar["bid"] == 2) { // yellow $(myCell).html(''); } else if(ply_ar["bid"] == 3) { // red $(myCell).html(''); } } else if(assoc== "bteam"){ if(SESSION["b_team"] > 0) { if(ply_ar["reserve_team"]) { $(myCell).html(make_button("","promote_player("+ply_ar["id"]+")","small_button")); } else { $(myCell).html(make_button("","demote_player("+ply_ar["id"]+")","small_button")); } } } else if(assoc=="ti") { if(arrows[ply_ar.id]) { $(myCell).html(arrows[ply_ar.id].ti); } else $(myCell).html("-"); } else if(assoc=="ti_dif") { if(arrows[ply_ar.id]) { $(myCell).html(arrows[ply_ar.id].ti_shift); } else $(myCell).html("-"); } else if(assoc=="age") { if(show_training) myCell.innerHTML = ply_ar[assoc]; else myCell.innerHTML = ply_ar[assoc].split(".")[0]; } else { myCell.innerHTML = ply_ar[assoc]; } } else { myCell.innerHTML = "-"; } } for (var i=0; iSuper Squad Toogle: "; var togscoutskills = new_toogle_button("toggle_scoutskills", "Scout-Skills"); $e("filters").innerHTML = $e("filters").innerHTML + togscoutskills; var togSetPie = new_toogle_button("toggle_setpieces", "Set-Pieces"); $e("filters").innerHTML = $e("filters").innerHTML + togSetPie; var togConvocados = new_toogle_button("toggle_convocados", "On-Squad"); $e("filters").innerHTML = $e("filters").innerHTML + togConvocados; var togPosicoes = new_toogle_button("toggle_posicoes", "Skills in Positions"); $e("filters").innerHTML = $e("filters").innerHTML + togPosicoes; var togFieldperformance = new_toogle_button("toggle_fieldperformance", "Field Play Skills"); $e("filters").innerHTML = $e("filters").innerHTML + togFieldperformance; var toglast_data = new_toogle_button("toggle_last_data", "Season Player Data"); $e("filters").innerHTML = $e("filters").innerHTML + toglast_data; var togtotal_data = new_toogle_button("toggle_total_data", "Total Player Data"); $e("filters").innerHTML = $e("filters").innerHTML + togtotal_data; $e("filters").innerHTML = $e("filters").innerHTML + ""; //#######ACTUAL FORMATION DETAILS A################### var togteamA_det = new_toogle_button("toggle_teamA_det", "(Show Team A formation details - OnRefresh)"); $e("filters").innerHTML = $e("filters").innerHTML + "
Formation details Team-A:"+togteamA_det+"
"; if(document.show_teamA_det){ $e("filters").innerHTML = $e("filters").innerHTML + "Defensive:"; $e("filters").innerHTML = $e("filters").innerHTML + " DDi:"+ var_DDi_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DWi:"+ var_DWi_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DSh:"+ var_DSh_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DLB:"+ var_DLB_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DTB:"+ var_DTB_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "
Playing:     "; $e("filters").innerHTML = $e("filters").innerHTML + " PDi:"+ var_PDi_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PWi:"+ var_PWi_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PSh:"+ var_PSh_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PLB:"+ var_PLB_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PTB:"+ var_PTB_a +" "; $e("filters").innerHTML = $e("filters").innerHTML + "
"; } else { $e("filters").innerHTML = $e("filters").innerHTML + ""; } //#######ACTUAL FORMATION DETAILS B################### var togteamB_det = new_toogle_button("toggle_teamB_det", "(Show Team B formation details - OnRefresh)"); $e("filters").innerHTML = $e("filters").innerHTML + "
Formation details Team-B:"+togteamB_det +"
"; if(document.show_teamB_det){ $e("filters").innerHTML = $e("filters").innerHTML + "Defensive:"; $e("filters").innerHTML = $e("filters").innerHTML + " DDi:"+ var_DDi_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DWi:"+ var_DWi_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DSh:"+ var_DSh_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DLB:"+ var_DLB_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "DTB:"+ var_DTB_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "
Playing:     "; $e("filters").innerHTML = $e("filters").innerHTML + " PDi:"+ var_PDi_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PWi:"+ var_PWi_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PSh:"+ var_PSh_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PLB:"+ var_PLB_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "PTB:"+ var_PTB_b +" "; $e("filters").innerHTML = $e("filters").innerHTML + "
"; } else { $e("filters").innerHTML = $e("filters").innerHTML + ""; } //$e("filters").innerHTML = $e("filters").innerHTML + stringTeste; function new_toogle_button(classButton, textButton){ return "    "+textButton+" "; } $('#select_age_max').attr('disabled', false); $('#select_age_min').attr('disabled', false); $('#filters').attr('tooltip', ''); $('#filters').attr('onclick', '#'); //$('.training_toggle').attr('onclick', 'toggle_training()'); if(!is_pro){ $(".training_toggle").click(function(){ toggle_training(); }); } function filter_available(i) { if(!document.show_convocados && players_ar[i]["on_field"]) return false; return true; } /* headers_ar = { "no" : { "header":"#", "title":"Numero", "style": "border", "width": "30px"}, "name" : { "header":"Nome", "title":"", "style": "left name", "width": "50px"}, "fp" : { "header":"Pf", "title":"Posicao Favorita", "style": "position", "width": "56px"}, "age" : { "header":"Idade", "title":"", "style": "", "width": "30px"}, "rec" : { "header":"Ava", "title":"Avaliacao", "style": "rec", "width": "100px"}, "asi" : { "header":"ASI", "title":"ASI", "style": "asi", "width": "82px"}, "wage" : { "header":"Salary", "title":"Weekly Salary", "style": "asi", "width": "82px"}, "SK1" : { "header":"SK1", "title":"SK1", "style": "sk", "width": "82px"}, "SK2" : { "header":"SK2", "title":"SK2", "style": "sk", "width": "82px"}, "SK1ant" : { "header":"+SK1", "title":"Incresed SK1", "style": "sk", "width": "82px"}, "SK2ant" : { "header":"+SK2", "title":"Incresed SK2", "style": "sk", "width": "82px"}, "routine" : { "header":"Rou", "title":"Routine", "style": "sk", "width": "82px"}, "str" : { "header":"For", "title":"Forca", "style": "skill"}, "sta" : { "header":"Res", "title":"Resistencia", "style": "skill"}, "pac" : { "header":"Vel", "title":"Velocidade", "style": "border skill"}, "mar" : { "header":"Mar", "title":"Marcacao", "style": "skill"}, "tac" : { "header":"Des", "title":"Desarme", "style": "border skill"}, "wor" : { "header":"TrE", "title":"Trabalho de Equipa", "style": "skill"}, "pos" : { "header":"Pos", "title":"Posicionamento", "style": "skill"}, "pas" : { "header":"Pas", "title":"Passe", "style": "skill"}, "cro" : { "header":"Cru", "title":"Cruzamentos", "style": "skill"}, "tec" : { "header":"Tec", "title":"Tecnica", "style": "border skill"}, "hea" : { "header":"Cab", "title":"Cabeceamento", "style": "skill"}, "fin" : { "header":"Fin", "title":"Finalizacao", "style": "skill"}, "lon" : { "header":"RmL", "title":"Remates de Longe", "style": "border skill"}, "set" : { "header":"BP", "title":"Bolas Paradas", "style": "border skill"}, "cantos" : { "header":"Cor", "title":"Corner Kicks", "style": "skill"}, "livres" : { "header":"FrK", "title":"Free Kicks", "style": "skill"}, "penaltis" : { "header":"Pen", "title":"Penalty Kicks", "style": "skill"}, "han" : { "header":"Enc", "title":"Encaixe", "style": "skill"}, "one" : { "header":"Um", "title":"Saidas de Baliza", "style": "skill"}, "ref" : { "header":"Ref", "title":"Reflexos", "style": "skill"}, "ari" : { "header":"Aer", "title":"Capacidade A?a", "style": "skill"}, "jum" : { "header":"Sal", "title":"Salto", "style": "skill"}, "com" : { "header":"Com", "title":"Comunicacao", "style": "skill"}, "kic" : { "header":"Pon", "title":"Pontape", "style": "skill"}, "thr" : { "header":"Rep", "title":"Reposicao", "style": "skill"}, "ti" : { "header":"Intensidade", "title":"A intensidade com que o jogador treinou com um TI de 10 equivale a um total de 1 ponto ganho em determinada habilidade", "style": "skill"}, "ti_dif" : { "header":"+/-", "title":"A mudanca na intensidade de treino comparativamente com a semana anterior", "style": "skill"}, "bteam" : { "header":"", "title":"Promote/Demote", "style": ""} }; */ headers_ar.wage = { "header":"Salary", "title":"Weekly Salary", "style": "asi", "width": "82px"}; headers_ar.SK1 = { "header":"SK1", "title":"SK1", "style": "skill", "width": "82px"}; headers_ar.SK2 = { "header":"SK2", "title":"SK2", "style": "skill", "width": "82px"}; headers_ar.SK1ant = { "header":"+SK1", "title":"Incresed SK1", "style": "sk", "width": "82px"}; headers_ar.SK2ant = { "header":"+SK2", "title":"Incresed SK2", "style": "sk", "width": "82px"}; headers_ar.routine = { "header":"Rou", "title":"Routine", "style": "border skill", "width": "82px"}; headers_ar.cantos = { "header":"Cor", "title":"Corner Kicks", "style": "skill"}; headers_ar.livres = { "header":"FrK", "title":"Free Kicks", "style": "skill"}; headers_ar.penaltis = { "header":"Pen", "title":"Penalty Kicks", "style": "border skill"}; headers_ar.DDi = { "header":"DDir", "title":"Direct - Defending against (0-100%)", "style": "skillspat"}; headers_ar.DWi = { "header":"DWin", "title":"Wings - Defending against (0-100%)", "style": "skillspat"}; headers_ar.DSh = { "header":"DSho", "title":"Shortpassing - Defending against (0-100%)", "style": "skillspat"}; headers_ar.DLB = { "header":"DLoB", "title":"Long Balls - Defending against (0-100%)", "style": "skillspat"}; headers_ar.DTB = { "header":"DThB", "title":"Through Balls - Defending against (0-100%)", "style": "border skillspat"}; headers_ar.PDi = { "header":"PDir", "title":"Direct - Playing in (0-100%)", "style": "skillspat"}; headers_ar.PWi = { "header":"PWin", "title":"Wings - Playing in (0-100%)", "style": "skillspat"}; headers_ar.PSh = { "header":"PSho", "title":"Shortpassing - Playing in (0-100%)", "style": "skillspat"}; headers_ar.PLB = { "header":"PLoB", "title":"Long Balls - Playing in (0-100%)", "style": "skillspat"}; headers_ar.PTB = { "header":"PThB", "title":"Through Balls - Playing in (0-100%)", "style": "border skillspat"}; headers_ar.growOK = { "header":"Gok", "title":"How good is the skills placement for development!", "style": "skill"}; headers_ar.growOfGok = { "header":"+Gok", "title":"Increse of Gok in last training!", "style": "sk"}; headers_ar.potential = { "header":"Pot", "title":"Player Potential. (0-5) [Send Scout]", "style": "skill"}; headers_ar.charisma = { "header":"Cha", "title":"Player Charisma. (0-20) [Send Scout]", "style": "skill"}; headers_ar.professionalism = { "header":"Pro", "title":"Player Professionalism. (0-20) [Send Scout OR use PRO]", "style": "skill"}; headers_ar.aggression = { "header":"Agg", "title":"Player Aggression. (0-20) [Send Scout OR use PRO]", "style": "skill"}; headers_ar.injury = { "header":"Inj", "title":"Player Injury Capacity. (0-20) [Only using PRO]", "style": "skill"}; headers_ar.Adp = { "header":"Adp", "title":"Player Adaptability Capacity. (0-20) [Only using PRO]", "style": "skill"}; headers_ar.captain = { "header":"Cap", "title":"Game Captain. >+[Send Scout]", "style": "skill"}; headers_ar.potGok = { "header":"PoG", "title":"Player potencial taking in acount Pot&Gok! (0-5) [Send Scout]", "style": "skill"}; headers_ar.last_games = { "header":"Games", "title":"This season amount of games played", "style": "asi"}; headers_ar.last_goals = { "header":"Goals", "title":"This season amount of goals scored", "style": "asi"}; headers_ar.last_goals_per_games = { "header":"Goa/Ga", "title":"This season amount of goals scored per game", "style": "asi"}; headers_ar.last_conceded = { "header":"Conc", "title":"This season amount of goals conceded", "style": "asi"}; headers_ar.last_conceded_per_games = { "header":"Con/Ga", "title":"This season amount of goals conceded per game", "style": "asi"}; headers_ar.last_assists = { "header":"Assists", "title":"This season amount of assists", "style": "asi"}; headers_ar.last_assists_per_games = { "header":"Ass/Ga", "title":"This season amount of assists per game", "style": "asi"}; headers_ar.last_cards = { "header":"Cards", "title":"This season amount of cards received", "style": "asi"}; headers_ar.last_cards_per_games = { "header":"Car/Ga", "title":"This season amount of cards received per game", "style": "asi"}; headers_ar.last_productivity = { "header":"Prod", "title":"This season productivity", "style": "asi"}; headers_ar.last_productivity_per_games = { "header":"Pro/Ga", "title":"This season productivity per game", "style": "asi"}; headers_ar.last_rating_avg = { "header":"Rating", "title":"This season Rating", "style": "asi"}; headers_ar.total_games = { "header":"Games", "title":"Total amount of games played", "style": "asi"}; headers_ar.total_goals = { "header":"Goals", "title":"Total amount of goals scored", "style": "asi"}; headers_ar.total_goals_per_games = { "header":"Goa/Ga", "title":"Total amount of goals scored per game", "style": "asi"}; headers_ar.total_conceded = { "header":"Conc", "title":"Total amount of goals conceded", "style": "asi"}; headers_ar.total_conceded_per_games = { "header":"Con/Ga", "title":"Total amount of goals conceded per game", "style": "asi"}; headers_ar.total_assists = { "header":"Assists", "title":"Total amount of assists", "style": "asi"}; headers_ar.total_assists_per_games = { "header":"Ass/Ga", "title":"Total amount of assists per game", "style": "asi"}; headers_ar.total_cards = { "header":"Cards", "title":"Total amount of cards received", "style": "asi"}; headers_ar.total_cards_per_games = { "header":"Car/Ga", "title":"Total amount of cards received per game", "style": "asi"}; headers_ar.total_productivity = { "header":"Prod", "title":"Total productivity", "style": "asi"}; headers_ar.total_productivity_per_games = { "header":"Pro/Ga", "title":"Total productivity per game", "style": "asi"}; headers_ar.total_rating_avg = { "header":"Rating", "title":"Total Career Rating", "style": "asi"}; headers_ar.bestSkill = { "header":"B/sk", "title":"Best skill value", "style": "asi"}; //"last_games","last_conceded","last_conceded_per_games","last_goals","last_goals_per_games","last_assists","last_assists_per_games","last_cards","last_cards_per_games","last_productivity","last_productivity_per_games","last_rating_avg", //"total_games","total_conceded","total_conceded_per_games","total_goals","total_goals_per_games","total_assists","total_assists_per_games","total_cards","total_cards_per_games","total_productivity","total_productivity_per_games","total_rating_avg", for (var k=0; k< positionNames.length; k++) { headers_ar[positionNames[k]]= { "header":positionNames[k], "title":"Skill in " + positionNames[k], "style": "killspat"}; } function addNewStyle(newStyle) { var styleElement = document.getElementById('styles_js'); if (!styleElement) { styleElement = document.createElement('style'); styleElement.type = 'text/css'; styleElement.id = 'styles_js'; document.getElementsByTagName('head')[0].appendChild(styleElement); } styleElement.appendChild(document.createTextNode(newStyle)); } addNewStyle('.name {width:150px !important;}'); addNewStyle('.rec {width:70px !important;}'); addNewStyle('.position {width:45px !important;}'); addNewStyle('.skill {width:19px !important;}'); addNewStyle('.sk {width:30px !important;}'); addNewStyle('.asi {width:45px !important;}'); addNewStyle('.skillspat {width:35px !important;}'); makeTable = function() { if(document.show_teamA_det) $("img.toggle_teamA_det").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_teamA_det").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_teamB_det) $("img.toggle_teamB_det").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_teamB_det").attr("src","/pics/sort_btn_gray_off.gif"); if(show_training) $("img.training_toggle").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.training_toggle").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_setpieces) $("img.toggle_setpieces").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_setpieces").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_scoutskills) $("img.toggle_scoutskills").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_scoutskills").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_convocados) $("img.toggle_convocados").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_convocados").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_posicoes) $("img.toggle_posicoes").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_posicoes").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_fieldperformance) $("img.toggle_fieldperformance").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_fieldperformance").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_last_data) $("img.toggle_last_data").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_last_data").attr("src","/pics/sort_btn_gray_off.gif"); if(document.show_total_data) $("img.toggle_total_data").attr("src","/pics/sort_btn_gray_on.gif"); else $("img.toggle_total_data").attr("src","/pics/sort_btn_gray_off.gif"); if(show_training){ ths = ["no","name","age","fp","str","sta","pac","mar","tac","wor","pos","pas","cro","tec","hea","fin","lon","set","ti","ti_dif","growOK","growOfGok","SK1","SK1ant","SK2","SK2ant","asi","wage","bteam"]; gk_ths = ["no","name","age","fp","str","sta","pac","han","one","ref","ari","jum","com","kic","thr",,,,"ti","ti_dif","growOK","growOfGok","SK1","SK1ant","SK2","SK2ant","asi","wage","bteam"]; } else if(document.show_last_data){ //"last_games","last_conceded","last_conceded_per_games","last_goals","last_goals_per_games","last_assists","last_assists_per_games","last_cards","last_cards_per_games","last_productivity","last_productivity_per_games","last_rating_avg", ths = ["no","name","age","fp","last_games","last_conceded","last_conceded_per_games","last_goals","last_goals_per_games","last_assists","last_assists_per_games","last_cards","last_cards_per_games","last_productivity","last_productivity_per_games","last_rating_avg","routine","SK1","SK2","bteam"]; gk_ths = ["no","name","age","fp","last_games","last_conceded","last_conceded_per_games","last_goals","last_goals_per_games","last_assists","last_assists_per_games","last_cards","last_cards_per_games","last_productivity","last_productivity_per_games","last_rating_avg","routine","SK1","SK2","bteam"]; } else if(document.show_total_data){ //"total_games","total_conceded","total_conceded_per_games","total_goals","total_goals_per_games","total_assists","total_assists_per_games","total_cards","total_cards_per_games","total_productivity","total_productivity_per_games","total_rating_avg", ths = ["no","name","age","fp","total_games","total_conceded","total_conceded_per_games","total_goals","total_goals_per_games","total_assists","total_assists_per_games","total_cards","total_cards_per_games","total_productivity","total_productivity_per_games","total_rating_avg","routine","SK1","SK2","bteam"]; gk_ths = ["no","name","age","fp","total_games","total_conceded","total_conceded_per_games","total_goals","total_goals_per_games","total_assists","total_assists_per_games","total_cards","total_cards_per_games","total_productivity","total_productivity_per_games","total_rating_avg","routine","SK1","SK2","bteam"]; } else if(document.show_posicoes){ ths = ["no","name","age","fp","D C", "D L", "D R", "DM C", "DM L", "DM R", "M C", "M L", "M R", "OM C", "OM L", "OM R", "F","bestSkill","asi","rec","bteam"]; gk_ths = ["no","name","age","fp",, , , , , , , , , , , , , "GK","asi","rec","bteam"]; } else if(document.show_fieldperformance){ ths = ["no","name","age","fp","DDi","DWi","DSh","DLB","DTB","PDi","PWi","PSh","PLB","PTB","routine","SK1","SK2","asi","rec","bteam"]; gk_ths = ["no","name","age","fp",,,,,,,,,,,"routine","SK1","SK2","asi","rec","bteam"]; }else { if(!document.show_setpieces){ if(document.show_scoutskills){ ths = ["no","name","age","fp","str","sta","pac","mar","tac","wor","pos","pas","cro","tec","hea","fin","lon","set","potential","Adp","injury","charisma","professionalism","aggression","routine","captain","growOK","potGok","SK1","SK2","bteam"]; //,"wage" ||||| gk_ths = ["no","name","age","fp","str","sta","pac","han","one","ref","ari","jum","com","kic","thr",,,,"potential","Adp","injury","charisma","professionalism","aggression","routine","captain","growOK","potGok","SK1","SK2","bteam"]; //,"wage"||||| } else { ths = ["no","name","age","fp","str","sta","pac","mar","tac","wor","pos","pas","cro","tec","hea","fin","lon","set","routine","growOK","SK1","SK2","wage","asi","rec","bteam"]; // ||||| gk_ths = ["no","name","age","fp","str","sta","pac","han","one","ref","ari","jum","com","kic","thr",,,,"routine","growOK","SK1","SK2","wage","asi","rec","bteam"]; //||||| } } else { if(document.show_scoutskills){ ths = ["no","name","age","fp","str","sta","pac","mar","tac","wor","pos","pas","cro","tec","hea","fin","lon","set","cantos","livres","penaltis","potential","Adp","injury","charisma","professionalism","aggression","routine","captain","growOK","potGok","SK1","SK2","bteam"]; //,"wage","rec","asi"||||| gk_ths = ["no","name","age","fp","str","sta","pac","han","one","ref","ari","jum","com","kic","thr",,,,,,,"potential","Adp","injury","charisma","professionalism","aggression","routine","captain","growOK","potGok","SK1","SK2","bteam"]; //,"wage","rec","asi"||||| }else{ ths = ["no","name","age","fp","str","sta","pac","mar","tac","wor","pos","pas","cro","tec","hea","fin","lon","set","cantos","livres","penaltis","routine","growOK","SK1","SK2","asi","rec","bteam"]; //,"wage","rec","asi"||||| gk_ths = ["no","name","age","fp","str","sta","pac","han","one","ref","ari","jum","com","kic","thr",,,,,,,"routine","growOK","SK1","SK2","asi","rec","bteam"]; //,"wage","rec","asi"||||| } } } //SESSION["is_pro"] = 1; //,"DDi", "DWi", "DSh", "DLB", "DTB" myTable = document.createElement('table'); myTable.className = "hover zebra"; construct_th(); var z=0; var player_count = 0; for (i=0; i age_max)) { construct_tr(players_ar[i], z, true); z++; } } } } var $player_count = $("#player_count"); if($player_count.length ==0) $player_count = $("").attr("id","player_count").addClass("float_right").prependTo("#filters"); $player_count.text(pc_replace(pagecontent[116],{"[number]":player_count})); $e("sq").innerHTML = ""; $e("sq").appendChild(myTable); activate_player_links($(myTable).find("[player_link]")); init_tooltip_by_elems($(myTable).find("[tooltip]")) //########################################################################################################### //########################################################################################################### //########################################################################################################### zebra(); }; } var inject = document.createElement("script"); inject.setAttribute("type", "text/javascript"); inject.appendChild(document.createTextNode("(" + embed + ")()")); document.body.appendChild(inject); $(document).ready(function(){ sort_it("no"); make_radio("main_squad"); }); var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})}; loadAndExecute("//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js", function() { $.noConflict(); jQuery(document).ready(function($) { $('table.zebra th:eq(1)').click(); }); });