var mediaPlugin = new Class
(
	{
		initialize: function(parent)
		{
			this.parent = parent;
		},
		
		load: function()
		{
			
		},
		
		complete: function()
		{
			var mediaId = '42';

			if($('ubbMediaId'))
			{
				mediaId = $('ubbMediaId').value;
			}
			
			this.parent.insertTag(null, 'media', false, mediaId, "");
		},
		
		view: function()
		{
				var url = site_url + "js/custom/media.html";

				new Ajax(url, {
					method: 'get',
					update: this.parent.advancedConfig,
					onComplete: (function(){this.parent.buildSubmitButton(this); this.load()}).bind(this)
				}).request();
			return '';
		}
	}
);
