// -----------------------------
// SERVER INFO
// ------------------------------

// TESTING
var testing = {
	assets: "file:///C:/projects/Activision/WWW_GuitarHero_Metallica/repository/DEV_Deploy/assets/",
	securityDomain: "false"
};

// TESTING2
var testing2 = {
	assets: "file:///Users/Andrew/SVN/GHMetallica/GHMetallica/DEV_Deploy/assets/",
	securityDomain: "false"
};

// LOCALHOST
var localhost = {
	url: "localhost",
	assets: "http://localhost/Activision/WWW_GuitarHero_Metallica/repository/DEV_Deploy/assets/",
	securityDomain: "true"
};

// STAGING SERVER
var staging = {
	url: "http://activision.blitzagency.com/GUITAR_HERO/GHMetallica/internal_staging_versions/v0100/",
	assets: "http://activision.blitzagency.com/GUITAR_HERO/GHMetallica/internal_staging_versions/v0100/assets/",
	securityDomain: "true"
};

// QA SERVER
var qa = {
	url: "http://ghm.atvi.2advanced.com/",
	assets: "http://cdn.guitarhero.com/ghm/staging/assets/",
	securityDomain: "true"
};

// LIVE SERVERS
var live = {
	url: "http://metallica.guitarhero.com/",
	assets: "http://cdn.guitarhero.com/ghm/assets/",
	securityDomain: "true"
};

var live1 = {
	url: "http://www.metallica.guitarhero.com/",
	assets: "http://cdn.guitarhero.com/ghm/assets/",
	securityDomain: "true"
};

var live2 = {
	url: "http://www.guitarherometallica.com/",
	assets: "http://cdn.guitarhero.com/ghm/assets/",
	securityDomain: "true"
};

var live3 = {
	url: "http://metallica.guitarhero.com/",
	assets: "http://cdn.guitarhero.com/ghm/assets/",
	securityDomain: "true"
};

var live4 = {
	url: "http://guitarherometallica.com/",
	assets: "http://cdn.guitarhero.com/ghm/assets/",
	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 = testing;
	serverLocation = testing2;
	
	// we are on localhost
	if(url.indexOf(localhost.url) != -1) {
		serverLocation = localhost;
	}
	
	// we are on staging server
	else if(url.indexOf(staging.url) != -1)	{
		serverLocation = staging;
	}
	
	// we are on live servers
	else if(url.indexOf(live.url) != -1) {
		serverLocation = live;
	}
	else if(url.indexOf(live1.url) != -1) {
		serverLocation = live1;
	}
	else if(url.indexOf(live2.url) != -1) {
		serverLocation = live2;
	}
	else if(url.indexOf(live3.url) != -1) {
		serverLocation = live3;
	}
	else if(url.indexOf(live4.url) != -1) {
		serverLocation = live4;
	}
	
	// we are on live server
	else if(url.indexOf(qa.url) != -1) {
		serverLocation = qa;
	}
	

};

// determin server location, results will be in 'serverLocation' object
determineServerLocation();

