/* 
* jQuery 'onImagesLoaded' plugin 1.0.5
* Fires a callback function when all images have loaded within a particular selector.
*
* Copyright (c) Cirkuit Networks, Inc. (http://www.cirkuit.net), 2008.
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* For documentation and usage, visit "http://includes.cirkuit.net/js/jquery/plugins/onImagesLoad/1.0/documentation/"
*/
if(!window.jQuery){throw("jQuery must be referenced before using the 'onImagesLoad' plugin.");}
(function($){$.fn.onImagesLoad=function(options){var opts=$.extend({},$.fn.onImagesLoad.defaults,options);return this.each(function(){var container=this;var $imgs=$('img',container);if($imgs.length===0&&opts.callbackIfNoImagesExist&&opts.callback){opts.callback(container);}
var loadedImages=[];$imgs.each(function(i,val){$(this).bind('load',function(){if(jQuery.inArray(i,loadedImages)==-1){loadedImages.push(i);if(loadedImages.length==$imgs.length){if(opts.callback){opts.callback(container);}}}}).each(function(){if(this.complete||this.complete===undefined){this.src=this.src;}});});});};$.fn.onImagesLoad.defaults={callback:null,callbackIfNoImagesExist:true};})(jQuery);