﻿$(function () {
    
    $("#brochure-link").addClass('brochure-link-home');
    $("#brochure-link").delay(1000).animate({ marginTop: '0px' }, 800);

    $('.jumpPanel').hover(function () {
        $(this).css('background-color', '#d9d3a8');

    },
		   function () {
		       $(this).css('background-color', '#FFF');
		   });


    $(".imgfadein").delay(200).each(function (index, value) {
        $(this).delay(100 * index).fadeIn("slow");
        //window.setTimeout($(this).fadeIn("fast"),10000);
    });



    //$('div.heroOverlay').corner("15px");
    $('#heroSlideshow').cycle({
        cssBefore: 'background:#000',
        before: onBefore,
        speed: 1000,
        timeout: 6000,
        pause: 1,
        pauseOnPagerHover: 1,
        after: onAfter,
        fx: 'fade', 	
        pager: '#hero-nav',
        pagerAnchorBuilder: function (idx, slide) {
            return '<div><a href="#"><span>' + (idx) + '</span></a></div>';
        }
    });

});

function onBefore(curr, next, opts) {   
    $('.hero-info').fadeOut('fast')
}


function onAfter(curr, next, opts) {    
    $('#hero-info-' + opts.currSlide).fadeIn('fast');
}

function loadFlickr() {
    //load the flickr feed
    $.ajax({
        url: "flickr-feed.aspx #flickrFeed",
        success: function (data) {
            $("#flickr-feed").html(data);
            $(".flickr-thumbnail").delay(200).each(function (index, value) {
                $(this).delay(100 * index).fadeIn("slow");
                $(".flickr-logo").delay(1000).fadeIn("slow");
                $(".flickr-link").delay(1000).fadeIn("slow");
            });
        }
    });

}
