var sdk = (function(){ var sdk = {} sdk.env = "development" var endpoint = "https://secure.api.yoox.biz/" // var endpoint = "http://api.yoox.biz/" sdk.init = function(opt){ switch (sdk.env = opt.env || "development") { case 'test': endpoint = window.location.origin + "/" break default: case 'development': endpoint = "/" break case 'production': endpoint = "https://secure.api.yoox.biz/" break } } sdk.path = function(api, path, cc){ return endpoint + api + "/STONEISLAND_" + (cc || sdk.cc()) + "/" + path } sdk.image = function(code, size){ return "https://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg" } sdk.cc = function(){ return sim.data.countryCode.toUpperCase() // return 'CA' } sdk.cms = function(){ return "https://stone.giraffe.life" // return "http://staging.stone.giraffe.life" } $.ajaxSetup({ // possibly: application/json; charset=utf-8" contentType: "application/json", }) return sdk })()