<div class="ilMainMenuSearch">
<form class="ilMainMenuSearch" action="{FORMACTION}" method="post" target="_top">
<div style="margin-top:1px; text-align:left;">
<table cellpadding="0" cellspacing="0" datatable="0"><tr><td>
	<!-- block-inline hack, see: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
		-moz-inline-stack for FF2
		zoom 1; *display:inline for IE6 & 7 -->
	<div style="margin-left: width:150px; display: -moz-inline-stack; display:inline-block; zoom: 1; *display:inline;" id="myAutoComplete">
		<label class="ilAccHidden" for="main_menu_search">{BTN_SEARCH}</label>
		<input style="width:140px; font-size:80%" type="text" class="ilMainMenuSearch" id="main_menu_search" name="queryString" />
		<input type="hidden" name="root_id" value="{CONT_REF_ID}" />
	    <div class="yui-skin-sam" style="font-size: 75%;" id="{ID_AUTOCOMPLETE}"></div>
	</div>
	</td>
</tr></table>
</div><div class="ilOverlay" style="display:none;" id="mm_search_menu">{SEARCH_LINK_MENU}</div>
	<script type="text/javascript">
		ilAddOnLoad(
			function()
			{
				// Define the schema of the delimited results
				var responseSchema = ["response.results","term"];
				
				// source script uri
				// any existing parameters (after a '?') are stripped off
				// and passed seperately to the DataSource instance
				var aUri = "{YUI_DATASOURCE}";
				var additionalArguments = "";
				if (aUri.indexOf('?'))
				{
					additionalArguments = aUri.substr(aUri.indexOf('?')+1);
					aUri = aUri.substr(0, aUri.indexOf('?'));
				}
				
				// Use an XHRDataSource
				var oDS = new YAHOO.widget.DS_XHR(aUri , responseSchema);
				
				// Set the responseType
				oDS.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;
				
				// set arguments
				oDS.scriptQueryAppend = additionalArguments;
				
				// Enable caching
				oDS.maxCacheEntries = 5;
				
				// Instantiate the AutoComplete
				var oAC = new YAHOO.widget.AutoComplete("main_menu_search", "{ID_AUTOCOMPLETE}", oDS);
				oAC.minQueryLength = 2;
				oAC.queryDelay = 0.5;	
				oAC.autoHighlight = false;
				oAC.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;
				oAC.animVert = false;
				oAC.animSpeed = 0;
				// compatibility for IE < 7
				oAC.useIFrame = true;
				
				if (typeof $ != "undefined")
				{
					$("#main_menu_search").bind("focusin focusout keyup click", function(e) {
							if (this.value.length < 1 && e.type != "focusout")
							{
								ilOverlay.show(e, "mm_search_menu", "main_menu_search",
									false, 'tl', 'bl');
							}
							else
							{
								if (e.type == "keyup")
								{
									ilOverlay.hide(e, "mm_search_menu");
								}
							}
						});
				}
			}
		);
	</script>
</form>
</div>