 // Hero Shot 
            
            (function( $ )
            {
              $.fn.heroShotSlideshow = function( options )
              {  
                    var settings =
                    {
                      'interval' : '5000',
                      'fadeSpeed' : '750'
                    };
                    
                    var context = this;
                    
                    context.hide();
                    
                    $(window).load(function()
                    {
                      context.show();
                    
                      return context.each(function() {        
                      // If options exist, lets merge them
                      // with our default settings
                      if ( options ) { 
                        $.extend( settings, options );
                      }
                                        
                      var _hsHeight = 0;
                      var _hsWidth = 0;
                      
                      $('img', $(this)).each(function()
                      {
                          if ($(this).height() > _hsHeight)
                              _hsHeight = $(this).height();
                              
                          if ($(this).width() > _hsWidth)
                              _hsWidth = $(this).width();
                      });
                      
                      $(this).css('width', _hsWidth+'px');
                      $(this).css('height', _hsHeight+'px');
                      $(this).css('position', 'relative');
                      
                      $(this).children().each(function()
                      {
                          $(this).css('position', 'absolute');
                          
                          if (!$(this).is("*:first-child"))
                          {
                               $(this).css('opacity', '0');
                               $(this).css('z-index', '0');
                          }    
                          else
                              $(this).addClass('_hsCurrentShot');
                      });
                                       
                     var _hsContainer = $(this);
                      
                      setInterval(function()
                      {
                            _hsContainer.children('._hsCurrentShot').each(function()
                            {
                                    $(this).removeClass('_hsCurrentShot');
                                    $(this).stop();                                   
                                    $(this).animate({ opacity : 0 }, settings.fadeSpeed);
                                    $(this).css('z-index', 0);
    
                                    var nextOne;
    
                                    if ($(this).next().length > 0)
                                    {
                                       nextOne = $(this).next();
                                     }
                                    else
                                    {
                                       nextOne = $(this).parent().children('*:first-child');
                                    }
                                    
                                    nextOne.addClass('_hsCurrentShot');
                                    nextOne.stop();
                                    nextOne.animate({ opacity : 1 }, settings.fadeSpeed);
                                    nextOne.css('z-index', 1);
                            });
                            
                      }, settings.interval);
                    
                    });
                });
            
              };
            })( jQuery );
