﻿$(document).ready(function() {
     $(function() {
        $('#slides').slides({
            preload: true,
            preloadImage: 'img/loading.gif',
            play: 5000,
            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);
            }
        });
    });

});

$(document).ready(function() {
    /* This is basic - uses default settings */
    $("a.popup-image").fancybox({
        'titlePosition': 'inside'
    });

    
    $("a.popup-iframe").fancybox({
    'width': 980,
    'height': 670,
    'autoScale': false,
    'transitionIn': 'none',
    'transitionOut': 'none',
    'type': 'iframe'
    });
    

    $("a.popup-email").fancybox({
        'width': 640,
        'height': 550,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe'
    });

    $(".image-box").hover(function() {
        $(this).stop().animate({ "opacity": 0.7 });
    }, function() {
        $(this).stop().animate({ "opacity": 1 });
    });


    $(".promo h3").click(function() {
        $(this).toggleClass("closed");
        $(this).parent(".promo").children(".home-content-panel").toggle();
        $(this).parent(".promo").children(".home-content-panel-hidden").toggle();
    });

});

