
var tiny_mce_default_options = {
      // Location of TinyMCE script
      script_url : '/javascripts/tiny_mce_3.2.7_jquery/tiny_mce.js',

      // General options
      mode : "none",
      theme: "advanced",
      skin : "o2k7",
      plugins : "paste",

      // Theme options

      theme_advanced_buttons3 : "",

      theme_advanced_toolbar_location : "top",
      theme_advanced_toolbar_align : "left",
      theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
      theme_advanced_buttons2 : "cut,copy,paste,pastetext, pasteword,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,cleanup,forecolor,backcolor",

      content_css : "/stylesheets/tiny_mce.css",

      theme_advanced_resizing : true,
      theme_advanced_resize_horizontal : true,

      spellchecker_rpc_url : '/tiny_mce_spellcheck',
      spellchecker_languages : "+English=en"
};

var tiny_mce_options_lite = jQuery.extend({}, tiny_mce_default_options, {
  plugins : "autoresize",
        theme_advanced_buttons1 : "",
        theme_advanced_buttons2 : "",
        theme_advanced_toolbar_location : "none"
});

var tiny_mce_options_standard = jQuery.extend({}, tiny_mce_default_options, {
      plugins : "autoresize,inlinepopups,paste,spellchecker,preview",
      theme_advanced_buttons3 : "spellchecker,iespell",
      theme_advanced_statusbar_location : "none"
});

var tiny_mce_options_liquid = jQuery.extend({}, tiny_mce_default_options, {
      plugins : "autoresize,inlinepopups,paste,spellchecker,preview,procore",
      theme_advanced_buttons3 : "spellchecker,iespell,liquidictionary",
      theme_advanced_statusbar_location : "none"
});

var tiny_mce_options_standard_no_autoresize = jQuery.extend(tiny_mce_options_standard, {
      plugins: "inlinepopups,paste,spellchecker,preview"});

var tiny_mce_options_heavy = jQuery.extend({}, tiny_mce_default_options, {
      plugins : "inlinepopups,paste,spellchecker,preview," + 
                "style,layer,table,save,advhr,advimage,advlink,autoresize," +
                "emotions,iespell,insertdatetime,media,searchreplace,print,contextmenu," +
                "directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

      theme_advanced_buttons3 : "code,styleprops,attribs,visualchars,absolute,hr,visualaid,|,nonbreaking,template,pagebreak,|,tablecontrols",
      theme_advanced_buttons4 : "spellchecker,iespell"
});

$j(function($) {
  $(document).ready(function() {
    var toggleTinymce = function(selector){
    //  tm = $j(selector).tinymce();
    //  tm.isHidden() ? tm.show() : tm.hide();
    };

   function isAppleMobileDevice() {
       return (navigator.platform == "iPad" || navigator.platform == "iPhone" || navigator.platform == "iPhone Simulator");
   }


   if (!isAppleMobileDevice())
   {
    $('textarea.tinymce_lite').tinymce(tiny_mce_options_lite);
    $('textarea.tinymce_light').tinymce(tiny_mce_default_options);    
    $('textarea.tinymce_standard').tinymce(tiny_mce_options_standard);
    $('textarea.tinymce_heavy').tinymce(tiny_mce_options_heavy);
    $('textarea.tinymce_standard_no_autoresize').tinymce(tiny_mce_options_standard); 
   }
    // We won't show the TinyMCE for this kind until it's toggled on. 
    // Store the options now so they can be retrieved for initilization the first time it's shown.

    // TEMP: let ckeditor init these instead. -DL 
    //$('textarea.tinymce_liquid').data('tinymce_options', tiny_mce_options_liquid);    
  });
});





// Other Options: -

//       plugins : "inlinepopups,paste,spellchecker,preview",

//"save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
//"save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
//"cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,back
//"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
//"insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage"

//theme_advanced_statusbar_location : "bottom"

