window.gaTracker = {
	url: '/js/flowplayer/flowplayer.analytics-3.2.2.swf',
	events: {
		all: true
	},
	debug: false,
	accountId: 'UA-20349636-1'
};
window.flowPlayerSWF = '/js/flowplayer/flowplayer.commercial-3.2.7.swf';

function startFlowplayer(fDiv, fSWFPlayer, fClip, fOnStart, fOnFinish, fName) {
	if (fName == undefined) {
		fName = fClip;
	}

	fPlayer = flowplayer(fDiv, window.flowPlayerSWF, {
		key: '#@abd051d1c883433910a',
		logo: {
			url: '/images/flowplayer.logo.png',
			bottom: 30,
			left: 30,
			opacity: 1,
			fullscreenOnly: false
		},
		onMouseOver: function() {
			this.getPlugin("logo").fadeTo(0.5, 1000);
		},
		
		onMouseOut: function() {
			this.getPlugin("logo").fadeTo(0, 1000);
		},
		
		clip: {
			autoPlay:true,
			autoBuffering:true,
			url: fClip+'',
			onStart:function(clip){
				var clipwidth = clip.metaData.width;
				var clipheight= clip.metaData.height;
				this.getPlugin("logo").fadeTo(0, 8000);
				fOnStart(clip, clipwidth, clipheight);
			},
			onFinish:function(){
				fOnFinish();
			},
			eventCategory: 'Video: '+fName
		},
		plugins: {
			gatracker: window.gaTracker
		},
		onLoad : function() {
			this.unmute();
			this.setVolume(100);
        },
        onError: function (errorCode, errorMessage) {
            //alert(errorCode + '\n' + errorMessage);
        }

	}).ipad({
		'simulateiDevice': false
	});
	fPlayer.load();
}


