rendered paste bodyfunction clear_blocks(num){ var selector_num = num ? num : 1; var text_object = $('#txtblock_'+selector_num); var image_object = $('#imgblock_'+selector_num); if (image_object.length){ var start_height = image_object.height() + RESIZE_DIFF; var start_width = image_object.width() + RESIZE_DIFF; image_object.height(start_height); image_object.width(start_width); image_object.attr('dest_left', image_object.css('left')); image_object.attr('dest_top', image_object.css('top')); image_object.css('left', '0px'); image_object.css('top', '0px'); image_object.hide(); } if (text_object.length){ text_object.hide(); clear_blocks(selector_num+1); }}function run_effects(num){ var selector_num = num ? num : 1; var text_object = $('#txtblock_'+selector_num); var image_object = $('#imgblock_'+selector_num); if (image_object.length){ image_object.animate({ height: image_object.height() - RESIZE_DIFF, width: image_object.width() - RESIZE_DIFF, left: image_object.attr('dest_left'), top: image_object.attr('dest_top') }, 250, function(){ if (text_object.length){ text_object.fadeIn(EFFECTS_DELAY, function(){ run_effects(selector_num+1); }); } else { run_effects(selector_num+1); } }) image_object.removeAttr('dest_left'); image_object.removeAttr('dest_top'); } else if (text_object.length) { text_object.fadeIn(EFFECTS_DELAY, function(){ run_effects(selector_num+1); }); }}