function adminForm()
{
	if (document.getElementById( 'FCKeditor' ))
	{
		document.getElementById( 'currLang' ).value = document.getElementById( 'lang' ).value;
		setEditor( document.getElementById( 'lang' ).value, false );
	}
}

function setEditor( lang, save )
{
	if (save){
		var oEditor = FCKeditorAPI.GetInstance('FCKcontent');
		var element = 'content' + document.getElementById( 'currLang' ).value;
		var editorValue = oEditor.GetXHTML(true);
		document.getElementById( element ).value = addslashes( editorValue );
		document.getElementById( 'currLang' ).value = lang;
	}
	var oFCKeditor = new FCKeditor( 'FCKcontent' ) ;
	oFCKeditor.BasePath = "fckeditor/" ;
	oFCKeditor.Height = "500";
	oFCKeditor.Width = "100%";
	oFCKeditor.Value = stripslashes( document.getElementById( 'content' + lang ).value );
	document.getElementById( 'FCKeditor' ).innerHTML = oFCKeditor.CreateHtml();
}

function setContent()
{
	var oEditor = FCKeditorAPI.GetInstance('FCKcontent');
	var element = 'content' + document.getElementById( 'currLang' ).value;
	document.getElementById( element ).value = addslashes( oEditor.GetXHTML(true) );
	return true;
}

function setTask( task )
{
	document.getElementById( 't' ).value = task;
}

function setImage( value, element, path )
{
	document.getElementById( element ).innerHTML = '<img src="' + path + '/' + value + '" />';
}
