window.log = function(){
  log.history = log.history || [];
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};
(function(doc){
  var write = doc.write;
  doc.write = function(q){
    log('document.write(): ',arguments);
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);
  };
})(document);

jQuery(document).ready(function($) {

    $('#ngg-images-3 > div > a > img').not(':first').hide();
    setInterval(function() {
        $('#ngg-images-3 > div > a > img').filter(':visible').fadeOut(2200);
        if ($('#ngg-images-3 > div > a > img:last').is(':visible')) {
             $('#ngg-images-3 > div > a > img').filter(':first').fadeIn(2200);
        } else {
            $('#ngg-images-3 > div > a > img').filter(':visible').parent('a').next('a').children('img').fadeIn(2200);
        }
    }, 4900);

    $('img.alignleft').parents('p').before('<div class="clear"></div>');

    var pageTitle = $('div.page > header > h1.entry-title').text();
    $('div.ngg-gallery-thumbnail > a, dt.gallery-icon > a, div.ngg-widget > a').each(function() {
        var thisTitle = $(this).children('img').attr('title');
        $(this).attr('title', pageTitle+' '+thisTitle).attr('rel', 'shadowbox[gallery]');
    });
    $('div.ngg-gallery-thumbnail > a > img').removeAttr('title').removeAttr('alt');
    $('div.ngg-galleryoverview').wrapInner('<ul class="jcarousel"></ul>');
    $('div.ngg-gallery-thumbnail-box').wrap('<li></li>');
    $('ul.jcarousel').jcarousel();
    Shadowbox.init();
});
























