function geonameSearch(keyword)
{
  	if (keyword == undefined) return;

	var xmlhttp_osm=false;
	try {
		xmlhttp_osm = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp_osm = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp_osm = false;
		}
	}

	if (!xmlhttp_osm && typeof XMLHttpRequest!='undefined') {
        	try {
                	xmlhttp_osm = new XMLHttpRequest();
	        } catch (e) {
        	        xmlhttp_osm=false;
	        }
	}

        if (xmlhttp_osm) {
		var url = "http://whatamap.com/tools/osm_search/geoname_map/index.php?q="+keyword;

                xmlhttp_osm.open("GET",url,true);

                xmlhttp_osm.onreadystatechange = function() {

                        if (xmlhttp_osm.readyState == 4) {

                                if (xmlhttp_osm.status == 200) {
					var splitResult = xmlhttp_osm.responseText.split(" ");
 
//					var sr = document.getElementById("searchresults_wrap").style.display = "inline";
					var sr = document.getElementById("searchresults");
					var li = document.createElement("li");
					var a = document.createElement("a");
					var img = document.createElement("img");
					var hidden = document.createElement("input");
					img.setAttribute("src", splitResult[3]);
					img.setAttribute("width", "128");
					img.setAttribute("height", "128");
					a.setAttribute("href", "http://whatamap.com/index.php?option=com_user&view=addmaps&layout=viewer&map_id="+splitResult[1]);
					a.appendChild(img);
					li.appendChild(a);
					sr.insertBefore(li, sr.firstChild);
                                }
                                else {
                                }
                        }
                }

		if (window.XMLHttpRequest)
        		xmlhttp_osm.send(null);
	        else
        	        xmlhttp_osm.send();
	}
}

