// var dir
// declare and assign this variable before including this script
//
var btnElement=1;
var topRow=true;

function onHelp()
{
	if (!checkModified())
		return;

	document.ftgate.config.value=COMMAND_CONTENT;
	if (verbose==CONTENT_VERBOSE)
		document.ftgate.param1.value=CONTENT_MINIMAL;
	else
		document.ftgate.param1.value=CONTENT_VERBOSE;
		
	document.ftgate.submit();
}

function onCancel(parms)
{
	if (!checkModified())
		return;

	if (parms)
		window.location.href="index.fts?"+parms;
	else
		window.location.href="index.fts";
}

function onClose()
{
	if (!isOK(document.ftgate))
		return;

	document.ftgate.redirect.value="index.fts";
	document.ftgate.submit();
}

function onApply()
{
	if (!isOK(document.ftgate))
		return;
		
	document.ftgate.submit();
}

function dialogTitle(title, apply, cancel, close, ok, icon)
{
	if (title=="")
		title="&nbsp;";

	document.write("<TR>\r\n");
	document.write("<TD>\r\n");
	document.write("<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"0\" CELLSPACING=\"0\">\r\n");
	document.write("<TR>\r\n");

	if (icon)
	{
		document.write("<TD WIDTH=\"23\" HEIGHT=\"23\" CLASS=\"dialogTitle\">");
		document.write("<IMG SRC=\"/images/icons/"+icon+"\" NAME=\"iconA\" WIDTH=\"20\" HEIGHT=\"20\" ALT=\"icon\">\r\n");
		document.write("</TD>\r\n");
	}

	document.write("<TD HEIGHT=\"23\" CLASS=\"dialogTitle\">"+title+"</TD>\r\n");
	document.write("<TD HEIGHT=\"23\" CLASS=\"dialogButtons\" ALIGN=\"RIGHT\" VALIGN=\"MIDDLE\">\r\n");

	if (ok)
		button(ok, stOK, btnOK, "ok", "save.gif");
	if (apply)
		button(apply, stApply, btnApply, "apply", "save.gif");
	if (cancel)
		button(cancel, stCancel, btnCancel, "cancel", "cancel.gif");
	if (close)
		button(close, stClose, btnClose, "close", "close.gif");
	if (topRow)
	{
		document.write("&nbsp;<INPUT TYPE=\"CHECKBOX\" onClick=\"javascript:onHelp()\"");
		if (verbose==CONTENT_VERBOSE)
			document.write("CHECKED");
		document.write(">"+btnVerbose);
		//button("onHelp()", stVerbose, btnVerbose, "help");
		topRow=false;
	}

	document.write("&nbsp;</TD>\r\n");
	document.write("</TR>\r\n");

	document.write("</TABLE>\r\n");
	document.write("</TD>\r\n");
	document.write("</TR>\r\n");

	btnElement++;
}

