function mycarousel_itemVisibleInCallbackLeft(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, mycarousel_itemListLeft.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemListLeft[idx - 1]));

};

function mycarousel_itemVisibleInCallbackRight(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, mycarousel_itemListRight.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemListRight[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

/**
* Item html creation helper.
*/
function mycarousel_getItemHTML(item)
{
    //return '<img src="' + item.url + '" style="border:0" alt="" />';
    return '<a href="' + item.href + '"><img src="' + item.url + '" style="border:0; height:97px; width:120px;" alt="' + item.title + '"></img></a>';
};



//Funzione per creazione slider home

 function mycarousel_itemVisibleInCallbackImages(carousel, item, i, state, evt)
    {
        // The index() method calculates the index from a
        // given index who is out of the actual item range.
        var idx = carousel.index(i, mycarousel_itemImage.length);
        carousel.add(i, mycarousel_getImageHTML(mycarousel_itemImage[idx - 1]));
    };

    function mycarousel_itemVisibleOutCallbackImages(carousel, item, i, state, evt)
    {
        carousel.remove(i);
    };

    /**
    * Item html creation helper.
    */
    function mycarousel_getImageHTML(item)
    {
        return '<a href="' + item.href + '"><img src="' + item.url + '" style="border:0" alt="' + item.title + '"></img></a>';
    };
    
    
    //mycarouselImage
    //Funzione per creazione slider dettaglio prodotto

    function mycarousel_itemVisibleInCallbackImagesArticle(carousel, item, i, state, evt)
    {
        // The index() method calculates the index from a
        // given index who is out of the actual item range.
        var idx = carousel.index(i, mycarousel_itemListImages.length);
        carousel.add(i, mycarousel_getImageHTMLArticle(mycarousel_itemListImages[idx - 1]));
    };

    function mycarousel_itemVisibleOutCallbackImagesArticle(carousel, item, i, state, evt)
    {
        carousel.remove(i);
    };

    /**
    * Item html creation helper.
    */
    function mycarousel_getImageHTMLArticle(item)
    {
    
        //return '<a onclick="changeImage(' + item.res + ')"><img src="' + item.url + '" style="border:0" alt="' + item.title + '"></img></a>';
        return '<a href="javascript:" onclick=changeImage("' + item.res + '","' + item.zom + '")><img src="' + item.url + '" style="border:0" alt="' + item.title + '"></img></a>';
    };