// JavaScript Document
$(document).ready(function() {
  if($('#headerImg')[0].offsetWidth == 223) { // set width of a static image to check if images are enabled :s
    $('h2.img').each(function() { // replace h2 elements with 'img' class
      string = $(this).text();
      filename = string.toLowerCase().replace(/ /g, '-').replace(/([^0-9a-z-])/g,'');
      $(this).html('<img src="images/' + filename + '.jpg" alt="' + string + '" />');
    });
  }
});
