﻿$(document).ready(function() {
    $.preloadCssImages();
    $(".click_iframe").fancybox({ height: "85%", type: "iframe" });
    $(".click_image").fancybox({ maxWidth: "80%", maxHeight: "80%" });

    $(".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>';
                return '#gallery-nav li:eq('+idx+') a';
            },
            startingSlide: 4
        });
$("#gallery-nav li a").click(function(){
    $("#galleryWrapper .caption").text($(this).attr("title"));
});

        $("#gallery").show();
    }

    $("#thumb-gallery div").cycle({
        fx: 'fade',
        sync: 1,
        speed: 'fast'
    });

});

$(function() {
    $('.click_iframe').on('click', function() {
        $('#fancybox-inner').css('width', '700px');
    });
});
