function extractDomain(url) { var domain; //find & remove protocol (http, ftp, etc.) and get domain if (url.indexOf("://") > -1) { domain = url.split('/')[2]; } else { domain = url.split('/')[0]; } //find & remove port number domain = domain.split(':')[0]; return domain; } var endPoints = { CommercialSearchAction : 'http://commercialsearch.savills.co.uk/external/search', commercialSearchAutoCompleteUrl : 'http://commercialsearch.savills.co.uk/external/AutoCompleteList', GrsWebBase : 'https://search.savills.com', TileServer : 'https://search.savills.com/tileserver/highlight', templatesEndPoint : 'https://search.savills.com/', dataEndPoint : 'https://livev5-searchapi.savills.com', DialogEndPoint : 'https://livev5-dialog.savills.com', ProfileEndPoint : 'https://livev5-profile.savills.com', AuthenticationEndPoint : 'https://livev5-authentication.savills.com/token', AuthenticationBaseEndPoint : 'https://livev5-authentication.savills.com', GoogleMapsApIKey : 'v=3', UseMapHighlight : 'true', PropertyTrackerURL : 'http://localfakepts.#{urlSuffix}/Application.aspx', }; var isRussia1 = false var serviceDirectory = { CommercialSearchAction: endPoints.CommercialSearchAction, commercialSearchAutoCompleteUrl: endPoints.commercialSearchAutoCompleteUrl, GrsWebBase: isRussia1? endPoints.GrsWebBaseRu: endPoints.GrsWebBase, templatesEndPoint: isRussia1? endPoints.templatesEndPointRu: endPoints.templatesEndPoint, dataEndPoint: endPoints.dataEndPoint, ProfileEndPoint: endPoints.ProfileEndPoint, PropertyTrackerURL:endPoints.PropertyTrackerURL }; var commercialSearchRootDomain = "http://" + extractDomain(endPoints.commercialSearchAutoCompleteUrl); var slaves = {}; slaves[serviceDirectory.dataEndPoint] = "/Content/proxy.html"; slaves[serviceDirectory.GrsWebBase] = "/External/Proxy"; slaves[serviceDirectory.DialogEndPoint] = "/Content/proxy.html"; slaves[serviceDirectory.ProfileEndPoint] = "/Content/proxy.html"; slaves[serviceDirectory.AuthenticationBaseEndPoint] = "/Content/proxy.html"; slaves[commercialSearchRootDomain] = "/Content/proxy.html"; xdomain.slaves(slaves); // IE9 Console issue bug fix , console is not a standard object in HTML , through angular needs it.. if (!window.console) window.console = {}; if (!window.console.log) window.console.log = function () { }; if (!window.console.debug) window.console.debug = function () { }; if (!window.console.warn) window.console.warn = function () { };