    
    var category_id = 'short-1-content';
    var slide_id_1;
    var slide_id_2;
    var slide_id_3;
    
    $(document).ready(function() {
        $('#images-for-slide').before('<div id="image-nav">').cycle({ 
            fx:     'fade', 
            speed:  '500', 
            timeout: 0, 
            pager:  '#image-nav' 
        });
        
        $('#top-board-nav td.nav-cell a').click(function() {
            $('#top-board-nav td').removeClass('b-sel');
            $(this).parent().parent().addClass('b-sel');
        });
    
        $('.nav-cell a').click(function() {
            var trueID = this.id.substr(6, this.id.length - 6);
            
            $('#main-nav-' + trueID).click();
            
            $('#shadow').show();
            
            var this_id = this.id + '-content';
            
            if(this_id != category_id) {
                /*$('#' + category_id).animate({
                    top: '+=488',
                }, 400, function() {
                    $(this).hide();
                    $(this).css('top', '-244px');
                    category_id = this_id;
                });
                
                $('#' + this_id).show();
                
                $('#' + this_id).animate({
                    top: '+=244',
                }, 400);*/
                
                $('#' + category_id).animate({
                    left: '-=560',
                }, 400, function() {
                    $(this).hide();
                    $(this).css('left', '560px');
                    category_id = this_id;
                });
                
                $('#' + this_id).show();
                
                $('#' + this_id).animate({
                    left: '-=560',
                }, 400);
            }
            
            $('#shadow').hide(800);
        });
        
        slide_id_1 = $('#short-1-content .lsd:first').attr('id');
        slide_id_2 = $('#short-2-content .lsd:first').attr('id');
        slide_id_3 = $('#short-3-content .lsd:first').attr('id');
        
        $('.navis a').click(function() {
            $(this).parent().children('a').removeClass('active');
            $(this).addClass('active');
            
            var this_id = this.id + '-content';
            var slide_id;
            var log = 0;
            
            if($(this).parent().parent().attr('id') == 'short-1-content') { slide_id = slide_id_1; log = 1; }
            if($(this).parent().parent().attr('id') == 'short-2-content') { slide_id = slide_id_2; log = 2; }
            if($(this).parent().parent().attr('id') == 'short-3-content') { slide_id = slide_id_3; log = 3; }
            
            if(this_id != slide_id) {
                $('#' + slide_id).animate({
                    top: '-=488',
                }, 400, function() {
                    $(this).hide();
                    $(this).css('top', '244px');
                    if(log == 1) {
                        slide_id_1 = this_id;
                    }
                    if(log == 2) {
                        slide_id_2 = this_id;
                    }
                    if(log == 3) {
                        slide_id_3 = this_id;
                    }
                });
                
                $('#' + this_id).show();
                
                $('#' + this_id).animate({
                    top: '-=244',
                }, 400);
            }
        });
    });
