$(
	function(){
	
		$('#submenu ul li').each(		
			function(){
					
				var text  = $(this).text();
				
				//var h = Math.ceil(text.split(" ").join("  ").split("I").join("II").length / 16) * 25;
				
				var h = $(this).height() + 10;
					
				var flash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="150" height="'+h+'" class="main_menu_item" align="middle"><param name="sAlign" value="T"><param name="allowScriptAccess" value="always" /><param name="movie" value="/contentImages/flash/main_menu_item.swf" /><param name="quality" value="high" /><param name="flashVars" value="labeltext='+escape(text)+'&labellink='+escape($(this).children("a").attr('href'))+'&backgroundimage='+escape($(this).css('background-image'))+'" /><param name="wmode" value="transparent" /><embed src="/contentImages/flash/main_menu_item.swf" quality="high" width="150" height="'+h+'" name="main_menu_item" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" sAlign="T" flashVars="labeltext='+escape(text)+'&labellink='+escape($(this).children("a").attr('href'))+'&backgroundimage='+escape($(this).css('background-image'))+'" /></object>';	
			
				$(this).replaceWith(flash);
			}
		);
	}
)