// Video Player
$(function() {

	// setup overlay actions to buttons
	$(".v-thumb[rel]").overlay({

		// use the Apple effect for overlay
		effect: 'apple',		
		
		expose: '#000',				
		
		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			this.getOverlay().find("a.player").flowplayer(0).load();
		},
		
		onClose: function(content) {
			$f().unload();
		}
	});				
	
	// install flowplayers
	$("a.player").flowplayer("swf/flowplayer-3.1.5.swf"); 
});

$(document).ready(function() {

// select the overlay element - and "make it an overlay"
$("#overlay1").overlay({

	// use the Apple effect for overlay
		effect: 'apple',		
		
		expose: '#000',				
		
		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			this.getOverlay().find("a.player").flowplayer(0).load();
		},
		
		onClose: function(content) {
			$f().unload();
		},

	// we want to use the programming API
	api: true

// load it immediately after the construction
}).load();
});