$(function() { 
 
    // install flowplayer into flowplayer container 
    var player = $f("a.player", "/swf/flowplayer/flowplayer.commercial-3.1.5.swf", {

			// commercial version requires product key
			key: '#@b342a73d3b081c4333f',

			// example custom logo for commercial only 
	    	logo: { 
	        	url: '/images/site/videooverlay_logo.png', 
	        	fullscreenOnly: false 
	    	},

			clip: { autoPlay: true, scaling: 'fit' },

			// custom labels on the play button
			play: {
				label: 'Play',
				replayLabel: 'Play again', 
				fadeSpeed: 3000
			},

			// make canvas dark
			canvas: {
				backgroundColor: '#000000'
			},

			// don't use default controls
			plugins: {
				controls: {
					url: '/swf/flowplayer/flowplayer.controls-3.1.5.swf',
					
					// display properties (size, location and opacity)
					height: 21,
					bottom: 0,
					opacity: 0.95,
					
					timeColor: '#ffffff',
					durationColor: '#ffffff',
					progressColor: '#b3b3b3',
					progressGradient: [0.2, 0.05],
					bufferColor: '#6a6a6a',
					bufferGradient: [0.05, 0.2],
					sliderColor: '#717171',
					sliderGradient: [0.2, 0.05],
					buttonColor: '#171717',
					buttonOverColor: '#666666',
					timeBgColor: 'transparent',
					
					backgroundColor: '#000000',
					backgroundGradient: [0.2, 0.05],
					
					time: true,
					mute: false,
					volume: false,
					autoHide: 'always',
					hideDelay: 4000,
					
					tooltipColor: '#000000',
					tooltipTextColor: '#ffffff'
				}
			},
			
			contextMenu: [ 
				// 2. display custom player information
				"Outreach, Inc Video Player 1.0"
			]			
	}); 
     
    // setup button action. it will fire our overlay  
    $("a.video[rel]").overlay({ 
         
        // use the Apple effect for overlay 
        effect: 'apple', 
         
        // when overlay is opened, load our player 
        onLoad: function() { 
            //player.load();
			this.getContent().find("a.player").flowplayer(0).load();
        }, 
         
        // when overlay is closed, unload our player 
        onClose: function() { 
            $f().unload(); 
        } 
    }); 
             
});