// JavaScript Document
tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,print,contextmenu,paste,directionality,fullscreen",
	theme_advanced_buttons1_add_before : "save,newdocument,separator",
	theme_advanced_buttons1_add : "fontselect,fontsizeselect",
	theme_advanced_buttons2_add : "separator,forecolor,backcolor",
	theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
	theme_advanced_buttons3_add_before : "tablecontrols,separator",
	theme_advanced_buttons3_add : "iespell,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	content_css : "/css/tinymce.css",
	plugi2n_insertdate_dateFormat : "%Y-%m-%d",
	plugi2n_insertdate_timeFormat : "%H:%M:%S",
	external_link_list_url : "example_link_list.js",
	external_image_list_url : "example_image_list.js",
	media_external_list_url : "example_media_list.js",
	file_browser_callback : "ibrowseCallback",
	paste_use_dialog : false,
	theme_advanced_resizing : true,
	theme_advanced_resize_horizontal : false,
	theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
	paste_auto_cleanup_on_paste : true,
	paste_convert_headers_to_strong : false,
	paste_strip_class_attributes : "all",
	paste_remove_spans : false,
	paste_remove_styles : false		
});

function ibrowseCallback(field_name, url, type, win) {
  url = '/js/cf_ibrowser/index.cfm?editorType=mce&EDITOR_RESOURCE_TYPE=' + type;
  win_ref = win; // not sure why this works for IE, but it does.
  win_x = 700; win_y = 500; // adjust these variables to fit your desired window size
  cffmWindow = window.open(url,"","width="+win_x+",height="+win_y+",left=20,top=20,bgcolor=white,resizable,scrollbars,menubar=0");
  if ( cffmWindow != null ) {
    cffmWindow.focus();
  }
}
