// setup player  
$f("flowplayer", "/media/player/flowplayer.commercial-3.1.2.swf", {
	
	// commercial version requires product key
	key: '$bb14c7e73817e8d3ed4',
	
	// properties that are common to both clips in the playlist
	clip: { 
		autoPlay: true,
		autoBuffering: true,
		bufferLength: 1,
		scaling: 'fit',
		
        // track start event for this clip
        onStart: function(clip) {
            _tracker._trackEvent("Videos", "Play", clip.url);
        },

        // track pause event for this clip. time (in seconds) is also tracked
        onPause: function(clip) {
            _tracker._trackEvent("Videos", "Pause", clip.url, parseInt(this.getTime()));
        },

        // track stop event for this clip. time is also tracked
        onStop: function(clip) {
            _tracker._trackEvent("Videos", "Stop", clip.url, parseInt(this.getTime()));
        },

        // track finish event for this clip
        onFinish: function(clip) {
            _tracker._trackEvent("Videos", "Finish", clip.url)
        }
	},
		
	// custom labels on the play button
	play: {
		label: 'Play',
		replayLabel: 'Play again', 
		fadeSpeed: 200
	},
		
	// make canvas dark
	canvas: {
		backgroundColor: '#000000',
		// remove default canvas gradient 
		backgroundGradient: 'none'
	},
	
	// playlist with four entries
	
	playlist: [
				{
					title: 'Trailer',
					url: 'http://trailers.tosavealifemovie.com/trlr2/tosavealife_trlr2-pg_h.640.mov'
				},				
				{
					title: 'For Youth Workers',
					url: 'http://media.tosavealifemovie.com/_videos/tosavealife_youthpastors_HQ.mp4'
				},				
				{
					title: 'Behind The Scenes',
					url: 'http://media.tosavealifemovie.com/_videos/tosavealife_behindthescenes_HQ.mp4'
				},				
				{
					title: 'Clip: Is it worth it?',
					url: 'http://media.tosavealifemovie.com/_videos/tosavealife_clip_isitworthit_HQ.mp4'
				}
			],
	
	// show playlist buttons in controlbar
	plugins:  {
         
        // bandwidth check plugin 
        bwcheck: {   
            url: '/media/player/flowplayer.bwcheck-3.1.2.swf',    
            netConnectionUrl: '/media/player/expressinstall.swf', 
            bitrates: [40, 150, 400, 700, 1000], 
         
            // this method is called when the bandwidth check is done 
            onBwDone: function(url, chosenBitrate, bitrate) { 
                var el = document.getElementById("info"); 
                el.innerHTML = "Your speed is: " +bitrate+ "<br />Video file served: " +url; 
            } 
        },
		controls: {
			
			url: '/media/player/flowplayer.controls-tube-3.1.3.swf',
			
			// autohide the controlbar
			autoHide: 'always',

			// display properties (size, location and opacity)  
			bottom: 0, 
			height: 36,
			left: '50%',
			width: '100%',
			all: false,
				play:true,
				stop: true,
				scrubber: true,
				mute: true,
				volume: false,
				fullscreen: true,
				playlist: false,
				time: true,

			borderRadius: '0',
			opacity:0.75,

			backgroundColor: '#000000',
			backgroundGradient: 'none',
			bufferColor: '#666666',
			bufferGradient: 'none',
			buttonOverColor: '#ffffff',
			buttonColor: '#191919',
			buttonGradient: 'none',
			durationColor: '#ffffff',
			progressColor: '#999999',
			progressGradient: 'none',
			sliderColor: '#191919',
			sliderGradient: 'none',
			timeColor: '#ffffff',
			volumeSliderColor: '#333333',
				
			// background color for all tooltips 
			tooltipColor: '#333333',
			// text color 
			tooltipTextColor: '#a9a9a9',
				
			// tooltips configuration 
			tooltips: {					 
				// enable english tooltips on all buttons 
				buttons: true
				}
			}
		}
	
	}).playlist("div.sidebyside:first", {loop:true}); 