			var sCurrentElementOnFocus = "";
			var sCurrentCommonName = "";

			function Get_Hints(sXMLDictionary)
			{
				window.event.cancelBubble = false;
				sCurrentElementOnFocus = event.srcElement.id;
				sCurrentCommonName = event.srcElement.id.substr(3);

				var txtBoxName = "txt" + sCurrentCommonName;
				var txtDivName = "div" + sCurrentCommonName;
				var colSelectOnPage;
				var nCellsNumber;
				var i;

				sClass = "";

 				if (event.keyCode == 38)//up
				{
					if (document.all[txtDivName].style.display == "none")
					{
						return 0;
					}
					nCellsNumber = document.all.tblHintsTable.children(0).children.length;

					for (i = 0;i < nCellsNumber; i++)
					{
						if (( document.all['Cell'+i].className == "CellDark") && (i != 0))
						{
							document.all['Cell'+i].className = "CellBright"; 
							document.all['Cell'+(i-1)].className = "CellDark";
							sClass = "CellBright";
							document.all['Cell'+(i-1)].scrollIntoView();
						}
					}
				}
				
				if (event.keyCode == 40)//down
				{
					if (document.all[txtDivName].style.display == "none")
					{
						return 0;
					}
					else
					{
						nCellsNumber = document.all.tblHintsTable.children(0).children.length;
						for (i = 0;i < nCellsNumber; i++)
						{
							if (( document.all['Cell'+i].className == "CellDark") && (i != (nCellsNumber - 1)))
							{
								document.all['Cell'+i].className = "CellBright"; 
								document.all['Cell'+(i+1)].className = "CellDark";
								sClass = "CellBright";
    							document.all['Cell'+(i+1)].scrollIntoView();
        						i = nCellsNumber;
							}
						}
					}
				}
				
				if (event.keyCode == 13)//enter
				{
					if (document.all[txtDivName].style.display == "none")
					{
						return 0;
					}
					else
					{
						nCellsNumber = document.all.tblHintsTable.children(0).children.length;
						for (i = 0;i < nCellsNumber; i++)
						{
							if ( document.all['Cell'+i].className == "CellDark") 
							{
								document.all[txtBoxName].value = document.all['Cell'+i].innerText;
								document.all[txtDivName].style.display="none";
								document.all[txtDivName].innerHTML = "";
								window.event.cancelBubble = true;
								i = nCellsNumber;
							}
						}
					}
				}
	    		
				if (!(event.keyCode == 38) && !(event.keyCode == 40) && !(event.keyCode == 13) && !(event.keyCode == 0) && (document.all[txtBoxName].value.length < 5))
				{
					document.all[txtDivName].style.display="none";
					document.all[txtDivName].innerHTML = "";
				}
	    		//alert(event.keyCode);
	    		if (!(event.keyCode == 38) && !(event.keyCode == 40) && !(event.keyCode == 13) && !(event.keyCode == 0) && (document.all[txtBoxName].value.length >= 5))
	    		{
					if (Trim(document.all[txtBoxName].value) == "")
					{
						document.all[txtDivName].style.display="none";
						document.all[txtDivName].innerHTML = "";
						return 0;
					}
					
					var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
					xmlDoc.async="false";
					xmlDoc.load("../AL Filter/xml/" + sXMLDictionary);
					xmlDoc.setProperty("SelectionLanguage", "XPath");
			
					var SelectedXML; 
				
					if (document.all[txtBoxName].value == "'")
					{
						//alert(1);						
						document.all[txtBoxName].value = " ";	
					}
					if(xmlDoc.parseError == 0)
					{
						SelectedXML = xmlDoc.documentElement.selectNodes("/dictionary/w[starts-with(.,'" + document.all[txtBoxName].value.toUpperCase( ) + "')]");
					}
					else
					{
						SelectedXML = "";
					}
					nIndex = SelectedXML.length;
					if(nIndex > 5)
					{
						document.all[txtDivName].style.overflow = "scroll";
						document.all[txtDivName].style.overflowX = "hidden";
						document.all[txtDivName].style.height = "120px";
					}
					else
					{
						document.all[txtDivName].style.overflow = "visible";
						document.all[txtDivName].style.height = "";
					}				

	    			if( nIndex == 0)
	    			{
						document.all[txtDivName].style.display="none";
						document.all[txtDivName].innerHTML = "";
						return 0;
	    			}
					
					var sTableBody,sClass;
					var imgRow;
				
					sTableBody = "";
				
					sTableBody = sTableBody + '<table width="150" id="tblHintsTable" cellpadding="0" cellspacing="0">';
	    				for (i = 0;i < nIndex;i++)
						{
							if (i == 0)
							{
								sClass = "CellDark";
							}
							else
							{
								sClass = "CellBright";
							}
							sTableBody = sTableBody + '<tr><td id=\'Cell' + i + '\' onmouseout="JavaScript:Get_Medium_Class()" onmouseover="JavaScript:Get_Bright_Class()" onmousedown="JavaScript:Get_Selected_on_TextBox(\'' + document.all[txtBoxName].id +'\',\'Cell' + i + '\',\'' + document.all[txtDivName].id + '\')" class="' + sClass +'" style="PADDING-LEFT:3px">' + SelectedXML.item(i).text +'</td></tr>';
//							alert(sTableBody);
						}
						sTableBody = sTableBody + "</table>";
						document.all[txtDivName].innerHTML = sTableBody;
						document.all[txtDivName].style.display="block";
					
						return 0;
				}
			}
			
			function Get_Selected_on_TextBox(txtBoxName,tbCellName,oDivName)
			{
				if (event.button == 1)
				{
					document.all[txtBoxName].value = document.all[tbCellName].innerText;
					document.all[oDivName].style.display="none";
					document.all[oDivName].innerHTML = "";
				}
				return 0;
			}
			
			function DivOnFocus()
			{
				sCurrentElementOnFocus = event.srcElement.id;	
			}
			
			function Clear_Divs(sCommonName)
			{
				if (sCurrentElementOnFocus.substr(3) != sCommonName)
				{
					document.all["div"+sCommonName].style.display = "none";
				}
				return 0;
			}
			
			function TextBoxFocusOut()
			{
				sCurrentElementOnFocus = "";
				setTimeout('Clear_Divs("'+sCurrentCommonName+'")',50);
			}
			
			function DivFocusOut()
			{
				sCurrentElementOnFocus = "";
				setTimeout('Clear_Divs("'+sCurrentCommonName+'")',50);
			}
			
			function Get_Medium_Class()
			{
				//alert(event.srcElement.id);
				event.srcElement.className = "CellBright";
			}
			
			function Get_Bright_Class()
			{
				event.srcElement.className = "CellDark";
			}
	
			function TextBoxKeyPress()
			{
				sCurrentElementOnFocus = event.srcElement.id;
				sCurrentCommonName = event.srcElement.id.substr(3);

				var txtBoxName = "txt" + sCurrentCommonName;
				var txtDivName = "div" + sCurrentCommonName;
				var nCellsNumber;
				var i;
				
				if (event.keyCode == 13)//enter
				{
					if (document.all[txtDivName].style.display == "none")
					{
						return 0;
					}
					else
					{
						nCellsNumber = document.all.tblHintsTable.children(0).children.length;
						
						for (i = 0;i < nCellsNumber; i++)
						{
							if ( document.all['Cell'+i].className == "CellDark") 
							{
								document.all[txtBoxName].value = document.all['Cell'+i].innerText;
								document.all[txtDivName].style.display="none";
								document.all[txtDivName].innerHTML = "";
								i = nCellsNumber;
 							}
						}
					}
					event.keyCode = 0;
				}
				
			}