	$(function() {
		$.ajax({
			url: "categories.ashx",
			dataType: "xml",
			success: function( xmlResponse ) {
				var data = $( "category", xmlResponse ).map(function() {
					return {
						value: $( "name", this ).text() ,
						id: $( "url", this ).text()
					};
				}).get();
				$( "#category-combobox-input" ).autocomplete({
					position: { my : "left top", at: "left bottom" },
					source: data,
					minLength: 0,
					select: function( event, ui ) {
						document.location.href = ui.item.id;
					}
				});			
			}
		});
	});
	
	$(function() {
		$.ajax({
			url: "xml/insurers.xml?version=1",
			dataType: "xml",
			success: function( xmlResponse ) {
				var data = $( "insurer", xmlResponse ).map(function() {
					return {
						value: $( "name", this ).text() ,
						id: $( "url", this ).text()
					};
				}).get();
				$( "#insurer-combobox-input" ).autocomplete({
					position: { my : "left top", at: "left bottom" },
					source: data,
					minLength: 0,
					select: function( event, ui ) {
						document.location.href = ui.item.id;
					}
				});
			}
		});
	});

