Nilsnsn / 2minmanXtended

// ==UserScript==
// @name        2minmanXtended
// @namespace   https://openuserjs.org/users/Nilsnsn
// @version     0.2.10
// @description Extended teamview and other tweaks for 2minman.com (Erweiterte Mannschaftsansicht und andere Verbesserungen für 2minman.com)
// @include     http://*.2minman.com/select.php?select=*
// @include     http://2minman.com/select.php?select=*
// @include     https://*.2minman.com/select.php?select=*
// @include     https://2minman.com/select.php?select=*
// @grant       GM_addStyle
// @grant       GM_xmlhttpRequest
// @require     http://code.jquery.com/jquery-1.8.0.min.js
// @require     https://raw.github.com/ericmmartin/simplemodal/master/src/jquery.simplemodal.js
// @run-at      document-end
// @author      Nilsnsn (2mmxt@npfs.de)
// @licence     CC-BY-3.0
// @licence		MIT
// ==/UserScript==

var _this = this,
  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

(function() {
  var $helpLink, $mainMenu, Constants, Helper, StrongnessOverview, Teammate, TeammateList, XtendTeam, baseUrl, css, heads, helpContent, node, type, uicss, xTend, xtMenuContainer, _ref;
  Constants = (function() {
    
    function Constants() {}

    Constants.ashuerden = [0, 0, 0, 0, 5.0, 5.0, 5.0, 5.0, 2.0, 0, 100];
    
    Constants.lehrmeister = 1;
    
    Constants.calEpoch = new Date(2016, 10, 13); //13. November 2016 war ein Saisonstart
    
    Constants.jetzt = new Date();
    
    Constants.calendar = ["T", "E", "L", "E", "L", "T", "L", "P", "L", "T", "L", "E", "L", "T", "L", "P", "L", "E", "L", "T",
    							        "L", "E", "L", "T", "L", "E", "L", "E", "L", "T", "L", "E", "L", "T", "L", "E", "T", "T", "P", "L", 
    							        "E", "L", "T", "L", "E", "L", "P", "L", "T", "L", "E", "L", "T", "L", "P", "L", "T", "L", "P", "L",
    							        "E", "L", "T", "L", "E", "L", "P", "L", "T", "L", "E", "L", "E", "R", "P", "E", "E", "R"];
    							        
    Constants.restSaison = function ()
    {
      var heute = new Date(Constants.jetzt.getFullYear(), Constants.jetzt.getMonth(), Constants.jetzt.getDate());
      var ms = Math.abs(heute-Constants.calEpoch);
      return 77 - Math.ceil(ms / (1000 * 60 * 60 * 24)) % 78; 
    }    							    
    
    Constants.spielerBewertung = ["katastrophal", "katastrophal", "katastrophal", "katastrophal", "sehr-schwach", "sehr-schwach", "sehr-schwach", "sehr-schwach", "schwach", "schwach", "maessig", "maessig", "maessig", "maessig", "durchschnittlich", "durchschnittlich", "durchschnittlich", "durchschnittlich", "durchschnittlich", "durchschnittlich", "okay", "okay", "okay", "okay", "okay", "okay", "okay", "gut", "gut", "gut", "gut", "gut", "gut", "gut", "sehr-gut", "sehr-gut", "sehr-gut", "sehr-gut", "sehr-gut", "sehr-gut", "herausragend", "herausragend", "herausragend", "herausragend", "herausragend", "herausragend", "herausragend", "herausragend"];

    Constants.positions = {
      "T": "Tor",
      "A": "Abwehr",
      "M": "Mittelfeld",
      "S": "Sturm"
    };

    Constants.headerRow = '<tr class="xt-header-row"><th colspan="12">XXX</th></tr>';

    Constants.erfahrungGewinn = [0, 0.5875, 0.356025, 0.235, 0.1175, 0.0705, 0.047, 0.0235, 0.01175, 0.0005];

    Constants.erfahrungAlter = function(alter) {
      alter = parseInt(alter, 10);
      if (alter >= 30 || alter < 17) {
        return 0;
      }
      switch (alter) {
        case 17:
          return 0.2;
        case 18:
          return 0.4;
        case 19:
          return 0.6;
        case 20:
          return 0.8;
        case 28:
          return 0.75;
        case 29:
          return 0.5;
        default:
          return 1;
      }
    };

    Constants.maxStaerkeValues = {
      "Torwart": 40 * 1.2,
      "Abwehr": 200 * 1.2,
      "Mittelfeld": 200 * 1.2,
      "Sturm": 120 * 1.2,
      "Gesamt": 440 * 1.2,
      "Eingespieltheit": 100,
      "Moral": 75,
      "Taktiker": 440 * 1.2 * 0.03,
      "Taktgeber": 440 * 1.2 * 0.05,
      "Bonus": 440 * 0.05,
      "Auswärtsfans": 440 * 1.2 * 0.01,
      "Heimvorteil": 440 * 1.2 * 0.03
    };

    Constants.StaerkeRegExp = {
      "type": /([A-Z]{1}[a-zäöüß]+)[\:]?/,
      "Torwart": /([0-9]+(\.[0-9]+)?)\s\((\w.+)\)/,
      "Abwehr": /([0-9]+(\.[0-9]+)?)\s\((\w.+)\)/,
      "Mittelfeld": /([0-9]+(\.[0-9]+)?)\s\((\w.+)\)/,
      "Sturm": /([0-9]+(\.[0-9]+)?)\s\((\w.+)\)/,
      "Gesamt": /([0-9]+(\.[0-9]+)?)\s\((\w.+)\)/,
      "Eingespieltheit": /([0-9]+)(%)\s\((\w.+)\)/,
      "Moral": /\+ ([0-9]+(.[0-9]+)?)/,
      "Taktgeber": /\+ ([0-9]+(.[0-9]+)?)/,
      "Taktiker": /\+ ([0-9]+(.[0-9]+)?)/,
      "Bonus": /\+ ([0-9]+(.[0-9]+)?)/,
      "Auswärtsfans": /\+ ([0-9]+(.[0-9]+)?)\s(\([0-9](%)\))/,
      "Heimvorteil": /\+ ([0-9]+(.[0-9]+)?)\s(\([0-9](%)\))/
    };

    Constants.helpContents = {
      trainingslager: {
        title: 'Trainingslager',
        content: '<table id="xt-help-trainingslager" class="xt-table xt-help">' + '<thead><tr><th>Ort</th><th>Energie</th><th>Form</th><th>Dauer</th></tr><thead>' + '<tbody><tr><td>Trier</td><td>+1</td><td>+1</td><td>2 Tage</td></tr>' + '<tr><td>Ohlsbach</td><td>+2</td><td>+1</td><td>3 Tage</td></tr>' + '<tr><td>Offenburg</td><td>+1</td><td>+2</td><td>3 Tage</td></tr>' + '<tr><td>Überlingen</td><td>+2</td><td>+2</td><td>4 Tage</td></tr>' + '<tr><td>Moskow</td><td>+3</td><td>+2</td><td>5 Tage</td></tr>' + '<tr><td>Roma</td><td>+2</td><td>+3</td><td>5 Tage</td></tr>' + '<tr><td>Mexiko</td><td>+3</td><td>+3</td><td>6 Tage</td></tr>' + '<tr><td>New-Zealand</td><td>+4</td><td>+4</td><td>6 Tage</td></tr></tbody>' + '</table>'
      },
      erfahrungszuwachs: {
        title: 'Erfahrungszuwachs',
        content: '<p>Ab 30 ist kein Stärkeaufstieg mehr möglich, ab 32 fällt die Spielstärke jedes Jahr um 1!</p>' + '<p>Wenn die Werte für Energie/Form unter 15/15 sind, gibt es keinen Erfahrungszuwachs.</p>' + '<table id="xt-help-erfahrungszuwachs" class="xt-table xt-help">' + '<thead><tr><th colspan="8">Erfahrungszuwachs nach Alter/Stärke</th></tr></thead>' + '<tbody>' + '<tr><th></th><th>17</th><th>18</th><th>19</th><th>20</th><th>21-27</th><th>28</th><th>29</th></tr>' + '<tr><td>1</td><td>0,1175%</td><td>0,2350%</td><td>0,3525%</td><td>0,4700%</td><td>0,5875%</td><td>0,4406%</td><td>0,3750%</td></tr>' + '<tr><td>2</td><td>0,0712%</td><td>0,1424%</td><td>0,2136%</td><td>0,2848%</td><td>0,3560%</td><td>0,2670%</td><td>0,1780%</td></tr>' + '<tr><td>3</td><td>0,0470%</td><td>0,0940%</td><td>0,1410%</td><td>0,1880%</td><td>0,2350%</td><td>0,1762%</td><td>0,1175%</td></tr>' + '<tr><td>4</td><td>0,0235%</td><td>0,0470%</td><td>0,0705%</td><td>0,0940%</td><td>0,1175%</td><td>0,0881%</td><td>0,0587%</td></tr>' + '<tr><td>5</td><td>0,0141%</td><td>0,0282%</td><td>0,0423%</td><td>0,0564%</td><td>0,0705%</td><td>0,0528%</td><td>0,0352%</td></tr>' + '<tr><td>6</td><td>0,0094%</td><td>0,0188%</td><td>0,0282%</td><td>0,0376%</td><td>0,0470%</td><td>0,0352%</td><td>0,0235%</td></tr>' + '<tr><td>7</td><td>0,0047%</td><td>0,0094%</td><td>0,0141%</td><td>0,0188%</td><td>0,0235%</td><td>0,0176%</td><td>0,0117%</td></tr>' + '<tr><td>8</td><td>0,0023%</td><td>0,0047%</td><td>0,0070%</td><td>0,0094%</td><td>0,0117%</td><td>0,0088%</td><td>0,0058%</td></tr>' + '<tr><td>9</td><td>0,0001%</td><td>0,0002%</td><td>0,0003%</td><td>0,0004%</td><td>0,0005%</td><td>0,0004%</td><td>0,0003%</td></tr>' + '</tbody>' + '</table>'
      },
      stadionausbau: {
        title: 'Stadionausbau',
        content: '<div style="width: 420px"><table id="xt-help-stadionausbau-a" class="xt-table xt-help" style="float: left; width: 200px; margin-right: 20px;">' + '<thead><tr><th>Dauer (Tage)</th><th>Anzahl Plätze</th></tr><thead>' + '<tbody><tr><td> 1</td><td>1    - 199  </td></tr>' + '<tr><td> 2</td><td>200  - 599  </td></tr>' + '<tr><td> 3</td><td>600  - 999  </td></tr>' + '<tr><td> 4</td><td>1000 - 1399 </td></tr>' + '<tr><td> 5</td><td>1400 - 1799 </td></tr>' + '<tr><td> 6</td><td>1800 - 2199 </td></tr>' + '<tr><td> 7</td><td>2200 - 2599 </td></tr>' + '<tr><td> 8</td><td>2600 - 2999 </td></tr>' + '<tr><td> 9</td><td>3000 - 3399 </td></tr>' + '<tr><td>10</td><td>3400 - 3799 </td></tr>' + '<tr><td>11</td><td>3800 - 4199 </td></tr>' + '<tr><td>12</td><td>4200 - 4599 </td></tr>' + '<tr><td>13</td><td>4600 - 4999 </td></tr>' + '</tbody></table>' + '<table id="xt-help-stadionausbau-b" class="xt-table xt-help" style="float: left; width: 200px;">' + '<thead><tr><th>Dauer (Tage)</th><th>Anzahl Plätze</th></tr><thead>' + '<tr><td>14</td><td>5000 - 5399 </td></tr>' + '<tr><td>15</td><td>5400 - 5799 </td></tr>' + '<tr><td>16</td><td>5800 - 6199 </td></tr>' + '<tr><td>17</td><td>6200 - 6599 </td></tr>' + '<tr><td>18</td><td>6600 - 6999 </td></tr>' + '<tr><td>19</td><td>7000 - 7399 </td></tr>' + '<tr><td>20</td><td>7400 - 7799 </td></tr>' + '<tr><td>21</td><td>7800 - 8199 </td></tr>' + '<tr><td>22</td><td>8200 - 8599 </td></tr>' + '<tr><td>23</td><td>8600 - 8999 </td></tr>' + '<tr><td>24</td><td>9000 - 9399 </td></tr>' + '<tr><td>25</td><td>9400 - 9799 </td></tr>' + '<tr><td>26</td><td>9800 - 10000</td></tr></tbody>' + '</table></div><div style="clear: left; heihgt: 1px;"></div>'
      },
      spielerbewertung: {
        title: 'Spielerbewertung',
        content: '<p>Die Spielerbewertung errechnet sich wie folgt:<br/>' + '<strong>Stärke * (Formpunkte + Energiepunkte) / 10</strong></p>' + '<p><strong>Beispiel:</strong> Ein 6er mit 15 Energiepunkten und 17 Formpunkten hat eine Bewertung von <strong>6*(15 + 17)/10 = 19,2</strong></p>' + '<p>Aus folgender Tabelle kann man nun ablesen, welche Bewertung der Spieler hat. Das gleiche ist natürlich auch umgekehrt möglich, d. h. dass man anhand der Bewertung ungefähr die Form- und Energiewerte des/der Spieler/s herausfinden kann.</p>' + '<table class="xt-table xt-help">' + '<thead><tr><th>Punkte</th><th>Bewertung</th></tr><thead>' + '<tbody><tr><td>03</td><td>katastrophal</td></tr>' + '<tr><td>07</td><td>sehr schwach</td></tr>' + '<tr><td>09</td><td>schwach</td></tr>' + '<tr><td>13</td><td>mäßig</td></tr>' + '<tr><td>19</td><td>durchschnittlich</td></tr>' + '<tr><td>26</td><td>okay</td></tr>' + '<tr><td>33</td><td>gut</td></tr>' + '<tr><td>37</td><td>sehr gut</td></tr>' + '<tr><td>41</td><td>hervorragend</td></tr>' + '<tr><td>50</td><td>Weltklasse</td></tr>' + '</tbody><table>'
      },
      spielbenotung: {
        title: 'Spielbenotung',
        content: '<table class="xt-table xt-help"><thead><tr><th></th><th colspan="9">Einsatzpunkte</th></tr>' + '<tr><th>Anzahl Tore</th><th>+4</th><th>+3</th><th>+2</th><th>+1</th><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><tr></thead>' + '<tbody><tr><td>0</td><td>2-</td><td>3+</td><td>3</td><td>3-</td><td>4+</td><td>4</td><td>5</td><td>5-</td><td>6</td>' + '<tr><td>1</td><td>2</td><td>2-</td><td>3+</td><td>3</td><td>3-</td><td>4+</td><td>4-</td><td>5</td><td>6+</td>' + '<tr><td>2</td><td>2+</td><td>2</td><td>2-</td><td>3+</td><td>3</td><td>3-</td><td>4</td><td>5+</td><td>5-</td>' + '<tr><td>3</td><td>1-</td><td>2+</td><td>2</td><td>2-</td><td>3+</td><td>3</td><td>4+</td><td>4-</td><td>5</td>' + '<tr><td>4</td><td>1</td><td>1-</td><td>2+</td><td>2</td><td>2-</td><td>3+</td><td>3-</td><td>4</td><td>5+</td>' + '<tr><td>5</td><td>1+</td><td>1-</td><td>1.5</td><td>2+</td><td>2-</td><td>2.5</td><td>3-</td><td>4+</td><td>4.5</td>' + '<tr><td>6+</td><td>1+</td><td>1</td><td>1-</td><td>2+</td><td>2</td><td>2-</td><td>3</td><td>4+</td><td>4-</td>'
      },
      eigenschaften: {
        title: 'Eigenschaften',
        content: '<table id="xt-help-erfahrungszuwachs" class="xt-table xt-help">' + '<thead><tr><th colspan="11">Eigenschaften nach Stufe</th></tr></thead>' + '<tbody>' + '<tr><th>Stufe</th><th>EP-Kosten</th><th>Ant./Tech.</th><th>Lehrmeister</th><th>Planer</th><th>Manager</th><th>Medienm.</th><th>Feilscher</th><th>Publikumsm.</th><th>Motivator</th><th>Taktiker</th></tr>' + '<tr><td>1</td><td>+7 (7)</td><td>60%</td><td>4,12%</td><td>30,07%</td><td>0,78%</td><td>1,06%</td><td>0,31%</td><td>1,13%</td><td>12,5%</td><td>0,75%</td></tr>' + '<tr><td>2</td><td>+11 (18)</td><td>68%</td><td>7,12%</td><td>34,36%</td><td>1,08%</td><td>1,42%</td><td>0,43%</td><td>1,5%</td><td>21,87%</td><td>1,31%</td></tr>' + '<tr><td>3</td><td>+17 (35)</td><td>74,4%</td><td>9,28%</td><td>39,27%</td><td>1,5%</td><td>1,91%</td><td>0,58%</td><td>2%</td><td>28,91%</td><td>1,73%</td></tr>' + '<tr><td>4</td><td>+27 (62)</td><td>79,52%</td><td>10,86%</td><td>44,88%</td><td>2,09%</td><td>2,56%</td><td>0,79%</td><td>2,67%</td><td>34,18%</td><td>2,05%</td></tr>' + '<tr><td>5</td><td>+41 (103)</td><td>83,62%</td><td>12%</td><td>51,29%</td><td>2,9%</td><td>3,44%</td><td>1,07%</td><td>3,56%</td><td>38,13%</td><td>2,29%</td></tr>' + '<tr><td>6</td><td>+63 (166)</td><td>86,89%</td><td>12,82%</td><td>58,62%</td><td>4,03%</td><td>4,62%</td><td>1,46%</td><td>4,75%</td><td>41,1%</td><td>2,47%</td></tr>' + '<tr><td>7</td><td>+98 (264)</td><td>89,51%</td><td>13,42%</td><td>66,99%</td><td>5,6%</td><td>6,2%</td><td>1,99%</td><td>6,33%</td><td>42,33%</td><td>2,6%</td></tr>' + '<tr><td>8</td><td>+150 (414)</td><td>91,61%</td><td>13,86%</td><td>76,56%</td><td>7,78%</td><td>8,33%</td><td>2,7%</td><td>8,44%</td><td>44,99%</td><td>2,7%</td></tr>' + '<tr><td>9</td><td>+231 (645)</td><td>93,29%</td><td>14,17%</td><td>87,5%</td><td>10,8%</td><td>11,18%</td><td>3,68%</td><td>11,25%</td><td>46,25%</td><td>2,77%</td></tr>' + '<tr><td>10</td><td>+355 (1000)</td><td>100%</td><td>15%</td><td>100%</td><td>15%</td><td>15%</td><td>5%</td><td>15%</td><td>50%</td><td>3%</td></tr>' + '</tbody>' + '</table>'
      }
    };

    return Constants;

  })();
  Helper = (function() {

    function Helper() {}

    Helper.addTooltips = function(selector) {
      var elements;
      elements = $(selector);
      elements.mouseover(function(e) {
        var tip;
        tip = $(this).attr('title');
        $(this).attr('title', '');
        $(this).closest("td").append('<div id="xt-tooltip"><div class="xt-tooltip-inner">' + tip + '</div></div>');
        $('#xt-tooltip').css('top', e.pageY + 10);
        $('#xt-tooltip').css('left', e.pageX - 90);
        return $('#xt-tooltip').fadeIn('500');
      });
      elements.mousemove(function(e) {
        $('#xt-tooltip').css('top', e.pageY + 10);
        return $('#xt-tooltip').css('left', e.pageX - 90);
      });
      return elements.mouseout(function() {
        var thisTooltip;
        thisTooltip = $(this).closest("td").find('div#xt-tooltip');
        $(this).attr('title', thisTooltip.find('.xt-tooltip-inner').html());
        return thisTooltip.remove();
      });
    };

    Helper.addBarBg = function(dom, text, percentage, width) {
      var balken, container, height, wert;
      if (percentage > 1) {
        percentage = percentage / 100;
      }
      $(dom).addClass("xt-bar").html("");
      height = 26;
      if (!width) {
        width = $(dom).width();
      }
      container = document.createElement("div");
      $(container).addClass("xt-bar-container");
      balken = document.createElement("div");
      $(balken).addClass("xt-bar-balken");
      balken.style.width = (percentage * width) + "px";
      balken.style.height = height + "px";
      $(container).append(balken);
      wert = document.createElement("div");
      $(wert).addClass("xt-bar-wert");
      wert.style.width = width + "px";
      wert.style.height = height + "px";
      wert.style.lineHeight = height + "px";
      $(wert).append(text);
      $(container).append(wert);
      return $(dom).append(container);
    };

    Helper.round = function(n) {
      return Math.round(n * 100 + ((n * 1000) % 10 > 4 ? 1 : 0)) / 100;
    };

    return Helper;

  })();
  Teammate = (function() {

    function Teammate(dom) {
      var index, item, tds, _i, _len;
      this.dom = dom;
      _this.toString = __bind(_this.toString, this);

      _this.getEffektiveStaerke = __bind(_this.getEffektiveStaerke, this);

      _this.alterDom = __bind(_this.alterDom, this);

      _this.alterErfahrungTD = __bind(_this.alterErfahrungTD, this);

      _this.alterStatusTD = __bind(_this.alterStatusTD, this);

      _this.calcMinAnzahlTrainingBisAufstieg = __bind(_this.calcMinAnzahlTrainingBisAufstieg, this);

      tds = $(this.dom).find("td");
      for (index = _i = 0, _len = tds.length; _i < _len; index = ++_i) {
        item = tds[index];
        switch (index) {
          case 1:
            this.position = $(item).text().replace(/^\s+|\s+$/g, "");
            break;
          case 2:
            this.name = $(item).text().replace(/^\s+|\s+$/g, "");
            break;
          case 3:
            this.alter = parseInt($(item).text().replace(/^\s+|\s+$/g, ""), 10);
            break;
          case 4:
            this.staerke = parseInt($(item).text().replace(/^\s+|\s+$/g, ""), 10);
            break;
          case 5:
            this.energie = parseInt($(item).text().replace(/^\s+|\s+$/g, ""), 10);
            break;
          case 6:
            this.form = parseInt($(item).text().replace(/^\s+|\s+$/g, ""), 10);
            break;
          case 7:
            this.gk = parseInt($(item).text().replace(/^\s+|\s+$/g, ""), 10);
            Helper.addBarBg(item, this.gk, this.gk / 5, 25);
            break;
          case 8:
            this.erfahrung = parseFloat($(item).text().replace(/^\s+|\s+$/g, "").replace(/\(|\)|\%/g, ""));
            this.erfahrungTD = item;
            break;
          case 9:
            this.spiele = parseInt($(item).text().replace(/^\s+|\s+$/g, ""), 10);
            break;
          case 10:
            this.nation = $(item).text().replace(/^\s+|\s+$/g, "");
            break;
          case 11:
            this.status = $(item).text().replace(/^\s+|\s+$/g, "");
            this.statusTD = item;
        }
      }
      this.effStaerke = this.getEffektiveStaerke();
      this.alterStatusTD(this.statusTD);
      this.alterErfahrungTD(this.erfahrungTD);
      this.aufstiegsberechtigt = false;
      this.alterDom();
    }

    Teammate.isTeammate = function(dom) {
      return $(dom).find("td").length >= 12;
    };

    Teammate.prototype.calcMinAnzahlTrainingBisAufstieg = function() {
      if (this.erfahrung > Constants.ashuerden[this.staerke]) {
        return 0;
      }
      //Benötigte Erfahrung
      var beGesamt = (Constants.ashuerden[this.staerke] - this.erfahrung) / Constants.lehrmeister;
      
      var restTage = Constants.restSaison();
      var tage = Math.ceil(beGesamt / (Constants.erfahrungAlter(this.alter) * Constants.erfahrungGewinn[this.staerke]));
      
      var endTage = tage;
      
      
      if (tage>restTage)
      {
      	var beRest = restTage * Constants.erfahrungAlter(this.alter) * Constants.erfahrungGewinn[this.staerke];
      	var beTmp = 0;
         endTage = restTage;
         var s = 1;
      	
      	while (beGesamt > beRest + beTmp)
      	{
          var ramp = (Constants.erfahrungAlter(this.alter+s) * Constants.erfahrungGewinn[this.staerke]);
          if (ramp <= 0)
            beGesamt = -99;
          else
          {
      		  var tmpTage = Math.ceil((beGesamt-beRest-beTmp) / ramp);
      		  if (tmpTage>78)
      		  {
      			  beTmp+= 78 * ramp;
      			  endTage+= 78;
      		  }
      	  	else 
        		{
        			beTmp+= tmpTage * ramp;
        			endTage+= tmpTage;
        		}	
      		  s++;
          }
      	}
      }
      if (beGesamt<0)
        return -99;
      else
        return endTage;
    };

    Teammate.prototype.alterStatusTD = function(dom) {
      var alpha, maxStaerke;
      $(dom).addClass("status");
      if (this.status === "Ok.") {
        maxStaerke = 40;
        alpha = this.effStaerke >= maxStaerke ? 1 : Math.floor(this.effStaerke / maxStaerke * 100) / 100;
        dom.style.backgroundColor = "rgba(0,0,255," + alpha + ")";
        if (alpha > 0.6) {
          dom.style.color = "#eeeeee";
        }
        return $(dom).html(this.effStaerke);
      }
    };

    Teammate.prototype.alterErfahrungTD = function(dom) {
      var erf, anzahl, container, div, title, width, widthMax;
      anzahl = 0;
      widthMax = 100;
      erf = this.erfahrung + '%';
      width = this.erfahrung >= Constants.ashuerden[this.staerke] ? widthMax : parseInt(this.erfahrung / Constants.ashuerden[this.staerke] * widthMax, 10);
      $(dom).addClass("erfahrung");
      if (this.alter > 29) {
        $(dom).addClass("zu-alt");
      }
      else if (width === widthMax) {
        $(dom).addClass("aufstieg");
      }
      width = width + "px";
      div = document.createElement("div");
      div.style.width = width;
      $(div).addClass("balken");
      $(dom).html("");
      container = document.createElement("div");
      $(container).addClass("container");
      $(container).append(div);
      if (this.alter > 29) {
        title = "Nie wieder aufstiegsberechtigt";
      } else if (this.erfahrung >= Constants.ashuerden[this.staerke]) {
        /* Beginn: Deactivated, spohl, 02.05.2014: */
        /*
        if (this.spiele >= 5) {
        */
        /* End: Deactivated, spohl, 02.05.2014. */
          this.aufstiegsberechtigt = true;
          title = "Aufstiegsberechtigt";
        /* Beginn: Deactivated, spohl, 02.05.2014: */  
        /*
        } else {
          title = "Aufstiegsberechtigt, aber noch nicht genügend Spiele in dieser Saison.";
        }
        */
        /* End: Deactivated, spohl, 02.05.2014. */
      } else {
        anzahl = this.calcMinAnzahlTrainingBisAufstieg();
        if (anzahl<0)
          title = "Kann die Aufstiegshürde (vermutlich) nicht mehr erreichen<sup>1</sup>";
        else
        {
          title = "Noch " + (anzahl === 0 ? "" : "mindestens ") + "<strong>" + (anzahl > 0 ? anzahl : 1) + "</strong> Tag" + (anzahl > 1 ? "e" : "") + " (Training/Spiele) bis <strong>" + this.name + "</strong> aufstiegsberechtigt ist.<sup>1</sup>";
          erf = erf + ' (' + anzahl;
          if (anzahl>Constants.restSaison())
            erf = erf + '*';
          erf = erf + '*)';
        }
      }
      
      $(container).append('<div class="wert" title="' + title + '">' + erf + '</div>');
      return $(dom).append(container);
    };

    Teammate.prototype.alterDom = function() {
      var effStaerkeRounded, formClass;
      if (this.status.match(/Rot/g)) {
        $(this.dom).addClass("statrot");
      } else if (this.status.match(/Gelb/g)) {
        $(this.dom).addClass("statgelb");
      } else if (this.status.match(/Verl/g)) {
        $(this.dom).addClass("statverl");
      } else if (this.status.match(/TL/g)) {
        $(this.dom).addClass("stattl");
      }
      if (this.status.match(/Ok/g)) {
        $(this.dom).addClass("ok");
      } else {
        $(this.dom).addClass("verhindert");
      }
      formClass = 0;
      if (this.form >= 5 && this.energie >= 5)
        formClass++;
      if (this.form >= 14 && this.energie >= 14)
        formClass++;
      if (this.form >= 17 && this.energie >= 17)
        formClass++;
      if (this.form >= 20 && this.energie >= 20)
        formClass++;

      $(this.dom).addClass("form" + formClass);
      effStaerkeRounded = Math.ceil(this.effStaerke);
      $(this.dom).addClass(Constants.spielerBewertung[effStaerkeRounded]);
      return true;
    };

    Teammate.prototype.getEffektiveStaerke = function() {
      return Helper.round(this.staerke * (this.energie + this.form) / 10);
    };

    Teammate.prototype.toString = function() {
      return this.position + " | " + this.name + " | " + this.alter + " | " + this.staerke + " | " + this.energie + " | " + this.form + " | " + this.gk + " | " + this.erfahrung + " | " + this.spiele + " | " + this.nation + " | " + this.status;
    };

    return Teammate;

  })();
  TeammateList = (function() {

    function TeammateList() {
      _this.getStatisic = __bind(_this.getStatisic, this);

      _this.remove = __bind(_this.remove, this);

      _this.add = __bind(_this.add, this);

      var pos, _i, _len, _ref;
      this.list = [];
      this.total = {
        staerke: 0,
        effStaerke: 0,
        alter: 0,
        energie: 0,
        form: 0,
        count: 0,
        aufstieg: 0
      };
      _ref = ["T", "A", "M", "S"];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        pos = _ref[_i];
        this.total[pos] = {
          staerke: 0,
          effStaerke: 0,
          alter: 0,
          energie: 0,
          form: 0,
          count: 0,
          aufstieg: 0
        };
      }
      this.averages = jQuery.extend(true, {}, this.total);
    }

    TeammateList.prototype.add = function(teammate) {
      var effStaerke;
      this.list.push(teammate);
      this.total.staerke += teammate.staerke;
      this.total[teammate.position].staerke += teammate.staerke;
      effStaerke = teammate.getEffektiveStaerke();
      this.total.effStaerke += effStaerke;
      this.total[teammate.position].effStaerke += effStaerke;
      this.total.alter += teammate.alter;
      this.total[teammate.position].alter += teammate.alter;
      this.total.energie += teammate.energie;
      this.total[teammate.position].energie += teammate.energie;
      this.total.form += teammate.form;
      this.total[teammate.position].form += teammate.form;
      this.total.count++;
      this.total[teammate.position].count++;
      if (teammate.aufstiegsberechtigt === true) {
        this.total.aufstieg++;
        return this.total[teammate.position].aufstieg++;
      }
    };

    TeammateList.prototype.remove = function(teammate) {
      var index, item, _i, _len, _ref;
      _ref = this.list;
      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
        item = _ref[index];
        if (teammate === item) {
          this.list.splice(index, 1);
          return true;
        }
      }
      return false;
    };

    TeammateList.prototype.getStatisic = function() {
      var pos, _i, _len, _ref;
      this.total.effStaerke = Helper.round(this.total.effStaerke);
      this.averages.staerke = Helper.round(this.total.staerke / this.list.length);
      this.averages.effStaerke = Helper.round(this.total.effStaerke / this.list.length);
      this.averages.alter = Helper.round(this.total.alter / this.list.length);
      this.averages.energie = Helper.round(this.total.energie / this.list.length);
      this.averages.form = Helper.round(this.total.form / this.list.length);
      _ref = ["T", "A", "M", "S"];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        pos = _ref[_i];
        this.total[pos].effStaerke = Helper.round(this.total[pos].effStaerke);
        this.averages[pos].staerke = Helper.round(this.total[pos].staerke / this.total[pos].count);
        this.averages[pos].effStaerke = Helper.round(this.total[pos].effStaerke / this.total[pos].count);
        this.averages[pos].alter = Helper.round(this.total[pos].alter / this.total[pos].count);
        this.averages[pos].energie = Helper.round(this.total[pos].energie / this.total[pos].count);
        this.averages[pos].form = Helper.round(this.total[pos].form / this.total[pos].count);
      }
      return {
        total: this.total,
        averages: this.averages,
        counts: this.counts
      };
    };

    return TeammateList;

  })();
  StrongnessOverview = (function() {

    function StrongnessOverview(dom) {
      var beschriftung, bewertung, fanvorteil, counter, index, item, maxValue, percentage, tds, trs, typeTd, typeTxt, value, valueTd, _i, _len;
      this.dom = dom;
      trs = $(this.dom).find("tr");
      counter = 0;
      for (index = _i = 0, _len = trs.length; _i < _len; index = ++_i) {
        item = trs[index];
        tds = $(item).find("td");
        if (tds.length !== 2) {
          continue;
        }
        typeTd = tds[0];
        Constants.StaerkeRegExp["type"].exec($(typeTd).text());
        typeTxt = RegExp.$1;
        valueTd = tds[1];
        Constants.StaerkeRegExp[typeTxt].exec($(valueTd).text());
        value = RegExp.$1;
        bewertung = RegExp.$3;
        fanvorteil = RegExp.$4;
        
        beschriftung = bewertung === "" ? "+ " : (fanvorteil === "" ? "" : "+ ");
        beschriftung += value;
        if (bewertung !== "") {
          beschriftung += (RegExp.$2 === "%" ? "%" : "") + (fanvorteil === "%" ? " " : " - ") + bewertung;
        }
        maxValue = Constants.maxStaerkeValues[typeTxt];
        percentage = parseInt(value / maxValue * 100, 10) / 100;
        if (percentage > 1) {
          percentage = 1;
        }
        valueTd.style.backgroundColor = typeTd.style.backgroundColor = "rgba(0,0,255," + (0.25+3*percentage/4) + ")";
//        if (percentage > 0.3) {
          typeTd.style.color = valueTd.style.color = "#eeeeee";
//        }
        Helper.addBarBg(valueTd, beschriftung, percentage);
      }
    }

    return StrongnessOverview;

  })();
  XtendTeam = (function() {

    function XtendTeam() {
      
      _this.buildStatistic = __bind(_this.buildStatistic, this);

      _this.buildLegend = __bind(_this.buildLegend, this);

      _this.buildTMList = __bind(_this.buildTMList, this);

      var $infoTables;
      this.teammates = new TeammateList();
      this.table = $(".content_main > form > table")[0];
      this.table.id = "teammates";
      $(this.table).addClass("teammates xt-table");
      this.rows = $(this.table).find("tr");
      this.buildTMList();
      this.buildLegend();
      Helper.addTooltips('.erfahrung .wert');
      $infoTables = $("#info_content table");
      if ($infoTables.length === 3) {
        this.strongnessTable = $infoTables[0];
      } else {
        this.strongnessTable = $infoTables[1];
      }
      $(this.strongnessTable).addClass("xt-table xt-table-strongness");
      this.strongnessOV = new StrongnessOverview(this.strongnessTable);
      this.buildStatistic();
    }

    XtendTeam.prototype.buildTMList = function() {
      var header, index, item, pos, tm, _i, _len, _ref;
      pos = "X";
      header = $(this.table).find("tr")[0];
      $(header).addClass("xt-spaltenbeschriftung");
      _ref = this.rows;
      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
        item = _ref[index];
        if (index !== 0 && index !== this.rows.length - 1 && Teammate.isTeammate(item)) {
          tm = new Teammate(item);
          if (tm.position !== pos) {
            pos = tm.position;
            $(item).before(Constants.headerRow.replace(/XXX/, Constants.positions[pos]));
            $(item).before($(header).clone(true));
          }
          this.teammates.add(tm);
          $(item).addClass("teammate");
        }
      }
      return $(header).remove();
    };

    XtendTeam.prototype.buildLegend = function() {
      var alpha, color, container, fitness, footnote, form, num, textFitness, _i, _j;
      container = document.createElement("div");
      $(container).addClass("xt-legende");
      form = document.createElement("div");
      $(form).addClass("xt-legende-form");
      $(container).append(form);
      fitness = document.createElement("div");
      $(fitness).addClass("xt-legende-fitness");
      $(container).append(fitness);
      footnote = document.createElement("div");
      $(footnote).addClass("xt-legende-footnote");
      $(footnote).append('<p><sup>1</sup> Die Berechnung der verbleibenden Tage bis zur Aufstiegsberechtigung beruht auf der Annahme, dass ein Spieler jeden Tag Erfahrung sammelt. Steigendes Alter wird berücksichtigt, ein dadurch eventueller Verlust der Aufstiegsberechtigung nicht.</p><p><sup>* **</sup> Restdauer der Saison: ' + Constants.restSaison() + ' Tage');
      $(container).append(footnote);
      for (num = _i = 1; _i < 11; num = ++_i) {
        alpha = num / 10;
        color = alpha > 0.6 ? "#eeeeee" : "black";
        $(form).append('<div style="color: ' + color + '; background-color: rgba(0,0,255,' + alpha + ');">' + (alpha < 1 ? alpha * 40 : "40+" + '</div>'));
      }
      $(form).append('<p><strong>Status:</strong> Je höher die effektive Stärke, je dunkler das Blau. Grau, wenn verhindert.</p>');
      textFitness = ["min. eins unter 5", "jew. über 5", "jew. über 14", "jew. über 17", "jew. über 20"];
      for (num = _j = 0; _j < 5; num = ++_j) {
        $(fitness).append('<div class="form' + num + '">' + textFitness[num] + '</div>');
      }
      $(fitness).append('<p><strong>Energie/Form:</strong> Grün: aufstellbar, rot: Trainingslager?</p>');
      return $(this.table).after(container);
    };

    XtendTeam.prototype.buildStatistic = function() {
      var container, content, createRow, statistic, topic;
      statistic = this.teammates.getStatisic();
      container = document.createElement("div");
      $(container).addClass("xt-statistic");
      topic = document.createElement("div");
      $(topic).addClass("info_topic closed");
      $(topic).append('<span class="open">▼ </span><span class="closed">▶ </span>Statistik');
      $(container).append(topic);
      content = document.createElement("div");
      content.id = "xt-statistic-content";
      content.style.display = "none";
      $(container).append(content);
      createRow = function(header, cols, className, percentage) {
        var col, ret, _i, _len;
        percentage = Helper.round(percentage * 100);
        if (percentage > 100) {
          percentage = 100;
        }
        ret = '<tr class="' + className + ' xt-header-row"><th colspan="' + cols.length + '">' + '<div class="xt-bg" style="width: ' + percentage + '%;">' + '<div class="xt-value">' + header + '</div>' + '</div>' + '</th></tr>' + '<tr class="' + className + '">';
        for (_i = 0, _len = cols.length; _i < _len; _i++) {
          col = cols[_i];
          ret += '<td>' + col + '</td>';
        }
        ret += '</tr>';
        return ret;
      };
      $(content).append('<table class="xt-table">' + '<thead>' + '<tr><th>T</th><th>A</th><th>M</th><th>S</th><th>G</th></tr>' + '</thead>' + '<tbody>' + createRow("Anzahl Spieler", [statistic.total.T.count, statistic.total.A.count, statistic.total.M.count, statistic.total.S.count, statistic.total.count], "even", statistic.total.count / 24) + createRow("Stärke", [statistic.total.T.staerke, statistic.total.A.staerke, statistic.total.M.staerke, statistic.total.S.staerke, statistic.total.staerke], "odd", statistic.total.staerke / (10 * statistic.total.count)) + createRow("Eff. Stärke", [statistic.total.T.effStaerke, statistic.total.A.effStaerke, statistic.total.M.effStaerke, statistic.total.S.effStaerke, statistic.total.effStaerke], "even", statistic.total.effStaerke / (statistic.total.staerke * 4)) + createRow("Eff. Stärke Ø", [statistic.averages.T.effStaerke, statistic.averages.A.effStaerke, statistic.averages.M.effStaerke, statistic.averages.S.effStaerke, statistic.averages.effStaerke], "odd", statistic.averages.effStaerke / (statistic.averages.staerke * 4)) + createRow("Energie Ø", [statistic.averages.T.energie, statistic.averages.A.energie, statistic.averages.M.energie, statistic.averages.S.energie, statistic.averages.energie], "even", statistic.averages.energie / 20) + createRow("Form Ø", [statistic.averages.T.form, statistic.averages.A.form, statistic.averages.M.form, statistic.averages.S.form, statistic.averages.form], "odd", statistic.averages.form / 20) + createRow("Alter Ø", [statistic.averages.T.alter, statistic.averages.A.alter, statistic.averages.M.alter, statistic.averages.S.alter, statistic.averages.alter], "even", (statistic.averages.alter - 17) / 32) + '</tbody>' + '</table>');
      $($("#info_content .info_topic")[2]).before(container);
      $(topic).click(function(e) {
        $("#xt-statistic-content").toggle(300);
        return $(e.target).toggleClass("closed").toggleClass("open");
      });
      return true;
    };

    return XtendTeam;

  })();
  $mainMenu = $('#menu');
  xtMenuContainer = document.createElement('div');
  xtMenuContainer.id = 'xt-menu';
  $mainMenu.append(xtMenuContainer);
  $(xtMenuContainer).append('<h3 class="xt-headline">Hilfe</h3>');
  _ref = Constants.helpContents;
  for (type in _ref) {
    helpContent = _ref[type];
    $helpLink = $('<a href="#" class="xt-link" rel="xt-dialog-modal-' + type + '">' + helpContent.title + '</a>');
    $('body').append('<div style="display: none;" id="xt-dialog-modal-' + type + '" class="xt-dialog-modal"><h2>Hilfe – ' + helpContent.title + '</h2>' + helpContent.content + '</div>');
    $(xtMenuContainer).append($helpLink);
    $helpLink.click(function() {
      $("#" + $(this).attr('rel')).modal({
        overlayClose: true
      });
      return false;
    });
  }
    
  baseUrl = location.href.split("?")[0];
    
  if (location.href.match(/select=team/) && !location.href.match(/select=team&ac=1/)) {
      
      GM_xmlhttpRequest({
        method: 'GET',
        url: baseUrl + '?select=eigenschaften',
        overrideMimeType: "text/html; charset=ISO-8859-1",
        onload: function(response) {
            Constants.lehrmeister = Constants.lehrmeister + parseInt(response.responseText.split("<span id='lehrmeister'>")[1].split('</span>')[0]) / 100;

            if (response.responseText.split('+5% Aufstiegswahrscheinlichkeit<br/>(20% mit Lehrmeister) <span style="font-size: 20px; ')[1].split('" id="haken_1">')[0] == 'display:block;')
            {
                Constants.lehrmeister = Constants.lehrmeister + 0.05;
            }

            xTend = new XtendTeam();
        },
        onerror: function(response) {
            xTend = new XtendTeam();
        },
        onabort: function(response) {
            xTend = new XtendTeam();
        },
        ontimeout: function(response) {
            xTend = new XtendTeam();
        }

      });
    
  } else if (location.href.match(/select=bericht&vereinnr=[0-9]+&details=4/)) {
    
    GM_xmlhttpRequest({
      method: 'GET',
      url: baseUrl + '?select=finanzen&stadion=1',
      overrideMimeType: "text/html; charset=ISO-8859-1",
      onload: function(responseDetails) {
        var $content, $table, content, holder, table, tables, _i, _len;
        holder = document.createElement('div');
        holder.innerHTML = responseDetails.responseText.split('<div id=\'content\'>')[1].split('<div id="info">')[0];
        tables = $(holder).find(".content_main table");
        content = document.createElement("div");
        $content = $(content);
        for (_i = 0, _len = tables.length; _i < _len; _i++) {
          table = tables[_i];
          $table = $(table);
          $content.append("<h3 class=\"xt-headline\">" + $($(table).find("tr")[0]).text() + "</h3>");
          $($table.addClass("xt-table").find("tr")[0]).remove();
          $content.append(table);
        }
        $(content).addClass("content_main xt-stadion");
        return $('#content').append('<div class="content_icon"><img src="img/tab_logo.png"></div><div class="content_topic">Stadion<p class="content_subtopic">Eintrittspreise festlegen</p></div>', content);
      }
    });
  } else if (location.href.match(/select=chronik&vereinnr=[0-9]/)) {

  }
  css = ".content_main { margin: 50px 0 20px 0; }" + "#content table.teammates tr:last-child td { padding: 10px 0 0 0; }" + "table.teammates tr:last-child td img { display: none; }" + "table.teammates tr:last-child td input { line-height: 20px; border: 0 none; padding: 3px 10px; cursor: pointer; }" + "table.teammates font { color: black; } " + "table.teammates td:last-child { }" + ".xt-table { border-collapse: collapse; background: 0 none; font-size: 11px; font-family: Calibri, 'Trebuchet MS'; }" + ".xt-table td, .xt-table th { border: 1px solid #E8F6E7; height: 20px; line-height: 20px; }" + ".xt-table .xt-header-row th { padding-top: 15px; font-size: 15px; text-shadow: 1px 1px 0px white; text-align: left; vertical-align: bottom;  }" + ".form0 td, div.form0 { background-color: #c30 }" + ".form1 td, div.form1 { background-color: #FF7953 }" + ".form2 td, div.form2 { background-color: #FBFF64 }" + ".form3 td, div.form3 { background-color: #72FF42 }" + ".form4 td, div.form4 { background-color: #31C400 }" + "table.teammates tr.statrot > td:last-child," + "table.teammates tr.statgelb > td:last-child," + "table.teammates tr.statverl > td:last-child," + "table.teammates tr.stattl > td:last-child { background-color: grey; font-weight: bold; padding: 0 3px; }" + "table.teammates td.xt-bar { padding: 0; }" + "#content #teammates td.erfahrung { width: 60px; height: 26px; padding: 0; }" + "td.erfahrung .container { position: relative; width: 100px; height: 26px; }" + "td.erfahrung div.balken, td.erfahrung div.wert { top: 0; left: 0; position: absolute; height: 26px; line-height: 26px; z-index: 0 }" + "td.erfahrung div.wert { width: 100px; z-index: 100; cursor: pointer; }" + "td.erfahrung div.balken { background-color: rgba(0,0,0,0.25); }" + "td.erfahrung.aufstieg div.wert, td.erfahrung.zu-alt div.wert { color: #eeeeee; font-weight: bold; }" + "td.erfahrung.zu-alt { background-color: #700; }" + "td.erfahrung.aufstieg div.balken { background-color: rgba(0,0,0,0.9); }" + ".xt-bar { padding: 0; margin: 0 }" + ".xt-bar .xt-bar-container { position: relative; height: 26px; }" + ".xt-bar .xt-bar-container .xt-bar-balken, .xt-bar .xt-bar-container .xt-bar-wert { position: absolute; top: 0; left: 0; }" + ".xt-bar .xt-bar-container .xt-bar-balken { background: rgba(0,0,0,0.25); z-index: 0 }" + ".xt-bar .xt-bar-container .xt-bar-wert { font-weight: bold; z-index: 100 }" + "#info td.xt-bar { padding: 0; }" + ".xt-table-strongness td { background-color: grey }" + ".xt-table-strongness .xt-bar-wert { text-indent: 6px }" + ".xt-legende { padding: 20px 0; margin-left: 10px; }" + ".xt-legende .xt-legende-form { }" + ".xt-legende .xt-legende-fitness, .xt-legende .xt-legende-footnote { clear: left; padding-top: 15px; font-style: italic; }" + ".xt-legende .xt-legende-form div, .xt-legende .xt-legende-fitness div { height: 26px; line-height: 26px; text-align: center; width: 10%; float: left; }" + ".xt-legende .xt-legende-fitness div { width: 20%; }" + ".xt-legende .xt-legende-form p, .xt-legende .xt-legende-fitness p { font-style: italic; clear: left; line-height: 26px; }" + ".xt-statistic .info_topic { cursor: pointer; }" + ".xt-statistic span.closed, .xt-statistic span.open { float: left; width: 12px; font-size: .8em; }" + ".xt-statistic span.open { margin-top: 1px; }" + ".xt-statistic .closed .closed { display: block; }" + ".xt-statistic .closed .open { display: none; }" + ".xt-statistic .open .closed { display: none; }" + ".xt-statistic .open .open { display: block; }" + ".xt-statistic .xt-table { width: 100%; }" + ".xt-statistic .xt-table td, .xt-statistic .xt-table th { background-color: #C1DCB5; text-align: center; }" + ".xt-statistic .xt-table td:last-child { font-weight: bold; background-color: #B2CBA8; }" + ".xt-statistic .xt-table tbody th { text-align: left; padding: 0; }" + ".xt-statistic .xt-table .xt-bg { background-color: #B2CBA8; padding: 3px 0; text-indent: 3px; }" + ".xt-statistic .xt-table .xt-value { width: 150px; }" + ".xt-statistic .xt-table thead th { background-color: transparent; padding: 0; height: auto; line-height: 11px; }" + ".xt-statistic .xt-table .xt-header-row th { font-size: 11px; padding-top: 0; line-height: 11px; background-color: transparent; }" + ".xt-trigger { margin: 10px 0 5px 0; cursor: pointer }" + ".xt-help { margin-left: 0 }" + ".xt-help.xt-table td { background-color: #C1DCB5; }" + ".xt-help.xt-table td:first-child, .xt-help.xt-table th { font-weight: bold; background-color: #B2CBA8; text-shadow: 1px 1px 0px white; }" + ".xt-stadion .xt-table td { text-align: left; background-color: #C1DCB5; }" + ".xt-stadion .xt-table td:first-child { font-weight: bold; text-shadow: 1px 1px 0px white; }" + "#xt-tooltip { position:absolute; z-index:9999; width:180px; background-color: rgba(0,0,0,0.8); border: 1px solid rgb(51,51,51); -webkit-border-radius: 10px; border-radius: 10px; }" + "#xt-tooltip .xt-tooltip-inner { color:#eeeeee; font-size: 11px; font-family: Calibri, 'Trebuchet MS'; padding:5px; }" + "#content .xt-headline, #menu .xt-headline { margin: 10px 0 5px 10px; height: auto; text-shadow: 1px 1px 0px white; font-size: 13px; }" + "#menu .vlogo_size { border: 0 none; }" + "#menu .xt-headline { margin: 20px 0 5px 15px; }" + "#menu .xt-link { display: block; margin: 5px 0 5px 15px; }" + ".content_icon img { width: 30px; margin-top: 3px; }" + ".xt-dialog-modal { padding-bottom: 20px; }" + ".xt-dialog-modal p { margin: 5px 0; width: 400px; }" + "#simplemodal-overlay { background-color: #000; }" + "#simplemodal-container { background-color: #E8F6E7; border: 8px solid #999; padding: 20px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; }" + "#simplemodal-container h2 { font-size: 16px; height: auto; text-shadow: 1px 1px 0px white; margin: 0 0 15px; }" + "@media (min-width: 990px) {" + "#window_ads { display: none; }" + "#window_2mm { position: realtive; margin-top: -7px; }" + "#header_bg {position: fixed; z-index: 10000; width: 986px; }" + "#content {margin-left: 179px; margin-top: 97px; }" + "#menu { position: fixed; top: 77px; background-color: rgba(232, 246, 231, .9); z-index: 1000; }" + "#info { margin-top: 57px; }" + "}";
  css = css.replace(/; /g, ' !important;');
  if (typeof GM_addStyle !== "undefined") {
    return GM_addStyle(css);
  } else if (typeof PRO_addStyle !== "undefined") {
    return PRO_addStyle(css);
  } else if (typeof addStyle !== "undefined") {
    return addStyle(css);
  } else {
    heads = document.getElementsByTagName("head");
    if (heads.length > 0) {
      node = document.createElement("style");
      node.type = "text/css";
      node.appendChild(document.createTextNode(css));
      return heads[0].appendChild(node);
    }
  }
})();