$(function() {

	// setup overlay actions to buttons
	$("div[rel]").overlay({
		
		// setup exposing (optional operation);
/*onBeforeLoad: function() {
			this.expose({color:"#254558",});	
		},*/				
		
		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			$("a.player", content).flowplayer(0).load();					
		},
		
		onClose: function(content) {
			$("a.player", content).flowplayer(0).unload();
	
			// close exposing
			/*$.unexpose();*/
		}
	});				
	
	// install flowplayers
	$("a.player").flowplayer("apps/flowplayer-3.0.2.swf", {clip:{scaling:'fit'}}); 
});
	

