var player = null;
function playerReady(thePlayer) { player = window.document[thePlayer.id]; }$(function() {
	
	$("img[rel]").overlay({
		expose: '#fff',
		effect: 'apple',
		
		// when overlay is opened, load our player
		onLoad: function() { 
      window.setTimeout("player.sendEvent('PLAY')",1000);
  	},
		
		// when overlay is closed, unload our player
  	onBeforeClose: function() {
      player.sendEvent('STOP');
		} 
	});
       
});