function flowplayer(element, file, image, autoplay) {
	embed_video_player(element, element.width(), element.height(), file, image, autoplay);
}
function embed_video_player (obj, width, height, file, image, autoplay)
{
	var playlist =  new Array();
	var keys = {
		"evillegion.hostasaurus.com": "@62ec3bd7ea6985dafbe",
		"amievil.com": "@a3d747328525a706932",
		"www.amievil.com": "@a3d747328525a706932"
	};

	if (autoplay == false) {
		playlist.push({
			url: image,
			autoBuffering: true,
			scaling: 'orig'
		});
	}

	playlist.push({
		url: file,
		scaling: 'orig'
	});

	obj.flashembed(
		{
			src: "/swf/player.swf",
			wmode: "transparent",
			width: width,
			height: height
		},
		{
			config: {
				// commercial version requires product key
		    key: keys[location.host] || '',

				playlist: playlist,
				clip: {
					autoPlay: autoplay,
					accelerated: true
				},
				canvas:  { 
					backgroundColor: '#000000',
					backgroundGradient: 'none'
				},
				plugins: {
					controls: {
						width: '98%',
						left: '50%',
						bottom: 5,
						
						// Visibility properties
						autoHide: "always",
						hideDelay: 800,

						// Coloring
						backgroundColor: "#000000",
						backgroundGradient: "none",
						opacity: 0.95,

						// buttons
						buttonColor: "#666666",
						buttonOverColor: "#666666",

						// progress
						sliderColor: "#000000", // after
						sliderGradient: "none",
						bufferColor: "#666666", // loaded
						bufferGradient: "none",
						progressColor: "#333333", // played
						progressGradient: "none",

						// time
						timeColor: "#111111", // actual
						durationColor: "#990000", // total
						timeBgColor: "#666666", // bg

						// volume
						volumeSliderColor: "#666666",
						volumeSliderGradient: "none",
						
						// text above the volume when you drag
						tooltipColor: "#666666",
						tooltipTextColor: "#111111",
						
						// radios
						borderRadius: 15
					}
				}
			}
		}
	);
}
