function readCookie(name) {
    var nameEQ;
    nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}


function redirectWelcome()
{
    if (readCookie("bcomLanguage") != null)
    {
        window.location = "../start";
    }
}


function redirectIndex()
{
    if (window.location.pathname.indexOf("berner/be") >= 0 || window.location.pathname.indexOf("berner/versailles/be") >= 0)
    {
        window.location = "pages/welcome_be.html";
    }
    else
    {
        window.location = "start";
    }
}

function redirectHome()
{

    if ((window.location.pathname.indexOf("berner/be") >= 0 || window.location.pathname.indexOf("berner/versailles/be") >= 0) && (window.location.pathname.indexOf("language=")<0))
    {
        
        if (readCookie("bcomLanguage") == null)
        {
            window.location = "welcome_be.html";
        }
    }
}