function doFlowplayer(el, file, type) {
	var player = '/wp-content/themes/onesherpa/flash/flowplayer.commercial-3.1.0.swf';
	var url = (type == 'rtmp') ? 'mp4:'+file.substring(file.indexOf('/')+1,file.length) :
		(type == 'blip') ? file.replace("/video/", "http://blip.tv/file/get/")+".flv" : file;
	var clip = (type == 'rtmp') ? "url: '"+url+"', provider: 'rtmp'" : "url: '"+url+"'";
	/* clip = "onStart: function(clip) { \           
            pageTracker._trackEvent('Videos', 'Play', clip.url); \      
        }, \
        onPause: function(clip) { \        
            pageTracker._trackEvent('Videos', 'Pause', clip.url, parseInt(this.getTime())); \        
        }, \
        onStop: function(clip) { \
            pageTracker._trackEvent('Videos', 'Stop', clip.url, parseInt(this.getTime())); \
        }, \
        onFinish: function(clip) { \
            pageTracker._trackEvent('Videos', 'Finish', clip.url); \
        },"+clip; */
	clip = (file != '') ? "clip: {"+clip+"}," : "";
	var provider = (type == 'rtmp') ?
		"rtmp: { \
		            url: '/wp-content/themes/onesherpa/flash/flowplayer.rtmp-3.1.0.swf', \
		            netConnectionUrl: 'rtmp://uyc1j1dzjj.rtmphost.com/"+file.substring(0,file.indexOf('/'))+"', \
		            objectEncoding: '0' \
		        }," : "";
	var json = "{"+clip+" \
			key: '#$a60f8ae5b0b823284e8', \
			logo: { \
				url: '/wp-content/themes/onesherpa/images/logo-watermark.png', \
				fullscreenOnly: false, \
				bottom: '40', \
				right: '20', \
				width: '105', \
				height: '70', \
				linkUrl: '/' \
			}, \
			canvas: { \
				backgroundColor: 'transparent' \
			}, \
			plugins: {"+provider+" \
				controls: { \
					url: '/wp-content/themes/onesherpa/flash/flowplayer.controls-3.1.0.swf', \
					stop: true, \
					playlist: false, \
					fullscreen: true, \
					progressGradient: 'medium', \
					buttonOverColor: '#00adef', \
					backgroundColor: '#1e1e1d', \
					backgroundGradient: 'none', \
					bufferColor: '#064280', \
					timeBgColor: '#064280', \
					bufferGradient: 'none', \
					tooltipTextColor: '#ffffff', \
					volumeSliderGradient: 'none', \
					progressColor: '#00adef', \
					volumeSliderColor: '#484846', \
					buttonColor: '#064280', \
					tooltipColor: '#064280', \
					borderRadius: '0px', \
					sliderGradient: 'none', \
					sliderColor: '#484846', \
					timeColor: '#00adef', \
					durationColor: '#ffffff', \
					height: 20, \
					opacity: 1.0, \
					tooltips: { \
						buttons: true, \
						play: 'Play', \
						pause:  'Continue playing', \
						mute: 'Mute', \
						unmute: 'Unmute', \
						stop: 'Stop', \
						fullscreen: 'Full Screen', \
						fullscreenexit: 'Exit fullscreen' \
					} \
				} \
			} \
		}";
	eval('$(el).flowplayer(player, '+json+').load();');
	//if (type == 'flv') document.write("$('"+el+"').flowplayer('"+player+"', "+json+").load();");
}
$(document).ready( function() { zoombox.init() });