

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(){
	//get all Image product id
	var ids="";

    $('.acc_list_body li a img').each(function(){
		ids +=(ids==""?"":",")+$(this).attr('id');
	});
$.post('/ajax/shop/bubbleItem.php', {ids:ids}, InitBalloons, "json");
};

function InitBalloons(data){

$('.acc_list_body li a img').each(function(){
 
    var ID= $(this).attr('id');

    $(this).qtip({
        content: data[ID],
        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
                }
            }
        }
    });
});
    
}


