// JavaScript Document

$(function() {		

	// initialize overlay trigger MUST KEEP .overlay as target of button even though .overlay class is also referenced by fp-oex:::NO CONFLICT.
	$("button[rel]").overlay({
			
		// start exposing when overlay starts to load
		onBeforeLoad: function() {
			
			// this line does the magic. it makes the background image sit on top of the mask
			$f().hide().pause();
			this.getBackgroundImage().expose({color: 'transparent'});
		}, 
		
		// when overlay is closed take the expose instance and close it as well
		onClose: function() {
			$f().show().pause();
			$.expose.close();
		}
		
	});			
});
