function mycarousel_itemVisibleInCallback(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, myGallery_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(myGallery_itemList[idx - 1], i));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};


/**
* Item html creation helper.
*/
function mycarousel_getItemHTML(item, i)
{
    var strHtml = "";
    if (myGallery_itemList.length > 0 )
    {   
        //return '<a class="lightbox" href="' + item.href + '"><img src="' + item.url + '" style="border:0" alt="' + item.title + '"></img><div class="imgName">'+ item.title +'</div></a>';    
        //strHtml = '<a href="' + item.href + '"><div class="imgCont"><img id="' + item.title + '" onload="resizeImage(this)" src="' + item.url + '" alt="' + item.title + '" /></div><div class="imgName">'+ item.desc +'</div></a>'; 
        strHtml = '<div class="imgCont"><div id="preloader"><a href="' + item.href + '"><img id="' + item.title + '" onload="resizeImage(this)" src="' + item.url + '" alt="' + item.title + '" /></a></div></div><div class="imgName">'+ item.desc +'</div>';                     
        //strHtml = '<a href="' + item.href + '"><div class="imgCont"><img id="' + item.title + '" onload="function(){setTimeout(resizeImage("' + item.title + '"),500);}();" src="' + item.url + '" alt="' + item.title + '" /></div><div class="imgName">'+ item.desc +'</div></a>';  
        $('li.jcarousel-item').corner('bottom');
        
    }
    return strHtml;          
};

