﻿$(document).ready(function() {
    $.preloadCssImages();
	$(".click_grant").fancybox({ height: "90%", width: 710, type: "iframe" });
    $(".click_iframe").fancybox({ height: "75%", type: "iframe" });
    $(".click_image").fancybox({ maxWidth: "80%", maxHeight: "80%" });

    $(".click_movieLow").fancybox({ 'padding': 0,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        width: 300,
        height: 210

    });
    $(".click_movieHigh").fancybox({ 'padding': 0,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        height: 350

    });

    $(".click_movieVeryHigh").fancybox({ 'padding': 0,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        width: 768,
        height: 480

    });

    $(".click_show").click(function() {
        var toggleblock = $(this).attr("href");

        $(toggleblock).slideDown();
        $(this).hide();
        return false;
    });
    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 + '" /></a></li>';
            },
            pagerEvent: 'mouseover'
        });

        $("#gallery-nav").after("<p>ROLL OVER IMAGE TO ENLARGE</p>");

        $("#gallery").show();
    }


    $("#thumb-gallery-group").cycle({
        fx: 'fade',
        sync: 1,
        speed: 'fast'
    });

    if ($("#FloorPlan .floorPlanDownload a").length) {
        $("#FloorPlan .floorPlanThumb").wrap($("#FloorPlan .floorPlanDownload a"));
    }

});
