<!--------------------------------------------------------------------------------------------->
<!--                                                                                         -->
<!--                                                                                         -->
<!--  Copyright 1989-2015 by AutoDesSys, Inc.                                                -->
<!--                                                                                         -->
<!--  This software and its associated documentation contains proprietary,                   -->
<!--  confidential, and trade secret information of AutoDesSys Inc. and may not be           -->
<!--  disclosed, copied in any form, or used for any purpose except as specifically          -->
<!--  permitted in writing by AutoDesSys, Inc.                                               -->
<!--                                                                                         -->
<!--  AutoDesSys, Inc. grants permission to use the software to those who purchase           -->
<!--  a license.  Such a usage will be made according to the terms and conditions            -->
<!--  specified in the license agreement to which a licensee agrees before installing        -->
<!--  and commencing usage of the software.  The license agreement can be found              -->
<!--  on the envelop that contains the software CD.                                          -->
<!--                                                                                         -->
<!--  AutoDesSys, Inc. also grants permission to licensees to develop extensions to          -->
<!--  the software, which can be in the form of scripts or plugins.  The permission          -->
<!--  includes calling the API and call back functions provided by AutoDesSys, Inc.          -->
<!--  and accessing information relevant to these functions and the general workings         -->
<!--  of form.Z, but only up to the point to which AutoDesSys, Inc. has chosen to            -->
<!--  expose, through its form.Z SDK Manual.  All extensions developed by third              -->
<!--  parties will include a copy of this copyright note in an easily accessible place or    -->
<!--  a clear instruction to read this original note by AutoDesSys, Inc.                     -->
<!--                                                                                         -->
<!--  All the software distributed under a license, either for the purpose of using it or    -->
<!--  for the purpose of developing extensions, is distributed AS IS, WITHOUT                -->
<!--  WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND                                   -->
<!--  AutoDesSys, Inc. HEREBY DISCLAIMS ALL SUCH WARRANTIES,                                 -->
<!--  INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF                                        -->
<!--  MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.                                   -->
<!--                                                                                         -->
<!--  formZ, RenderZone, and RadioZity are registered trademarks of AutoDesSys, Inc.         -->
<!--                                                                                         -->
<!--  form.Z SDK, Version 8.0.0.0, Oct 07, 2016                                              -->
<!--                                                                                         -->
<!--                                                                                         -->
<!--------------------------------------------------------------------------------------------->


<HTML>
<HEAD>

 <title>formZ API</title>

<LINK REL=stylesheet HREF="formZApi.css" TYPE="text/css">

