$(function() {
    
    var open = false;
    
    $('.hidden').hide();
    $.doTimeout(1500, function(){
            $('#expandable').stop().animate({'top':'180px', 'padding-bottom':'105px'},{queue:true, duration:500, easing:'swing'});         
            $('.button').stop().animate({'top':'153px'},{queue:true, duration:500, easing:'swing'});                        
            $('.hidden').delay(200).fadeIn();
            $('.button').html(strOpen).removeClass('big');
            
            //set box state to open
            open = true;
            
            if(open === true) {
            
                $.doTimeout(5000, function(){
                    $('#expandable').stop().animate({'top':'230px', 'padding-bottom':'10px'},{queue:false, duration:500, easing:'swing'});         
                    $('.button').stop().animate({'top':'58px'},{queue:false, duration:500, easing:'swing'});
                    $('.hidden').fadeOut('fast');
                    $('.button').html(strClosed).addClass('big');
                    
                    //set box state closed
                    open = false;
                });
            }
    });
    
    
    $('#expandable').hover(function(){
    
        //checks if box state is closed
        if(open === false) {                
            $(this).stop().animate({'top':'180px', 'padding-bottom':'105px'},{queue:false, duration:500, easing:'swing'});         
            $('.button').stop().animate({'top':'153px'},{queue:false, duration:500, easing:'swing'});                        
            $('.hidden').fadeIn(1000);
            $('.button').html(strOpen).removeClass('big');
            
            //set box state open
            open = true;
        }
        
    }, function() {
        
        if(open === true) {   
            $(this).stop().animate({'top':'230px', 'padding-bottom':'10px'},{queue:false, duration:500, easing:'swing'});         
            $('.button').stop().animate({'top':'58px'},{queue:false, duration:500, easing:'swing'});
            $('.hidden').hide();
            $('.button').html(strClosed).addClass('big');
            
            //set box state closed
            open = false;
        }
    
    });
    
});
