// JavaScript Document

$().ready(function() {
	function log(event, data, formatted) {
		$("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result");
	}
	
	function formatItem(row) {
		return row[0] + " (<strong>id: " + row[1] + "</strong>)";
	}
	function formatResult(row) {
		return row[0].replace(/(<.+?>)/gi, '');
	}
	$("#citiimput").autocomplete('../../xi_search.php', {
		minChars: 0,
		max: 20,
		autoFill: false,
		mustMatch: false,
		matchContains: false,
		scrollHeight: 450,
		formatItem: function(data, i, total) {
			// don't show the current month in the list of values (for whatever reason)
			return data[0];
		}
	});
});

function LINKCITY(fname){
	$.post("XI_layout/xi_js/newgeo.php",  
      { 
          radius: $('#radius').val(),
          citiimput: $('#citiimput').val(), 
      }, 
     function(data){
		if(data!='&nbsp;'){
			window.location.href = data;
		}
    });
   return false;
}


