(function( $ )
{
	var methods = 
	{
		/**
		 * Constructor
		 */
		init : function( options ) 
		{ 			
			var settings = {};
			
			return this.each(function() 
			{				
				var $this = $(this);
				var aDatos = $this.data('GcImage');
				
				if ( options ) $.extend( settings, options );
				if (!aDatos)
				{
					aDatos = {target : $this}; 																		
					
					// Settings
					aDatos.settings = settings;
					$this.data('GcImage', aDatos);
				
					$this.bind('load.GcImage', jQuery.proxy( methods.onLoad, this ) );
					$this.hide();
				}								
			});
		},
		onLoad: function(e)
		{
			var aDatos = $(this).data('GcImage');
			var oImage = aDatos.target;
					
			oImage.fadeIn();
		}
	};
	
	/**
	 * Llamada general
	 */
	$.fn.GcImage = function(method) 
	{  
		if ( methods[method] ) 
		{
			return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} 
		else if ( typeof method === 'object' || ! method ) 
		{
		    return methods.init.apply( this, arguments );
		} 
		else 
		{
		      $.error( 'Method ' +  method + ' does not exist on jQuery.GcImage' );
	    }    
	};
})( jQuery );
