
/**
 * Note: we're wrapping an extra setTimeout function for Chrome. Chrome
 * appatently fires document.ready BEFORE actually loading/rendering everything,
 * hence passing wrong calculated heights. Solution: we grant it 100
 * milliseconds to actually render stuff (usually enough, but adapt as fit).
 */
$(document).ready(function() {
    window.setTimeout(function() {
        if ($('#case-spotlight')) {
//            var s = $('#case-spotlight');
//            var b = $('#books');
//            var h = Math.max(s.height(), b.height());
//            s.css('height', h + 'px');
//            b.css('height', h + 'px');
            var l = $('#blog');
            var e = $('#services');
            var p = $('#products');
            var h = Math.max(l.height(), e.height())
            h = Math.max(h, p.height());
            l.css('height', h + 'px');
            e.css('height', h + 'px');
            p.css('height', h + 'px');
        }
    }, 100);
});

function clickButton(e, buttonid) {
    var evt = e ? e : window.event;
    var bt = document.getElementById(buttonid);

    if (bt) {
        if (evt.keyCode == 13) {
            bt.click();
            return false;
        }
    }
}

