$(document).ready(resize);
$(window).resize(resize);
function resize(){
    $('#inner_box').height('auto').css('padding-bottom','0');
    if($('#banner_top').length > 0){
        boxheight = ($(document).height()-126);
    }else{
        boxheight = $(document).height();
    }
    if($(document).height() >= $(window).height()){
        $('#inner_box').css('padding-bottom','40px');
    }else{
        $('#inner_box').height(boxheight+'px'); 
    }
}

Cufon.replace('h1, h2, h3.agenda, .datum');



$(document).ready(function(){
    
//animatie cover    
    var arr = [ 117, 175, 233, 291 ];
    var width = 205;
    var height = 251;
    
    $(".cover").each(function(){
        var index = $(this).index();
        $(this).css({width: width * 0.9, height: height * 0.9});                
    });
    
    $(".button").mouseenter(function(){
        var index = $(this).index();
        $(".cover").eq(index).stop(true,false).delay(500).animate({left : arr[index] -157}, 500 ,function(){
            $(this).css({"z-index":10});
            $(this).animate({left : arr[index], width: width * 1.2, height: height * 1.2});
        });
    });
    $(".button").mouseleave(function(){
        var index = $(this).index();
        $(".cover").eq(index).stop(true,false).animate({left : arr[index] -157, width: width * 0.9, height: height * 0.9}, 500,function(){
            $(this).css({"z-index":0});
            $(this).animate({left : arr[index]});
        });
    });
    
    /* Input stylen */
    $("input[type=file]").filestyle({
        image: "/tp_images/kies_bestand.gif",
        imageheight:21,
        imagewidth:100,
        width:100
    });
    
    $('#content_col_right div .detaillink').each(function(){
       $(this).parent('div').click(function(){
            $(this).css({'cursor':'pointer'});
            window.location = $(this).children('.detaillink').attr('href');
       }) 
    });
    
});

//Links naar andere site opent in nieuw venster
	var pathname = window.location.pathname;
	$("a[href^='http://'],a[href^='http://www.'],a[href^='www.'],a[rel='external']").not("a[href^='http://www.'pathname],a[href^='http://'pathname],a[href^='www.'pathname]").attr('target','_blank');


