function changeTextArea(p_strTextAreaId)
{
   var oFCKeditor = new FCKeditor(p_strTextAreaId) ;
   oFCKeditor.BasePath = "fckeditor/" ;
   oFCKeditor.Width = '540' ;
	oFCKeditor.Height = '350' ;
   oFCKeditor.ReplaceTextarea() ;
   var eTextareaDiv	= document.getElementById( 'textDIV' ) ;
	var eFCKeditorDiv	= document.getElementById( 'textareaDIV' ) ;
		// Switch the DIVs display.
	eTextareaDiv.style.display = 'none' ;
	eFCKeditorDiv.style.display = '' ;
}

function PrepareSave()
{
	// If the textarea isn't visible update the content from the editor.
	if ( document.getElementById( 'Textarea' ).style.display == 'none' )
	{
		var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
		document.getElementById( 'DataTextarea' ).value = oEditor.GetXHTML() ;
	}
}

function FCKeditor_OnComplete( editorInstance )
{
	// Enable the switch button. It is disabled at startup, waiting the editor to be loaded.
	document.getElementById('btn_edit').disabled = true ;
}
