var mycarousel_itemList = [
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2166.jpg", title: "Dexter The Digger by WOW", link: "ps-2166-174-dexter-the-digger-by-wow.aspx", hoverText: "Dexter The Digger by WOW", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/1541.jpg", title: "Sophie The Giraffe by Vulli", link: "ps-1541-174-sophie-the-giraffe.aspx", hoverText: "Sophie The Giraffe by Vulli", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2097.jpg", title: "Dump Truck by Green Toys", link: "ps-2097-174-dump-truck-by-green-toys.aspx", hoverText: "Dump Truck by Green Toys", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2095.jpg", title: "Fire Truck by Green Toys", link: "ps-2095-174-fire-truck-by-green-toys.aspx", hoverText: "Fire Truck by Green Toys", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2144.jpg", title: "Fire Station by Happyland", link: "ps-2144-174-happyland-fire-station-by-elc.aspx", hoverText: "Fire Station by Happyland", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2170.jpg", title: "Fireball Frankie by WOW", link: "ps-2170-174-fireball-frankie-by-wow.aspx", hoverText: "Fireball Frankie by WOW", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2155.jpg", title: "Whizz Around Garage by ELC", link: "ps-2155-174-whizz-around-garage-by-elc.aspx", hoverText: "Whizz Around Garage by ELC", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2119.jpg", title: "Wonder Walker by Hape", link: "ps-2119-174-wonder-walker-by-hape.aspx", hoverText: "Wonder Walker by Hape", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/607.jpg", title: "Build Your Own Birdhouse by Melissa & Doug", link: "ps-607-171-build-your-own-wooden-birdhouse.aspx", hoverText: "Build Your Own Birdhouse by Melissa & Doug", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/580.jpg", title: "Deluxe Standing Easel by Melissa & Doug", link: "ps-580-171-deluxe-standing-easel.aspx", hoverText: "Deluxe Standing Easel by Melissa & Doug", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/1267.jpg", title: "Shape Model and Mold by Melissa & Doug", link: "ps-1267-171-shape-model-and-mold.aspx", hoverText: "Shape Model and Mold by Melissa & Doug", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2117.jpg", title: "eTruck by Hape", link: "ps-2117-163-e-truck-by-hape.aspx", hoverText: "eTruck by Hape", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/2131.jpg", title: "Stamp & Sort Mailbox by Melissa & Doug", link: "ps-2131-163-stamp-sort-mailbox-by-melissa-doug.aspx", hoverText: "Stamp & Sort Mailbox by Melissa & Doug", text: "SHOP NOW"},
    {url: "http://www.bullfrogsandbutterfliesshop.com/images/PRODUCT/icon/1196.jpg", title: "Musical Band by Plan Toys", link: "ps-1196-168-musical-band.aspx", hoverText: "Musical Band by Plan Toys", text: "SHOP NOW"}
    
];

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]));
    }
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    return '<a title="'+item.hoverText +'" href="'+ item.link + '"><img src="' + item.url + '" width="95" height="95" alt="' + item.url + '" /><p>'+item.text+'</p></a>';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        size: mycarousel_itemList.length,
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
    });
});


