﻿$(document).ready(function () {
    $(".glassbox").glassbox();

    $('#slides').slides({
        preload: true,
        preloadImage: 'img/loading.gif',
        play: 3000,
        generatePagination: false,
        pause: 2500,
        hoverPause: true,
        animationStart: function (current) {
            $('.caption').animate({
                bottom: -35
            }, 100);
            if (window.console && console.log) {
                // example return of current slide number
                console.log('animationStart on slide: ', current);
            };
        },
        animationComplete: function (current) {
            $('.caption').animate({
                bottom: 0
            }, 200);
            if (window.console && console.log) {
                // example return of current slide number
                console.log('animationComplete on slide: ', current);
            };
        },
        slidesLoaded: function () {
            $('.caption').animate({
                bottom: 0
            }, 200);
        }
    });



    $('.box').mouseover(function () {

        this.style.backgroundImage = this.style.backgroundImage.replace('_highlight.png', '.png');
        this.style.backgroundImage = this.style.backgroundImage.replace('.png', '_highlight.png');

        var thisNum = parseInt(this.id.replace('box', ''));
        for (var i = 1; i < 7; i++) {
            $('#BigBox' + i).hide(); 
        }
        $('#BigBox' + thisNum).fadeIn("slow");
    });


    $('.box').mouseout(function () {
        this.style.backgroundImage = this.style.backgroundImage.replace('_highlight.png', '.png');
    });

});
