var Cookies = {
  init: function () {
  var allCookies = document.cookie.split('; ');
    for (var i=0;i<allCookies.length;i++) {
      var cookiePair = allCookies[i].split('=');
      this[cookiePair[0]] = cookiePair[1];
    }
  },
  create: function (name,value,days) {
    if (days) {
      var date = new Date();
      date.setTime(date.getTime()+(days*24*60*60*1000));
      var expires = "; expires="+date.toGMTString();
    }else var expires = "";
      document.cookie = name+"="+value+expires+"; path=/";
    this[name] = value;
  },
  erase: function (name) {
    this.create(name,'',-1);
    this[name] = undefined;
  }
};
Cookies.init();

function saveCookie(lang) {
//alert('Uw keuze is vastgelegd op:\nYour choice is set on:\nIhre Wahl wird eingestellt an:\n\n'+lang);
  Cookies.create('Taal', lang, 28);
  document.location = lang;
}

function init() {
  if(Cookies['Taal'])
  {
    document.location = Cookies['Taal'];
} }

/*window.onload = init;*/
init();