// tiny MCE -
//    jQuery plugin for accessible, unobtrusive WYSIWYG HTML editing
// v .1
// by Alton Crossley
// http://www.nogahidebootstrap.com/jtinymce/
// Free beer and free speech. Enjoy!
// The cool part is oh-so-simple
$.fn.tinymce = function(options)
{
    return this.each(function()
    {
       preString = "<div class='tiny_wrapper'>";
       postString = "</div>";
       $(this).wrap(preString + postString);
         try
        {
            tinyMCE.execCommand("mceAddControl",true,  this.id); 
        }
        catch(e)
        {
            alert( this.id  + ':' + e.message);
        }
    });
}
function initMCE()
{
    tinyMCE.init({    mode : "none",
                      theme : "advanced",
	                    language : "es",
	                    convert_urls : false,
	                    theme_advanced_toolbar_location : "top",
	                    plugins : "ibrowser,table,advlink",
                      theme_advanced_buttons1 : "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,forecolor,backcolor,styleselect,formatselect",
		                  theme_advanced_buttons2 : "tablecontrols,hr",
		                  theme_advanced_buttons2_add : "ibrowser",
		                  theme_advanced_buttons3 : "cut,copy,paste,pastetext,pasteword,bullist,numlist,undo,redo,link,unlink,image,cleanup,code,removeformat,sub,sup,charmap,media",
                      theme_advanced_toolbar_location : "top",
                      theme_advanced_toolbar_align : "left",
                      extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|alt|title|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],span[class|align|style]",
                      theme_advanced_statusbar_location : "none",
                      theme_advanced_resizing : true,
                      relative_urls : false,
                      content_css : "css/tinyMCE.css",
                      theme_advanced_styles : "Titulo=texto_titulo;Destacado=texto_destacado;Imagen Izda=imagen_contenidos_izda;Imagen Dcha=imagen_contenidos_dcha"
       });
}
initMCE();


