var oEditor		= window.parent.InnerDialogLoaded();
var FCK			= oEditor.FCK;
var FCKLang		= oEditor.FCKLang;
var FCKConfig	= oEditor.FCKConfig;
var oImage = FCK.Selection.GetSelectedElement();
if (oImage && oImage.tagName != 'IMG')
	oImage = null;
window.onload = function()
{
	oEditor.FCKLanguageManager.TranslatePage(document);
	LoadSelection();
	window.parent.SetAutoSize(true);
	window.parent.SetOkButton(true);
}
function LoadSelection()
{
	if (! oImage) return;
	GetE('txtUrl').value = GetAttribute(oImage, 'src', '');
}
function Ok()
{
	if (GetE('txtUrl').value.length == 0)
	{
		GetE('txtUrl').focus();
		alert(FCKLang.DlgImgAlertUrl);
		return false;
	}
	oImage = FCK.CreateElement('IMG');
	UpdateImage(oImage);
	return true;
}
function UpdateImage(e)
{
	SetAttribute(e, "src", GetE('txtUrl').value);
}