function resizeIt() {
	var textarea = document.getElementById( "text" );
	textarea.style.height = 0;
	textarea.style.height = ( textarea.scrollHeight + 120 ) + "px";
}

function setup() {
   tinyMCE.init({
      mode : "textareas",
      theme : "advanced",
      plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
      theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
      theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
      theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
      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",
	  content_css : "css/tinymce.css",
      editor_selector : "mceAdvanced",
      theme_advanced_resizing : false
   });
   tinyMCE.init({
      mode : "textareas",
      theme : "advanced",
	  content_css : "css/tinymce.css",
      theme_advanced_resizing : true,
      editor_selector : "text",
      readonly : true
   });
}

function changeClass()
{
    tinymce.execCommand('mceToggleEditor',false,'text');
	document.getElementById("text").setAttribute("class", "mceAdvanced");
	setup();
	document.getElementById("submit").setAttribute("class", "visible");
	document.getElementById("cancel").setAttribute("class", "visible");
	document.getElementById("button").setAttribute("class", "hidden");
}
