function load_replacer(id, url, loadext)
{
  url = url.replace(/[//]/g, "|");
  url = url.replace(/[?]/g, "|v|");
  url = url.replace(/[&]/g, "|a|");
  url = url.replace(/[%]/g, "|p|");
  var myAjax = new Ajax.Updater(id, loadext + "?url=" + url, { method: 'get' });
}

function generate_lists(loadext)
{
   NOCACHE = "&NOCACHE";
   NOCACHE = "";
   //country = location.href.slice(location.href.lastIndexOf("/") + 1, location.href.lastIndexOf(".html"));
   url = location.href.replace("?middle", "");
   if (url[url.length - 1] == "/") url = url.substr(0, url.length - 1);
   country = url.substr(url.indexOf("/landen/") + 8);
   
   if (country.indexOf("/") > -1)
    country = country.substring(0, country.indexOf("/"));
    
   if (country && country.indexOf(".") == -1 && country.indexOf("localhost") == -1)
   {
     document.writeln("<DIV id='replacer1'><DIV id='win_loading'><BR>Bezig met laden...</A><BR><BR></DIV></DIV>");
     document.writeln("<DIV id='replacer2'><DIV id='win_loading'><BR>Bezig met laden...</A><BR><BR></DIV></DIV>");
     load_replacer('replacer1', 'http://www.reizenbank.nl/formatter/list.php?LIST=reizenportal_top10_' + country + '_foto' + NOCACHE, loadext);
     load_replacer('replacer2', 'http://www.reizenbank.nl/formatter/list.php?LIST=reizenportal_' + country + '_lang' + NOCACHE, loadext);
   }
}
