javascript:void function() {sit = game_data.player.sitter_id == "0" ? "" : "&t=" + game_data.player.id;if (!location.href.match(/screen=info_player/)) {confirm("Werkt alleen op een spelerprofiel, klik op ok om naar jouw profiel te gaan,") ? (location.href = "/game.php?screen=info_player&id=" + game_data.player.id + sit) : false;return false;} else {id = location.href.match(/&id=(\d+)$/)[1];tid = 0;oid = game_data.player.id;otid = game_data.player.ally_id;tl = $("#content_value table.vis a[href*=\"info_ally\"]");if (tl.length) {tid = tl.attr("href").match(/&id=(\d+)$/)[1];}cls = ["800080", "0000aa", "ff2000", "f0c800"];function ct() {bu = "http://twsmap.com/mapservice/" + game_data.world + "?";function p(a) {return parseInt(a);}function sq(a) {return Math.sqrt(a);}function abs(a) {return Math.abs(a);}function pw(a, b) {return Math.pow(a, b);}function cd(a, b) {return [abs(a[0] - b[0]), abs(a[1] - b[1])];}function d(a, b) {k = cd(a, b);return sq(pw(k[0], 2) + pw(k[1], 2));}function mx(a) {t = 0;a.forEach(function (i) {t = i > t ? i : t;});return t;}function as(a) {r = 0;a.forEach(function (b) {r += b;});return r;}function rp(a, c) {return a.replace(/_x_/, c[0]).replace(/_y_/, c[1]).replace(/_p_/, game_data.player.id).replace(/_t_/, game_data.player.ally_id);}function gcv(c) {cl = c.length;e = [];c.forEach(function () {e.push(new Array(cl));});for (i = 0; i < cl; i++) {for (j = 0; j < cl; j++) {if (e[i][j] == undefined) {e[i][j] = e[j][i] = d(c[i], c[j]);}}}g = 0;e.map(as).forEach(function (a, b) {!g || a < g[1] ? (g = [b, a]) : (g = g);});md = mx(e[g[0]]);g = c[g[0]];return [g, md];}c = [];$("#villages_list").find("tr td:nth-child(2)").text().split(/(\d{3}\|\d{3})/).forEach(function (i) {if (i) {c.push(i.split("|").map(p));}});cv = gcv(c);br = cv[0].slice(0);if (id !== oid) {$.post("/game.php?screen=groups&mode=overview&ajax=load_villages_from_group&group_id=0" + sit, function (data) {c = [];$(data).find("#group_table tr td:nth-child(2)").text().split(/(\d{3}\|\d{3})/).forEach(function (i) {if (!i.match(/\s+/)) {c.push(i.split("|").map(p));}});ov = gcv(c);br[0] = Math.round((cv[0][0] + ov[0][0]) / 2);br[1] = Math.round((cv[0][1] + ov[0][1]) / 2);om(br, cv, ov);});return;} else {cls[2] = cls[3];om(br, cv, cv);}function om(g, ovd, cvd) {cls[0] = tid == otid ? cls[1] : cls[0];cg = ovd[0];cc = cvd[0];mdg = (cvd[1] + ovd[1]) * 2;di = mx(cd(cg, cc)) + mdg / sq(2);zoom = Math.floor(100000 / di);rq = (tid ? "&ti0=" + tid + "&tc0=" + cls[0] : "") + (otid == tid || otid == 0 ? "" : "&ti1=" + otid + "&tc1=" + cls[1]) + "&pi0=" + id + "&pc0=" + cls[2] + (oid == id ? "" : "&pi1=" + oid + "&pc1=" + cls[3]) + "&zoom=" + zoom + "¢rex=" + g[0] + "¢rey=" + g[1] + "&nocache=1&fill=000000";open(bu + rq);}}lr = $("#villages_list").find("td").last();if (lr.attr("colspan") == 3) {$.getJSON("/game.php?screen=info_player&ajax=fetch_villages&player_id=" + id + sit, function (d) {lr.parents().first().after(d.villages).remove();ct();});} else {ct();}}}();