﻿$(function()
{
	var entry  = $("input.autocomplete");

	entry.each(function() {
		var config = $.microFormat($(this).attr("class"));
		var path = config.url || document.location.pathname.substring(0, document.location.pathname.lastIndexOf("/") + 1) + "autocomplete.aspx";

		$(this).autocomplete(path, {
			extraParams: config.params || {},
			lineSeparator: config.lineseparator || ",",
			matchContains: config.matchcontains || 0,
			maxItemsToShow: config.maxitemstoshow || "10",
			minChars: config.minchars || "1",
			selectFirst: true
		})

	});
});
