function goal_Click()
{

	var forRent = document.getElementById("forRent");
	var typeForSale = document.getElementById("search_typeForSale");
	var priceForSale = document.getElementById("search_budgetForSale");
	var typeForRent = document.getElementById("search_typeForRent");
	var priceForRent = document.getElementById("search_budgetForRent");


	//alert("typeForSale:" + typeForSale.parentNode.style.display + ";priceForSale:" + priceForSale.parentNode.style.display);
	//alert("typeForRent:" + typeForRent.parentNode.style.display + ";priceForRent:" + priceForRent.parentNode.style.display);
	if (forRent.checked)
	{
		typeForSale.parentNode.style.display = "none";
		typeForRent.parentNode.style.display = "inline";
		priceForSale.parentNode.style.display = "none";
		priceForRent.parentNode.style.display = "inline";
	}
	else
	{
		typeForSale.parentNode.style.display = "inline"	
		typeForRent.parentNode.style.display = "none";
		priceForSale.parentNode.style.display = "inline";
		priceForRent.parentNode.style.display = "none";	
	}
}

function search_Click(url)
{
	var typeName, priceName
	var forRent = document.getElementById("forRent");
	var goal = forRent.checked ? 1 : 0;
	if (goal == 0)
	{
		typeName = "search_typeForSale";
		priceName = "search_budgetForSale";
	}
	else
	{
		typeName = "search_typeForRent";
		priceName = "search_budgetForRent";
	}

	var cityname = document.getElementById("search_cityname");
	var type = document.getElementById(typeName);
	var price = document.getElementById(priceName);

	var myurl = url + "?goal=" + goal.toString();

	if (type.selectedIndex > 0)
	{
		myurl += "&type=" + type.options[type.selectedIndex].value;
	}
	
	if (cityname.selectedIndex > 0)
	{
		myurl += "&cityname=" + cityname.options[cityname.selectedIndex].value;
	}
	
	if (price.selectedIndex > 0)
	{
		var budget = price.options[price.selectedIndex].value;
		var budgetList = budget.split("-");
		if (budgetList.length > 1)
		{
			myurl += "&budget1=" + budgetList[0] + "&budget2=" + budgetList[1];
		}
	}
	//alert("myurl:" + myurl)
	location.href = myurl
	//location.href = url + "?type=" + type.options[type.selectedIndex].value + "&geo=" + geo.options[geo.selectedIndex].value;
	//alert("value:" + type.options[type.selectedIndex].value + ";text:" + type.options[type.selectedIndex].text);
	//alert("value:" + geo.options[geo.selectedIndex].value + ";text:" + geo.options[geo.selectedIndex].text);
	//alert("value:" + price.options[price.selectedIndex].value + ";text:" + price.options[price.selectedIndex].text);
	//alert("forSale:" + forSale.checked + ";forRent:" + forRent.checked);
	
	//if (typegeo.selectedIndex > 0)
	//{
		//location.href = url + typegeo.id + "=" + typegeo.options[typegeo.selectedIndex].value;
		//alert("value:" + typegeo.options[typegeo.selectedIndex].value + ";text:" + typegeo.options[typegeo.selectedIndex].text);
	//}
	//else
	//{
		//location.href = url.substring(0, url.length - 1) 
	//}
}