// manual entry of carousel array, needs tidying up and generating automatically from the DOM. todo
var mycarousel_itemList = [
    
	{url: '/clients/wales-in-style/wales-in-style-homepage.gif', title: 'Wales in Style website', href: '/fluke/folio/walesinstyle/'},
	{url: '/clients/mobank/preview.gif', title: 'MoBank website', href: '/fluke/folio/mobank/'},
	{url: '/clients/pete-and-tom/preview.gif', title: 'Pete&amp;Tom', href: '/fluke/folio/peteandtom/'},
	{url: '/clients/first-choice/first-choice-homepage.gif', title: 'First Choice Holidays website', href: '/fluke/folio/first-choice/'},
	{url: '/clients/thomson-fly/thomson-fly-001.gif', title: 'Thomson Fly', href: '/fluke/folio/thomson-fly/'},
	{url: '/clients/virgin-holidays/virgin-hols-001.gif', title: 'Virgin Holidays', href: '/fluke/folio/virgin-holidays/'},
	{url: '/clients/falcon/falcon-holidays-website-design.gif', title: 'Falcon holidays website design', href: '/fluke/folio/falcon-holidays/'},
	{url: '/clients/po-ferries/po-ferries-homepage.gif', title: 'P&amp;O Ferries interface design', href: '/fluke/folio/poferries/'}
	
	
	
];




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="' + item.href + '"><img src="' + item.url + '" alt="' + item.title + '" /></a>';
};


jQuery(document).ready(function() {
    jQuery.easing.def = "easeInOutQuad";
	jQuery('#mycarousel').jcarousel({
    // Config here
    start:1,
	scroll:2,
	animation:2500,
	auto:5,
	wrap:'circular',
	itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
    itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}

    });
});
