try{
tinyMCE.init({
    mode : "textareas",
    relative_urls : false,
    theme : "advanced",
    theme_advanced_toolbar_location : "top",
    theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,div,blockquote,dt,dd,code,samp",
    table_row_styles : "Odd=odd;Even=even",
    editor_deselector : "textile_area",
    width : "100%",
    plugins : "table,save,advhr,advimage,advlink,emotions,insertdatetime,preview,print,template",
    theme_advanced_buttons1 : "insertdate,inserttime,preview,zoom,bold,italic,underline,forecolor,backcolor,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,separator,sub,sup",
    theme_advanced_buttons2 : "tablecontrols,row_props,formatselect,removeformat,separator,charmap,emotions,code,help",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_align : "left",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    template_external_list_url : "http://tinymce.moxiecode.com/example_data/example_template_list.js",
    save_callback : "saveAndStripComments",
    apply_source_formatting : true,
    spellchecker_languages : "+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",
    extended_valid_elements : "iframe[style|src|width|frameborder|height]"
  });
 
function saveAndStripComments(element_id, html, body) {
	// Do some custom HTML cleanup
	html = html.replace(/<!--.*?-->/g,'');
	// html = html.replace(/<span style=".*?">&nbsp;<\/span>/g,'');
	return html;

}
}
catch(error){ };

try{
  SortableTable.setup({ 
    descendingClass : 'table_header_desc', 
    ascendingClass : 'table_header_asc',
    columnClass : 'table_header_start',
    rowEvenClass : 'even',
    rowOddClass : 'odd' });
}
catch(error){ };

YAHOO.namespace ("surveil");
YAHOO.surveil.onMenuBarReady = function() {
            // Instantiate and render the menu bar
    var oMenuBar = new YAHOO.widget.MenuBar("main_menu", { autosubmenudisplay:true, hidedelay:750, lazyload:true });
    oMenuBar.render();
 };

 // Initialize and render the menu bar when it is available in the DOM
 YAHOO.util.Event.onContentReady("main_menu", YAHOO.surveil.onMenuBarReady);