//-------
// Editor extensions
//--------
tinyMCE.init({
  mode : "textareas",
  editor_selector : "richtext",
  skin: 'default',
  theme : "advanced",
  convert_urls : false,
  plugins : "safari,paste,visualchars,asupload,inlinepopups,searchreplace,style",
  content_css: "/stylesheets/as_la.css",
  paste_auto_cleanup_on_paste : true,
  apply_source_formatting: true,
  inline_style : false,
  paste_convert_middot_lists : true,
  paste_remove_spans  : true,
  remove_trailing_nbsp : true,
  verify_html : false,
  entities : '38,amp,60,lt,62,gt',
  font_size_style_values : "xx-small,x-small,small,medium,large,x-large,xx-large",
  theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,forecolorpicker,backcolorpicker,|,charmap,styleprops",
  theme_advanced_buttons2 : "cut,copy,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,hr,removeformat,visualchars",
  theme_advanced_buttons3 : "",
  theme_advanced_toolbar_location : "top",
  theme_advanced_toolbar_align : "left",
  theme_advanced_statusbar_location : "bottom",
  theme_advanced_path: false,
  theme_advanced_resizing : true,
  theme_advanced_resizing_use_cookie : false
});

tinyMCE.init({
  mode : "textareas",
  editor_selector : "emailtext",
  skin: 'default',
  theme : "advanced",
  convert_urls : false,
  plugins : "safari,paste,visualchars,asupload,inlinepopups,searchreplace,style",
  content_css: "",
  paste_auto_cleanup_on_paste : true,
  apply_source_formatting: true,
  inline_style : true,
  paste_convert_middot_lists : true,
  paste_remove_spans  : true,
  remove_trailing_nbsp : true,
  verify_html : true,
  entities : '38,amp,60,lt,62,gt',
  font_size_style_values : "xx-small,x-small,small,medium,large,x-large,xx-large",
  theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,forecolorpicker,|,charmap,styleprops",
  theme_advanced_buttons2 : "cut,copy,pastetext,pasteword,|,search,replace,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,cleanup,code,|,hr,removeformat,visualchars",
  theme_advanced_buttons3 : "",
  theme_advanced_fonts : "Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;",
  theme_advanced_toolbar_location : "top",
  theme_advanced_toolbar_align : "left",
  theme_advanced_statusbar_location : "bottom",
  theme_advanced_path: false,
  theme_advanced_resizing : true,
  theme_advanced_resizing_use_cookie : false
});

function editorinsert(path)
{
  e = tinyMCE.activeEditor;
  e.dom.setAttrib('asupload_tmp', 'src', path);
  e.execCommand('mceRepaint');
  e.dom.setAttrib('asupload_tmp', 'id', '');
  for (var w in e.windowManager.windows)
    e.windowManager.close(w, null);
};