var mycarousel_itemList = [
    {url: "http://www.gamesfix.com/featured/shift-heads.png", lnk: "http://www.gamesfix.com/actiongames/Sift-Heads-3.html"},
    {url: "http://www.gamesfix.com/featured/cloud-jumper.jpg", lnk: "http://www.gamesfix.com/arcadegames/Cloud-Jumper.html"},
   {url: "http://www.gamesfix.com/featured/DownHill.jpg", lnk: "http://www.gamesfix.com/bikegames/Downhill-Mayhem.html"}
];
function mycarousel_itemLoadCallback(carousel, state)
{  for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }
        if (i > mycarousel_itemList.length) {
            break;
        }
        carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
    }
};
function mycarousel_getItemHTML(item)
{
    return '<a href="'+item.lnk+'"><img src="' + item.url + '" width="526" height="200"  /></a>';
};
function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });   
};
jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
		 size: mycarousel_itemList.length,
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback},
		auto: 6,
        wrap: 'last',
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});

