var UserLocation = 'ITA'; function setUserLocation(loc) { UserLocation = loc; if (window.sessionStorage) { window.sessionStorage.UserLocation = UserLocation; } else if (typeof(utils) != 'undefined' && typeof(utils.cookie) != 'undefined') { utils.cookie.set('usrLoc', UserLocation, {path: '/dl/RaiTV/'}); } } if (window.sessionStorage && window.sessionStorage.UserLocation) { setUserLocation(window.sessionStorage.UserLocation); } else if (typeof(utils) != 'undefined' && typeof(utils.cookie) != 'undefined' && utils.cookie.get("usrLoc")) { setUserLocation(utils.cookie.get("usrLoc")); } else { try { console.log('loading geolocation script'); // document.write('\u003cscript type="text/javascript" src="//mediapolis.rai.it/relinker/relinkerServlet.htm?cont=826819"\u003e;\u003c/script\u003e'); //$.getScript('//mediapolis.rai.it/relinker/relinkerServlet.htm?cont=826819'); setUserLocation("ITA"); } catch(e){} }