var Locale = { omniture_pre: 'nfsps_ea_global_localeSelect-', omniture_suff: '', query_string: new Querystring(window.location.search.replace('?','')), locale_param: '', get: function() { //this function should be deprecated but i'm not sure if it's being used anywhere. var country = this.getCookie(); return country; }, set: function(locale,redirect) { if (!redirect) { var redirect = "/prostreet/home.jsp"; } this.callOmniture(locale); if (this.detectCookies()) { this.setCookie(locale); } else { this.locale_param = "?locale=" + locale; } this.jumpTo(redirect); }, jumpTo: function(redirect) { window.location.href = redirect + this.locale_param; }, detectCookies: function(locale) { var ncc = this.query_string.get('ncc'); var cookieStatus; if (ncc == '1') cookieStatus = false; else cookieStatus = true; return cookieStatus; }, setCookie: function(locale) { var expires = new Date(); expires.setFullYear(expires.getFullYear() + 5); var currentHost = window.location.host; if (currentHost.search("ea.com") != -1) currentHost = ".ea.com"; setCookie('locale', locale, expires, '/', currentHost); }, getCookie: function() { return getCookie('locale'); }, callOmniture: function(locale) { //output will look like: 'nfsfran_ea_global_localeSelect-usLink' var omnitureTag = this.omniture_pre + locale + this.omniture_suff; setOmniValues(this,'o',omnitureTag,'','','',0,'',''); } };