var Ajax = new Object();

Ajax.Request = function(url,id, callbackMethod)
{
	if ( id == 0 )
	{
		return;
	}

	Ajax.request = Ajax.createRequestObject();
	Ajax.request.onreadystatechange = callbackMethod;
	Ajax.request.open("POST", url+id, true);
	Ajax.request.send(url);
}

Ajax.Response = function ()
{
	document.getElementById('member_county').length = 0;
	document.getElementById('member_county').options[0] = new Option("Select One...",'');

	var	response = Ajax.request.responseXML.documentElement;
	var _data = response.getElementsByTagName('category');
	if(_data.length == 0)
	{
		document.getElementById('member_county').options[0] = new Option("No counties available",'0');
	}
	var i
	for ( i = 0 ; i < _data.length ; i ++ )
	{
		var o = i + 1;
		document.getElementById('member_county').options[o] = new Option(response.getElementsByTagName('county')[i].firstChild.data,response.getElementsByTagName('id')[i].firstChild.data);
	}
}

Ajax.createRequestObject = function()
{
	var obj;
	if(window.XMLHttpRequest)
	{
		obj = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		obj = new ActiveXObject("MSXML2.XMLHTTP");
	}
	return obj;
}
