﻿$(function() {
		
		$( "#txtSearch" ).autocomplete({
			source: function( request, response ) {
				$.ajax({
					url: "http://www.gofnet.com/json",
					dataType: "jsonp",
					data: {
	
						search: request.term
					
					},
					success: function( data ) {
						response( $.map( data.gofnet, function( item ) {
							return {
								label: item.name ,
								value: item.name
							}
						}));
					}
				});
			},
			minLength: 1,
			open: function() {
				$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
			},
			close: function() {
				$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
			}
		});
	});
