// when the DOM is ready...
$(document).ready(function () {

// first, take care of the prettyPhoto stuff
$("a[rel^='prettyPhoto']").prettyPhoto();

});

function prep_photos()
{
  // set the widths of the divs surrounding the pictures
  $('div.image img').each(function(x) {
    var width = this.width;
    $(this).closest('div.image').width(width + 1);
  });
  
  $("a[rel^='prettyPhoto']").each(function(x) {
    $(this).addClass('enlarge');
    var width = this.width;
    if(width >= 175) {
      $(this).addClass('big'); 
    }
    
    $('img',this).wrap('<div class="inner_image"></div>');
  });
  
}

window.onload = prep_photos;
