function clearData(defaultValue)
{
	if (document.getElementById("keyword").value == defaultValue)
	{
		 document.getElementById("keyword").value = "";
		 document.getElementById("keyword").focus();
	}
 return true;
}

function populateCities()
{

	// Populate only when list is not ALREADY populated.
	var count;
	count = document.getElementById('cityName').length;
	if (count < 10)
	{
		var xmlhttp=false;
		var cityList;
		try
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); /* for IE < 5 */
		}
		catch (e)
		{
			try
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (E)
			{
				xmlhttp = false;
			}
		}
		/* mozilla & opera */
		if (!xmlhttp && typeof XMLHttpRequest!='undefined')
		{
			xmlhttp = new XMLHttpRequest();
		}
		xmlhttp.open("GET","/include/city-list.txt",true);
		xmlhttp.onreadystatechange=function()
		{
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
			{
				cityList = xmlhttp.responseText;
				var citiesArray;
				citiesArray = cityList.split( "|" );
				for ( var i = 0; i < citiesArray.length; i++ )
				{
					var opt = document.createElement("option");
					document.getElementById("cityName").options.add(opt);
					opt .text = citiesArray[i];
				}
			}
		}
		xmlhttp.send(null); /* are sending null because we dont have any data to post */
	}
}


