/*
jQuery(document).ready(function(){
	jQuery('#main').click(function() {
	
	//alert('Handler for .click() called.');
	  
	//Check if location.hash matches a lightbox-anchor. If so, trigger popup of image.
	setTimeout(function() {
		if(document.location.hash && $(document.location.hash.substr(1)).rel.indexOf('lightbox')!=-1) {
			myLightbox.start($(document.location.hash.substr(1)));
		}},
		250
	);

	});
});
*/
jQuery(function(){
  
  // Bind an event to window.onhashchange that, when the hash changes, gets the
  // hash and adds the class "selected" to any matching nav link.
  jQuery(window).bind( 'hashchange', function(){
    var hash = location.hash;
    
	
	//Check if location.hash matches a lightbox-anchor. If so, trigger popup of image.
	setTimeout(function() {
		if(document.location.hash && $(document.location.hash.substr(1)).rel.indexOf('lightbox')!=-1) {
			myLightbox.start($(document.location.hash.substr(1)));
		}},
		250
	);

  })
  
  // Since the event is only triggered when the hash changes, we need to trigger
  // the event now, to handle the hash the page may have loaded with.
  jQuery(window).trigger( 'hashchange' );
  
});
