Move cookie/getLocation code to marketplace.js