﻿function styleLastItems(group, num) {
    var even = group.length % 2 == 0 ? true : false;
    if (even == true) {
        var target = group.length - num;
        group.slice(target).addClass('last');
    }
    else {
        group.filter(':last').addClass('last');
    }
}

function equalHeight(group) {
    var maxHeight = 0;
    group.each(function () {
        var thisHeight = $(this).height();
        if (thisHeight > maxHeight) maxHeight = thisHeight;
    });
    group.height(maxHeight);
}

function centerThumbs(elems) {
    elems.bind('load', function (e) {
        var height = 0;
        elems.each(function () { 
            height = $(this).height() * -.5;
            $(this).css({
                "top": "50%",
                "margin-top": height
            }).removeClass("hiddenImage");
        });
    });
}
