// ==UserScript==
// @name           Extra links under villageslist
// @namespace      http://seo-info.nl/travian
// @include        http://*.travian.*php*
// @exclude 	   http://*.travian.*/login.php*
// @exclude        http://*.travian.*/logout.php*
// @exclude 	   http://*.travian.*/chat.php*
// @exclude 	   http://forum.travian.*
// @exclude 	   http://*.travian.*/index.php*
// @exclude 	   http://*.travian.*/manual.php*
// ==/UserScript==

//Configuration
var links = [
    ['Cropfinder'     , 'http://asite.110mb.com/cropfinder.php'],
    ['Travian World Analyzer'        , 'http://travian.ws/analyser.pl?&lang=nl'],
    ['Travian Tool'        , 'http://www.traviantool.com/index.php5'],
    ['Travianmap.nl'        , 'http://www.travianmap.nl/alpha/'],
    ['Travmap Silenz'        , 'http://traviannl.silenz.org/'],
    ['Travmap Shishnet'        , 'http://travmap.shishnet.org/?lang=nl'],
];

//Code
var menu = document.getElementById('lright1');
if(menu == null) { //Just one village
  menu = document.createElement('div');
  menu.setAttribute('id','lright1');
  document.getElementById('lmidall').appendChild(menu);
}
menu.appendChild(document.createElement('br'));

var elemB, elemUL, elemLI, elemA;

/* Links Menu */
elemB  = document.createElement('b');
elemB.appendChild(document.createTextNode('Extra links:'));
menu.appendChild(elemB)

elemUL = document.createElement('ul');
elemUL.setAttribute('class','dl');
menu.appendChild(elemUL)

for each ( var link in links ){
    elemLI = document.createElement('li');
    elemLI.setAttribute('class','dl');

    elemA = document.createElement('a');
    elemA.href = link[1];
    elemA.appendChild(document.createTextNode(link[0]));

    elemLI.appendChild(elemA);
    elemUL.appendChild(elemLI);
}
