<!--

// Set thickbox loading image
tb_pathToImage = "jcarousel/images/loading-thickbox.gif";

var mycarousel_itemList = [
    {url: "images/home/home_dw4_s.jpg", title: "Cabinetry Hardware"},
    {url: "images/home/home_Picture-012_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_Picture-013_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_Picture-023_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_Picture-024_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_4_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_CSC_0426_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_DSC_0041_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_fc9_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/home/home_P1000056_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/cottage_M8D3498_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/cottage_overall-coloured_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/cottage_M8D3568_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/other_burns-lib-2_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/colonial_cherry-drawer_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/closets_DSC_0142_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/cottage_jermaine-kitchen_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/kitchen_DSC_0014_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/kitchen_DSC_0102_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/other_P1000071_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/bathroom_DSC_0084_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/bathroom_Picture3_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/kitchen_newmark-kit-global_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/bathroom_Picture-015_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/stanford_secondbath2_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/gallery/other_Picture-028_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/whitewalnut_kitch_s.jpg", title: "Simply the Finest Cabinetry"},
    {url: "images/cabinetry/whitewalnut_showhouse-BP_s.jpg", title: "Simply the Finest Cabinetry"}
];

function mycarousel_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

};

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;
        }

        // Create an object from HTML
        var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    var url_l = item.url.replace(/_s.jpg/g, '_l.jpg');
    return '<a href="' + url_l + '" title="' + item.title + '" rel="cabinetry"><img src="' + item.url + '" width="150" height="150" border="0" alt="' + item.title + '" /></a>';
};


jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 3,
		scroll: 2,
		wrap: 'both',
        size: mycarousel_itemList.length,
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback},
        initCallback: mycarousel_initCallback
    });
});

 -->
