function checkLanguageAndFunction() {
  var language = readCookie('language');
  var theFunction = readCookie('function');

  if(language != null && theFunction != null)
    window.location.href = language + "/" + theFunction + "/index.php";
}

function setLanguage(language) {
  var expirationDate = new Date(2020,1,1,0,0,0,0);
  document.cookie = "language="+language+"; expires=" + expirationDate.toGMTString();
}

function setFunction(personFunction) {
  var expirationDate = new Date(2020,1,1,0,0,0,0);
  document.cookie = "function="+personFunction+"; expires=" + expirationDate.toGMTString();
}

function setLanguageAndFunction(language,personFunction) {
  setLanguage(language);
  setFunction(personFunction);
}

function getLanguageAndFunction() {
  var theCookie = document.cookie;
  alert(theCookie);
}

function readCookie(name) {
  var 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;
}
// *** Language selection *********************
function English() {
  setLanguageAndFunction('en','band');
  checkLanguageAndFunction();
}

function goEnglish() {
  setLanguageAndFunction('en','band');
  checkLanguageAndFunction();
}

function Nederlands() {
  setLanguageAndFunction('nl','band');
  checkLanguageAndFunction();
}

function Francais() {
  setLanguageAndFunction('fr','band');
  checkLanguageAndFunction();
}

// *** Main buttonbar functions *********************
function WhatDoWeDo() {
  window.location.href = "whatdowedo.php";
}

function WatDoenWij() {
  window.location.href = "whatdowedo.php";
}

function QueFaisonsNous() {
  window.location.href = "whatdowedo.php";
}

function FAQ() {
  window.location.href = "faq.php";
}

function Clubs() {
  window.location.href = "clubs.php";
}

function Salles() {
  window.location.href = "clubs.php";
}

function Contact() {
  window.location.href = "contact.php";
}

function TNSNearYou() {
  window.location.href = "tnsnearyou.php";
}

function DansTaRegion() {
  window.location.href = "tnsnearyou.php";
}

function TNSDichtbij() {
  window.location.href = "tnsnearyou.php";
}

function HomeBanner() {
  window.location.href = "index.php";
}