$(document).ready(function(){

	$('ul#slideshow li.omit').remove(); // ueberfluessiges erstes li-tag entfernen (eingesetzt, damit die ansonsten leere ul validiert)
	
});



var slideshow_itemList = [
    {url: 'http://www.drewsdesign.de/assets/templates/dd-template-2009/images/home-animation/quartier-110-broschuere.jpg', title: 'Broschüre Quartier 110, Friedrichstraße, Berlin-Mitte'},
    {url: 'http://www.drewsdesign.de/assets/templates/dd-template-2009/images/home-animation/website-arzt-sportchirurg-krueger.jpg', title: 'Website Sportchirurg Dr. Krüger'},
    {url: 'http://www.drewsdesign.de/assets/templates/dd-template-2009/images/home-animation/stars-immobilien-retail-portfolio.jpg', title: 'Stars Retail Portfolio'},
	{url: 'http://www.drewsdesign.de/assets/templates/dd-template-2009/images/home-animation/beisheim-center-website.jpg', title: 'Website Beisheim Center am Potsdamer Platz'},
	{url: 'http://www.drewsdesign.de/assets/templates/dd-template-2009/images/home-animation/hotel-schloss-hubertushoehe-logo.jpg', title: 'Logo Hotel Schloss Hubertushöhe'},
];

function slideshow_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, slideshow_itemList.length);
    carousel.add(i, slideshow_getItemHTML(slideshow_itemList[idx - 1]));
};

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

/**
 * Item html creation helper.
 */
function slideshow_getItemHTML(item)
{
    return '<img src="' + item.url + '" width="830" height="410" alt="' + item.title + '" />';
};

$(document).ready(function() {
    $('#slideshow').jcarousel({
        auto: 5,
        scroll: 1,
		wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: slideshow_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: slideshow_itemVisibleOutCallback}
    });
});
