simsekcountr / ea menu and article

// ==UserScript==
// @name           ea menu and article
// @namespace      ea menu and article
// @author         Lother
// @description    ea
// @version        1.1
// @match          http://*.erepublik.com/*
// @include        http://*.erepublik.com/*
// ==/UserScript==
var urlList = new Array();
function add(name, url, target)
{
  var item = {
    0: name,
    1: url,
    2: target
  };
  urlList.push(item);
}
function update()
{
  var ul = document.getElementById('menu5').getElementsByTagName('ul') [0];
  for (var i = 0; i < urlList.length; i++)
  {
    var li = document.createElement('li');
    var link = document.createElement('a');
    link.setAttribute('href', urlList[i][1]);
    link.setAttribute('target', ((urlList[i][2] == true) ? '_blank' : '_self'));
    var name = document.createTextNode(urlList[i][0]);
    link.appendChild(name);
    li.appendChild(link);
    ul.appendChild(li);
  }
}
add('IRC', 'http://mibbit.com/?channel=%23etr,%23grupturko&server=rizon.mibbit.org', true);
add('son haberler', 'http://www.erepublik.com/en/news/latest/all', false);
add('erepmatik', 'http://eagazetesi.wix.com/erepmatik', true);
add('erepmatik docs.', 'http://goo.gl/QCMKni', true);
add('EA Gazetesi', 'http://www.erepublik.com/en/newspaper/ea-gazetesi-236231/1', true);
update();