// JavaScript Document
function uzXmlHttp()
{
	var xmlhttp = false;
	try
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			xmlhttp = false;
		}
	}

	if(!xmlhttp && document.createElement)
	{
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}


function sub_location(group_id, name, divname, java)
{
	
	//var java = 'onchange=sub_location(;'
	var url = 'http://www.i-marketingasia.com/dewa_form/pd_ajax/location_box.php?group_id=' + group_id +'&name='+ name +'&java=' + java;
	///alert(java);
//	var url = 'http://localhost/CBRE_form/pd_ajax/location_box.php?group_id=' + group_id +'&name='+ name +'&java=' + java;
	
	xmlhttp = uzXmlHttp();
	xmlhttp.open("GET", url, false);
	xmlhttp.send(null);

	result = xmlhttp.responseText;
	
	document.getElementById('region').innerHTML = result;
	/*if(name=="bedroom")
	{
		//alert('hi');
		 //var divname2 ="propertydiv";
		 document.getElementById('propertydiv').innerHTML="<select name='bedroom' style='width:120px;' id='property'><option value='0'>--Column--</option></select>";
		  document.getElementById('pricediv').innerHTML="<input name='price' type='text' id='price'  style='background-color:#fbf7c8'  readonly='readonly' />";
	}
	else if(name=="property")
	{
		  document.getElementById('pricediv').innerHTML="<input name='price' type='text' id='price'  style='background-color:#fbf7c8'  readonly='readonly' />";
	}*/
	divname.innerHTML = result;
	
}

function sub_location2(parent_id,sub_id, name, divname, java)
{
	var url = 'http://i-marketingasia.com/cbre/avaiability/pd_ajax/price_box.php?parent_id=' + parent_id +'&subid='+ sub_id +'&name='+ name +'&java=' + java;
	//var url = 'http://localhost/i-marketing/CBRE_form/pd_ajax/price_box.php?parent_id=' + parent_id +'&subid='+ sub_id +'&name='+ name +'&java=' + java;
	//alert(url);
	xmlhttp = uzXmlHttp();
	xmlhttp.open("GET", url, false);
	xmlhttp.send(null);

	result = xmlhttp.responseText;
	//alert(result);
	//document.getElementById('divname').innerHTML = result;
	divname.innerHTML = result;
}


function sub_location_front(group_id, name, divname, java)
{
	//var java = 'onchange=sub_location(;'
	var url = 'ajax/location_box.php?group_id=' + group_id +'&name='+ name +'&java=' + java;
	//alert(divname);
	//alert(group_id);
	//alert(url);
	xmlhttp = uzXmlHttp();
	xmlhttp.open("GET", url, false);
	xmlhttp.send(null);
	result = xmlhttp.responseText;
	//alert(result);
	//document.getElementById('divname').innerHTML = result;
	divname.innerHTML = result;
}
