/*
    Load the image at URL src. Once it's loaded optionally call the callback function.
    The callback should take two parameters: the image URL (src) and the
    image itself.
*/
loadImage = function(src, callback) {
    var img = new Image();
    if (callback) {
        img.onload = function() {callback(src, img);}
    }
    img.src = src;
}

