function removeAfterChar(sChar, searchStr)
// remove all the characters after sChar
 {
  pos = searchStr.indexOf(sChar);
  if (pos == -1)
    return searchStr;
  else
    return searchStr.substring(0, pos);
 }

function replaceString(oldStr, searchStr, replaceStr)
// replace in oldStr, searchStr with replaceStr
 {
  pos = oldStr.indexOf(searchStr);
  if (pos == -1)
    return oldStr;
  else
    return oldStr.substring(0, pos) + replaceStr + oldStr.substring(pos + searchStr.length, oldStr.length);
 }
function switchLangue(language)
 {
  documentUrl = window.location.href;
  if (language == "nl")
    {
     goUrl = replaceString(documentUrl, "/fr/", "/nl/");
     goUrl = replaceString(goUrl, "l=/fr/", "l=/nl/");
    }
  else
    {
	goUrl = replaceString(documentUrl, "/fr/", "/nl");
    goUrl = replaceString(goUrl, "l=/fr/", "l=/nl/");
	}
  goUrl = removeAfterChar('#', goUrl);
  window.location = goUrl;
 }
