function preloadImages(arrayOfImages) {
    jQuery(arrayOfImages).each(function () {
        jQuery('<img/>')[0].src = this;
        // Alternatively you could use:
        // (new Image()).src = this;
    });
}

//http: //ditio.net/2010/02/14/jquery-preload-images-tutorial-and-example/
(function ($) {
    var imgList = [];
    $.extend({
        preload: function (imgArr, option) {
            var setting = $.extend({
                init: function (loaded, total) { },
                loaded: function (img, loaded, total) { },
                loaded_all: function (loaded, total) { }
            }, option);
            var total = imgArr.length;
            var loaded = 0;

            setting.init(0, total);
            for (var i in imgArr) {
                imgList.push($("<img />")
					.attr("src", imgArr[i])
					.load(function () {
					    loaded++;
					    setting.loaded(this, loaded, total);
					    if (loaded == total) {
					        setting.loaded_all(loaded, total);
					    }
					})
				);
            }

        }
    });
})(jQuery);

