﻿$(function() { 
 
    // if the function argument is given to overlay, 
    // it is assumed to be the onBeforeLoad event listener 
    $("a[rel]").overlay({ 
        top: 180,
        expose: {
            color: "#fff",
            loadSpeed: 200,
            opacity: 0.8
        },
        onBeforeLoad: function() { 
 		$("#overlay").css('display', 'block');
            // grab wrapper element inside content 
            var wrap = this.getContent().find(".contentWrap"); 
 
            // load the page specified in the trigger 
            wrap.load(this.getTrigger().attr("href")); 
        } 
        
    }); 
});