Cufon.replace('header a');
Cufon.replace('.menu a');
Cufon.replace('.big');
Cufon.replace('.meer');

$ (document).ready (function (){
        
        $ ('.left').css ('width', Math.floor(($ (window).width () - 960) / 2) + 'px');
        $ ('.content').css ('width', Math.floor(($ (window).width () - 960) / 2) + 960 + 'px');
        $ ('.background').css ('width', Math.floor(($ (window).width () - 960) / 2) + 703 + 'px'); 
        $ ('.right-top').css ('width', Math.floor(($ (window).width () - 960) / 2) + 'px');
        $ ('.right-bottom').css ('width', Math.floor(($ (window).width () - 960) / 2) + 'px'); 
        
        $ ('.fold').click (function (){
                
                if ($ (this).hasClass ('selected') == false)
                {
                        var desc = '';
                        
                        if ($ ('.projecten .page ul li').children ('.selected').length > 0) 
                                desc = $ ('.projecten .page ul li').children ('.selected').html ();
                        
                        desc = (desc != '' ? desc.replace ('-', '+') : '');
                        $ ('.projecten .page ul li').children ('.selected').html (desc);
                        $ ('.projecten .page ul li').children ('.selected').next ().toggle ('slow');
                        $ ('.projecten .page ul li').children ('.selected').removeClass ('selected');              
                }
                
                $(this).next().animate({height: 'toggle'}, 'slow', 'linear');
                $(this).toggleClass('selected');
                
                if ($ (this).hasClass ('selected') == false)
                {
                        var desc = $ (this).html ();
                        desc = desc.replace ('-', '+');
                        $ (this).html (desc);
                }
                else
                {
                        var desc = $ (this).html ();
                        desc = desc.replace ('+', '-');
                        $ (this).html (desc);
                }
        });
        
        if ($ ('#container').height () < $ (window).height () - 200)
        {
                $ ('#container').css ('height', $ (window).height () - 200 + 'px');   
        }
        
        $ ('.meer').click (function () {
            $ ('.detail').toggle (650);
            $ (this).hide ();    
            $ (this).next ().remove ();
            $ (this).next ().remove ();
        });
        
});

$ (window).resize (function() {
        if (($ (window).width () - 960) / 2 > 0)
        {
                $ ('.left').css ('width', Math.floor(($ (window).width () - 960) / 2) + 'px');
                $ ('.content').css ('width', Math.floor(($ (window).width () - 960) / 2) + 960 + 'px');
                $ ('.background').css ('width', Math.floor(($ (window).width () - 960) / 2) + 703 + 'px'); 
                $ ('.right-top').css ('width', Math.floor(($ (window).width () - 960) / 2) + 'px');
                $ ('.right-bottom').css ('width', Math.floor(($ (window).width () - 960) / 2) + 'px');
        }
        else
        {
                $ ('.left').css ('width', '0px');
                $ ('.content').css ('width', 960 + 'px');
                $ ('.background').css ('width', 703 + 'px'); 
                $ ('.right-top').css ('width', '0px');
                $ ('.right-bottom').css ('width', '0px');   
        }
});
