/*-------------------------------
	VERIFICA EDITOR MODE
-------------------------------*/
// dovendo gestire anche pił iframe quando agisco su uno recupero la modalitą 
// di quello che sto gestendo e la setto.
function SetEditorOperativo(mode)
{
	currentEditorMode = mode.value;
}

/*-------------------------------
	FORMATTA TESTO
-------------------------------*/
function FormattaTesto(select, startag, myEditor) 
{
	addTagsHead(myEditor, startag,'');
	select.selectedIndex = 0;
} 

/*-------------------------------
	GET EDITOR MODE
-------------------------------*/
function GetEditorMode(myEditorName)
{
	return document.getElementById('EditorMode_'+myEditorName);
}

/*------------------------------
	CURR EDITOR MODE
------------------------------*/
function currEditorMode(myEditorName)
{
	return this.GetEditorMode(myEditorName);
}

/*------------------------------
	SELECT EDITOR
------------------------------*/
function SelectEditor(TipoEditor,myEditor)
{
	var mode = currEditorMode(myEditor);
	TipoEditor.value = mode.value;
	currentEditorMode = mode.value;
}

function ApriGalleria()
{
	// window.open('../../servizi/ecm5/index_galleria.htm','galleria','height=400 width=400 resizable=yes scrollbars=yes');
	window.open('/central/servizi/ecm5/index_galleria.htm',
		'galleria', 'height=400 width=400 resizable=yes scrollbars=yes');
}

function HideLayer(obj)
{
	obj.style.visibility = 'hidden';
}

function ShowLayer(nome)
{
	obj = document.getElementById(nome);
	if (obj) obj.style.visibility = 'visible';
}

function TrovaTabelle(editor, coloreEvidenziatore,myEditor)
{
	tabelleEvidenziate = EvidenziaLeTabelle(editor, coloreEvidenziatore, tabelleEvidenziate);
}

function RiversaContenuto(myEditor, inputHidden)
{
	SetEditorOperativo(document.getElementById('EditorMode_'+myEditor.name));
	if (currentEditorMode=="HTML")
	{
		alert('ATTENZIONE: uno degli Editor e\' in modalita\' CODICE, impostare la modalita\' TESTO e riprovare!');
		return false;
	}
	else 
	{
		inputHidden.value=myEditor.document.body.innerHTML;
		return true;
	}
}

