// JQuery set-up for displaying items on page using fancybox.

    // Add ajax qualifier to an ajax-enabled links
    $(document).ready(function() {
        // Ajax link lets us show content item in a fancy box!
        $("a.ajax_enabled")
          .each(function(){
              this.href = this.href + "ajax/";
          });
          
        // Alter vimeo video links to use the player.
        $("a.modal_box")
            .each(function(){
                this.href = this.href.replace("/vimeo.com/", "/player.vimeo.com/video/"); 
            });

        // customize fancybox CSS for special cases
        small_arrows = $("a.small_fancybox_arrows");
        //small_arrows.each(function(){
        //       this.title = "Use arrow keys < > or scroll wheel to browse through " + this.rel;
        //  });
        if (small_arrows.length > 0) {
            $("#fancybox-right").css("width","60px");
            $("#fancybox-left").css("width","60px");
        }

        // Apply fancybox to all modal links
        $("a.modal_box").fancybox({
            'transitionIn'  :   'elastic',
            'transitionOut' :   'elastic',
            'cyclic'        :   true,
            'speedIn'       :   600, 
            'speedOut'      :   200, 
            'overlayShow'   :   true,
            'hideOnOverlayClick' : true,
            'showNavArrows' : true
        });         
    });

