$(document).ready(function() {
    $('#mycarousel').jcarousel({
        // Configuration goes here
    });

    $("#slider_main img").live('mouseover', function() {
        $(this).attr("src", $(this).attr("src").split("_thumb.").join("_thumb-hover."));
    });
    $("#slider_main img").live('mouseout', function() {
        $(this).attr("src", $(this).attr("src").split("-hover.").join("."));
    });

    $("#slider_main a").live('click', function() {
        var imageSource = $(this).children("img").attr("src").split("_thumb-hover.").join(".");
        var description = $(this).children("img").attr("alt");

        $("#textdiv").empty().append(description);
        $("#imagediv").addClass("loading");
        if(jQuery.support.htmlSerialize==true)
            showImage(imageSource);
        else
            showImageforIE(imageSource);
        return false;
    });
});

function showImage(src) {
    $("#imagediv img").fadeOut("slow").remove();
    var largeImage = new Image();
    $(largeImage).attr("src", src).load(function() {
                    $(largeImage).hide();
                    $("#imagediv").removeClass("loading").append(largeImage);
                    $(largeImage).fadeIn("slow");
                });
}

function showImageforIE(src) {
    $("#imagediv").empty().removeClass('loading').append('<img src="'+src+'" />');
}