// JavaScript Document
var currentFancybox = ''; 

jQuery(document).ready(function(){

        $("A.fancybox-gallery").fancybox();

	    $("A.fancybox").fancybox({
        'autoScale'     : true,
        'autoDimensions': true,
        'transitionIn'  : 'fade',
        'transitionOut' : 'fade',
        'easingIn'      : 'easeOutBack',
        'easingOut'     : 'easeInBack',
        'type'			: 'ajax',
        'titleShow'     : true,
        'onComplete'    : function () {
            $("fancybox-inner").css("overflow-x", "hidden");
            $.fancybox.resize();
        }
    });

    $("A.fancybox-ajax").fancybox({
        'autoScale'     : true,
        'autoDimensions': true,
        'transitionIn'  : 'fade',
        'transitionOut' : 'fade',
        'width'         : 570,
        'height'        : 480,
        'easingIn'      : 'easeOutBack',
        'easingOut'     : 'easeInBack',
        'type'			: 'ajax',
        'titleShow'     : false,
        'onComplete'    : function () {
            $("#fancybox-content").css("overflow-x", "hidden");
            $.fancybox.resize();
        }
    });
	
	        // forms and default iframe
        $("A.fancybox-iframe").fancybox({
            'autoScale'     : true,
            'autoDimensions': true,
            'width'			: 540,
            'height'        : 720,
            'transitionIn'  : 'none',
            'transitionOut' : 'none',
            'easingIn'      : 'easeOutBack',
            'easingOut'     : 'easeInBack',            
            'type'			: 'iframe',
            'titleShow'     : false,
            'scrolling'     : 'auto'
        });

        $("A.fancybox-media").fancybox({
            'autoScale'     : true,
            'autoDimensions': true,
            'width'         : 640,
            'height'        : 480,
            'transitionIn'  : 'fade',
            'transitionOut' : 'fade',
            'easingIn'      : 'easeOutBack',
            'easingOut'     : 'easeInBack',            
            'type'          : 'ajax',
            'titleShow'     : false,
            'onComplete'    : function () {
                jQuery(html5media);
                $("audio#fancybox_media_tag").parent().parent().parent().width($("#fancybox_media_tag").width()+20);
                $("video#fancybox_media_tag").parent().parent().parent().width($("#fancybox_media_tag").width()+20);
                $("span#fancybox_media_tag").parent().attr({style: "overflow:hidden;"});
                $("span#fancybox_media_tag").parent().parent().parent().width($("#fancybox_media_tag").width()+10);
                $("#fancybox-inner").width($("#fancybox_media_tag").width());
                $.fancybox.resize();
            }
        });

        // Disruption
        $("A.fancybox-iframe-disruption").fancybox({
            'autoScale'     : true,
            'width'			: 540,
            'height'        : 200, //690,
            'transitionIn'  : 'none',
            'transitionOut' : 'none',
            'easingIn'      : 'easeOutBack',
            'easingOut'     : 'easeInBack',            
            'type'			: 'iframe',
            'titleShow'     : false,
            'scrolling'     : 'no'
        });
        $("A.fancybox-iframe-bookmarks").fancybox({
            'autoScale'     : true,
            'width'			: 260,
            'height'        : 35, //350,
            'transitionIn'  : 'none',
            'transitionOut' : 'none',
            'easingIn'      : 'easeOutBack',
            'easingOut'     : 'easeInBack',            
            'type'			: 'iframe',
            'titleShow'     : false,
            'scrolling'     : 'no',
            'onComplete'    : function () {
                $("#fancybox-frame").addClass("bookmarks");
            },
            'onClosed'    : function () {
                $("#fancybox-frame").removeClass("bookmarks");
            }
        });
        $("A.fancybox-ajax-bookmarks").fancybox({
            'autoScale'     : true,
            'autoDimensions': true,
            'width'			: 260,
            'height'        : 35, //350,
            'transitionIn'  : 'fade',
            'transitionOut' : 'fade',
            'easingIn'      : 'easeOutBack',
            'easingOut'     : 'easeInBack',            
            'type'			: 'ajax',
            'titleShow'     : false,
            'scrolling'     : 'no',
            'onComplete'    : function () {
                $("#fancybox-frame").addClass("bookmarks");
            },
            'onClosed'    : function () {
                $("#fancybox-frame").removeClass("bookmarks");
            }
        });

});
