jQuery(function() {
	jQuery("a.iframe").overlay({ expose: '#333',
	onBeforeLoad: function() {
		var iframe = this.getContent().find("iframe");
		iframe.attr("src", this.getTrigger().attr("href"));
	}
});

jQuery("a.map").overlay({ expose: '#333' });

jQuery("a.movie").overlay({ 

	expose: '#333', 

	// when overlay is opened, load our player 
	onLoad: function() { 
		player = $f("flowplayer", {src: "http://video.jpmguides.com/movies/flowplayer.commercial-3.1.0.swf", bgcolor: '#ffffff'},  {
			key: '#$03e514d89ee00321241',			

			// use first frame from the video as "splash image"
			clip: {
				url: "http://video.jpmguides.com/movies/content.flv", 
				autoPlay: true,
				autoBuffering: true
			},

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

			// screen dimensions are 1 pixel less than the rounded canvas
			screen: {
				width:506,
				height:234
			},

			// rounded canvas is done with borderRadius
			canvas: {
				backgroundColor: '#112233',
				borderRadius:0
			},

			// don't use default controls
			plugins: { 
				controls: null 
			} 

			// use HTML controls instead. place it inside element named "htmlControls"
			}).controls("htmlControls");
			player.load();
		}, 

		// when overlay is closed, unload our player 
		onClose: function() { 
			player.unload(); 
		} 
	}); 

});
