// execute your scripts when the DOM is ready. this is a good habit 
var $expo_on = false;

$(function() { 
 
    // assign a click event to the exposed element, using normal jQuery coding 
    $("img.photo, img.captioned").click(function() { 
     
      if ( $expo_on ) {
         $(this).expose().close(); 
      } else {
         $(this).expose({
             api: true, 
             color: '#000', 
             opacity: 0.9, 
             onBeforeLoad: function() { this.getExposed().css({borderColor: '#ffffff'}); $expo_on = true;},  
             onClose: function() { this.getExposed().css({borderColor: '#000000'}); $expo_on = false;}
         }).load(); 
      }      
    }); 
    
    //$("img.photo, img.captioned").dblclick(function() { 
    //    $(this).expose().close(); 
    //}); 
    
});
