window.domReady(function() {
	mint.globalize();
	
	// create mintJS suggest plugin for city suggests
	new mint.Suggest({
		listClass: "city-suggest",
		input: "city",
		offsetY: 2,
		limit: 10,
		startFrom: 2,
		source: cities
	});
	
	$('city').focus();
	
	deleteCookie('city', '/');
	deleteCookie('street', '/');
});

function setCity(el) {
	$('city').value = el.innerHTML;
	return false;
}

function find() {
	if(!$('city').value) {
		$('city-not-found').show();
		return false;
	}
	
	$('city-not-found').hide();
	
	setCookie('city', $('city').value, 60, '/');
	setCookie('street', $('street').value, 60, '/');
	
	return true;
}