tinyMCEPopup.requireLangPack();

var ComponentDialog = {
	init : function() {
		var f = document.forms[0];

		// Get the selected contents as text and place it in the input
		//f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
	},

	insert : function(url) {
		if (url){
			// Insert the contents from the input into the document
			html = '<img src="' + baseUrl + '/admin/media/images/component.gif" alt="component:' + url + '" text="component:' + url + '" />';
			tinyMCEPopup.editor.execCommand('mceInsertContent', false, html);
			tinyMCEPopup.close();
		}
	}
};

tinyMCEPopup.onInit.add(ComponentDialog.init, ComponentDialog);
