/*
 * jQuery 'onImagesLoaded' plugin v1.1.0
 * Fires callback functions when 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.1/documentation/"
 */
(function($){$.fn.onImagesLoad=function(options){var self=this;self.opts=$.extend({},$.fn.onImagesLoad.defaults,options);self.bindEvents=function($imgs,container,callback){if($imgs.length===0){if(self.opts.callbackIfNoImagesExist&&callback){callback(container);}}else{var loadedImages=[];if(!$imgs.jquery){$imgs=$($imgs);}$imgs.each(function(i,val){$(this).bind('load',function(){if(jQuery.inArray(i,loadedImages)<0){loadedImages.push(i);if(loadedImages.length==$imgs.length){if(callback){callback(container);}}}}).each(function(){if(this.complete||this.complete===undefined){this.src=this.src;}});});}};var imgAry=[];self.each(function(){if(self.opts.itemCallback){var $imgs;if(this.tagName=="IMG"){$imgs=this;}else{$imgs=$('img',this);}self.bindEvents($imgs,this,self.opts.itemCallback);}if(self.opts.selectorCallback){if(this.tagName=="IMG"){imgAry.push(this);}else{$('img',this).each(function(){imgAry.push(this);});}}});if(self.opts.selectorCallback){self.bindEvents(imgAry,this,self.opts.selectorCallback);}return self.each(function(){});};$.fn.onImagesLoad.defaults={selectorCallback:null,itemCallback:null,callbackIfNoImagesExist:false};})(jQuery);

