$(document).ready(function() {
    $('#carousel').css('overflow', 'hidden');
    $('#carousel .logo img').each(function() {
        $(this).parent().css('width', $(this).width());
        $(this).parent().css('height', $(this).height());
        $(this).parent().css('margin', 'auto');
        var padding_top = (($(this).parent().parent().height() + 15 )- $(this).height())/2;
        $(this).parent().css('margin-top', padding_top);
    })
    $('.carousel_nav').click(function(e) {
        e.preventDefault();
    })
    var start = SWFAddress.getValue().replace('/', '');
    var start_index = 0;
    $('#carousel li').each(function(index) {
        if ($(this).attr('id') == start) {
            start_index = index;
        }
    })
    $('#carousel').jCarouselLite({
        btnNext: '#carousel_nav_right',
        btnPrev: '#carousel_nav_left',
        start: start_index,
        visible: 1,
        afterEnd: function(current_slide) {
            SWFAddress.setValue(current_slide.attr('id'));
        }
    })
})
