// read locale // if locale exists > goto locale index // else getcountry > go country index function erasecookies(){ localStorage.setItem('mediaguidactivemedia',''); localStorage.setItem('mediaguidactivecountry',''); alert('Cookies RESET'); } function showcookies(){ alert(localStorage.getItem('mediaguidactivemedia')); alert(localStorage.getItem('mediaguidactivecountry')); }