function Menu() {
	var _this = this;

	var $root;

	var defaultVars = {
		id : -1,
		animation : 'true',
		color_active : "0xFFFFFF",
		color_inactive : "0x000000",
		links : [
			{
				url : '/'
			},
			{
				url : '/activiteiten'
			},
			{
				url : '/aandeslag'
			},
			{
				url : '/inzenden'
			},
			{
				url : '/mdvers'
			},
			{
				url : '/motto'
			},
			{
				url : '/nieuws'
			},
			{
				url : '/clubs'
			}
		]
	};

	var defaultParams = {
		scale : "noscale",
		menu  : "false",
		wmode : "transparent",
		allowscriptaccess : "samedomain"
	};

	var flashVars;

	function init(root) {
		$root = $(root);

		if($root.length < 1)
			throw 'Root node for menu if null';

		// Create flash vars
		flashVars = $.extend(true, {}, defaultVars);
		for(var key in flashVars) {
			var value = $root.attr('m:'+key);
			if(value) {
				flashVars[key] = value;
			}
		}

		var $flashElem = $('<div/>');

		$root.empty();
		$root.append($flashElem);

		var uid;

		do {
			uid = 'flashMenu-'+ Math.floor(Math.random()*999);
		} while($('#'+uid).length > 0);

		$flashElem.attr('id', uid);

		// TODO Rename. This (flashvars) is too easily confused with flashVars
		var flashvars = {
			menudata : encodeURI(JSON.stringify(flashVars))
		};

		var params = defaultParams;

		// trigger the swf embed (a bit delayed to prevent framerate issues)
		setTimeout(function() {
			window.swfobject.embedSWF("/swf/mainmenu.swf?r=" + Math.floor(Math.random()*999), $flashElem.attr('id'), "100%", "100%", "9", "false", flashvars, params, null, onFlashEmbed);
		}, 500);
	}

	function onFlashEmbed(e) {
		if(!e.success) {
			$root.empty();
			new mdv.MenuHtml(
				$root,
				flashVars.id,
				'#'+flashVars.color_active.substr(2),
				'#'+flashVars.color_inactive.substr(2)
			);
		}
	}

	init.apply(this, arguments);

	return _this;
}
