// JavaScript Document

var i = 15000;
$(function() {
	$f("player", "scripts/flowplayer/flowplayer.commercial-3.1.2.swf", {
    // product key from your account 
    key: '$767d8aac30d59aa73c7',
    canvas: {backgroundColor: "#4d4d4d"},
      plugins: { 
        controls: { 
			url: 'scripts/flowplayer/flowplayer.controls-3.1.2.swf', 
			//autoPlay: false,
			skin: 'customskin',
			height: 20,
			backgroundGradient: 'medium',
			backgroundColor: '#4d4d4d',
			sliderGradient: 'low',
			sliderColor: '#ffffff',
			progressGradient: 'none',
			progressColor: '#bb133e',
			bufferGradient: 'none',
			bufferColor: '#333333',
			fullscreen: false,
			playlist: false,
			timeBgHeightRatio: .7,
			timeBgColor: '#333333',
			timeColor: '#cccccc',
			volumeSliderHeightRatio: .3,
			volumeSliderColor: '#333333',
			buttonOverColor: '#bb133e',
			buttonColor: '#333333',
			tooltips: {buttons: true},
			tooltipColor: '#ffffff',
			tooltipTextColor: '#333333'
		},
		customskin: { url: "scripts/flowplayer/custom.swf", type: "classLibrary" } 
	},
   
   clip: { 
		//autoPlay:false,
		 // track start event for this clip 
		onStart: function(clip) {eventTracker._trackEvent("Videos", "Play", clip.fileName);}, 
		// track pause event for this clip. time (in seconds) is also tracked 
		onPause: function(clip) {eventTracker._trackEvent("Videos", "Pause", clip.fileName, parseInt(this.getTime()));}, 
		// track stop event for this clip. time is also tracked 
		onStop: function(clip) {eventTracker._trackEvent("Videos", "Stop", clip.fileName, parseInt(this.getTime()));}, 
		// track stop event for this clip. time is also tracked 
		onResume: function(clip) {eventTracker._trackEvent("Videos", "Resume", clip.fileName, parseInt(this.getTime()));}, 
		// track finish event for this clip  par
		onFinish: function(clip) {eventTracker._trackEvent("Videos", "Finish", clip.fileName);},
		//when the Clip's duration is tracked,
		onMetaData: function(clip) 
		{ 
			//create a cuepoint every i seconds (while i < Clip's duration)
			for(i; i < clip.duration * 1000; i = i + 15000)
			{
				//creates cuepoint and sends data to GA with name = clip.fileName (define in playlist) and based on current time: Math.ceil(this.getTime())+"sec"
				this.onCuepoint(i, function(clip, cuepoint) 
				{
					eventTracker._trackEvent("Videos", Math.round(this.getTime())+"sec", clip.fileName, parseInt(this.getTime())); 
				});
			}
		}
	//close clips
	},
   
   playlist: [
 // playlist entries 
 
 		//define first playlist entry
        {
			url: 'http://ceboard.vo.llnwd.net/o1/marketing/FinalLegal.flv',
			fileName: "www.exbd.com/legalandcompliance - Navigating the \"New Normal\"",
			title: "1&mdash;Navigating the \"New Normal\"",
			autoPlay: true
		},
 		
 		//define second playlist entry
        {
			url: 'http://ceboard.vo.llnwd.net/o1/marketing/FIRSTLEGALshort_vide.flv',
			fileName: "www.exbd.com/legalandcompliance - Prepare for Increased Regulatory Activity",
			title: "2&mdash;Prepare for Increased Regulatory Activity",
			autoPlay: false,
			onBeforeFinish: function ()  { return false; }
		}
    ]
})
	
// use playlist plugin. again loop is true
	//.playlist("div.petrol", {loop:true});	
	.playlist("div.clips:first", {loop:true});
	
	//this changes the order in which the playlist will play the clips. Each are defined by their index. The first clip created has an index of 0, the second index is 1, and so on and so forth...
	//$f("player").play(1, 0);	
//--End Video--
});
