﻿$(document).ready(function () {



    //$(".fade_img").fadeTo("slow", 0.3); // This sets the opacity of the thumbs to fade down to 30% when the page loads
    $(".fade_img").hover(function () {
        $(this).fadeTo("fast", 0.3); // This should set the opacity to 100% on hover
    }, function () {
        $(this).fadeTo("fast", 1.0); // This should set the opacity back to 30% on mouseout
    });


    // Expand Panel
    $("#open").click(function () {
        $("div#panel").animate({
            width: "100px"
        }, 300);

        document.getElementById("searchField").focus();
    });

    // Collapse Panel
    $("#close").click(function () {
        $("div#panel").animate({
            width: "0"
        }, 300);
    });

    // Switch buttons from "Log In | Register" to "Close Panel" on click
    $("#search a").click(function () {
        $("#search li").toggle();
    });
});


// Ride the carousel...
jQuery(document).ready(function () {
    jQuery("#slideshow").jcarousel({
        wrap: 'circular',
        scroll: 1,
        auto: 4,
        duration: 1500,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});



function mycarousel_initCallback(carousel) {

    jQuery('#next2').bind('click', function () {
        carousel.next();
        return false;
    });

    jQuery('#prev2').bind('click', function () {
        carousel.prev();
        return false;
    });

    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function () {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function () {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function () {
        carousel.stopAuto();
    }, function () {
        carousel.startAuto();
    });

};

