new Auto();

function Auto()
{
	//-----------------------------------------------------------------------------------------------------------
	// Static functions
	//-----------------------------------------------------------------------------------------------------------

	Auto.init = init;
	
	//-----------------------------------------------------------------------------------------------------------
	// Functions
	//-----------------------------------------------------------------------------------------------------------
	
	function init(id, ajaxHandler, maxLimit)
	{
		var html = '';
		
		$('#' + id).autocomplete
		(
			ajaxHandler,
			{
				minChars: 1,
				delay: 300,
				max: maxLimit,
				matchSubset: false,
				scrollHeight: 600,
				formatItem:function(item)
				{
					html = item.length >= 2 ? '<img src="' + BASE + THUMB + item[1] + '&amp;w=30&amp;h=30&amp;zc=1" alt=""/>\n' : '';
					return html + item[0];
				}
			}
		);
	}
}
