 $(function() {
 
  	// install flowplayer into flowplayer container
  	var player = $f("player", "/swf/flowplayer-3.1.1.swf");
 
  	// setup button action. it will fire our overlay 
  	$("img[rel]").overlay({
      onBeforeLoad: function() {
 				if(typeof(usingIE6) == 'boolean'){
 					$('div.overlay:first').attr('overlay', '');
 				}
  			jQuery('#exposeMask').show();
      },
 
  		// when overlay is opened, load our player
  		onLoad: function() {
  			player.load();
  		},
 
  		// when overlay is closed, unload our player
  		onClose: function() {
  		  jQuery('#exposeMask').hide();
  			player.unload();
  		}
  	});
 
 	});
