$(document).ready(function() {
	if($('#flowplayer')){
		
		//Please amend following 2 lines to indicate URI of SWFs
	    var locationOfPlayerSWF = "/content/flash/flowplayer.commercial-3.1.5.swf";
		var locationOfControlsSWF = "/content/flash/flowplayer.controls-tube-3.1.5.swf";
		
		// Other variables, should not need editing
		
		// Flowplayer commercial license key
		var permiraLicenseKey = "#$f3ccd0e7e546aa863d7";
		
		// ID of container element to replace with Flash content
		var containerElementID = "flowplayer";
		
		// ID of <a> element containing 'href' attribute of FLV file to play
		var videoLinkElementID = "video-url";
		
		// ID of <img> element containing 'src' attribute of image to use for video 'splash screen'
		var splashImageElementID = "video-splash";
		
		var vidWidth = $('#'+splashImageElementID).attr('width');
		var vidHeight = parseInt($('#'+splashImageElementID).attr('height')) + 25;		
		
		var params = {
			'allowScriptAccess': 'always',
			'allowFullScreen': 'true',
			'bgcolor': '#000000'
		};
		
		var flashVars = {
			"config": "{'key':'"+permiraLicenseKey+"','playerId':'"+containerElementID+"','playlist':['"+$("#"+splashImageElementID).attr("src")+"',{'url':'"+$("#"+videoLinkElementID).attr("href")+"','autoPlay':false}],'plugins':{'controls':{'url':'"+locationOfControlsSWF+"','progressColor':'#0066CC','bufferColor':'#3399EE','buttonOverColor':'#F47D31','tooltipColor':'#0066CC','tooltipTextColor':'#FFFFFF','volumeSliderColor':'#000000','timeBgColor':'#0066CC','timeColor':'#FFFFFF'}}}"
		};
		
		var attributes = {
			"id": "VideoPlayer"
		}
		
		swfobject.embedSWF(locationOfPlayerSWF, containerElementID, vidWidth, vidHeight, "9.0.115", "", flashVars, params,attributes,function() {
			$("#VideoPlayer").bind("onStart", function() {
				console.log("loaded");
			});
		});
	}	
});