﻿$(document).ready(function() {

    $(".click_iframe").fancybox({ width: "80%", height: "80%", 'type':'iframe' });
	$(".click_grant").fancybox({ height: "90%", width: 710, type: "iframe" });
    $(".click_image").fancybox();
    $(".click_show").click(function() {
        var toggleblock = $(this).attr("href");

        $(toggleblock).slideDown();
        $(this).hide();
        return false;
    });

    $("#thumb-gallery-group").cycle({
        fx: 'fade',
        sync: 1,
        speed: 'fast'
    });


    if ($("#gallery").length) {
        $("#gallery").cycle({
            fx: 'fade',
            sync: 1,
            speed: 'fast',
            timeout: 0,
            pager: '#gallery-nav',

            // callback fn that creates a thumbnail to use as pager anchor
            pagerAnchorBuilder: function(idx, slide) {
                return '<li><a href="#"><img src="' + slide.src + '" width="90" /></a></li>';
            },
            pagerEvent: 'mouseover'
        });

        $("#gallery-nav").after("<p>rollover image to enlarge</p>");

        $("#gallery").show();
    }
});