<SCRIPT LANGUAGE="JavaScript" SRC="globals.js">
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" SRC="indxnodes1.js">
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" SRC="ftsnodes1.js">
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" SRC="indxbotmfrm1.js">
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" SRC="formZApi1.js">
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript1.2">
<!--
	if(parent.frames.length==0)	window.location.replace("formZApi.htm");

	var ListArray;
	var NumList = 0;

	function GetStem(szWord)
	{
		var aStems = new Array();
		aStems[0] = "ed";
		aStems[1] = "es";
		aStems[2] = "er";
		aStems[3] = "e";
		aStems[4] = "s";
		aStems[5] = "ingly";
		aStems[6] = "ing";
		aStems[7] = "ly";

		// Loop through all the stems
		var nNumStems = aStems.length;
		var	nStemPos = 0;
		var csStem = "";
		var csSubString = "";
		for (var iStem = 0; iStem < nNumStems; iStem++) {

			// Get the "would be" position of the stem in the word and see
			// if this word has the stem
			nStemPos = szWord.lastIndexOf(aStems[iStem]);
			if (nStemPos > 0) {
				csSubString = szWord.substring(nStemPos);
				if (csSubString == aStems[iStem]) {
					
					// Found a stem

					// Check for double consonant
					csStem = szWord;
					if (szWord.charAt(nStemPos - 2) == szWord.charAt(nStemPos - 1)) {
						csStem = csStem.substring(0, nStemPos - 1);
					} else {
						csStem = csStem.substring(0, nStemPos);
					}
					return csStem;
				}
			}
		}

		// No stem found
		csStem = szWord;
		return csStem;
	}

	function find_fts_node(wrd)
	{
		var iFirst, iLast, i, nRet;
		var indx = -1;

//		alert(wrd);
		iFirst = 0;
		iLast = numFtsNodes-1;
		while(iFirst <= iLast)
		{
			i = parseInt((iFirst + iLast) / 2);

			s2 = ftsnodes[i].word.replace("_", "-");
//			alert(s2);
			if(s2.indexOf(wrd) == 0)
			{
				indx = i;
				break;
			}
			if(wrd > s2)
			{
				iFirst = i+1;
			}
			else if(wrd < s2)
			{
				iLast = i-1;
			}
//			else
//			{
//				indx = i;
//				break;
//			}
		}
		
		return indx;
	}

	function addToList(indx)
	{
		if(NumList == 0)
		{
			ListArray = new Array();
		}

		found = false;
		for(i = 0; i < NumList; i++)
		{
			if(ListArray[i] == indx)
				found = true;
		}
		if(!found)
		{
			ListArray[NumList] = indx;
			NumList++;
		}
	}

	function FtsInputSubmit()
	{
		txtobj = document.getElementById("FtsTxt");

		var txt = txtobj.value;
		txt = txt.toUpperCase();

		wrd = GetStem(txt);
		s1 = wrd.replace("_", "-");
		indx = find_fts_node(s1);
//		alert(indx);
		NumList = 0;
		if(indx > -1)
		{
//alert(indx);
			outdoc = parent.frames["FTSBotmFrm"].document;
//			alert("Found " + ftsnodes[indx].numLinks + " Matchs");
			outdoc.write("<HTML>\n");
			outdoc.write("<HEAD>\n");
			outdoc.write(" <title>formZ API</title>\n");
			outdoc.write(" <LINK REL=stylesheet HREF=\"formZApi.css\" TYPE=\"text/css\">\n");
			outdoc.write("</HEAD>\n");
			outdoc.write("<BODY>\n");
			indx2 = indx;
			s2 = ftsnodes[indx2].word.replace("_", "-");
//alert(s2);
//alert(s1);
//alert(s2.indexOf(s1));
			while(indx2 > -1 && s2.indexOf(s1) == 0)
			{
//alert(indx2);
//alert(s2);
//alert(s1);
//alert(s2.indexOf(s1));
				for(i = 0; i < ftsnodes[indx2].numLinks; i++)
				{
					j = ftsnodes[indx2].links[i];
//					alert(j);
//					alert(numIndxTopNodes + j);
//					alert("Match " + i + ": " + indxnodes[numIndxTopNodes + j].title);
//					alert(indxnodes[numIndxTopNodes + j].link);
					addToList(j);

//					outdoc.write("<P style=\"margin-top:2.00pt;margin-bottom:1.00pt;\"><A HREF=\"files/" + indxnodes[numIndxTopNodes + j].link + "\" TARGET=\"RightFrm\">\n");
//					outdoc.write(indxnodes[numIndxTopNodes + j].title + "</P>\n");
				}
				indx2++;
				s2 = ftsnodes[indx2].word.replace("_", "-");
			}
			indx2 = indx-1;
			s2 = ftsnodes[indx2].word.replace("_", "-");
//alert(s2);
//alert(s1);
//alert(s2.indexOf(s1));
			while(indx2 > -1 && s2.indexOf(s1) == 0)
			{
//alert(indx2);
//alert(s2);
//alert(s1);
//alert(s2.indexOf(s1));
				for(i = 0; i < ftsnodes[indx2].numLinks; i++)
				{
					j = ftsnodes[indx2].links[i];
//					alert(j);
//					alert(numIndxTopNodes + j);
//					alert("Match " + i + ": " + indxnodes[numIndxTopNodes + j].title);
//					alert(indxnodes[numIndxTopNodes + j].link);
					addToList(j);

//					outdoc.write("<P style=\"margin-top:2.00pt;margin-bottom:1.00pt;\"><A HREF=\"files/" + indxnodes[numIndxTopNodes + j].link + "\" TARGET=\"RightFrm\">\n");
//					outdoc.write(indxnodes[numIndxTopNodes + j].title + "</P>\n");
				}
				indx2 = indx2 - 1;
				s2 = ftsnodes[indx2].word.replace("_", "-");
			}

			ListArray.sort();

			for(i = 0; i < NumList; i++)
			{
				outdoc.write("<P style=\"margin-top:2.00pt;margin-bottom:1.00pt;\"><A  class=\"TocLeaf\" HREF=\"files/" + indxnodes[numIndxTopNodes + ListArray[i]].link + "\" TARGET=\"RightFrm\">\n");
				outdoc.write(indxnodes[numIndxTopNodes + ListArray[i]].title + "</P>\n");
			}

			outdoc.write("</BODY>\n");
			outdoc.write("</HTML>\n");
			outdoc.close();
		}
		else
		{
			alert("Nomatch found for " + txtobj.value);
		}
	}
//-->
</SCRIPT>

</HEAD>
<BODY STYLE="background-color : #c0c0c0;" BGCOLOR=#c0c0c0 onLoad="window.top.LeftFrm.TabFrm.document.images[0].src = 'image/ftstab1.gif'">
<FORM NAME=ftsform onSubmit="FtsInputSubmit(); return false;">
<TABLE width="100%">
 <TR>
   <TD BGCOLOR=#c0c0c0>
	<INPUT ID="FtsTxt" TYPE="text" SIZE="32">
   </TD>
 </TR>
 <TR>
   <TD BGCOLOR=#c0c0c0 ALIGN="center">
	<INPUT TYPE="submit" VALUE="Search">
   </TD>
 </TR>
</TABLE>
</FORM>
</BODY>
</HTML>
