// NIVO SLIDER //
$(window).load(function() {
	$('#slider').nivoSlider({ effect:'slideInLeft', directionNav:false, pauseTime:3000 });
});
 

// THICKBOX 3 FOR PHOTO VIDEO GALLERY // 
// Set thickbox loading image
tb_pathToImage = "images/loading-thickbox.gif";
 
var mycarousel_itemList = [
    {url: "images/home-photo-001_s.jpg", title: ""},
    {url: "images/home-photo-002_s.jpg", title: ""},
    {url: "images/home-photo-003_s.jpg", title: ""},
    {url: "images/home-photo-004_s.jpg", title: ""},
    {url: "images/home-photo-005_s.jpg", title: ""},
    {url: "images/home-photo-006_s.jpg", title: ""},
    {url: "images/home-photo-007_s.jpg", title: ""},
    {url: "images/home-photo-008_s.jpg", title: ""},
    {url: "images/home-photo-009_s.jpg", title: ""},
    {url: "images/home-photo-010_s.jpg", title: ""},
	{url: "images/home-photo-011_s.jpg", title: ""},
	{url: "images/home-photo-012_s.jpg", title: ""}
];
 
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_m = item.url.replace(/_s.jpg/g, '_m.jpg');
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="80" height="80" border="0" alt="' + item.title + '" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        size: mycarousel_itemList.length,
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
    });
});

// NEWS SCROLLER //
$().ready(function () {
	$('#scroller').vScroll({ speed: 500, height: 300, upID: "#prevButton", downID: "#nextButton", cycle: true });
});
