function switchLanguage(url,newLanguage){
  //find the end of the filename
  var strPos = url.lastIndexOf(".");
  //go two positions back to replace the old language (de | en | fr | es) with the new one
  //include the point when replacing to avoid replacing mistakenly e.g. "es" in impressum_en.php
  var newURL = url.replace(url.substring(strPos-2,strPos+1),newLanguage+".");
  //send user to new url
  location.href = newURL;
  return false;
}



