/*
    Coded By Steven Bower
    TurnWheel Designs (cc) 2009
    http://turnwheel.com/
*/

$(function() {
    $.getScript('/js/jcarousellite_1.0.1.min.js',function() {
        $('.carousel').each(function() {
            var self = $(this);
            var selfid = self.attr('id') || '';
            
            // If no ID is set, give it a random one
            if (selfid === '') {
                selfid = 'carousel_'+Math.round(Math.random()*11);
                self.attr('id',selfid);
            }
            
            self.jCarouselLite({
                btnNext: '#'+selfid+'+.carousel_nav .carousel_next',
                btnPrev: '#'+selfid+'+.carousel_nav .carousel_prev',
                visible: $('#'+selfid+' li').length < 3 ? 2 : 4
            });
        });
    });
    
    $.getScript('/js/jquery.lightbox-0.5.min.js',function() {
        $('.carousel').each(function() {
            $(this).find('a').lightBox({
                imageLoading: '/images/lightbox-ico-loading.gif',
                imageBtnClose: '/images/lightbox-btn-close.gif',
                imageBtnPrev : '/images/lightbox-btn-prev.gif',
                imageBtnNext : '/images/lightbox-btn-next.gif',
                imageBlank : '/images/lightbox-blank.gif'
            });
        });
    });
});