// var dir
// declare and assign this variable before including this script
//

if (!document.images) {}
else {
  close0 = new Image();
  close0.src  = dir+"close.gif";
  close1 = new Image();
  close1.src = dir+"closeon.gif";
  close2 = new Image();
  close2.src = dir+"closeover.gif";
  ok0 = new Image();
  ok0.src  = dir+"ok.gif";
  ok1 = new Image();
  ok1.src = dir+"okon.gif";
  ok2 = new Image();
  ok2.src = dir+"okover.gif";
  apply0 = new Image();
  apply0.src  = dir+"apply.gif";
  apply1 = new Image();
  apply1.src = dir+"applyon.gif";
  apply2 = new Image();
  apply2.src = dir+"applyover.gif";
  cancel0 = new Image();
  cancel0.src  = dir+"cancel.gif";
  cancel1 = new Image();
  cancel1.src = dir+"cancelon.gif";
  cancel2 = new Image();
  cancel2.src = dir+"cancelover.gif";
}

function change(Name,Image,No)
{
  if (!document.images) {}
  else document[Name].src = eval(Image + No + ".src");
}

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 onLaunch(href)
{
	if (!checkModified())
		return;

  document.ftgate.config.value="2";
  document.ftgate.redirect.value=href;
	document.ftgate.submit();
}

function dialogTitleWM(locator, title)
{
	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");
	document.write("<TD HEIGHT=\"23\" CLASS=\"dialogTitle\">"+title+"</TD>\r\n");
	document.write("<TD HEIGHT=\"23\" CLASS=\"dialogTitle\" STYLE=\"{text-align: right}\">"+locator+"&nbsp;</TD>\r\n");
	document.write("</TR>\r\n");
	document.write("</TABLE>\r\n");
	document.write("</TD>\r\n");
	document.write("</TR>\r\n");
}

function dialogTitle(locator, title, apply, cancel, close, ok)
{
	if (title=="")
		title="&nbsp;";

	document.write("<TR>\r\n");
	document.write("<TD>\r\n");
	document.write("<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"0\" CELLSPACING=\"2\">\r\n");

	if (locator!="")
	{
		document.write("<TR>\r\n");
		document.write("<TD HEIGHT=\"19\" CLASS=\"dialogLocator\">"+locator+"</TD>\r\n");
		document.write("</TR>\r\n");
	}
	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");
	document.write("<TD HEIGHT=\"23\" CLASS=\"dialogTitle\">"+title+"</TD>\r\n");
	document.write("<TD HEIGHT=\"23\" CLASS=\"dialogTitle\" ALIGN=\"RIGHT\" VALIGN=\"MIDDLE\">\r\n");

	if (ok)
	{
		document.write("<A HREF=\"javascript:"+ok+"\"\r\n");
		document.write("onMouseDown=\"change('okA', 'ok', 1)\"\r\n");
		document.write("onMouseOver=\"change('okA', 'ok', 2)\"\r\n");
		document.write("onMouseOut=\"change('okA', 'ok', 0)\"><IMG SRC=\""+buttons+"ok.gif\" NAME=\"okA\" BORDER=\"0\" WIDTH=\"50\" HEIGHT=\"20\" ALT=\"OK\"></A>\r\n");
	}
	if (apply!="")
	{
		document.write("<A HREF=\"javascript:"+apply+"\"\r\n");
		document.write("onMouseDown=\"change('applyA', 'apply', 1)\"\r\n");
		document.write("onMouseOver=\"change('applyA', 'apply', 2)\"\r\n");
		document.write("onMouseOut=\"change('applyA', 'apply', 0)\"><IMG SRC=\""+buttons+"apply.gif\" NAME=\"applyA\" BORDER=\"0\" WIDTH=\"50\" HEIGHT=\"20\" ALT=\"Apply\"></A>\r\n");
	}
	if (cancel!="")
	{
		document.write("<A HREF=\"javascript:"+cancel+"\"\r\n");
		document.write("onMouseDown=\"change('cancelA', 'cancel', 1)\"\r\n");
		document.write("onMouseOver=\"change('cancelA', 'cancel', 2)\"\r\n");
		document.write("onMouseOut=\"change('cancelA', 'cancel', 0)\"><IMG SRC=\""+buttons+"cancel.gif\" NAME=\"cancelA\" BORDER=\"0\" WIDTH=\"50\" HEIGHT=\"20\" ALT=\"Cancel\"></A>\r\n");
	}
	if (close!="")
	{
		document.write("<A HREF=\"javascript:"+close+"\"\r\n");
		document.write("onMouseDown=\"change('closeA', 'close', 1)\"\r\n");
		document.write("onMouseOver=\"change('closeA', 'close', 2)\"\r\n");
		document.write("onMouseOut=\"change('closeA', 'close', 0)\"><IMG SRC=\""+buttons+"close.gif\" NAME=\"closeA\" BORDER=\"0\" WIDTH=\"50\" HEIGHT=\"20\" ALT=\"Close\"></A>\r\n");
	}

	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");
	document.write("</TABLE>\r\n");
	document.write("</TD>\r\n");
	document.write("</TR>\r\n");
}
