function getHTTPObject()
{
	var xmlhttp;

	/*@cc_on

	@if (@_jscript_version >= 5)

	try {

	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

	} catch (e) {

	try {

	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

	} catch (E) {

	xmlhttp = false;

	}

	}

	@else

	xmlhttp = false;

	@end @*/

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		try
		{
			xmlhttp = new XMLHttpRequest();
		} catch (e)
		{
			xmlhttp = false;
		}
	}
	return xmlhttp;
}

var http = getHTTPObject(); // We create the HTTP Object

function typeOfSpaceChange(fromMode)
{
	var propertyType = document.getElementById("p_type").value;
	var url = "ajaxTypeOfSpace.php?propertyType="+propertyType+"&fromMode="+fromMode;
	var http = null; 
	var http = getHTTPObject(); 
	if (http==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	if (http)
	{
		http.onreadystatechange = function()
		{
			if (http.readyState == 4) { 				
				
				document.getElementById("changeSpace").innerHTML = http.responseText;				
			}						
		}
		http.open("GET", url, true);
		http.send(null);		
	}
}

function typeOfSpaceChangePost(fromMode)
{
	var propertyType = document.getElementById("property_type").value;
	var url = "ajaxTypeOfSpace.php?propertyType="+propertyType+"&fromMode="+fromMode;
	var http = null; 
	var http = getHTTPObject(); 
	if (http==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	if (http)
	{
		http.onreadystatechange = function()
		{
			if (http.readyState == 4) { 				
				
				document.getElementById("changeSpace").innerHTML = http.responseText;				
			}						
		}
		http.open("GET", url, true);
		http.send(null);		
	}
}