
    $.fn.extend({
        Story : {
            Ready : function()
            {
              $('#story-selector a.selector')
                .hover(
                  function() {
                    $(this).addClass('slideHover');
                  },
                  function() {
                    $(this).removeClass('slideHover');
                  }
                )
                .click(
                  function(e) {
                  
                    e.preventDefault();
                    
                    $.fn.Story.SlideInterupted = true;
                    $('div.story').hide();
                    $('a.selector').removeClass('active');
                    
                    $('div#story' + this.id.split("").pop()).show()
                    
                    $(this).addClass('active');
                    
                  }
                );
                
                this.SlideCounter = 1;
                this.SlideInterupted = false;
                this.SlideShow();
            },
            
            SlideShow : function()
            {
                if ($.fn.Story.SlideInterupted) {
                    return;
                }
                
                $.fn.Story.SlideLast = $.fn.Story.SlideCounter - 1;
                
                if ($.fn.Story.SlideLast < 1) {
                
                    $.fn.Story.SlideLast = 3;
                }
                
                $('div#story' + $.fn.Story.SlideLast).fadeOut(
                'slow',
                    function() {
                        $('a#selector' + $.fn.Story.SlideLast).removeClass('active');
                        $('a#selector' + $.fn.Story.SlideCounter).addClass('active');
                        $('div#story' + $.fn.Story.SlideCounter).fadeIn('slow');
                    
                        $.fn.Story.SlideCounter++;
                    
                        if ($.fn.Story.SlideCounter > 3) {
                            $.fn.Story.SlideCounter = 1;
                        }
                    
                        setTimeout('$.fn.Story.SlideShow();', 8000);
                    }
                );
            
            }
        }
    });

    
    $(document).ready(function(){   

        if ($("#splash-container")) {
        	$.fn.Story.Ready();
        }

    });
    
