﻿
jQuery(document).ready(function() {
    jQuery('#videoCarousel').jcarousel({
        buttonNextHTML: null,
        buttonPrevHTML: null,
        initCallback: videoCarousel_initCallback,
        animation: "slow",
        scroll: 1
    });
    $("#videoImages img").css("background-color", randomColor);
});
function videoCarousel_initCallback(carousel) {
    $("#videoImages img").eq(0).css("border-color", color);
    $("#videoImages img").eq(0).addClass("selected");
    $("#videoImages img").hover(function() {
        $(this).css("border-color", borderColor);
    }, function() {
        if ($(this).hasClass("selected")) {
            $(this).css("border-color", color);
        }
        else {
            $(this).css("border-color", backgroundColor);
        }
    });
    $('#videoImages img').click(function() {
        var videoIndex = $("img", $(this).parent().parent()).index($(this)) + 1;
        carousel.scroll(jQuery.jcarousel.intval(videoIndex));
        $("#videoImages img").css("border-color", backgroundColor);
        $("#videoImages img").removeClass("selected");
        $(this).css("border-color", color);
        $(this).addClass("selected");
    });
};
