$(document).ready(function() { 
   $(".elem_small_img a").fancybox({'hideOnContentClick': true});
});
