﻿$(document).ready(function () {

    $("a.fancyModal").fancybox({
        'transitionIn': 'fade',
        'transitionOut': 'fade',
        'speedIn': 200,
        'speedOut': 200,
        'overlayShow': true,
        'overlayOpacity': 0.8,
        'overlayColor': '#000',
        'showNavArrows': true,
        'titleShow': true,
        'target': this,
        'titlePosition': 'inside',
        'titleFormat': function formatTitle(title, currentArray, currentIndex, currentOpts) {
            title = currentArray[currentIndex].attributes["caption"].value; //$("a.boxcaptionaText").eq(currentIndex).attr('caption');
            return (title && title.length ? '<b>' + title + '</b><br />' : '') + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length;
        },
        'swf': {
            'wmode': 'transparent',
            'allowfullscreen': 'true'
        },
        'onClosed': function () {
            $(".covera").stop().fadeTo('fast', 0);
            $(".boxcaptionaText").stop().hide();
        }
    });

    $("a.fancyYoutube").fancybox({
        'transitionIn': 'fade',
        'transitionOut': 'fade',
        'speedIn': 200,
        'speedOut': 200,
        'overlayShow': true,
        'overlayOpacity': 0.8,
        'overlayColor': '#000',
        'showNavArrows': true,
        'titleShow': true,
        'titlePosition': 'inside',
        'titleFormat': function formatTitle(title, currentArray, currentIndex, currentOpts) {


            title = currentArray[currentIndex].attributes["caption"].value; //$("a.boxcaptionaText").eq(currentIndex).attr('caption');
            return (title && title.length ? '<b>' + title + '</b><br />' : '') + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length;
            
        },
        'type': 'swf',
        'swf': {
            'wmode': 'transparent',
            'allowfullscreen': 'true',
            'autostart': 'true'
        },
        'onClosed': function () {
            $(".covera").stop().fadeTo('fast', 0);
            $(".boxcaptionaText").stop().hide();
        }

    });


    $("a.fancyIframe").fancybox({
        'transitionIn': 'fade',
        'transitionOut': 'fade',
        'speedIn': 200,
        'speedOut': 200,
        'overlayShow': true,
        'overlayOpacity': 0.8,
        'overlayColor': '#000',
        'showNavArrows': true,
        'titleShow': false,
        'type': 'iframe',
        'height': 484,
        'width': 705,
        'autoDimensions': false,
        'autoScale': false
    });

});
