/**
 * This plugin can be used in 4 ways, this is only 1. Make sure to check
 * the other 3 links as well to see all the Modes.
 */
 $(document).ready(function(){ 
 
 /*jQuery(function( $ ){*/			
	/*$('#summary').fadeIn('slow');*/
	
	/* $('#gallery img').hide; */
	
	/**
	 * All the functions below, are used to update the summary div
	 * That is not the objective of the plugin, the really important part 
	 * is the one right below. The option placeholder, and threshold.
	 */
	$.preload( '#gallery img', {//the first argument is a selector to the images
		onRequest:request,
		onComplete:complete,
		onFinish:finish,
		placeholder:'loader.gif',//this is the really important option
		notFound:'notfound.gif',//optional image if an image wasn't found
		threshold: 2 //'2' is the default, how many at a time, to load.
	});
	
	function update( data ){
		/*
		$('#done').html( ''+data.done );
		$('#total').html( ''+data.total );
		$('#loaded').html( ''+data.loaded );
		$('#failed').html( ''+data.failed );
		*/
	};
	function complete( data ){
		/*
		update( data );
		$('#image-next').html( 'none' );//reset the "loading: xxxx"
		$('#image-loaded').html( data.image );
		*/
		$('#gallery img').fadeIn('slow');
	};
	function request( data ){
		/*
		update( data );
		$('#image-next').html( data.image );//set the "loading: xxxx"
		*/
		/* $('#gallery img').hide; */
	};
	function finish(){//hide the summary
		/*$('#summary').fadeOut('slow');*/
	};
});
