$(document).ready(function(){	
	
	// install flowplayer into flowplayer container
	var player = $f("player", "splash/flash/flowplayer/flowplayer-3.1.2.swf");
		
	$("a[rel]").each(function(i) {	
	// setup button action. it will fire our overlay 
	
	$(this).overlay( {
		onBeforeLoad: function() {
			var wrap = this.getContent().find("div.wrap"); 
			if (wrap) {
				wrap.load(this.getTrigger().attr("href")); 
			}
		},
								
		oneInstance: false,  
		
			expose: { 
    	        color: '#000', 
        	    opacity: 0.7, 
            	closeSpeed: 1000 
        	},
		
			start: {
				width: 0
			},
		
			
				// when overlay is opened, load our player
				onLoad: function() {
					player.load();
				},
		
				// when overlay is closed, unload our player
				onClose: function() {
					player.unload();
				}
			
			});					
	});			
});			
