
/* - userLocation_vars.js - */
// http://fdsweb-b.factset.com/portal_javascripts/userLocation_vars.js?original=1
var userLocation=new UserLocation("Unknown","Unknown");
function UserLocation(city,country){this.city=city;this.country=country}
function locationstatechange(){if(xmlhttp.readyState==4&&xmlhttp.status==200){var location=xmlhttp.responseXML.documentElement;userLocation.city=location.getElementsByTagName("city")[0].firstChild.data;userLocation.country=location.getElementsByTagName("country")[0].firstChild.data;document.cookie="user_country="+userLocation.country+";path=/"
document.cookie="user_city="+userLocation.city+";path=/"
location_callback()}}
function readUserCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ') c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length)}
return null}
function loadUserLocation(){if(document.cookie.indexOf('user_country')==-1||document.cookie.indexOf('user_city')==-1){xmlhttp=createXMLHTTP();xmlhttp.onreadystatechange=locationstatechange
xmlhttp.open("GET",'/userLocation.xml');xmlhttp.send(null)} else{userLocation.city=readUserCookie('user_city');userLocation.country=readUserCookie('user_country');location_callback()}}
function locationstatechange_mm(){if(xmlhttp.readyState==4&&xmlhttp.status==200){var location=xmlhttp.responseXML.documentElement;userLocation.city=location.getElementsByTagName("city")[0].firstChild.data;userLocation.country=location.getElementsByTagName("country")[0].firstChild.data;document.cookie="user_country="+userLocation.country+";path=/"
document.cookie="user_city="+userLocation.city+";path=/"
location_callback_mm()}}
function location_callback_mm(){if(userLocation.country=="Unknown"||userLocation.country=="US")
$("#support_number").html("+1.617.376.0550");else
$("#support_number").html("+44.(0)20.3009.7300")}
function loadUserLocation_mm(){if(document.cookie.indexOf('user_country')==-1||document.cookie.indexOf('user_city')==-1){xmlhttp=createXMLHTTP();xmlhttp.onreadystatechange=locationstatechange_mm
xmlhttp.open("GET","http://"+$("#host").val()+"/userLocation.xml");xmlhttp.send(null)} else{userLocation.city=readUserCookie('user_city');userLocation.country=readUserCookie('user_country');location_callback_mm()}}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1) c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}
return ""}
function locationstatechange_jp(){if(xmlhttp.readyState==4&&xmlhttp.status==200){var location=xmlhttp.responseXML.documentElement;userLocation.city=location.getElementsByTagName("city")[0].firstChild.data;userLocation.country=location.getElementsByTagName("country")[0].firstChild.data;document.cookie="user_country="+userLocation.country+";path=/"
document.cookie="user_city="+userLocation.city+";path=/"
location_callback_jp()}}
function location_callback_jp(){drawSupportNumber();if(userLocation.country=="JP"&&getCookie('factset_lang')!="eng")
window.location="http://www.factset.co.jp"}
function loadUserLocation_jp(){if(document.cookie.indexOf('user_country')==-1||document.cookie.indexOf('user_city')==-1){xmlhttp=createXMLHTTP();xmlhttp.onreadystatechange=locationstatechange_jp
xmlhttp.open("GET",'/userLocation.xml');xmlhttp.send(null)} else{userLocation.city=readUserCookie('user_city');userLocation.country=readUserCookie('user_country');location_callback_jp()}}


