﻿function resizeControls() {
    var pageContentHeight = $('.contentbox').height();
    
    if ($('.menubox').height() > $('.contentbox').height()) {
        pageContentHeight = $('.menubox').height();
    }

    pageContentHeight = pageContentHeight + 20;

    $('#pageContent').height(pageContentHeight);
}

$(document).ready(function() {
    resizeControls();
    
    var resizeTimer = null;
    $(window).bind('resize', function() {
        if (resizeTimer) clearTimeout(resizeTimer);
        resizeTimer = setTimeout(resizeControls, 100);
    });
    
    $('.contentbox').bind('resize', resizeControls);

    $("#" + linkFavorietenId).click(function(e) {
        e.preventDefault();
        var url = this.href;
        var title = $("#" + labelCustomerId).attr("innerText");

        if ($.browser.mozilla == true) {
            window.sidebar.addPanel(title, url, '');
            return false;
        } else if ($.browser.msie == true) {
            window.external.AddFavorite(url, title);
            return false;
        } else {
            alert('Druk CTRL + D om deze website toe te voegen tot uw favorieten.');
        }
    });
});

$(function() {
    if ($.fn.markItUp) {
        $.fn.markItUp.afterInit = function() {
            resizeControls();
        }
    }
});

