

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
	
}


function LoadCarousel(){

    jQuery('.shop_carousel').hide();
    jQuery('.shop_carousel').find('img').each(function(){
        image_address = $(this).attr('src');
        var preload = new Image();
        preload.src = image_address;
    });
    jQuery('.shop_carousel').show();

    jQuery('#mycarousel,#AeroCarousel ').jcarousel({
        auto: 5,
        wrap: 'last',
        scroll: 1,
        initCallback: mycarousel_initCallback
    });

}

function LoadBalloons(){
    $('.acc_list_body li a img').each(InitBalloons);
};

function InitBalloons(){

    var ID= $(this).attr('id');

    $(this).qtip({
        content: {
            prerender: true,
            url: 'ajax/shop/bubbleItem.php',
            data: {
                id: ID
            },
            method: 'post'
        },

        show: {
            delay: 0
        },
        hide: {
            //delay:1000,
            fixed:true,
            when:'mouseleave'
        },
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            border: {
                width: 0,
                radius: 1,
                color: 'fff'
            },
            padding: '2px 2px',
            title: {
                'padding': '1px' ,
                'background-color':'transparent'
            },
            tip: {
                size: {
                    x: 0,
                    y: 0
                }
            }
        }
    });

    return true;
}

