<!--
// Function to change/switch the language (de/en)
function changeLanguage() {
    var currentURL = location.href;
    var newURL = ""; // default
    var replacement = ".de."; // Default
    var langCodePosition = -1; // Default
    var oldLangCode = ".de."; // Default
    if ((currentURL.indexOf(oldLangCode) != -1) || (currentURL.indexOf(".html.") != -1)) {
        // Check for german...
        langCodePosition = currentURL.indexOf(oldLangCode);
        if (langCodePosition == -1) {
            oldLangCode = ".html.";
            langCodePosition = currentURL.indexOf(oldLangCode);
        }
        replacement = ".en.";
    } else if (currentURL.indexOf(".en.") != -1) {
        // Check for english...
        oldLangCode = ".en.";
        langCodePosition = currentURL.indexOf(oldLangCode);
        replacement = ".de.";
    } else if (document.images["flagimg"].src.indexOf("germany") != -1) {
        currentURL = currentURL + "index.en.html";
        oldLangCode = ".en.";
        replacement = ".de."
        langCodePosition = currentURL.indexOf(oldLangCode);
    } else if (document.images["flagimg"].src.indexOf("usa_uk") != -1) {
        currentURL = currentURL + "index.de.html";
        oldLangCode = ".de.";
        replacement = ".en."
        langCodePosition = currentURL.indexOf(oldLangCode);
    }
    if (langCodePosition >= 0) {
        newURL = currentURL.substr(0, langCodePosition) + replacement + currentURL.substr(langCodePosition+oldLangCode.length, currentURL.length);
        location.href = newURL
    }
} // end changeLanguage

//-->
