var mycarousel_itemList = [
		{image: '/Content/Images/jcarousel/images/losi/LOSB0012LE.png', title: '1/8 Aftershock LTD RTR', alt: '1/8 Aftershock LTD RTR (LOSB0012LE)', url: '/Products/Default.aspx?ProdID=LOSB0012LE'},
		{image: '/Content/Images/jcarousel/images/losi/losb0236.png', title: '1/24 Micro Rock Crawler RTR', alt: '1/24 Micro Rock Crawler RTR (LOSB0236)', url: '/Products/Default.aspx?ProdID=LOSB0236'},
		{image: '/Content/Images/jcarousel/images/losi/losb0126.png', title: '1/10 Ten-T RTR', alt: '1/10 Ten-T RTR (LOSB0126)', url: '/Products/Default.aspx?ProdID=LOSB0126'},
		{image: '/Content/Images/jcarousel/images/losi/losb0236BD.png', title: '1/24 Micro Rock Crawler BND', alt: '1/24 Micro Rock Crawler BND (LOSB0236BD)', url: '/Products/Default.aspx?ProdID=LOSB0236BD'},
		{image: '/Content/Images/jcarousel/images/losi/losb0204.png', title: '1/18 Mini Desert Buggy RTR', alt: '1/18 Mini-Desert Buggy RTR (LOSB0204)', url: '/Products/Default.aspx?ProdID=LOSB0204'},
		{image: '/Content/Images/jcarousel/images/losi/losb0237.png', title: '1/36 Micro HIGHroller RTR', alt: '1/36 MicroHIGHroller RTR (LOSB0237)', url: '/Products/Default.aspx?ProdID=LOSB0237'},
		{image: '/Content/Images/jcarousel/images/losi/losb0104.png', title: '1/10 Night Crawler RTR', alt: '1/10 Night Crawler RTR (LOSB0104)', url: '/Products/Default.aspx?ProdID=LOSB0104'},
		{image: '/Content/Images/jcarousel/images/losi/losb0105.png', title: '1/10 Strike SCT RTR', alt: '1/10 Strike SCT RTR (LOSB0105)', url: '/Products/Default.aspx?ProdID=LOSB0105'},
		{image: '/Content/Images/jcarousel/images/losi/losb0105bd.png', title: '1/10 Strike SCT BND', alt: '1/10 Strike SCT BND (LOSB0105BD)', url: '/Products/Default.aspx?ProdID=LOSB0105BD'}
];

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, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
		    $("img[@src$=png], #mycarousel").pngfix();
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);

};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    return '<a href="' + item.url + '" onclick="pageTracker._trackEvent ('+"'/HP/" + item.title + "')"+';" >' + '<div id="back"><div class="text1">'+ item.title + '</div></div>'+'<img src="' + item.image + '"width="155" height="107" "alt="' + item.title + '" />'+ '</a>';
};

jQuery(document).ready(function() {
	
    jQuery('#mycarousel').jcarousel({
        wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
		
    });
});
jQuery(function($) {
    $("img[@src$=png], #wrap").pngfix();

});
