tinyMCE.init({
// General options
mode : "specific_textareas",
editor_selector: "wikicontent",
body_class : "wikicontent",
content_css: "/static/css/wiki.css",
theme : "advanced",
theme_advanced_layout_manager: "SimpleLayout",
auto_focus: "mce_editor_0",
plugins :
"pagebreak,table,save,advimage,advlink,emotions,inlinepopups,media,searchreplace,contextmenu,paste,noneditable,visualchars,nonbreaking,xhtmlxtras,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : 
"bold,italic,underline,strikethrough,sub,sup,|,bullist,numlist,|,outdent,indent,blockquote,|,forecolor,backcolor,|,removeformat,cleanup,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 :
"undo,redo,|,pastetext,pasteword,|,search,replace,|,tablecontrols,|,visualaid",
theme_advanced_buttons3 : "formatselect,fontselect,fontsizeselect,link,unlink,anchor,|,charmap,emotions,image,media,|,code",

theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

file_browser_callback:'img_gallery'

});

function img_gallery (field_name, url, type, win) {
    var cmsURL = "/Image";    // script URL - use an absolute path!

    tinyMCE.activeEditor.windowManager.open(
	{
      	file : cmsURL,
       	title : 'Image Gallery',
       	width : 420,  // Your dimensions may differ - toy around with them!
       	height : 400,
       	resizable : "no",
       	inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
       	close_previous : "no"
	}, 
	{
	window : win,
        input : field_name
	});
    return false;
  }


