function convertLanguageCode(langCode) { var temp = ""; var newtemp = ""; langCode = '' + langCode; splitstring = langCode.split("-"); for (i = 0; i < splitstring.length; i++) { temp += splitstring[i]; } temp = '' + temp; splitstring = temp.split("/"); for (i = 0; i < splitstring.length-1; i++) { newtemp += splitstring[i]; } return newtemp; } function convertLanguageCodeSlash(langCode) { var temp = ""; var newtemp = ""; var splitstring = ""; langCode = '' + langCode; splitstring = langCode.split("-"); for (i = 0; i < splitstring.length; i++) { temp += splitstring[i]; } splitstring = temp.split("/"); for (i = 0; i < splitstring.length; i++) { newtemp += splitstring[i]; } return newtemp; } function gotoLocalizedRegister(countrycode) { url="/ChooseToRegister?sLang=" + countrycode; document.location=url; }; function getLocalServerToSale(lang, thislocation){ var servername="games.ea.com"; var locallocation =""; if(lang=="default"){ locallocation="http://"+servername+thislocation; }else{ var position=servername.search(/[0-9,\.]/); // if you want to go to english cant just replace lang because int and prod use www instead of ea if ((lang == "ea") || (lang == "en")){ // if you are in prod or int if((servername.indexOf("str") == -1) && (servername.indexOf("asm") == -1) && (servername.indexOf("dev") == -1)){ locallocation = "http://www" + servername.slice(position, (servername.length))+ thislocation; // if you are in string, preview or assembly } else { locallocation = "http://"+ lang + servername.slice(position, (servername.length))+ thislocation; } }else if(lang == "es"){ locallocation = "http://www.ea.com/global/legal/tosale/tosale_es.jsp"; }else{ locallocation = "http://"+ lang + servername.slice(position, (servername.length))+ thislocation; } } return locallocation; } function getLocalServer(lang, thislocation){ var servername="games.ea.com"; var locallocation =""; if(lang=="default"){ locallocation="http://"+servername+thislocation; }else{ var position=servername.search(/[0-9,\.]/); // if you want to go to english cant just replace lang because int and prod use www instead of ea if ((lang == "ea") || (lang == "en")){ // if you are in prod or int if((servername.indexOf("str") == -1) && (servername.indexOf("asm") == -1) && (servername.indexOf("dev") == -1)){ locallocation = "http://www" + servername.slice(position, (servername.length))+ thislocation; // if you are in string, preview or assembly } else { locallocation = "http://"+ lang + servername.slice(position, (servername.length))+ thislocation; } }else if(lang == "es"){ locallocation = "http://account.ea.com/legal/legal.jsp?locale=es&site=eaeu"; }else{ locallocation = "http://"+ lang + servername.slice(position, (servername.length))+ thislocation; } } return locallocation; } function getLocalServerSecure(langsecure, thislocationsecure){ var securelocation = getLocalServer(langsecure, thislocationsecure); securelocation = "https://"+securelocation.slice(7, (securelocation.length)); return securelocation; }