jQuery(document).ready( function (jQuery) { }); //============================================================ var derivatives = { elements: null, done: 0, total: 0, finished: function() { derivatives.elements.splice(0, 1); return derivatives.done == derivatives.total && derivatives.elements && derivatives.elements.length==0; } }; function progress(success,data) { if (derivatives.finished()) { jQuery("#theMainImage").trigger("Finish", [derivatives]); } } derivatives.elements = []; var ids = derivatives.elements.splice(0, 500); var params = { max_urls: 10, ids: ids, types: [], src: [],width:[], height:[] }; function getDerivativeUrls(nofile) { params.max_urls = nofile.length; jQuery(nofile).each(function (i, t) { if (typeof t.file != "undefined") { nbsrc = params.src.length; var reg = new RegExp("^\/", "g",1); t.file= t.file.replace( reg ,"",1); if (nbsrc == 0) { params.ids.push(t.id); params.types.push(t.type); params.src.push(t.file); } else if (~jQuery.inArray(t.file, params.src)) { jQuery.noop(); } else { params.ids.push(t.id); params.types.push(t.type); params.src.push(t.file); } } }); if(derivatives.elements.length==0) derivatives.elements = params.ids; derivatives.total += params.src.length; jQuery("body").append("