var mycarousel_itemList = [    
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/nationalChampions.png', url: 'http://owu.bkstr.com/'},
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/TiPiT.png', url: 'http://practice.owu.edu/'},
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/princetonReview.png', url: 'http://news.owu.edu/2011/20110802-princetonReview.html'},
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/fijiFoundingFatherOpportunity.png', url: 'https://www.facebook.com/OhioWesleyanFiji'},	
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/OWUMobile.png', url: 'http://infoserv.owu.edu/mobile/'},
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/sustainability.png', url: 'http://sustainability.owu.edu/'},
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/licensePlate.png', url: 'http://alumni.owu.edu/LicensePlate.html'},
	{photo: 'http://dev.owu.edu/images/featuredLinkEntries/new/referAStudent.png', url: 'http://alumni.owu.edu/apart_studentref.html'}
];

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.url + '"><img src="' + item.photo + '" width="168" height="150" />';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        vertical: false,
		/*
		Use auto:10 for normal rotation and auto:0 for fixed (no rotation)
		*/
		auto: 10,
		wrap: 'circular',
		animation: 1000,
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
});
