function strpos (haystack, needle, offset)
{
    var i = (haystack + '').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}

function isset(variable)
{
    return (typeof(variable) != 'undefined');
}

$(function() {
    $('.rich_text_area').tinymce({
        // Location of TinyMCE script
        script_url : '/sup/js/tiny_mce/tiny_mce.js',
        // General options
        theme : "advanced",
        plugins : "table, imagemanager, paste",
        // Theme options
        theme_advanced_buttons1 : "fontsizeselect,bold,italic,underline,forecolor,undo,bullist,numlist,link,unlink,removeformat,cleanup,help",
        theme_advanced_buttons2 : "tablecontrols,|,code,|,image,|,pasteword",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        relative_urls : false,
        // Example content CSS (should be your site CSS)
        content_css : "/sup/css/tiny_mce.css"
    });

    $('.simple_text_area').tinymce({
        // Location of TinyMCE script
        script_url : '/sup/js/tiny_mce/tiny_mce.js',
        // General options
        theme : "advanced",
        plugins : "table, imagemanager, paste",
        // Theme options
        theme_advanced_buttons1 : "fontsizeselect,bold,italic,underline,forecolor,undo,bullist,numlist,link,unlink,removeformat,cleanup,help",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        relative_urls : false,
        // Example content CSS (should be your site CSS)
        content_css : "/sup/css/tiny_mce.css"
    });
});
