function mycarousel_itemLoadCallback(carousel, state)
{

    // 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();
    });


    // Since we get all URLs in one file, we simply add all items
    // at once and set the size accordingly.
	
    if (state != 'init')
        return;
    jQuery.get('hediye2.txt', function(data) {
        mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, data);
    });
	
};

function mycarousel_itemAddCallback(carousel, first, last, data)
{
    // Simply add all items at once and set the size accordingly.
    var items = data.split('\n');

    for (i = 0; i < items.length; i++) {
        carousel.add(i+1, mycarousel_getItemHTML(items[i]));
    }

    carousel.size(items.length);
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(veri)
{
	var urun = veri.split('|');
    return '<a href="'+ urun[1] +'"><img src="' + urun[0] + '" width="106" height="106" alt="" border="0" /><br/><a href="'+ urun[1] +'">&nbsp;</a>';
};
 
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({ auto: 2,
        wrap: 'last',

        itemLoadCallback: mycarousel_itemLoadCallback
    });
});