var CONTROLLER = 'bridgettemayer';

/**
 * Page-specific JavaScript initialization:
 *   - event handlers for Promo units
 *   - Slideshow
 */
Controller.prototype.pageInit = function()
{
  
  $.getJSON(SLIDE_DATA, function(data, status)
  {
    if (data.length > 1)
    {
      $('#slideshow_0_wrap').slideshow(
      {
        type: 'auto',
        slides: data
      });
    }
  });
  
  $.getJSON(SLIDE_DATA, function(data, status)
  {
    if (data.length > 1)
    {
      $('#slideshow_image_detail').slideshow(
      {
        type: 'auto',
        slides: data,
        labels:
        {
          caption: $('div.works_item.caption p.title'),
          subtitle: $('div.works_item.caption p.date')
        }
      });
    }
  });
  
  if(SLIDESHOW_VIEWED == false) {
	  $('#body_wrap').click(function() {
	    window.location.href = self.location.protocol+'//'+self.location.host+self.location.pathname;
	  });
  }
}

/**
 * Instantiate and initialize a Controller object
 */
$(document).ready(function()
{
    window[CONTROLLER] = new Controller();
    window[CONTROLLER].init();
});

