(function() {

	tinymce.PluginManager.requireLangPack('contentselector');

	tinymce.create('tinymce.plugins.CommunityServerContentSelectorPlugin', {
		init : function(ed, url) {

			ed.addCommand('mceContentSelector', function() {
				if (tinyMCE_CommunityServerOptions)
					tinyMCE_CommunityServerOptions.ContentSelectorOpenFunction();
			});

			ed.addButton('contentselector', {
				title : 'contentselector.desc',
				cmd : 'mceContentSelector',
				image : url + '/img/browse.gif'
			});
		},

		createControl : function(n, cm) {
			return null;
		},

		getInfo : function() {
			return {
				longname : 'Community Server Content Selector Plugin',
				author : 'Telligent Systems',
				authorurl : 'http://telligentsystems.com/',
				infourl : 'http://telligentsystems.com/',
				version : "1.0"
			};
		}
	});

	tinymce.PluginManager.add('contentselector', tinymce.plugins.CommunityServerContentSelectorPlugin);
})();