<script>
/**
 * Mocking client-server processing
 */

var Shop = Shop || {};

(function() {

    var internals = {
        products: [
            { "id": 1, "title": "iPad 4 Mini", "price": 500.01, "inventory": 2, "image": "/assets/ipad-mini.png" },
            { "id": 2, "title": "H&M T-Shirt White", "price": 10.99, "inventory": 10, "image": "/assets/t-shirt.png" },
            { "id": 3, "title": "Charli XCX - Sucker CD", "price": 19.99, "inventory": 5, "image": "/assets/sucker.png" }
        ]
    };

    var TIMEOUT = 100;

    Shop.getProducts = function (cb, timeout) {
        timeout = timeout || TIMEOUT;
        setTimeout(function () {
            cb(null, internals.products);
        }, timeout);
    };

    Shop.buyProducts = function (payload, cb, timeout) {
        timeout = timeout || TIMEOUT;
        setTimeout(function () {
            cb();
        }, timeout);
    };

})();

</script>

<script>
/**
 * Mocking client-server processing
 */

var Shop = Shop || {};

(function() {

    var internals = {
        products: [
            { "id": 1, "title": "iPad 4 Mini", "price": 500.01, "inventory": 2, "image": "assets/ipad-mini.png" },
            { "id": 2, "title": "H&M T-Shirt White", "price": 10.99, "inventory": 10, "image": "assets/t-shirt.png" },
            { "id": 3, "title": "Charli XCX - Sucker CD", "price": 19.99, "inventory": 5, "image": "assets/sucker.png" }
        ]
    };

    var TIMEOUT = 100;

    Shop.getProducts = function (cb, timeout) {
        timeout = timeout || TIMEOUT;
        setTimeout(function () {
            cb(null, internals.products);
        }, timeout);
    };

    Shop.buyProducts = function (payload, cb, timeout) {
        timeout = timeout || TIMEOUT;
        setTimeout(function () {
            cb();
        }, timeout);
    };

})();

</script>

Make images uris in mock data relative to page
Make images uris in mock data relative to page
