// JavaScript Document
var selectId = '';
var xmlHttp = '';

function createXMLHttpRequest() 
{
	if (window.ActiveXObject) 
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} 
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
	return xmlHttp;
}

function changeDropDown() 
{
	
//	var a = document.getElementById('location').options.length = 1;
//	document.getElementById('location').options[0] = new Option("--Select--","");
	
	var address = document.getElementById('location').value;
	var url = 'includes/otherAddress.php';	
	xmlHttp = createXMLHttpRequest();
	queryString = url+'?task=first&address='+address;
	xmlHttp.onreadystatechange = searchResults;	
	xmlHttp.open("GET", queryString, true);
	xmlHttp.send(null);
}

function searchResults() 
{ 	
	if (xmlHttp.readyState==4)
	{	
		document.getElementById('spanData').innerHTML=xmlHttp.responseText;
	}
}


