var baseUrl = location.href.substring(0,location.href.indexOf('/', 8)) + '/';

var flashVars = {};

flashVars.serverLocation = baseUrl;
flashVars.secureServerLocation = baseUrl;
flashVars.assetsPathPrefix = baseUrl;

switch (flashVars.serverLocation) {
  case "http://localhost:3000/":
    flashVars.secureServerLocation = flashVars.serverLocation;
    flashVars.storeLocatorLocation = "http://localhost:3001";
  break;
  case "http://beta.prada.com/":
    flashVars.secureServerLocation = flashVars.serverLocation;  
  break;
  
  case "http://demo.prada.com":
    flashVars.storeLocatorLocation = "http://beta-storelocator.prada.com";
  break;
  
  default:
   flashVars.secureServerLocation = "https://secure.prada.com/"; 
   flashVars.storeLocatorLocation = "http://storelocator.prada.com";
}

// ecommerce
flashVars.ecommercePathPrefix = baseUrl + 'buy-online/';
flashVars.ecommerceCataloguesPathPrefix = baseUrl;
flashVars.ecommerceAssetsPathPrefix = baseUrl + 'buy-online/';
flashVars.xmlPathPrefix = baseUrl + 'buy-online/assets/xml/';
// ?countryCode=' + getCountryCode(getCookie("country")) + "&language=" + getCookie("language");    
flashVars.orderPageURL = flashVars.secureServerLocation + 'buy-online/order';
flashVars.shoppingBasketLocation = flashVars.secureServerLocation;
flashVars.commerceOrderPageURL =  flashVars.secureServerLocation + 'shoppingbasket/details';

// take the get arguments from the URL and transform into flashvars
var sArgs = location.search.slice(1).split("&");
  if (sArgs.length>0) { 
  for (var i = 0; i < sArgs.length; i++) {
    flashVars[sArgs[i].slice(0, sArgs[i].indexOf("="))] = sArgs[i].slice(sArgs[i].indexOf("=")+1, sArgs[i].length);
  }
}