if( typeof(swis) !== 'object') swis = {};
                         
swis.initCufon = function() {
    Cufon.replace('#main-nav a', {
        fontSize: '13px',
        fontFamily: 'anivers',
        textShadow: '#08a311 1px 1px'
    });
    Cufon.replace('.small-heading, .big-heading, .amfKnoppen a span', {
        fontFamily: 'anivers'
    });                      
                             }

swis.updateBody = function() {        
    var iSpaceLeft = Math.floor($(window).height() - (102 + $('#page-footer').position().top));
    if( iSpaceLeft > 0 ) {                                  
        $('#page-footer').height(50 + iSpaceLeft);
    }
    else {
        $('#page-footer').height(50);
    }
}

swis.updateBoxes = function() {
    $('.box-style').each(function(i, el) {
                           
        $(el).show();
        $(el).children('.box-style-l').height($(el).children('.box-style-l').next().height());
        $(el).children('.box-style-r').height($(el).children('.box-style-r').prev().height());
        $(el).children('.box-style-c').height($(el).children('.box-style-c').next().height());
    });
}

swis.initCufon();

$(function() {
    Cufon.now();    
    
    // Alle links met rel="external" in een nieuw venster openen
    $("a[rel=external], a[rel=partner]").each(function(i){
        this.target="_blank";
    });
    
    
    swis.updateBoxes();
    swis.updateBody();
    
    $(window).resize(function() {
        swis.updateBody();
    });
    
    // Bij alle anker links de pagina url ervoor plakken
    var sCurrentUrl = window.location.href;
    var iDashPos = sCurrentUrl.indexOf('#', 0);
                                     
    if(iDashPos !== -1){
        sCurrentUrl = sCurrentUrl.substring(0,iDashPos);
    }
    $('article.tb a[href^="#"]').each(function(){
       $(this).attr('href', sCurrentUrl + $(this).attr('href'));
    });

});


