function bookBoxHeights() {
    // Set height of book selection boxes to the same height for each row
    $('.bookboxrow').each(function() {
        var bh = new Array();
        var i=0;
        $(this).children('.bookbox').each(function() {
            //$(this).children('.body').height("auto");
            bh[i] = $(this).height();
            i++;
        });
        bhMax = bh.maxVal();
        $(this).children('.bookbox').each(function() {
            hh = $(this).children('.head').height();
            ch = $(this).children('.body').height();
            if ((hh + ch) < bhMax) {
                $(this).children('.body').height((bhMax-hh)+"px");
            }
        });
    });
}

function bookBoxCorners() {
    $(".bookbox").corner("9px");
}

function contentExpand() {
    var expID = $(this).attr("id");
    $('#'+expID+'_div').show();
    var imgObj = $(this).children('img').get(0);
    imageSwap(imgObj, 's');
}

function contentCollapse() {
    var expID = $(this).attr("id");
    $('#'+expID+'_div').hide();
    var imgObj = $(this).children('img').get(0);
    imageSwap(imgObj);
}

$(window).ready(function() {
    bookBoxCorners();
    //bookBoxHeights();
    //$("a.exptoggle").each(contentCollapse());
    $("a.exptoggle").toggle(contentExpand, contentCollapse);
});

$(window).resize(function() {
    //bookBoxHeights();
});
