var estradaCustom = {
	sitePath: '',
	leaveSite: 'You are leaving the Clarion site',
	editor: {
	  defaultConfig: {
	    //height: "500px"
/*
	    plugins : "table,advlink,insertdatetime,preview,searchreplace,print,contextmenu,paste,fullscreen,xhtmlxtras,advimage,media,imagepicker",
        theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,cleanup,removeformat,separator,search,replace,separator,undo,redo,separator,styleselect,fontsizeselect",
        theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,image,imagepicker,charmap,media",
        theme_advanced_buttons3 : "tablecontrols,separator,hr,visualaid,code,separator,fullscreen,separator,print",
	    theme_advanced_blockformats : "p,div,span,blockquote,h4,h3,h2,h1",
	    theme_advanced_font_sizes : 'xSmall (8pt)=1,Small (10pt)=2,Medium (12pt)=3,Large (14pt)=4,xLarge (16pt)=5,xxLarge (18pt)=6,xxxLarge (20pt)=7',
	    font_size_style_values : '.8em,1em,1.2em,1.4em,1.6em,1.8em,2em,',
      content_css : '/assets/common/styles/mce.css',
      invalid_elements: "font",
      forced_root_block : ''
*/
	mode : "none",
	theme : "advanced",
	skin : "o2k7",
	gecko_spellcheck: true,
	skin_variant : "black",
	plugins : "table,advlink,insertdatetime,preview,searchreplace,print,contextmenu,paste,fullscreen,xhtmlxtras,imagepicker",
	height: "300px",
	width: "600px",
	safari_warning : false,
	cleanup_on_startup : false,
	relative_urls: true,
	strict_loading_mode: true,
	content_css : "/assets/estrada/library/scripts/custom/editor.css",
	theme_advanced_buttons1: "cut,copy,paste,pastetext,pasteword,cleanup,removeformat,separator,search,replace,separator,undo,redo,separator,styleselect,formatselect",
	theme_advanced_buttons2: "bold,italic,underline,strikethrough,sub,sup,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,imagepicker,charmap",
	theme_advanced_buttons3 : "tablecontrols,separator,hr,visualaid,code,separator,fullscreen,separator,print",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	theme_advanced_blockformats : "p,address,h2,h3,h4",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	theme_advanced_resize_horizontal : false,
	theme_advanced_resizing : false,
	extended_valid_elements : "iframe[src|width|height|align]",
	forced_root_block : '',
        paste_insert_word_content_callback : "convertWord",
        paste_auto_cleanup_on_paste : true
    }
    /*
    ,
    full: {
	    plugins : "table,advlink,insertdatetime,preview,searchreplace,print,contextmenu,paste,fullscreen,xhtmlxtras,advimage,media,imagepicker",
      theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,cleanup,removeformat,separator,search,replace,separator,undo,redo,separator,forecolor,backcolor,styleselect,fontsizeselect,fontselect",
      theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,image,imagepicker,charmap,media",
      theme_advanced_buttons3 : "tablecontrols,separator,hr,visualaid,code,separator,fullscreen,separator,print",
	    theme_advanced_blockformats : "p,div,span,blockquote,h4,h3,h2,h1",
	    theme_advanced_font_sizes : 'Small=.small-text,Large=.large-text',
      content_css : $.authoring().url.base + 'scripts/custom/content.css'
    }
    */
  }
  

};

var custom_editor_config = {
	mode : "none",
	theme : "advanced",
	skin : "o2k7",
	gecko_spellcheck: true,
	skin_variant : "black",
	plugins : "table,advlink,insertdatetime,preview,searchreplace,print,contextmenu,paste,fullscreen,xhtmlxtras,imagepicker",
	height: "300px",
	width: "600px",
	safari_warning : false,
	cleanup_on_startup : false,
	relative_urls: true,
	strict_loading_mode: true,
	content_css : "/assets/library/scripts/custom/editor.css",
	theme_advanced_buttons1: "cut,copy,paste,pastetext,pasteword,cleanup,removeformat,separator,search,replace,separator,undo,redo,separator,styleselect,formatselect",
	theme_advanced_buttons2: "bold,italic,underline,strikethrough,sub,sup,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,imagepicker,charmap",
	theme_advanced_buttons3 : "tablecontrols,separator,hr,visualaid,code,separator,fullscreen,separator,print",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	theme_advanced_blockformats : "p,address,h2,h3,h4",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	theme_advanced_resize_horizontal : false,
	theme_advanced_resizing : false,
	onpageload: "tinyMCE_oninit",
        paste_insert_word_content_callback : "convertWord",
        paste_auto_cleanup_on_paste : true
};
function convertWord (type, content) {
	// console.info("In convertWord");
    switch (type) {
        // Gets executed before the built in logic performs it's cleanups
        case "before":
            //content = content.toLowerCase(); // Some dummy logic
            //alert(content);
            break;
        // Gets executed after the built in logic performs it's cleanups
        case "after":
            //alert(content);
            content = content.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,'');
            //content = content.toLowerCase(); // Some dummy logic
            //alert(content);
            break;
    }
    return content;
}
