


		function getWord(){
			return document.getElementById("word").value;
		}
		function clearWord(){
			document.getElementById("word").value = "";
		}
 
		function genClear(){
			var word = getWord();
			if(word=="Search..."){
				clearWord();
			}			 
		}
		//function doSearch(id){
//			alert('i m in do search');
//			var word = id;
//			var url = "AJ/getCountry.php?word="+word;		
		//}
		
		function setLoading(){
			var code = "<img src='loading.gif'>";
			document.getElementById("results").innerHTML = code;
			setTimeout("",200);
		}
		
		function doSearch(id){
	   
		// var pauza = new Pause(0.5, setLoading);
			
		
			//first get the word...
			var word =id;
		
			var url = "AJ/getCountry.php?word="+word;
			
			if (window.XMLHttpRequest) {
				xhr = new XMLHttpRequest();
			}
			else {
				if (window.ActiveXObject) {
					try {
						xhr = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e) { }
				}
			}

			if (xhr) {
				xhr.onreadystatechange = showSearchResults;
				xhr.open("GET", url, true);
				xhr.send(null);
			}
			else {
				alert("Sorry, but I couldn't create an XMLHttpRequest");
			}	
		}
		
		function showSearchResults(){
			
			if (xhr.readyState == 4) {
				
				if (xhr.status == 200) {
					
				
					var outMsg = xhr.responseText;
					
					document.getElementById("selectByAjax").innerHTML=outMsg;
					//document.write(outMsg);
					//document.getElementById("results").innerHTML = outMsg;
				}
				else {
					var outMsg = "There was a problem with the request " + xhr.status;
			
				}

				// Do something here with outMsg
			}			
		}
