var XmlHttpObj1;
function CreateXmlHttpObj1()
{
	try
	{
		XmlHttpObj1 = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpObj1 = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpObj1 = null;
		}
	}
	if(!XmlHttpObj1 && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpObj1 = new XMLHttpRequest();
	}
}

function show_town(countryid)
{
	var abs_url			=	"http://www.internationalvenues.com/"
	obj3				=	document.getElementById('mytown');
	obj3.innerHTML		=	"<img src=\""+abs_url+"images/ajax-loader.gif\"> Loading...";
	
	var requestUrl;
	requestUrl	=	abs_url+"ajax_gettown.php?county_id="+countryid;
	CreateXmlHttpObj1();
	if(XmlHttpObj1)
	{
		XmlHttpObj1.onreadystatechange = function(){
				Settown(countryid)
			};
		XmlHttpObj1.open("GET", requestUrl,  true);
		XmlHttpObj1.send(null);		
	}
}

function Settown(countryid)
{
	if(XmlHttpObj1.readyState == 4)
	{
		if(XmlHttpObj1.status == 200)
		{		
			
			document.getElementById('mytown').innerHTML			=	'';
			document.getElementById('mytown').innerHTML			=	XmlHttpObj1.responseText;
			
		}
		else
		{
			alert("problem retrieving data from the server, status code: "  + XmlHttpObj1.status);
		}
	}
}
