
function link(id,url,text1,text2,chance) {
   this.id = id;
   this.url = url;
   this.text1 = text1;
   this.text2 = text2;
   this.chance = chance;
}

links = new Array();

sum_of_all_chances = 0;
for (i = 0; i < links.length; i++) {
  sum_of_all_chances += links[i].chance;
}
function linkfeed() {
  chance_limit = 0;
  randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
  for (i = 0; i < links.length; i++) {
    chance_limit += links[i].chance;
    if (randomly_selected_chance <= chance_limit) {
      document.write("<img src=\"http://feed.linkfeed.nl/img/vinkje.gif\" alt=\"\" width=\"14\" height=\"14\"> <A HREF=\"" + links[i].url + "\" target=\"_blank\" rel=\"nofollow\"><b><font color=\"red\" face=\"Arial\" size=\"2\">" + links[i].text1 + "</font><font color=\"black\" face=\"Arial\" size=\"2\"> - " + links[i].text2 + "</font></b> <font color=\"black\" face=\"Arial\" size=\"1\">klik hier</font></A><img src=\"http://manager.linkfeed.nl/log.php?id=" + links[i].id + "&ref=kadoabonnement\" alt=\"\" width=\"1\" height=\"1\">");
      return links[i];
      break;
    }
  }
}

this_link = linkfeed();

