var mycarousel_itemList = [

	{VideoID: '11', url: 'Vid_BBQRoast.jpg', title: 'Barbecue Roasts', TitleDesc: 'Barbecue Roasts', BodyDesc: 'Simple, barbecue roasting.'},
	{VideoID: '10', url: 'Vid_Medallions.jpg', title: 'Beef Medallions', TitleDesc: 'Beef Medallions', BodyDesc: 'Thick-cut, tender and juicy.'},
	{VideoID: '6', url: 'Vid_Burgers.jpg', title: 'Beautiful Burgers', TitleDesc: 'Beautiful Burgers', BodyDesc: 'Burger basics and more.'},
	{VideoID: '12', url: 'Vid_QuickRoast.jpg', title: 'Mini Quick Roasts', TitleDesc: 'Mini Quick Roasts', BodyDesc: 'Smaller roasts, ready fast.'},
	{VideoID: '8', url: 'Vid_DinnerEasy.jpg', title: 'Dinner Made Easy!TM', TitleDesc: 'Dinner Made Easy!<sup>TM</sup>', BodyDesc: 'Easy family weeklnight meals.'},
    {VideoID: '3', url: 'Vid_BBQPitBoys.jpg', title: 'Roast Beef Recipe Barbecue by the BBQ Pit Boys', TitleDesc: 'The BBQ Pit Boys', BodyDesc: 'Roast Beef Recipe Barbecue.'},
    {VideoID: '2', url: 'Vid_beef_skewers.jpg', title: 'Spiced beef skewers for the sports event', TitleDesc: 'Spiced beef skewers', BodyDesc: 'for the sports event.'},
    {VideoID: '5', url: 'Vid_GoodEatsSteak.jpg', title: 'Good Eats: Steak Your Claim', TitleDesc: 'Good Eats', BodyDesc: 'Steak Your Claim.'},
    {VideoID: '4', url: 'Vid_GR_BeefWellington.jpg', title: 'Gordon Ramsay - Beef Wellington', TitleDesc: 'Gordon Ramsay', BodyDesc: 'Beef Wellington.'},
	{VideoID: '13', url: 'Vid_GR_CoconutCurryBeef.jpg', title: 'Coconut Curry Beef Noodles', TitleDesc: 'Coconut Curry Beef Noodles', BodyDesc: '2009 Milk Calendar - January'}

];

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]));
	};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    return '<a href="?ID=4&amp;VideoID=' + item.VideoID + '&amp;SecID=6"><img src="/image/module/VideoCarousel/' + item.url + '" width="171" height="89" alt="' + item.title + '" /></a><p><strong>'+ item.TitleDesc + '</strong><br/>'+ item.BodyDesc + '<img src="/image/module/VideoCarousel/Arrow.jpg " width="5" height="8" alt="go" style="padding-left:8px;"/></p>';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		start: 1,
		scroll: 5,
		vertical: true,
        wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
});

