// -----------------------------
// SERVER INFO
// ------------------------------

// TESTING
var local = {
	url: "file:///C:/",
	assets: "file:///C:/projects/Starbucks/SharedPlanet_Phase2_5/DEV_Deploy/flash/Interactive_Map/assets/",
	securityDomain: "false",
	apiKey: "ABQIAAAA-0TfI3N5H2hnmz1cOFkpghQT-wfGr_T_-JggI63M6ZDMJ_pJNRQbhsOumfLfkB6LAYKtjfhzhhzonQ"
};

// STAGING SERVER
var dev = {
	url: "starbucks.blitzagencyhosting.com",
	assets: "http://starbucks.blitzagencyhosting.com/sharedplanet/flash/Interactive_Map/assets/",
	securityDomain: "true",
	apiKey: "ABQIAAAA-0TfI3N5H2hnmz1cOFkpghQT-wfGr_T_-JggI63M6ZDMJ_pJNRQbhsOumfLfkB6LAYKtjfhzhhzonQ"
};

// STAGING SERVER
var staging = {
	url: "test.starbucks.com",
	assets: "http://test.starbucks.com/sharedplanet/flash/Interactive_Map/assets/",
	securityDomain: "true",
	apiKey: "ABQIAAAA-0TfI3N5H2hnmz1cOFkpghQ2JoRAg6Eikasc4EyisBhkLsPdpxSG75WrdgNNqiKzdygPX-8VVYuk_w"
};

// LIVE SERVER /
var live = {
	url: "/starbucks.com",
	assets: "http://starbucks.com/sharedplanet/flash/Interactive_Map/assets/",
	apiKey: "ABQIAAAADsVqTZhFgQlBUYyJib-e4xRKbQulrJzFOfO-YfxdBkAUGjWgRRTX4qzzYLLU8nFwbUEDpQMQLLXEkA",
	securityDomain: "true"
};

// LIVE SERVER WWW
var live_www = {
	url: "www.starbucks.com",
	assets: "http://www.starbucks.com/sharedplanet/flash/Interactive_Map/assets/",
	apiKey: "ABQIAAAADsVqTZhFgQlBUYyJib-e4xRKbQulrJzFOfO-YfxdBkAUGjWgRRTX4qzzYLLU8nFwbUEDpQMQLLXEkA",
	securityDomain: "true"
};

var url = window.location.href; // current window full URL 
var serverLocation; // object consisting of server properties

/**
  *  Determines if the current window's location is on localhost, staging, or live
  *  
  *  If the server location can be determined the full URL is attached to the 'serverLocation' object
  */
function determineServerLocation() {
	// we are testing
	serverLocation = live_www;
	
	// we are on live, but without www
	if(url.indexOf(live.url) != -1) {
		serverLocation = live;
	}
	
	// we are on local
	if(url.indexOf(local.url) != -1) {
		serverLocation = local;
	}
	
	// we are on dev server
	else if(url.indexOf(dev.url) != -1)	{
		serverLocation = dev;
	}
	
	// we are on staging server
	else if(url.indexOf(staging.url) != -1)	{
		serverLocation = staging;
	}

};

// determin server location, results will be in 'serverLocation' object
determineServerLocation();