$(function() {  
    // select the thumbnails and make them trigger our overlay
    $(".gallery a").overlay({

    	// each trigger uses the same overlay with the id "gallery"
    	target: '#gallery',

    	// optional exposing effect
    	expose: '#f1f1f1'

    // let the gallery plugin do its magic!
    }).gallery({
    	// the plugin accepts its own set of configuration options
        autohide: false,
        opacity: 0.6,
    	speed: 800
    });
    
    $("a[rel]").overlay({ 
 
        expose: '#f1f1f1',
 
        onBeforeLoad: function() { 
            // grab wrapper element inside content 
            var wrap = this.getContent().find(".contentWrap"); 
            // load the page specified in the trigger 
            wrap.load(this.getTrigger().attr("href")); 
        }
 
    });
    
    $("a.issuu[rel]").overlay({ 
 
        expose: '#f1f1f1',
 
        onBeforeLoad: function() { 
            // grab wrapper element inside content 
            var wrap = this.getContent().find(".contentWrap"); 
            // load the page specified in the trigger 
            wrap.load(this.getTrigger().attr("href")); 
        }
 
    });
 
});
