﻿function flowplayer_config(selector, path, option) {
	if (option == "video") {
		flowplayer(selector, path, {
				screen:	{
					bottom: 0	// make the video take all the height
				},
				
				plugins: {
					controls: {
						url: 'flowplayer.controls-3.2.1.swf',
						
						backgroundColor: "transparent",
						backgroundGradient: "none",
						
						progressColor: '#FF0066',
						sliderColor: '#FFFFFF',
						sliderBorder: '1.5px solid rgba(160,160,160,0.7)',
						
						buttonOverColor: '#FF0066',
						
						volumeColor: '#FF0066',
						volumeSliderColor: '#FFFFFF',
						volumeBorder: '1.5px solid rgba(160,160,160,0.7)',

						timeColor: '#FF0066',
						durationColor: '#535353',

						tooltipColor: 'rgba(255, 255, 255, 0.7)',
						tooltipTextColor: '#000000',
						
						autoHide: 'enable'
						
					}
				},
				clip: {

					onStart: function() {
						$f("flowplayer_audio").pause();
					},
					onBeforeFinish: function() {
						$f("flowplayer_audio").resume();
					},
					onBeforePause: function() {
						$f("flowplayer_audio").resume();
					},
					onBeforeResume: function() {
						$f("flowplayer_audio").pause();
					}
				}
			}
		);
		
		
		// get the embedding code
		//var code = $f().embed().getEmbedCode();

		// place this code in our textarea
		/*
		$(function() {
			$('textarea#vdo_embed').val(code);
			//$('textarea#vdo_embed').append('<div id="hideVdoEmbed">close</div>');
		})
		*/
	}
	
	else if (option == "audio") {
		$f(selector, path, {

			// fullscreen button not needed here
			plugins: {
				controls: {
					fullscreen: false,
					height: 30,
					autoHide: false
				},
				audio: {
					url: '/../../flowplayer/flowplayer.audio.swf'
				}
			},

			clip: {
				// optional: when playback starts close the first audio playback
				onBeforeBegin: function() {
					$f("a.flowplayer").close();
				}
			}

		});
	}

}