	jQuery.normalFlashEmbed = function(flashCloudSelector, xml, myWidth, myHeight) {
		jQuery(flashCloudSelector).flash(
			     {
			         src: 'szerkesztheto_oldalak/flash/text_and_image_cloud.swf',
			         width: myWidth,
			         height: myHeight,
			         wmode: 'transparent',
			         quality: 'high',
			         allowScriptAccess: 'always',
			         swLiveConnect: 'true',
			         flashvars: { cloud_data: xml, tspeed: 200 }
			      }
			 );
	}
	
	jQuery.tag2flash = function(type, width, height) {

		var tagHtml = jQuery('div#tagcloud_' + type).html();
		if (tagHtml != null) {
			jQuery('input#meta_tmp_' + type).val(tagHtml);
			
			var tagCloud = jQuery('form#meta_tmp_form_' + type).serialize();
			
			jQuery.ajax({
				url: CONTEXT_PATH + '/tagCloud2Flash',
				type: 'post', 
				contentType: 'application/x-www-form-urlencoded; charset=utf-8',
				data: tagCloud + '&type=' + type,
				dataType: 'json',
				success: function(json) {
					jQuery.normalFlashEmbed('div#flashCloud_' + type, json.xml, width, height);
					
				}
			});
		}
	};
