if ( window.CKEDITOR )
{
	(function()
	{
		var onload_config = function()
		{
			
			CKEDITOR.config.toolbar_Content =
				[
				    ['Source','-','Preview'],
				    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
				    ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
				    ['Link','Unlink','Anchor'],
				    '/',
				    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
				    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
				    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
				    ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
				    '/',
				    ['Styles','Format','Font','FontSize'],
				    ['TextColor','BGColor'],
				    ['Maximize', 'ShowBlocks']
				];
				
			CKEDITOR.config.toolbar_MinContent =
				[
				    ['Undo','Redo'],['Link','Unlink'],
				    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
				    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
				    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
				    ['Image']
				];
			onload_content();
			onload_min_content();
		};
		
		var onload_content = function()  {
			CKEDITOR.replaceAll( function(textarea, config) {
				config.toolbar = "Content";
				if (textarea.className.indexOf("content") == -1) return false;
				return true;
			});
			for (n in CKEDITOR.instances) {
			 	CKFinder.SetupCKEditor(CKEDITOR.instances[n], '/modules/ckeditor/ckfinder/') ;
			 }
		}
		
		var onload_min_content = function()  {
			CKEDITOR.replaceAll( function(textarea, config) {
				config.toolbar = "MinContent";
				if (textarea.className.indexOf("min_content") == -1) return false;
				
	  			return true;
			 });
		}
		
		// Register the onload listener.
		if ( window.addEventListener ) window.addEventListener( 'load', onload_config, false );
			else if ( window.attachEvent ) window.attachEvent( 'onload', onload_config );
	})();
}