var thumbloader = {
    // just a placeholder.. it's to simple for now
}

$(document).ready(function() {
    $('.mainimage img').load(function () {
        $('.mainimage').animate( { height : $('.mainimage img').height()}, 500);
    });

    $('.mainimage').css({ 'overflow' : 'hidden', 'margin-bottom' : 5});

    // remove other events (exturls)
    $('.imagethumbs a').unbind('click');

    $('.imagethumbs a').click(function () {
        $('.mainimage img').attr('src', this.href);



        return false;
    }).css( { 
        width: $('.mainimage').width() / 5 - 7 ,
        height: $('.mainimage').width() / 5 * 0.7 - 7
    });

    $.each($('.imagethumbs a'), function (i, thumb) {
        thumb = $(thumb);
        thumb.css('background-image', thumb.css('background-image').replace('/125/125/', '/' + thumb.width() + '/' + thumb.height() + '/'));
    });

    $('.mainimage img').css( { width: $('.mainimage').width() - 5 });
});

