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;
}

        // Redirect from welcome page to start, if language set
function redirectWelcome()
{
    if (readCookie("bcomWelcomePage") != null)
    {
        window.location = "../start";
    }
}



      // Redirect to Welcome Page in Belgien
function redirectToLanguageSelector()
{

    if (window.location.pathname.indexOf("berner/be") >= 0  && (window.location.pathname.indexOf("language=")<0))
    {

        if (readCookie("bcomWelcomePage") == null)
        {
            window.location = "pages/welcome_be.html";
        }
    }
}
